cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1497271 - /cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java
Date Thu, 27 Jun 2013 09:48:13 GMT
Author: cschneider
Date: Thu Jun 27 09:48:13 2013
New Revision: 1497271

URL: http://svn.apache.org/r1497271
Log:
DOSGI-195 Wait for service to be exported and protect against not serializeable

Modified:
    cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java

Modified: cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java?rev=1497271&r1=1497270&r2=1497271&view=diff
==============================================================================
--- cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java
(original)
+++ cxf/dosgi/trunk/systests2/multi-bundle/src/test/java/org/apache/cxf/dosgi/systests2/multi/TestExportRestService.java
Thu Jun 27 09:48:13 2013
@@ -59,13 +59,20 @@ public class TestExportRestService exten
 
     @Test
     public void testEndpointAvailable() throws Exception {
-        waitPort(8080);
-        Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-        GreeterService greeterService = JAXRSClientFactory.create("http://localhost:8080/greeter",
-                                                                  GreeterService.class);
-        GreeterInfo result = greeterService.greetMe("Chris");
-        GreetingPhrase greeting = result.getGreetings().get(0);
-        Assert.assertEquals("Hello", greeting.getPhrase());
-        Assert.assertEquals("Chris", greeting.getName());
+        try {
+            waitPort(8080);
+            // wait for service to be exported
+            Thread.sleep(2000);
+            Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+            GreeterService greeterService = JAXRSClientFactory.create("http://localhost:8080/greeter",
+                                                                      GreeterService.class);
+            GreeterInfo result = greeterService.greetMe("Chris");
+            GreetingPhrase greeting = result.getGreetings().get(0);
+            Assert.assertEquals("Hello", greeting.getPhrase());
+            Assert.assertEquals("Chris", greeting.getName());
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e.getMessage());
+        }
     }
 }



Mime
View raw message