Author: rsearls
Date: 2014-07-11 15:51:42 -0400 (Fri, 11 Jul 2014)
New Revision: 18799
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloRequest.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloResponse.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWs.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWsImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/OasisCatalogHelloWSTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/jax-ws-catalog.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/wsdl/Hello.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/wsdl/Hello_schema1.xsd
Log:
[JBWS-3788] test clientSide app catalog and clientSide jbossws-cxf-client.jar catalog
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloRequest.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloRequest.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloRequest.java 2014-07-11
19:51:42 UTC (rev 18799)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.catalog;
+
+public class HelloRequest
+{
+ private String input;
+
+ public String getInput()
+ {
+ return input;
+ }
+
+ public void setInput(String input)
+ {
+ this.input = input;
+ }
+
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloResponse.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloResponse.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloResponse.java 2014-07-11
19:51:42 UTC (rev 18799)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.catalog;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class HelloResponse
+{
+ private List<String> multiHello = new ArrayList<String>();
+
+ public List<String> getMultiHello()
+ {
+ return multiHello;
+ }
+
+ public void setMultiHello(List<String> multiHello)
+ {
+ this.multiHello = multiHello;
+ }
+
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWs.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWs.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWs.java 2014-07-11
19:51:42 UTC (rev 18799)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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.cxf.catalog;
+
+import org.jboss.test.ws.jaxws.cxf.catalog.HelloRequest;
+import org.jboss.test.ws.jaxws.cxf.catalog.HelloResponse;
+
+import javax.jws.WebService;
+
+@WebService(name = HelloWs.NAME, targetNamespace = HelloWs.TARGET_NAMESPACE)
+public interface HelloWs
+{
+ public final static String NAME = "HelloService";
+
+ public final static String TARGET_NAMESPACE = "http://hello/test";
+
+ public HelloResponse doHello(HelloRequest request);
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWsImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWsImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/HelloWsImpl.java 2014-07-11
19:51:42 UTC (rev 18799)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, 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 theb 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.cxf.catalog;
+
+import org.jboss.test.ws.jaxws.cxf.catalog.HelloRequest;
+import org.jboss.test.ws.jaxws.cxf.catalog.HelloResponse;
+import org.jboss.test.ws.jaxws.cxf.catalog.HelloWs;
+
+import javax.jws.WebService;
+
+@WebService(wsdlLocation = "META-INF/wsdl/Hello.wsdl",
+ name = org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.NAME,
+ serviceName = org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.NAME,
+ targetNamespace = org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.TARGET_NAMESPACE,
+ endpointInterface = "org.jboss.test.ws.jaxws.cxf.catalog.HelloWs")
+public class HelloWsImpl implements HelloWs {
+ public HelloResponse doHello(HelloRequest request) {
+ HelloResponse response = new HelloResponse();
+ response.getMultiHello().add(request.getInput());
+ response.getMultiHello().add("world");
+ return response;
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/OasisCatalogHelloWSTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/OasisCatalogHelloWSTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/catalog/OasisCatalogHelloWSTestCase.java 2014-07-11
19:51:42 UTC (rev 18799)
@@ -0,0 +1,117 @@
+package org.jboss.test.ws.jaxws.cxf.catalog;
+
+import junit.framework.Test;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.catalog.OASISCatalogManager;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * User: rsearls
+ * Date: 7/9/14
+ */
+public class OasisCatalogHelloWSTestCase extends JBossWSTest
+{
+ private final String endpointAddress = "http://" + getServerHost() +
":8080/jaxws-cxf-catalog/HelloService";
+
+ public static BaseDeployment<?>[] createDeployments() {
+
+ List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-catalog.war") {
{
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.apache.cxf\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloRequest.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloResponse.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloWsImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/cxf/catalog/META-INF/wsdl/Hello.wsdl"),
"wsdl/Hello.wsdl")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/cxf/catalog/META-INF/wsdl/Hello_schema1.xsd"),
"wsdl/Hello_schema1.xsd")
+ .add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/catalog/META-INF/jax-ws-catalog.xml")),
+ "META-INF/jax-ws-catalog.xml")
+ ;
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(OasisCatalogHelloWSTestCase.class,
+ JBossWSTestHelper.writeToFile(createDeployments()));
+ }
+
+ public void testCatalogOnClientSide() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ BusFactory.setThreadDefaultBus(bus);
+
+ URL archiveURL =
JBossWSTestHelper.getArchiveURL("jaxws-cxf-catalog.war");
+
+ // add archive to classpath
+ ClassLoader currentThreadClassLoader =
Thread.currentThread().getContextClassLoader();
+ URLClassLoader urlClassLoader
+ = new URLClassLoader(new URL[]{archiveURL}, currentThreadClassLoader);
+ Thread.currentThread().setContextClassLoader(urlClassLoader);
+
+ QName serviceName = new QName(
+ org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.TARGET_NAMESPACE,
+ org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.NAME);
+ URL wsdlURL = new URL(endpointAddress + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+
+ OASISCatalogManager catalogManager =
bus.getExtension(OASISCatalogManager.class);
+ assertNotNull("OASISCatalogManager not provided ", catalogManager);
+
+ String xsd = "http://org.jboss.ws/cxf/catalogclient/ws-addr.xsd";
+ String resolvedSchemaLocation = catalogManager.resolveSystem(xsd);
+ assertEquals("http://org.foo.bar/client/ws-addr.xsd",
resolvedSchemaLocation);
+
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+ public void testCatalogInJbosswsCxfClientJar() throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ try {
+ BusFactory.setThreadDefaultBus(bus);
+
+ QName serviceName = new QName(
+ org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.TARGET_NAMESPACE,
+ org.jboss.test.ws.jaxws.cxf.catalog.HelloWs.NAME);
+ URL wsdlURL = new URL(endpointAddress + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+
+ // jbossws-cxf-client.Jar is on the classpath by default.
+ // cxf processed it during service creation.
+ OASISCatalogManager catalogManager =
bus.getExtension(OASISCatalogManager.class);
+ assertNotNull("OASISCatalogManager not provided ", catalogManager);
+
+ String xsd = "http://ws-i.org/profiles/basic/1.1/ws-addr.xsd";
+ String resolvedSchemaLocation = catalogManager.resolveSystem(xsd);
+ assertEquals("classpath:/schemas/wsdl/ws-addr.xsd",
resolvedSchemaLocation);
+
+ } finally {
+ bus.shutdown(true);
+ }
+ }
+
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/jax-ws-catalog.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/jax-ws-catalog.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/jax-ws-catalog.xml 2014-07-11
19:51:42 UTC (rev 18799)
@@ -0,0 +1,6 @@
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
prefer="system">
+
+ <rewriteSystem
systemIdStartString="http://org.jboss.ws/cxf/catalogclient"
+ rewritePrefix="http://org.foo.bar/client"/>
+
+</catalog>
\ No newline at end of file
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/wsdl/Hello.wsdl
===================================================================
(Binary files differ)
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/wsdl/Hello.wsdl
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/wsdl/Hello_schema1.xsd
===================================================================
(Binary files differ)
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/catalog/META-INF/wsdl/Hello_schema1.xsd
___________________________________________________________________
Added: svn:mime-type
+ application/xml