Author: olegk Date: Sun Jun 26 07:45:58 2005 New Revision: 201857 URL: http://svn.apache.org/viewcvs?rev=201857&view=rev Log: Removed test cases that test functionality of the local web server rather that of HttpClient
Removed: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestGetMethodLocal.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestLocalHost.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestMethodsLocalHost.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestTraceMethodLocal.java Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAll.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAllLocal.java jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestHttpConnection.java Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAll.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAll.java?rev=201857&r1=201856&r2=201857&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAll.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAll.java Sun Jun 26 07:45:58 2005 @@ -46,7 +46,6 @@ public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(TestNoHost.suite()); - suite.addTest(TestLocalHost.suite()); suite.addTest(TestExternalHost.suite()); return suite; } Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAllLocal.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAllLocal.java?rev=201857&r1=201856&r2=201857&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAllLocal.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestAllLocal.java Sun Jun 26 07:45:58 2005 @@ -46,7 +46,6 @@ public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(TestNoHost.suite()); - suite.addTest(TestLocalHost.suite()); return suite; } Modified: jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestHttpConnection.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestHttpConnection.java?rev=201857&r1=201856&r2=201857&view=diff ============================================================================== --- jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestHttpConnection.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/test/org/apache/commons/httpclient/TestHttpConnection.java Sun Jun 26 07:45:58 2005 @@ -55,10 +55,10 @@ * @version $Id$ * */ -public class TestHttpConnection extends TestLocalHostBase { +public class TestHttpConnection extends HttpClientTestBase { // ------------------------------------------------------------ Constructor - public TestHttpConnection(String testName) { + public TestHttpConnection(String testName) throws Exception { super(testName); } @@ -78,13 +78,15 @@ // ----------------------------------------------------------- Test Methods public void testConstructThenClose() { - HttpConnection conn = new HttpConnection(getHost(), getPort()); + this.server.setHttpService(new EchoService()); + HttpConnection conn = new HttpConnection( + this.server.getLocalAddress(), this.server.getLocalPort()); conn.close(); assertTrue(!conn.isOpen()); } public void testConnTimeoutRelease() { - + this.server.setHttpService(new EchoService()); // create a custom protocol that will delay for 500 milliseconds Protocol testProtocol = new Protocol( "timeout", @@ -92,13 +94,16 @@ 500, Protocol.getProtocol("http").getSocketFactory() ), - getPort() + this.server.getLocalPort() ); NoHostHttpConnectionManager connectionManager = new NoHostHttpConnectionManager(); - connectionManager.setConnection(new HttpConnection(getHost(), getPort(), testProtocol)); - HttpClient client = createHttpClient(connectionManager); - client.getHostConfiguration().setHost(getHost(), getPort(), testProtocol); + connectionManager.setConnection( + new HttpConnection( + this.server.getLocalAddress(), this.server.getLocalPort(), testProtocol)); + this.client.setHttpConnectionManager(connectionManager); + client.getHostConfiguration().setHost( + this.server.getLocalAddress(), this.server.getLocalPort(), testProtocol); client.getHttpConnectionManager().getParams().setConnectionTimeout(1); try { @@ -122,10 +127,11 @@ 500, Protocol.getProtocol("http").getSocketFactory() ), - getPort() + this.server.getLocalPort() ); - HttpConnection conn = new HttpConnection(getHost(), getPort(), testProtocol); + HttpConnection conn = new HttpConnection( + this.server.getLocalAddress(), this.server.getLocalPort(), testProtocol); // 1 ms is short enough to make this fail conn.getParams().setConnectionTimeout(1); try { @@ -138,8 +144,8 @@ } public void testForIllegalStateExceptions() { - HttpConnection conn = new HttpConnection(getHost(), getPort()); - + HttpConnection conn = new HttpConnection( + this.server.getLocalAddress(), this.server.getLocalPort()); try { OutputStream out = conn.getRequestOutputStream(); fail("getRequestOutputStream did not throw the expected exception"); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]