geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r567190 - /geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/AsyncHttpClientTest.java
Date Sat, 18 Aug 2007 00:13:28 GMT
Author: jgenender
Date: Fri Aug 17 17:13:27 2007
New Revision: 567190

URL: http://svn.apache.org/viewvc?view=rev&rev=567190
Log:
Throw a timeout semaphore for failed tests

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

Modified: geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/AsyncHttpClientTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/AsyncHttpClientTest.java?view=diff&rev=567190&r1=567189&r2=567190
==============================================================================
--- geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/AsyncHttpClientTest.java
(original)
+++ geronimo/sandbox/AsyncHttpClient/src/test/java/org/apache/ahc/AsyncHttpClientTest.java
Fri Aug 17 17:13:27 2007
@@ -56,6 +56,22 @@
         fis.read(realFile);
         
         TestCallback callback = new TestCallback();
+        doConnection(callback, "http://localhost:8282","/pwrd_apache.gif", false);
+
+        HttpResponseMessage msg = callback.getMessage();
+
+        assertTrue(Arrays.equals(realFile,msg.getContent()));
+    }
+
+    public void testSSLBinaryRequest() throws Exception {
+
+        //Get the real file
+        File file = new File(ROOT, "pwrd_apache.gif");
+        FileInputStream fis = new FileInputStream(file);
+        byte realFile[] = new byte[(int)file.length()];
+        fis.read(realFile);
+
+        TestCallback callback = new TestCallback();
         doConnection(callback, "https://localhost:8383","/pwrd_apache.gif", false);
 
         HttpResponseMessage msg = callback.getMessage();
@@ -76,8 +92,7 @@
         //So this little wait simulates the thread going back in the pool
         synchronized(semaphore){
             //5 second timeout due to no response
-            //semaphore.wait(5000);
-            semaphore.wait();
+            semaphore.wait(5000);
         }
 
         if (!testForException){



Mime
View raw message