cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1434564 - in /cxf/trunk: systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
Date Thu, 17 Jan 2013 06:24:54 GMT
Author: ffang
Date: Thu Jan 17 06:24:54 2013
New Revision: 1434564

URL: http://svn.apache.org/viewvc?rev=1434564&view=rev
Log:
[CXF-4761]a testcase which demonstrate CXF follow jaxws spec 3.6.2.3

Modified:
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
    cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java?rev=1434564&r1=1434563&r2=1434564&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerRPCLitTest.java
Thu Jan 17 06:24:54 2013
@@ -43,6 +43,7 @@ import javax.xml.transform.stream.Stream
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Dispatch;
 import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
 import javax.xml.ws.soap.SOAPFaultException;
 import javax.xml.xpath.XPathConstants;
 
@@ -52,8 +53,10 @@ import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.binding.soap.Soap11;
+import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.helpers.XMLUtils;
 import org.apache.cxf.helpers.XPathUtils;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.W3CNamespaceContext;
@@ -111,6 +114,7 @@ public class ClientServerRPCLitTest exte
         String response2 = new String("Bonjour");
         try {
             GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class);
+            ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
             updateAddressPort(greeter, PORT);
             for (int idx = 0; idx < 1; idx++) {
                 String greeting = greeter.greetMe("Milestone-" + idx);
@@ -121,6 +125,25 @@ public class ClientServerRPCLitTest exte
                 String reply = greeter.sayHi();
                 assertNotNull("no response received from service", reply);
                 assertEquals(response2, reply);
+                try {
+                    greeter.greetMe("return null");
+                    fail("should catch WebServiceException");
+                } catch (WebServiceException e) {
+                    //do nothing
+                } catch (Exception e) {
+                    fail("should catch WebServiceException");
+                    throw e;
+                }
+                
+                try {
+                    greeter.greetMe(null);
+                    fail("should catch WebServiceException");
+                } catch (WebServiceException e) {
+                    //do nothing
+                } catch (Exception e) {
+                    fail("should catch WebServiceException");
+                    throw e;
+                }
             }
         } catch (UndeclaredThrowableException ex) {
             throw (Exception)ex.getCause();

Modified: cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java?rev=1434564&r1=1434563&r2=1434564&view=diff
==============================================================================
--- cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
(original)
+++ cxf/trunk/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
Thu Jan 17 06:24:54 2013
@@ -37,7 +37,11 @@ public class RPCLitGreeterImpl implement
     public String greetMe(String me) {
         //System.out.println("Executing operation greetMe");
         //System.out.println("Message received: " + me + "\n");
-        return "Hello " + me;
+        if ("return null".equals(me)) {
+            return null;
+        } else {
+            return "Hello " + me;
+        }
     }
 
     public String sayHi() {



Mime
View raw message