geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r604016 - /geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/ConnectionReuseTest.java
Date Thu, 13 Dec 2007 20:17:53 GMT
Author: rickmcguire
Date: Thu Dec 13 12:17:51 2007
New Revision: 604016

URL: http://svn.apache.org/viewvc?rev=604016&view=rev
Log:
GERONIMO-3703 should allow custom SSL context for AsyncHttpClient

Patch submitted by Sangjin Lee. 


Modified:
    geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/ConnectionReuseTest.java

Modified: geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/ConnectionReuseTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/ConnectionReuseTest.java?rev=604016&r1=604015&r2=604016&view=diff
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/ConnectionReuseTest.java
(original)
+++ geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/ConnectionReuseTest.java
Thu Dec 13 12:17:51 2007
@@ -54,6 +54,27 @@
         assertEquals(0, closeCount.get());
     }
     
+    
+    public void testSSLConnectionReuse() throws Exception {
+        // reset the count
+        closeCount.set(0);
+        Future<HttpResponseMessage> future = 
+                submitRequest("https://localhost:8383/", true, new SessionCloseCounter());
+
+        HttpResponseMessage msg = future.get();
+        assertEquals("\nHello World!", msg.getStringContent());
+        
+        // do another request for the same host
+        future = submitRequest("https://localhost:8383/", true, new SessionCloseCounter());
+
+        msg = future.get();
+        assertEquals("\nHello World!", msg.getStringContent());
+        
+        // check that I got zero close at this point
+        assertEquals(0, closeCount.get());
+    }
+    
+    
     public void testConnectionClose() throws Exception {
         // reset the count
         closeCount.set(0);



Mime
View raw message