vmassol 01/08/19 10:00:09 Modified: cactus/src/framework/share/org/apache/commons/cactus/util/log LogService.java cactus/src/test/share/org/apache/commons/cactus TestAbstractTestCase.java TestAbstractTestCase_InterceptorTestCase.java TestAll.java cactus/src/test/share/org/apache/commons/cactus/mock MockHttpURLConnection.java cactus/src/test/share/org/apache/commons/cactus/util TestAssertUtils.java Log: align with coding conventions Revision Changes Path 1.6 +4 -4 jakarta-commons/cactus/src/framework/share/org/apache/commons/cactus/util/log/LogService.java Index: LogService.java =================================================================== RCS file: /home/cvs/jakarta-commons/cactus/src/framework/share/org/apache/commons/cactus/util/log/LogService.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- LogService.java 2001/08/19 16:43:16 1.5 +++ LogService.java 2001/08/19 17:00:09 1.6 @@ -64,7 +64,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> * - * @version $Id: LogService.java,v 1.5 2001/08/19 16:43:16 vmassol Exp $ + * @version $Id: LogService.java,v 1.6 2001/08/19 17:00:09 vmassol Exp $ */ public class LogService { @@ -112,10 +112,10 @@ */ public static synchronized LogService getInstance() { - if (this.instance == null) { - this.instance = new LogService(); + if (instance == null) { + instance = new LogService(); } - return this.instance; + return instance; } /** 1.2 +3 -1 jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAbstractTestCase.java Index: TestAbstractTestCase.java =================================================================== RCS file: /home/cvs/jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAbstractTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestAbstractTestCase.java 2001/08/11 13:33:07 1.1 +++ TestAbstractTestCase.java 2001/08/19 17:00:09 1.2 @@ -64,7 +64,9 @@ /** * Unit tests of the <code>AbstractTestCase</code> class. * - * @version @version@ + * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> + * + * @version $Id: TestAbstractTestCase.java,v 1.2 2001/08/19 17:00:09 vmassol Exp $ */ public class TestAbstractTestCase extends TestAbstractTestCase_InterceptorTestCase 1.2 +3 -1 jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAbstractTestCase_InterceptorTestCase.java Index: TestAbstractTestCase_InterceptorTestCase.java =================================================================== RCS file: /home/cvs/jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAbstractTestCase_InterceptorTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestAbstractTestCase_InterceptorTestCase.java 2001/08/11 13:33:07 1.1 +++ TestAbstractTestCase_InterceptorTestCase.java 2001/08/19 17:00:09 1.2 @@ -66,7 +66,9 @@ * them) coming from test case classes that inherits from it. This class is * used to unit test the <code>TestAbstractTestCase</code> class. * - * @version @version@ + * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> + * + * @version $Id: TestAbstractTestCase_InterceptorTestCase.java,v 1.2 2001/08/19 17:00:09 vmassol Exp $ */ public class TestAbstractTestCase_InterceptorTestCase extends AbstractTestCase 1.3 +5 -2 jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAll.java Index: TestAll.java =================================================================== RCS file: /home/cvs/jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/TestAll.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- TestAll.java 2001/08/11 13:33:07 1.2 +++ TestAll.java 2001/08/19 17:00:09 1.3 @@ -60,7 +60,9 @@ * environment to run. These other tests will be exercised in the sample * application. * - * @version @version@ + * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> + * + * @version $Id: TestAll.java,v 1.3 2001/08/19 17:00:09 vmassol Exp $ */ public class TestAll extends TestCase { @@ -90,7 +92,8 @@ */ public static Test suite() { - TestSuite suite = new TestSuite("Cactus unit tests not needing servlet engine"); + TestSuite suite = + new TestSuite("Cactus unit tests not needing servlet engine"); suite.addTest(org.apache.commons.cactus.util.TestAssertUtils.suite()); suite.addTest(org.apache.commons.cactus.TestAbstractTestCase.suite()); 1.2 +49 -15 jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/mock/MockHttpURLConnection.java Index: MockHttpURLConnection.java =================================================================== RCS file: /home/cvs/jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/mock/MockHttpURLConnection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MockHttpURLConnection.java 2001/08/11 13:33:07 1.1 +++ MockHttpURLConnection.java 2001/08/19 17:00:09 1.2 @@ -60,59 +60,93 @@ /** * Mock implementation of <code>HttpURLConnection</code>. * - * @version @version@ + * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> + * + * @version $Id: MockHttpURLConnection.java,v 1.2 2001/08/19 17:00:09 vmassol Exp $ */ public class MockHttpURLConnection extends HttpURLConnection { - private Vector m_GetHeaderFieldValues = new Vector(); - private Vector m_GetInputStreamValues = new Vector(); + /** + * Store the header fields that the <code>getHeaderField()</code> will + * return (for each call, the last entry of the vector will be returned + * and removed from the vector). + */ + private Vector getHeaderFieldValues = new Vector(); + + /** + * Store the input streams that the <code>getHeaderField()</code> will + * return (for each call, the last entry of the vector will be returned + * and removed from the vector). + */ + private Vector getInputStreamValues = new Vector(); // ----------------------------------------------------------------------- // Methods added on top of those found in HttpURLConnection // ----------------------------------------------------------------------- + /** + * Add a new header field value to the vector of values that will be + * returned by <code>getHeaderField()</code>. + * + * @param theValue the header file value to add + */ public void addGetHeaderFieldValue(String theValue) { - m_GetHeaderFieldValues.addElement(theValue); + this.getHeaderFieldValues.addElement(theValue); } + /** + * Add a new input stream to the vector of values that will be + * returned by <code>getInputStream()</code>. + * + * @param theValue the input stream to add + */ public void addGetInputStream(InputStream theValue) { - m_GetInputStreamValues.addElement(theValue); + this.getInputStreamValues.addElement(theValue); } // ----------------------------------------------------------------------- // Methods overriding those from HttpURLConnection // ----------------------------------------------------------------------- + /** + * @param theURL the underlying URL + */ public MockHttpURLConnection(URL theURL) { super(theURL); } + /** + * See <code>java.net.URLConnection.getHeaderField</code>. + */ public String getHeaderField(int fieldNumber) { - if (m_GetHeaderFieldValues.isEmpty()) { + if (this.getHeaderFieldValues.isEmpty()) { throw new RuntimeException("Must call addGetHeaderFieldValue() " + "first !"); } - String result = (String)m_GetHeaderFieldValues.elementAt( - m_GetHeaderFieldValues.size() - 1); - m_GetHeaderFieldValues.removeElementAt( - m_GetHeaderFieldValues.size() - 1); + String result = (String)this.getHeaderFieldValues.elementAt( + this.getHeaderFieldValues.size() - 1); + this.getHeaderFieldValues.removeElementAt( + this.getHeaderFieldValues.size() - 1); return result; } + /** + * See <code>java.net.URLConnection.getInputStream</code>. + */ public InputStream getInputStream() { - if (m_GetInputStreamValues.isEmpty()) { + if (this.getInputStreamValues.isEmpty()) { throw new RuntimeException("Must call addGetInputStream() " + "first !"); } - InputStream result = (InputStream)m_GetInputStreamValues.elementAt( - m_GetInputStreamValues.size() - 1); - m_GetInputStreamValues.removeElementAt( - m_GetInputStreamValues.size() - 1); + InputStream result = (InputStream)this.getInputStreamValues.elementAt( + this.getInputStreamValues.size() - 1); + this.getInputStreamValues.removeElementAt( + this.getInputStreamValues.size() - 1); return result; } 1.2 +9 -4 jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/util/TestAssertUtils.java Index: TestAssertUtils.java =================================================================== RCS file: /home/cvs/jakarta-commons/cactus/src/test/share/org/apache/commons/cactus/util/TestAssertUtils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TestAssertUtils.java 2001/04/09 11:52:39 1.1 +++ TestAssertUtils.java 2001/08/19 17:00:09 1.2 @@ -60,7 +60,9 @@ /** * Unit tests of the <code>AssertUtils</code> class. * - * @version @version@ + * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a> + * + * @version $Id: TestAssertUtils.java,v 1.2 2001/08/19 17:00:09 vmassol Exp $ */ public class TestAssertUtils extends TestCase { @@ -81,7 +83,8 @@ */ public static void main(String[] theArgs) { - junit.ui.TestRunner.main(new String[] {TestAssertUtils.class.getName()}); + junit.ui.TestRunner.main(new String[] { + TestAssertUtils.class.getName()}); } /** @@ -96,7 +99,8 @@ public void testParseSetCookieHeader1() { - Vector cookies = AssertUtils.parseSetCookieHeader("testcookie=value;Domain=jakarta.apache.org"); + Vector cookies = AssertUtils.parseSetCookieHeader( + "testcookie=value;Domain=jakarta.apache.org"); assert(cookies.size() == 1); ClientCookie cookie = (ClientCookie)cookies.elementAt(0); @@ -112,7 +116,8 @@ public void testParseSetCookieHeader2() { - Vector cookies = AssertUtils.parseSetCookieHeader("testcookie=value; domain=jakarta.apache.org"); + Vector cookies = AssertUtils.parseSetCookieHeader( + "testcookie=value; domain=jakarta.apache.org"); assert(cookies.size() == 1); ClientCookie cookie = (ClientCookie)cookies.elementAt(0);