[jbossws-commits] JBossWS SVN: r3371 - in trunk: testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod and 1 other directory.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Jun 1 11:37:28 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-06-01 11:37:28 -0400 (Fri, 01 Jun 2007)
New Revision: 3371

Modified:
   trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
   trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
Log:
Enable sunri webmethod

Modified: trunk/integration/sunri/src/test/resources/excludes-jboss50.txt
===================================================================
--- trunk/integration/sunri/src/test/resources/excludes-jboss50.txt	2007-06-01 15:23:20 UTC (rev 3370)
+++ trunk/integration/sunri/src/test/resources/excludes-jboss50.txt	2007-06-01 15:37:28 UTC (rev 3371)
@@ -18,8 +18,7 @@
 org/jboss/test/ws/jaxws/samples/wssecurity/**
 
 
-#org/jboss/test/ws/jaxws/samples/swaref/**
-org/jboss/test/ws/jaxws/samples/webmethod/**
+#org/jboss/test/ws/jaxws/samples/webmethod/**
 org/jboss/test/ws/jaxws/samples/webservice/**
 org/jboss/test/ws/jaxws/samples/xop/**
 

Modified: trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java
===================================================================
--- trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java	2007-06-01 15:23:20 UTC (rev 3370)
+++ trunk/testsuite/src/java/org/jboss/test/ws/jaxws/samples/webmethod/WebMethodTestCase.java	2007-06-01 15:37:28 UTC (rev 3371)
@@ -37,6 +37,7 @@
 import javax.xml.ws.Dispatch;
 import javax.xml.ws.Service;
 import javax.xml.ws.Service.Mode;
+import javax.xml.ws.soap.SOAPFaultException;
 
 import junit.framework.Test;
 
@@ -78,8 +79,15 @@
       MessageFactory msgFactory = MessageFactory.newInstance();
       SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
 
-      String reqEnv = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + " <env:Header/>" + " <env:Body>" + "  <ns1:echoString xmlns:ns1='"
-            + targetNS + "'>" + "   <arg0>Hello</arg0>" + "  </ns1:echoString>" + " </env:Body>" + "</env:Envelope>";
+      String reqEnv = 
+         "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + 
+         " <env:Header/>" + 
+         " <env:Body>" + 
+         "  <ns1:echoString xmlns:ns1='" + targetNS + "'>" + 
+         "   <arg0>Hello</arg0>" + 
+         "  </ns1:echoString>" + 
+         " </env:Body>" + 
+         "</env:Envelope>";
       SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));
 
       URL epURL = new URL(endpointURL);
@@ -96,8 +104,15 @@
       MessageFactory msgFactory = MessageFactory.newInstance();
       SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
 
-      String reqEnv = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + " <env:Header/>" + " <env:Body>" + "  <ns1:noWebMethod xmlns:ns1='"
-            + targetNS + "'>" + "   <String_1>Hello</String_1>" + "  </ns1:noWebMethod>" + " </env:Body>" + "</env:Envelope>";
+      String reqEnv = 
+         "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + 
+         " <env:Header/>" + 
+         " <env:Body>" + 
+         "  <ns1:noWebMethod xmlns:ns1='" + targetNS + "'>" + 
+         "   <String_1>Hello</String_1>" + 
+         "  </ns1:noWebMethod>" + 
+         " </env:Body>" + 
+         "</env:Envelope>";
       SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(reqEnv.getBytes()));
 
       URL epURL = new URL(endpointURL);
@@ -109,24 +124,39 @@
       assertTrue(faultString, faultString.indexOf("noWebMethod") > 0);
    }
 
-   public void testIllegalCallAccess() throws Exception
+   public void testIllegalDispatchAccess() throws Exception
    {
       URL wsdlURL = new URL(endpointURL + "?wsdl");
       QName serviceName = new QName(targetNS, "TestEndpointService");
       QName portName = new QName(targetNS, "TestEndpointPort");
 
-      String reqPayload = "<ns1:noWebMethod xmlns:ns1='" + targetNS + "'>" + " <String_1>Hello</String_1>" + "</ns1:noWebMethod>";
+      String reqPayload = 
+         "<ns1:noWebMethod xmlns:ns1='" + targetNS + "'>" + 
+         " <String_1>Hello</String_1>" + 
+         "</ns1:noWebMethod>";
 
-      String expPayload = "<env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
-            + " <faultcode>env:Client</faultcode>"
-            + " <faultstring>Endpoint {http://webmethod.samples.jaxws.ws.test.jboss.org/}TestEndpointPort does not contain operation meta data for: {http://webmethod.samples.jaxws.ws.test.jboss.org/}noWebMethod</faultstring>"
-            + "</env:Fault>";
+      String expPayload = 
+         "<env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" + 
+         " <faultcode>env:Client</faultcode>" + 
+         " <faultstring>Endpoint {http://webmethod.samples.jaxws.ws.test.jboss.org/}TestEndpointPort does not contain operation meta data for: {http://webmethod.samples.jaxws.ws.test.jboss.org/}noWebMethod</faultstring>" + 
+         "</env:Fault>";
 
+      if (isIntegrationNative())
+      {
+         System.out.println("FIXME: [JBWS-1680] Dispatch.invoke does not throw a Protocol exception when response is a SOAP Fault");
+         return;
+      }
+      
       Service service = Service.create(wsdlURL, serviceName);
-      Dispatch dispatch = service.createDispatch(portName, StreamSource.class, Mode.PAYLOAD);
-      Source retSource = (Source)dispatch.invoke(new StreamSource(new StringReader(reqPayload)));
-      Element retEl = DOMUtils.sourceToElement(retSource);
-
-      assertEquals(DOMUtils.parse(expPayload), retEl);
+      Dispatch dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+      try
+      {
+         dispatch.invoke(new StreamSource(new StringReader(reqPayload)));
+         fail("SOAPFaultException expected");
+      }
+      catch (SOAPFaultException ex)
+      {
+         // ignore
+      }
    }
 }
\ No newline at end of file




More information about the jbossws-commits mailing list