You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/07/22 15:45:25 UTC

svn commit: r1149606 - in /cxf/branches/2.4.x-fixes: ./ systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java

Author: dkulp
Date: Fri Jul 22 13:45:24 2011
New Revision: 1149606

URL: http://svn.apache.org/viewvc?rev=1149606&view=rev
Log:
Merged revisions 1149598 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1149598 | sergeyb | 2011-07-22 09:18:54 -0400 (Fri, 22 Jul 2011) | 1 line
  
  Adding some timeout to EngineLifecycleTests
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java

Propchange: cxf/branches/2.4.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java?rev=1149606&r1=1149605&r2=1149606&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java (original)
+++ cxf/branches/2.4.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java Fri Jul 22 13:45:24 2011
@@ -127,15 +127,25 @@ public class EngineLifecycleTest extends
     }
     
     private void getTestHtml() throws Exception {
-        HttpURLConnection httpConnection = 
-            getHttpConnection("http://localhost:" + PORT2 + "/test.html");    
-        httpConnection.connect();
-        InputStream in = httpConnection.getInputStream();        
-        assertNotNull(in);
-        CachedOutputStream response = new CachedOutputStream();
-        IOUtils.copy(in, response);
-        in.close();
-        response.close();
+        CachedOutputStream response = null;
+        for (int i = 0; i < 10; i++) {
+            try {
+                HttpURLConnection httpConnection = 
+                    getHttpConnection("http://localhost:" + PORT2 + "/test.html");    
+                httpConnection.connect();
+                InputStream in = httpConnection.getInputStream();        
+                assertNotNull(in);
+                response = new CachedOutputStream();
+                IOUtils.copy(in, response);
+                in.close();
+                response.close();
+                break;
+            } catch (Exception ex) {
+                response = null;
+                Thread.sleep(1000);
+            }
+        }
+        assertNotNull("Test doc can not be read", response);
               
         FileInputStream htmlFile = 
             new FileInputStream("target/test-classes/org/apache/cxf/systest/http_jetty/test.html");