hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r321320 - in /jakarta/httpclient/trunk/http-common/src/test/org/apache/http: TestHttpExceptions.java TestHttpHost.java
Date Sat, 15 Oct 2005 12:22:03 GMT
Author: olegk
Date: Sat Oct 15 05:21:56 2005
New Revision: 321320

URL: http://svn.apache.org/viewcvs?rev=321320&view=rev
Log:
More test cases

Modified:
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpExceptions.java
    jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpHost.java

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpExceptions.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpExceptions.java?rev=321320&r1=321319&r2=321320&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpExceptions.java
(original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpExceptions.java
Sat Oct 15 05:21:56 2005
@@ -67,6 +67,9 @@
         new NoHttpResponseException("Oppsie");
         new ConnectTimeoutException();
         new ConnectTimeoutException("Oppsie");
+        new ConnectionClosedException("Oppsie");
+        new MethodNotSupportedException("Oppsie");
+        new MethodNotSupportedException("Oppsie", cause);
     }
             
 }

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpHost.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpHost.java?rev=321320&r1=321319&r2=321320&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpHost.java (original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestHttpHost.java Sat Oct
15 05:21:56 2005
@@ -94,6 +94,20 @@
         } catch (IllegalArgumentException ex) {
             //expected
         }
+        ProxyHost proxyhost1 = new ProxyHost("somehost");
+        assertEquals("somehost", proxyhost1.getHostName()); 
+        assertEquals(http.getDefaultPort(), proxyhost1.getPort()); 
+        assertEquals(http, proxyhost1.getProtocol()); 
+
+        ProxyHost proxyhost2 = new ProxyHost("somehost", 8080);
+        assertEquals("somehost", proxyhost2.getHostName()); 
+        assertEquals(8080, proxyhost2.getPort()); 
+        assertEquals(http, proxyhost2.getProtocol()); 
+
+        ProxyHost proxyhost3 = new ProxyHost(proxyhost2);
+        assertEquals("somehost", proxyhost3.getHostName()); 
+        assertEquals(8080, proxyhost3.getPort()); 
+        assertEquals(http, proxyhost3.getProtocol()); 
     }
     
     public void testHashCode() {
@@ -170,5 +184,8 @@
         HttpHost host1 = new HttpHost("somehost", 8888, Protocol.getProtocol("http"));
         HttpHost host2 = (HttpHost) host1.clone(); 
         assertEquals(host1, host2);
+        ProxyHost proxyhost1 = new ProxyHost("somehost", 8888);
+        ProxyHost proxyhost2 = (ProxyHost) proxyhost1.clone(); 
+        assertEquals(proxyhost1, proxyhost2);
     }
 }



Mime
View raw message