Author: asoldano
Date: 2014-08-25 06:37:34 -0400 (Mon, 25 Aug 2014)
New Revision: 18861
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet2.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet3.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/HelloServiceJAXWS22.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web2.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web3.xml
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java
Log:
[JBWS-3820] Adding testcase
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet2.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet2.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet2.java 2014-08-25
10:37:34 UTC (rev 18861)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws2307;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.soap.MTOM;
+
+/**
+ * Client servlet with injected JAX-WS 2.0 service
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+public class ClientServlet2 extends HttpServlet
+{
+ private static final long serialVersionUID = 323764398209417743L;
+
+ @WebServiceRef(name="service/jbws2307service")
+ @MTOM
+ HelloService service;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ {
+ Hello hello = service.getHelloPort();
+ hello.hello("Foo");
+ resp.getWriter().print(true);
+ }
+
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet2.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet3.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet3.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet3.java 2014-08-25
10:37:34 UTC (rev 18861)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws2307;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.soap.MTOM;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Client servlet using the injected JAXWS 2.2 service
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+public class ClientServlet3 extends HttpServlet
+{
+
+ private static final long serialVersionUID = 323764398209417744L;
+
+ private final Logger log = Logger.getLogger(ClientServlet3.class);
+
+ @WebServiceRef(name="service/jbws2307service")
+ @MTOM
+ HelloServiceJAXWS22 service;
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
+ {
+ boolean result = false;
+ try
+ {
+ log.info("service = "+service);
+ Hello hello = service.getHelloPort();
+ SOAPBinding binding = (SOAPBinding)((BindingProvider)hello).getBinding();
+ if ("true".equals(req.getParameter("mtom")))
+ {
+ log.info("mtom enabled = " + binding.isMTOMEnabled());
+ if (!binding.isMTOMEnabled())
+ {
+ throw new Exception("Expected mtom enabled because of @MTOM
annotation");
+ }
+ }
+ result = hello.getMessageContextTest();
+ log.info("result = " + result);
+ }
+ catch (Exception e)
+ {
+ log.error("Error while invoking service!", e);
+ throw new ServletException(e);
+ }
+ resp.getWriter().print(result);
+ }
+
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/ClientServlet3.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java 2014-08-25
10:37:34 UTC (rev 18861)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws2307;
+
+import java.io.File;
+
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+public final class DeploymentArchives
+{
+ public static final String SERVER = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2307-service.war") { {
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.Hello.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloService.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/web.xml"), "web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/wsdl/HelloService.wsdl"),
"wsdl/HelloService.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/web.xml"));
+ }
+ });
+
+ public static final String CLIENT_2 = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2307-client-2.war") { {
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.ClientServlet2.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.Hello.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloService.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web2.xml"), "web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/wsdl/HelloService.wsdl"),
"wsdl/HelloService.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web2.xml"));
+ }
+ });
+
+ public static final String CLIENT_3 = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2307-client-3.war") { {
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.ClientServlet3.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.Hello.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloServiceJAXWS22.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web3.xml"), "web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/wsdl/HelloService.wsdl"),
"wsdl/HelloService.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web3.xml"));
+ }
+ });
+
+ public static final String CLIENT = JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2307-client.war") { {
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.ClientServlet.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.Hello.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloService.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web.xml"), "web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/wsdl/HelloService.wsdl"),
"wsdl/HelloService.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web.xml"));
+ }
+ });
+
+ private DeploymentArchives() {
+ //NOOP
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/HelloServiceJAXWS22.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/HelloServiceJAXWS22.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/HelloServiceJAXWS22.java 2014-08-25
10:37:34 UTC (rev 18861)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws2307;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+
+@WebServiceClient(name = "HelloService", targetNamespace =
"http://helloservice.org/wsdl", wsdlLocation =
"WEB-INF/wsdl/HelloService.wsdl")
+public class HelloServiceJAXWS22 extends Service
+{
+ private static final URL HELLOSERVICE_WSDL_LOCATION;
+
+ public HelloServiceJAXWS22(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+
+ public HelloServiceJAXWS22()
+ {
+ super(HELLOSERVICE_WSDL_LOCATION, new
QName("http://helloservice.org/wsdl", "HelloService"));
+ }
+
+ public HelloServiceJAXWS22(URL wsdlLocation, QName serviceName, WebServiceFeature...
features) {
+ super(wsdlLocation, serviceName, features);
+ }
+
+ @WebEndpoint(name = "HelloPort")
+ public Hello getHelloPort()
+ {
+ return ((Hello)super.getPort(new
QName("http://helloservice.org/wsdl",
"HelloPort"), Hello.class));
+ }
+
+ static
+ {
+ URL url = null;
+ try
+ {
+ url = new
URL("http://files1/releng/cts_5.x/cts-5.0c-temp/bin/WEB-INF/wsdl/HelloService.wsdl");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ HELLOSERVICE_WSDL_LOCATION = url;
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/HelloServiceJAXWS22.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java 2014-08-25
10:35:56 UTC (rev 18860)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java 2014-08-25
10:37:34 UTC (rev 18861)
@@ -22,19 +22,14 @@
package org.jboss.test.ws.jaxws.jbws2307;
import java.io.BufferedReader;
-import java.io.File;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
import junit.framework.Test;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
import org.jboss.wsf.test.JBossWSTestSetup;
/**
@@ -44,38 +39,9 @@
*/
public class JBWS2307MTOMTestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2307-service.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws2307.Hello.class)
- .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloImpl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloService.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/jboss-web.xml"), "jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/web.xml"), "web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/wsdl/HelloService.wsdl"),
"wsdl/HelloService.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-service/web.xml"));
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2307-client.war")
{ {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws2307.ClientServlet.class)
- .addClass(org.jboss.test.ws.jaxws.jbws2307.Hello.class)
- .addClass(org.jboss.test.ws.jaxws.jbws2307.HelloService.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/jboss-web.xml"), "jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web.xml"), "web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/wsdl/HelloService.wsdl"),
"wsdl/HelloService.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2307/WEB-INF-client/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
- }
-
public static Test suite()
{
- return new JBossWSTestSetup(JBWS2307MTOMTestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()), true);
+ return new JBossWSTestSetup(JBWS2307MTOMTestCase.class, DeploymentArchives.SERVER +
" " + DeploymentArchives.CLIENT, true);
}
public void testMTOM() throws Exception
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java 2014-08-25
10:37:34 UTC (rev 18861)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws2307;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.ws.common.IOUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ *
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+public class WebServiceRefMTOMTestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(WebServiceRefMTOMTestCase.class,
DeploymentArchives.SERVER, true);
+ }
+
+ public void testUsingClientArchive3() throws Exception
+ {
+ try {
+ JBossWSTestHelper.deploy(DeploymentArchives.CLIENT_3);
+ assertEquals("true", IOUtils.readAndCloseStream(new
URL("http://" + getServerHost() +
":8080/jaxws-jbws2307-client-3/jbws2307?mtom=true").openStream()));
+ HttpURLConnection con = (HttpURLConnection)new URL("http://" +
getServerHost() + ":8080/jaxws-jbws2307-client-3/jbws2307").openConnection();
+ BufferedReader isr = new BufferedReader(new
InputStreamReader(con.getInputStream()));
+ assertEquals("true", isr.readLine());
+ } finally {
+ JBossWSTestHelper.undeploy(DeploymentArchives.CLIENT_3);
+ }
+ }
+
+ public void testUsingClientArchive2() throws Exception
+ {
+ try {
+ JBossWSTestHelper.deploy(DeploymentArchives.CLIENT_2);
+ URL url = new URL("http://" + getServerHost() +
":8080/jaxws-jbws2307-client-2/jbws2307?mtom=true");
+ final HttpURLConnection c = (HttpURLConnection)url.openConnection();
+ c.connect();
+ assertEquals(500, c.getResponseCode());
+ String error = IOUtils.readAndCloseStream(c.getErrorStream());
+ c.disconnect();
+ assertTrue(error.contains("Could not instantiate ClientServlet2"));
+ } finally {
+ JBossWSTestHelper.undeploy(DeploymentArchives.CLIENT_2);
+ }
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web2.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web2.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web2.xml 2014-08-25
10:37:34 UTC (rev 18861)
@@ -0,0 +1,23 @@
+<?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>ClientServlet2</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws2307.ClientServlet2</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ClientServlet2</servlet-name>
+ <url-pattern>/jbws2307</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>54</session-timeout>
+ </session-config>
+ <service-ref>
+ <service-ref-name>service/jbws2307service</service-ref-name>
+ <service-interface>javax.xml.ws.Service</service-interface>
+ <wsdl-file>WEB-INF/wsdl/HelloService.wsdl</wsdl-file>
+ <port-component-ref>
+
<service-endpoint-interface>org.jboss.test.ws.jaxws.jbws2307.Hello</service-endpoint-interface>
+ </port-component-ref>
+ </service-ref>
+</web-app>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web2.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web3.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web3.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web3.xml 2014-08-25
10:37:34 UTC (rev 18861)
@@ -0,0 +1,23 @@
+<?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>ClientServlet3</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws2307.ClientServlet3</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ClientServlet3</servlet-name>
+ <url-pattern>/jbws2307</url-pattern>
+ </servlet-mapping>
+ <session-config>
+ <session-timeout>54</session-timeout>
+ </session-config>
+ <service-ref>
+ <service-ref-name>service/jbws2307service</service-ref-name>
+ <service-interface>javax.xml.ws.Service</service-interface>
+ <wsdl-file>WEB-INF/wsdl/HelloService.wsdl</wsdl-file>
+ <port-component-ref>
+
<service-endpoint-interface>org.jboss.test.ws.jaxws.jbws2307.Hello</service-endpoint-interface>
+ </port-component-ref>
+ </service-ref>
+</web-app>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws2307/WEB-INF-client/web3.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native