[jboss-cvs] JBossAS SVN: r65841 - branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 4 10:03:50 EDT 2007


Author: wolfc
Date: 2007-10-04 10:03:50 -0400 (Thu, 04 Oct 2007)
New Revision: 65841

Modified:
   branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java
Log:
EJBTHREE-757: really calling the endpoint with JAX-RPC

Modified: branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java
===================================================================
--- branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java	2007-10-04 14:03:16 UTC (rev 65840)
+++ branches/Branch_4_2/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java	2007-10-04 14:03:50 UTC (rev 65841)
@@ -31,11 +31,13 @@
 
 import javax.ejb.EJBException;
 import javax.xml.namespace.QName;
+import javax.xml.rpc.ServiceFactory;
 import javax.xml.ws.Service;
 import javax.xml.ws.soap.SOAPFaultException;
 
 import java.io.File;
 import java.net.URL;
+import java.rmi.RemoteException;
 
 /**
  * Test JAXWS WebServiceContext
@@ -80,9 +82,10 @@
    public void testClientAccessRPC() throws Exception
    {
       log.info("In case of connection exception, there is a host name defined in the wsdl, which used to be '@jbosstest.host.name@'");
-      URL wsdlURL = new File("../src/resources/test/jaxws/TestService.wsdl").toURL();
+      URL wsdlURL = new URL("http://localhost:8080/jaxws-context/testService?wsdl");
       QName qname = new QName("http://org.jboss.ws/jaxws/context", "TestService");
-      Service service = Service.create(wsdlURL, qname);
+      ServiceFactory factory = ServiceFactory.newInstance();
+      javax.xml.rpc.Service service = factory.createService(wsdlURL, qname);
       EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);
       
       String helloWorld = "Hello world!";
@@ -91,9 +94,11 @@
          Object retObj = port.echoRPC(helloWorld);
          assertEquals(helloWorld, retObj);
       }
-      catch(SOAPFaultException e)
+      catch(RemoteException e)
       {
-         assertEquals("java.lang.IllegalStateException: No message context found", e.getMessage());
+         assertNotNull(e.getCause());
+         assertTrue(e.getCause() instanceof javax.xml.rpc.soap.SOAPFaultException);
+         assertEquals("java.lang.IllegalStateException: No message context found", e.getCause().getMessage());
          showKnownIssue("EJBTHREE-757");
       }
    }




More information about the jboss-cvs-commits mailing list