Author: alessio.soldano(a)jboss.com
Date: 2008-11-20 14:07:07 -0500 (Thu, 20 Nov 2008)
New Revision: 8770
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler2.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler3.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler4.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientServlet.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/Endpoint.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/EndpointImpl.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308ServletTestCase.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308TestCase.java
stack/metro/trunk/modules/testsuite/metro-tests/src/test/resources/jaxws/jbws2308/
stack/metro/trunk/modules/testsuite/metro-tests/src/test/resources/jaxws/jbws2308/WEB-INF/
stack/metro/trunk/modules/testsuite/metro-tests/src/test/resources/jaxws/jbws2308/WEB-INF/web.xml
Modified:
stack/metro/trunk/modules/testsuite/metro-tests/scripts/metro-jars-jaxws.xml
Log:
[JBWS-2308] Adding testcase
Modified: stack/metro/trunk/modules/testsuite/metro-tests/scripts/metro-jars-jaxws.xml
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/scripts/metro-jars-jaxws.xml 2008-11-20
16:35:11 UTC (rev 8769)
+++
stack/metro/trunk/modules/testsuite/metro-tests/scripts/metro-jars-jaxws.xml 2008-11-20
19:07:07 UTC (rev 8770)
@@ -75,6 +75,23 @@
</webinf>
</war>
+ <!-- jbws2308 -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2308.jar" >
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2308/**/Endpoint*"/>
+ </fileset>
+ </jar>
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws2308-client.war"
webxml="${tests.output.dir}/test-resources/jaxws/jbws2308/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws2308/**/Endpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/jbws2308/**/Client*"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/jbws2308/WEB-INF">
+ <include name="wsdl/**"/>
+ <include name="*.xml"/>
+ </webinf>
+ </war>
+
<!-- wsit-rm -->
<war warfile="${tests.output.dir}/test-libs/wsit-rm.war"
webxml="${tests.output.dir}/test-resources/wsit/rm/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler2.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler2.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler2.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,37 @@
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.logging.Logger;
+
+public class ClientHandler2 implements LogicalHandler<LogicalMessageContext>
+{
+ private static Logger log = Logger.getLogger(ClientHandler2.class);
+
+ public void close(MessageContext arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean handleFault(LogicalMessageContext arg0)
+ {
+ System.out.println("HANDLE FAULT 2");
+
+ arg0.getMessage().getPayload();
+
+ return true;
+ }
+
+ public boolean handleMessage(LogicalMessageContext arg0)
+ {
+ System.out.println("HANDLE MESSAGE 2");
+
+ arg0.getMessage().getPayload();
+
+ return true;
+ }
+
+}
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler2.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler3.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler3.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler3.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,110 @@
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
+import javax.xml.soap.DetailEntry;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+
+public class ClientHandler3 implements LogicalHandler<LogicalMessageContext>
+{
+ private static Logger log = Logger.getLogger(ClientHandler3.class);
+ private final QName FAULTCODE = new
QName("http://dlhandlerservice.org/wsdl", "ItsASoapFault",
"tns");
+ private static MessageFactory mfactorySOAP11;
+ private static MessageFactory mfactorySOAP12;
+
+ public void close(MessageContext arg0)
+ {
+
+ }
+
+ public boolean handleFault(LogicalMessageContext arg0)
+ {
+ System.out.println("HANDLE FAULT 3");
+ return true;
+ }
+
+ public boolean handleMessage(LogicalMessageContext arg0)
+ {
+ System.out.println("HANDLE MESSAGE 3");
+ String faultString = "ClientLogicalHandler6.handleMessage throws
SOAPFaultException for ClientLogicalOutboundHandleFaultFalseTest";
+ SOAPFault sf = null;
+ try
+ {
+ Name name = SOAPFactory.newInstance().createName("somefaultentry");
+ sf = createSOAPFault("soap11", this.FAULTCODE, "faultActor",
faultString, name);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Unexpected error occurred in handleMessage for
an outbound message" + e);
+ }
+ throw new SOAPFaultException(sf);
+ }
+
+ private static SOAPFault createSOAPFault(String soapVer, QName faultCode, String
faultActor, String faultString, Name name) throws Exception
+ {
+ DetailEntry detailentry;
+ SOAPFault soapFault = null;
+ try
+ {
+ log.info("Create a SOAP MessageFactory instance - " + soapVer);
+ MessageFactory mfactory = getMessageFactory(soapVer);
+
+ log.info("Create a SOAPMessage");
+ SOAPMessage soapmsg = mfactory.createMessage();
+
+ log.info("Get SOAP Part");
+ SOAPPart sp = soapmsg.getSOAPPart();
+
+ log.info("Get SOAP Envelope");
+ SOAPEnvelope envelope = sp.getEnvelope();
+
+ log.info("Get SOAP Header");
+ SOAPHeader hdr = envelope.getHeader();
+
+ log.info("Get SOAP Body");
+ SOAPBody body = envelope.getBody();
+
+ soapFault = body.addFault();
+ soapFault.setFaultCode(faultCode);
+ soapFault.setFaultActor(faultActor);
+ soapFault.setFaultString(faultString);
+ Detail detail = soapFault.addDetail();
+ detailentry = detail.addDetailEntry(name);
+ }
+ catch (Exception e)
+ {
+ log.info("Exception caught: " + e);
+ return null;
+ }
+ return soapFault;
+ }
+
+ public static MessageFactory getMessageFactory(String soapVer) throws Exception
+ {
+ System.out.println("JAXWS_Util:getMessageFactory");
+ if (soapVer.equals("soap11"))
+ {
+ if (mfactorySOAP11 == null)
+ mfactorySOAP11 = MessageFactory.newInstance();
+ return mfactorySOAP11;
+ }
+ if (mfactorySOAP12 == null)
+ mfactorySOAP12 = MessageFactory.newInstance("SOAP 1.2 Protocol");
+ return mfactorySOAP12;
+ }
+
+}
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler3.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler4.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler4.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler4.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,30 @@
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import javax.xml.ws.handler.LogicalHandler;
+import javax.xml.ws.handler.LogicalMessageContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.logging.Logger;
+
+public class ClientHandler4 implements LogicalHandler<LogicalMessageContext>
+{
+ private static Logger log = Logger.getLogger(ClientHandler4.class);
+
+ public void close(MessageContext arg0)
+ {
+
+ }
+
+ public boolean handleFault(LogicalMessageContext arg0)
+ {
+ System.out.println("HANDLE FAULT 4");
+ return true;
+ }
+
+ public boolean handleMessage(LogicalMessageContext arg0)
+ {
+ System.out.println("HANDLE MESSAGE 4");
+ return true;
+ }
+
+}
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientHandler4.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientServlet.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientServlet.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientServlet.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,61 @@
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+
+public class ClientServlet extends HttpServlet
+{
+ private String endpointURL =
"http://127.0.0.1:8080/jaxws-jbws2308/EndpointImpl";
+ private String targetNS = "http://jbws2308.jaxws.ws.test.jboss.org/";
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ URL wsdlURL = new URL(endpointURL + "?wsdl");
+ QName serviceName = new QName(targetNS, "EndpointService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ BindingProvider bindingProvider = (BindingProvider)port;
+ List<Handler> handlerChain = new ArrayList<Handler>();
+ handlerChain.add(new ClientHandler2());
+ handlerChain.add(new ClientHandler3());
+ handlerChain.add(new ClientHandler4());
+ bindingProvider.getBinding().setHandlerChain(handlerChain);
+
+ try
+ {
+ Object retObj = port.echo("Hello");
+ throw new ServletException("A RuntimeException was expected");
+ }
+ catch (RuntimeException e)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(baos, true);
+ e.printStackTrace(ps);
+ String tmp = "ClientLogicalHandler6.handleMessage throws SOAPFaultException
for ClientLogicalOutboundHandleFaultFalseTest";
+ if (baos.toString().indexOf(tmp) > -1) {
+ res.getOutputStream().println("Did get expected RuntimeException
text");
+ }
+ else
+ {
+ System.out.println("Obtained this exception: " + baos.toString());
+ throw new ServletException("Did not get expected RuntimeException
text");
+ }
+ }
+ }
+}
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/ClientServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/Endpoint.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/Endpoint.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/Endpoint.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService (name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint
+{
+ @WebMethod(operationName = "echoString", action =
"urn:EchoString")
+ String echo(String input);
+}
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/Endpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/EndpointImpl.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/EndpointImpl.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/EndpointImpl.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.xml.ws.soap.SOAPFaultException;
+
+import org.jboss.logging.Logger;
+
+@Stateless
+@WebService(serviceName="EndpointService", portName="EndpointPort",
endpointInterface = "org.jboss.test.ws.jaxws.jbws2308.Endpoint")
+public class EndpointImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl.class);
+
+ public String echo(String input) throws SOAPFaultException
+ {
+ log.info("echo: " + input);
+ return input;
+ }
+}
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/EndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308ServletTestCase.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308ServletTestCase.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308ServletTestCase.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+public class JBWS2308ServletTestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2308ServletTestCase.class,
"jaxws-jbws2308.jar, jaxws-jbws2308-client.war");
+ }
+
+ public void testInvocationThroughServlet() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() +
":8080/jaxws-jbws2308-client/jbws2308");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ String retStr = br.readLine();
+ assertEquals("Did get expected RuntimeException text", retStr);
+ }
+
+}
+
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308ServletTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308TestCase.java
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308TestCase.java
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308TestCase.java 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws2308;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+public class JBWS2308TestCase extends JBossWSTest
+{
+
+ private String endpointURL = "http://" + getServerHost() +
":8080/jaxws-jbws2308/EndpointImpl";
+ private String targetNS = "http://jbws2308.jaxws.ws.test.jboss.org/";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS2308TestCase.class,
"jaxws-jbws2308.jar");
+ }
+
+ public void testInvocation() throws Exception
+ {
+ URL wsdlURL = new URL(endpointURL + "?wsdl");
+ QName serviceName = new QName(targetNS, "EndpointService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ BindingProvider bindingProvider = (BindingProvider)port;
+ List<Handler> handlerChain = new ArrayList<Handler>();
+ handlerChain.add(new ClientHandler2());
+ handlerChain.add(new ClientHandler3());
+ handlerChain.add(new ClientHandler4());
+ bindingProvider.getBinding().setHandlerChain(handlerChain);
+
+ try
+ {
+ Object retObj = port.echo("Hello");
+ fail("A RuntimeException was expected");
+ }
+ catch (RuntimeException e)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ PrintStream ps = new PrintStream(baos, true);
+ e.printStackTrace(ps);
+ String tmp = "ClientLogicalHandler6.handleMessage throws SOAPFaultException
for ClientLogicalOutboundHandleFaultFalseTest";
+ if (baos.toString().indexOf(tmp) > -1) {
+ System.out.println("Did get expected RuntimeException text");
+ }
+ else
+ {
+ fail("Did not get expected RuntimeException text");
+ }
+ }
+
+ }
+
+}
+
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2308/JBWS2308TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/resources/jaxws/jbws2308/WEB-INF/web.xml
===================================================================
---
stack/metro/trunk/modules/testsuite/metro-tests/src/test/resources/jaxws/jbws2308/WEB-INF/web.xml
(rev 0)
+++
stack/metro/trunk/modules/testsuite/metro-tests/src/test/resources/jaxws/jbws2308/WEB-INF/web.xml 2008-11-20
19:07:07 UTC (rev 8770)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <display-name>jbws2307_testcase_client</display-name>
+ <servlet>
+ <servlet-name>ClientServlet</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws2308.ClientServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ClientServlet</servlet-name>
+ <url-pattern>/jbws2308</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>54</session-timeout>
+ </session-config>
+</web-app>
\ No newline at end of file
Property changes on:
stack/metro/trunk/modules/testsuite/metro-tests/src/test/resources/jaxws/jbws2308/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF