hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r321176 - in /jakarta/httpclient/trunk/http-common/src/test/org/apache/http: TestHttpHost.java TestStatusLine.java
Date Fri, 14 Oct 2005 18:54:38 GMT
Author: olegk
Date: Fri Oct 14 11:54:33 2005
New Revision: 321176

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

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

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=321176&r1=321175&r2=321176&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 Fri Oct
14 11:54:33 2005
@@ -154,6 +154,18 @@
         assertEquals("myhttp://somehost:80", host6.toString());
     }
 
+    public void testToHostString() {
+        Protocol http = Protocol.getProtocol("http");
+        HttpHost host1 = new HttpHost("somehost");
+        assertEquals("somehost", host1.toHostString());
+        HttpHost host2 = new HttpHost("somehost", http.getDefaultPort());
+        assertEquals("somehost", host2.toHostString());
+        HttpHost host3 = new HttpHost("somehost", -1);
+        assertEquals("somehost", host3.toHostString());
+        HttpHost host4 = new HttpHost("somehost", 8888);
+        assertEquals("somehost:8888", host4.toHostString());
+    }
+
     public void testClone() {
         HttpHost host1 = new HttpHost("somehost", 8888, Protocol.getProtocol("http"));
         HttpHost host2 = (HttpHost) host1.clone(); 

Modified: jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestStatusLine.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestStatusLine.java?rev=321176&r1=321175&r2=321176&view=diff
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestStatusLine.java (original)
+++ jakarta/httpclient/trunk/http-common/src/test/org/apache/http/TestStatusLine.java Fri
Oct 14 11:54:33 2005
@@ -66,6 +66,11 @@
         assertEquals(HttpVersion.HTTP_1_1, statusline.getHttpVersion()); 
         assertEquals(HttpStatus.SC_OK, statusline.getStatusCode()); 
         assertEquals("OK", statusline.getReasonPhrase()); 
+
+        statusline = new StatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_OK);
+        assertEquals(HttpVersion.HTTP_1_1, statusline.getHttpVersion()); 
+        assertEquals(HttpStatus.SC_OK, statusline.getStatusCode()); 
+        assertEquals("OK", statusline.getReasonPhrase()); 
     }
         
     public void testConstructorInvalidInput() {



Mime
View raw message