cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r480059 - in /incubator/cxf/trunk: systests/src/test/java/org/apache/cxf/systest/jaxws/ systests/src/test/java/org/apache/cxf/systest/ws/addressing/ testutils/src/main/java/org/apache/hello_world_soap_http/ testutils/src/main/resources/wsdl/
Date Tue, 28 Nov 2006 14:16:37 GMT
Author: andreasmyth
Date: Tue Nov 28 06:16:36 2006
New Revision: 480059

URL: http://svn.apache.org/viewvc?view=rev&rev=480059
Log:
Reverted changes to GreeterImpl and used separate operation greetMeLater to test asynchronous
invocations.

Modified:
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/GreeterImpl.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
    incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/NotAnnotatedGreeterImpl.java
    incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java?view=diff&rev=480059&r1=480058&r2=480059
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerTest.java
Tue Nov 28 06:16:36 2006
@@ -62,7 +62,7 @@
 import org.apache.hello_world_soap_http.SOAPService;
 import org.apache.hello_world_soap_http.SOAPServiceDocLitBare;
 import org.apache.hello_world_soap_http.types.BareDocumentResponse;
-import org.apache.hello_world_soap_http.types.GreetMeResponse;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
 import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
 
 public class ClientServerTest extends ClientServerTestBase {
@@ -613,12 +613,13 @@
         
         long before = System.currentTimeMillis();
 
-        Response<GreetMeResponse> r1 = greeter.greetMeAsync("one");
-        Response<GreetMeResponse> r2 = greeter.greetMeAsync("two");
+        long delay = 3000;
+        Response<GreetMeLaterResponse> r1 = greeter.greetMeLaterAsync(delay);
+        Response<GreetMeLaterResponse> r2 = greeter.greetMeLaterAsync(delay);
 
         long after = System.currentTimeMillis();
 
-        assertTrue("Duration of calls exceeded 6000 ms", after - before < 6000);
+        assertTrue("Duration of calls exceeded " + (2 * delay) + " ms", after - before <
(2 * delay));
 
         // first time round, responses should not be available yet
         assertFalse("Response already available.", r1.isDone());
@@ -626,7 +627,7 @@
 
         // after three seconds responses should be available
         long waited = 0;
-        while (waited < 5000) {
+        while (waited < (delay + 1000)) {
             try {
                 Thread.sleep(500);
             } catch (InterruptedException ex) {

Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/GreeterImpl.java?view=diff&rev=480059&r1=480058&r2=480059
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/GreeterImpl.java
(original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/addressing/GreeterImpl.java
Tue Nov 28 06:16:36 2006
@@ -33,6 +33,7 @@
 import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
 import org.apache.hello_world_soap_http.types.BareDocumentResponse;
 import org.apache.hello_world_soap_http.types.ErrorCode;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
 import org.apache.hello_world_soap_http.types.GreetMeResponse;
 import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
 import org.apache.hello_world_soap_http.types.NoSuchCodeLit;
@@ -62,6 +63,19 @@
         return "Hello " + me;
     }
 
+    public String greetMeLater(long delay) {
+        System.out.println("\n\n*** GreetMeLater called with: " + delay + "***\n\n");
+        if (delay > 0) {
+            try {
+                Thread.sleep(delay);
+            } catch (InterruptedException ex) {
+                // ignore
+            }
+        }
+        verifyMAPs();
+        return "Hello, finally";
+    }
+
     public void greetMeOneWay(String requestType) {   
         System.out.println("\n\n*** GreetMeOneWay called with: " + requestType + "***\n\n");
         verifyMAPs();
@@ -144,6 +158,16 @@
     }
     
     public Response<GreetMeResponse> greetMeAsync(String requestType) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse>
asyncHandler) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) { 
         return null; 
         /*not called */
     }

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java?view=diff&rev=480059&r1=480058&r2=480059
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
Tue Nov 28 06:16:36 2006
@@ -29,6 +29,7 @@
 import javax.xml.ws.Response;
 
 import org.apache.hello_world_soap_http.types.BareDocumentResponse;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
 import org.apache.hello_world_soap_http.types.GreetMeResponse;
 import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
 import org.apache.hello_world_soap_http.types.SayHiResponse;
@@ -45,6 +46,7 @@
     public AnotherDerivedGreeterImpl() {
         invocationCount.put("sayHi", 0);
         invocationCount.put("greetMe", 0);
+        invocationCount.put("greetMeLater", 0);
         invocationCount.put("greetMeOneWay", 0);
         invocationCount.put("overloadedSayHi", 0);
     }
@@ -96,6 +98,18 @@
         return "Bonjour " + me + "!";
     }
 
+    public String greetMeLater(long delay) {
+        if (delay > 0) {
+            try {
+                Thread.sleep(delay);
+            } catch (InterruptedException ex) {
+                /// ignore
+            }
+        }
+        incrementInvocationCount("greetMeLater");
+        return "Hello, finally!";
+    }
+
     public String greetMeSometime(String me) {
         incrementInvocationCount("greetMeSometime");
         return "Hello there " + me + "!";
@@ -118,6 +132,16 @@
     }
 
     public Response<GreetMeResponse> greetMeAsync(String requestType) {
+        return null;
+        /*not called */
+    }
+
+    public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse>
asyncHandler) {
+        return null;
+        /*not called */
+    }
+
+    public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) {
         return null;
         /*not called */
     }

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java?view=diff&rev=480059&r1=480058&r2=480059
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
Tue Nov 28 06:16:36 2006
@@ -29,6 +29,7 @@
 import javax.xml.ws.Response;
 
 import org.apache.hello_world_soap_http.types.BareDocumentResponse;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
 import org.apache.hello_world_soap_http.types.GreetMeResponse;
 import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
 import org.apache.hello_world_soap_http.types.SayHiResponse;
@@ -46,6 +47,7 @@
     public DerivedGreeterImpl() {
         invocationCount.put("sayHi", 0);
         invocationCount.put("greetMe", 0);
+        invocationCount.put("greetMeLater", 0);
         invocationCount.put("greetMeOneWay", 0);
         invocationCount.put("overloadedSayHi", 0);
     }
@@ -97,6 +99,18 @@
         return "Bonjour " + me + "!";
     }
 
+    public String greetMeLater(long delay) {
+        if (delay > 0) {
+            try {
+                Thread.sleep(delay);
+            } catch (InterruptedException ex) {
+                /// ignore
+            }
+        }
+        incrementInvocationCount("greetMeLater");
+        return "Hello, finally!";
+    }
+
     public String greetMeSometime(String me) {
         incrementInvocationCount("greetMeSometime");
         return "Hello there " + me + "!";
@@ -119,6 +133,16 @@
     }
 
     public Response<GreetMeResponse> greetMeAsync(String requestType) {
+        return null;
+        /*not called */
+    }
+
+    public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse>
asyncHandler) {
+        return null;
+        /*not called */
+    }
+
+    public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) {
         return null;
         /*not called */
     }

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java?view=diff&rev=480059&r1=480058&r2=480059
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/GreeterImpl.java
Tue Nov 28 06:16:36 2006
@@ -33,6 +33,7 @@
 
 import org.apache.hello_world_soap_http.types.BareDocumentResponse;
 import org.apache.hello_world_soap_http.types.ErrorCode;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
 import org.apache.hello_world_soap_http.types.GreetMeResponse;
 import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
 import org.apache.hello_world_soap_http.types.NoSuchCodeLit;
@@ -57,17 +58,23 @@
     }
 
     public String greetMe(String me) {
-        try {
-            // to prove async invocation works
-            Thread.sleep(3000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
         LOG.info("Invoking greetMe " + me);
         invocationCount++;
         return "Hello " + me;
     }
 
+    public String greetMeLater(long delay) {
+        LOG.info("Invoking greetMeLater " + delay);
+        if (delay > 0) {
+            try {
+                Thread.sleep(delay);
+            } catch (InterruptedException ex) {
+                /// ignore
+            }
+        }
+        return "Hello, finally!";
+    }
+
     public String sayHi() {
         LOG.info("Invoking sayHi");
         invocationCount++;
@@ -159,6 +166,16 @@
 
     public Response<GreetMeResponse> greetMeAsync(String requestType) {
         invocationCount++;
+        return null;
+        /*not called */
+    }
+
+    public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse>
asyncHandler) {
+        return null;
+        /*not called */
+    }
+
+    public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) {
         return null;
         /*not called */
     }

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/NotAnnotatedGreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/NotAnnotatedGreeterImpl.java?view=diff&rev=480059&r1=480058&r2=480059
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/NotAnnotatedGreeterImpl.java
(original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/NotAnnotatedGreeterImpl.java
Tue Nov 28 06:16:36 2006
@@ -27,6 +27,7 @@
 
 import org.apache.hello_world_soap_http.types.BareDocumentResponse;
 import org.apache.hello_world_soap_http.types.ErrorCode;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
 import org.apache.hello_world_soap_http.types.GreetMeResponse;
 import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
 import org.apache.hello_world_soap_http.types.NoSuchCodeLit;
@@ -45,6 +46,18 @@
         LOG.info("Executing operation greetMe");
         return me;
     }
+
+    public String greetMeLater(long delay) {
+        LOG.info("Executing operation greetMeLater");
+        if (delay > 0) {
+            try {
+                Thread.sleep(delay);
+            } catch (InterruptedException ex) {
+                /// ignore
+            }
+        }
+        return "Hello, finally!";
+    }
     
     public String greetMeSometime(String me) {
         LOG.info("Executing operation greetMeSometime");
@@ -69,6 +82,16 @@
     
     public Response<GreetMeResponse> greetMeAsync(String requestType) { 
         return null; 
+        /*not called */
+    }
+
+    public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse>
asyncHandler) {
+        return null;
+        /*not called */
+    }
+
+    public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) {
+        return null;
         /*not called */
     }
     

Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl?view=diff&rev=480059&r1=480058&r2=480059
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl (original)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl Tue Nov 28 06:16:36
2006
@@ -50,6 +50,20 @@
                     </sequence>
                 </complexType>
             </element>
+            <element name="greetMeLater">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="long"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeLaterResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
             <element name="greetMeSometime">
                 <complexType>
                     <sequence>
@@ -145,6 +159,12 @@
     <wsdl:message name="greetMeResponse">
         <wsdl:part name="out" element="x1:greetMeResponse"/>
     </wsdl:message>
+    <wsdl:message name="greetMeLaterRequest">
+        <wsdl:part name="in" element="x1:greetMeLater"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeLaterResponse">
+        <wsdl:part name="out" element="x1:greetMeLaterResponse"/>
+    </wsdl:message>
     <wsdl:message name="greetMeSometimeRequest">
         <wsdl:part name="in" element="x1:greetMeSometime"/>
     </wsdl:message>
@@ -181,6 +201,10 @@
             <wsdl:input name="greetMeRequest" message="tns:greetMeRequest"/>
             <wsdl:output name="greetMeResponse" message="tns:greetMeResponse"/>
         </wsdl:operation>
+        <wsdl:operation name="greetMeLater">
+            <wsdl:input name="greetMeLaterRequest" message="tns:greetMeLaterRequest"/>
+            <wsdl:output name="greetMeLaterResponse" message="tns:greetMeLaterResponse"/>
+        </wsdl:operation>
        <wsdl:operation name="greetMeSometime">
             <wsdl:input name="greetMeSometimeRequest" message="tns:greetMeSometimeRequest"/>
             <wsdl:output name="greetMeSometimeResponse" message="tns:greetMeSometimeResponse"/>
@@ -215,6 +239,15 @@
             </wsdl:output>
         </wsdl:operation>
         <wsdl:operation name="greetMe">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="greetMeLater">
             <soap:operation style="document"/>
             <wsdl:input>
                 <soap:body use="literal"/>



Mime
View raw message