From jbossws-commits at lists.jboss.org Wed Oct 7 09:33:45 2009 Content-Type: multipart/mixed; boundary="===============0231722228072536457==" MIME-Version: 1.0 From: jbossws-commits at lists.jboss.org To: jbossws-commits at lists.jboss.org Subject: [jbossws-commits] JBossWS SVN: r10852 - stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint. Date: Wed, 07 Oct 2009 09:33:45 -0400 Message-ID: <200910071333.n97DXjS3008188@svn01.web.mwc.hst.phx2.redhat.com> --===============0231722228072536457== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: richard.opalka(a)jboss.com Date: 2009-10-07 09:33:45 -0400 (Wed, 07 Oct 2009) New Revision: 10852 Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/ja= va/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/ja= va/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java Log: [JBWS-2674][JBWS-2754] don't use proprietary API (WIP) Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/= test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/j= ava/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2009-10-07 13:32:= 00 UTC (rev 10851) +++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/j= ava/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2009-10-07 13:33:= 45 UTC (rev 10852) @@ -39,23 +39,20 @@ = import org.jboss.logging.Logger; import org.jboss.wsf.common.DOMUtils; -import org.jboss.wsf.spi.SPIProvider; -import org.jboss.wsf.spi.SPIProviderResolver; -import org.jboss.wsf.spi.http.HttpContext; -import org.jboss.wsf.spi.http.HttpServer; -import org.jboss.wsf.spi.http.HttpServerFactory; import org.w3c.dom.Element; import org.w3c.dom.NodeList; = /** - * Test Endpoint deployment + * Tests Endpoint deployment in J2EE environment. * - * @author Thomas.Diesler(a)jboss.org - * @since 12-Jul-2006 + * @author Thomas Diesler + * @author Richard Opalka */ public class EndpointServlet extends HttpServlet { - private Endpoint endpoint; + = + private Endpoint endpoint1; + private Endpoint endpoint2; private static final String TEST_ELEMENT =3D "123456789"; = @Override @@ -63,25 +60,16 @@ { super.init(config); = - // Create the endpoint - EndpointBean epImpl =3D new EndpointBean(); - endpoint =3D Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, epImpl); - - // Create and start the HTTP server - SPIProvider spiProvider =3D SPIProviderResolver.getInstance().getPro= vider(); - HttpServer httpServer =3D spiProvider.getSPI(HttpServerFactory.class= ).getHttpServer(); - httpServer.start(); - = - // Create the context and publish the endpoint - HttpContext context =3D httpServer.createContext("/jaxws-endpoint"); - endpoint.publish(context); + endpoint1 =3D Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, new En= dpointBean()); + endpoint1.publish("http://localhost:8080/jaxws-endpoint"); + endpoint2 =3D Endpoint.publish("http://localhost:8080/jaxws-endpoint= 2/endpoint/long/path", EndpointBean.class); } = @Override public void destroy() { - // Stop the endpoint - endpoint.stop(); + endpoint1.stop(); + endpoint2.stop(); = super.destroy(); } @@ -99,16 +87,15 @@ String retStr =3D port.echo(param); = //Test epr - assertEndpointReference(endpoint.getEndpointReference(DOMUtils.parse= (TEST_ELEMENT)), TEST_ELEMENT); - assertEndpointReference(endpoint.getEndpointReference(W3CEndpointRef= erence.class, (Element[])null), null); + assertEndpointReference(endpoint1.getEndpointReference(DOMUtils.pars= e(TEST_ELEMENT)), TEST_ELEMENT); + assertEndpointReference(endpoint1.getEndpointReference(W3CEndpointRe= ference.class, (Element[])null), null); = // Return the result PrintWriter pw =3D new PrintWriter(res.getWriter()); pw.print(retStr); + pw.close(); } = - - = private void assertEndpointReference(EndpointReference epr, String refP= ar) throws IOException { Logger.getLogger(this.getClass()).info("epr: "+epr); @@ -121,7 +108,6 @@ assert("http://127.0.0.1:8080/jaxws-endpoint".equals(addresses.item(= 0).getFirstChild().getNodeValue())); if (refPar !=3D null) { - //TODO enhance this check assert(epr.toString().contains(refPar)); } } Modified: stack/native/branches/ropalka/modules/testsuite/native-tests/src/= test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/j= ava/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2009-10-07 13:32= :00 UTC (rev 10851) +++ stack/native/branches/ropalka/modules/testsuite/native-tests/src/test/j= ava/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2009-10-07 13:33= :45 UTC (rev 10852) @@ -57,12 +57,10 @@ = public void testWSDLAccess() throws Exception { - URL wsdlURL =3D new URL("http://" + getServerHost() + ":8080/jaxws-e= ndpoint?wsdl"); - WSDLReader wsdlReader =3D WSDLFactory.newInstance().newWSDLReader(); - Definition wsdlDefinition =3D wsdlReader.readWSDL(wsdlURL.toString()= ); - assertNotNull(wsdlDefinition); + readWSDL(new URL("http://" + getServerHost() + ":8080/jaxws-endpoint= ?wsdl")); + readWSDL(new URL("http://" + getServerHost() + ":8080/jaxws-endpoint= 2/endpoint/long/path?wsdl")); } - + = public void testClientAccess() throws Exception { // Create the port @@ -83,4 +81,11 @@ assertEquals("hello-world", br.readLine()); } = + private void readWSDL(URL wsdlURL) throws Exception + { + WSDLReader wsdlReader =3D WSDLFactory.newInstance().newWSDLReader(); + Definition wsdlDefinition =3D wsdlReader.readWSDL(wsdlURL.toString()= ); + assertNotNull(wsdlDefinition); + } + } --===============0231722228072536457==--