cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1167357 - /cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Date Fri, 09 Sep 2011 20:43:09 GMT
Author: dkulp
Date: Fri Sep  9 20:43:09 2011
New Revision: 1167357

URL: http://svn.apache.org/viewvc?rev=1167357&view=rev
Log:
Use async method in test to make it closer to what Camel does

Modified:
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=1167357&r1=1167356&r2=1167357&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Fri Sep  9 20:43:09 2011
@@ -241,9 +241,25 @@ public class DispatchClientServerTest ex
         InputStream is1 = getClass().getResourceAsStream("resources/GreetMe1WDocLiteralReq2.xml");
         SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null, is1);
         assertNotNull(soapReqMsg1);
-        
+
+        //Version 1:
         //we'll just call invoke
-        disp.invoke(soapReqMsg1);
+        //disp.invoke(soapReqMsg1);
+        
+        
+        //Version 2:
+        //We want to handle things asynchronously
+        AsyncHandler<SOAPMessage> callback = new AsyncHandler<SOAPMessage>()
{
+            public void handleResponse(Response<SOAPMessage> res) {
+                synchronized (this) {
+                    notifyAll();
+                }
+            }
+        };
+        synchronized (callback) {
+            disp.invokeAsync(soapReqMsg1, callback);
+            callback.wait();
+        }
     }
     @Test
     public void testSOAPMessage() throws Exception {



Mime
View raw message