Author: asoldano
Date: 2015-03-10 12:15:03 -0400 (Tue, 10 Mar 2015)
New Revision: 19549
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml
Log:
[JBWS-3875] Modifying fastinfoset test to also check FI configured with feature
properties
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2015-03-10
16:11:57 UTC (rev 19548)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2015-03-10
16:15:03 UTC (rev 19549)
@@ -38,11 +38,15 @@
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.ws.api.configuration.ClientConfigUtil;
+import org.jboss.ws.api.configuration.ClientConfigurer;
import org.jboss.wsf.stack.cxf.client.UseThreadBusFeature;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.WrapThreadContextClassLoader;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -58,11 +62,23 @@
archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.apache.cxf\n"))
.addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFIImpl.class)
.addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl.class)
+ .add(new FileAsset(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml")),
"jaxws-endpoint-config.xml")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/fastinfoset/WEB-INF/web.xml"));
return archive;
}
+ @Override
+ protected String getClientJarPaths() {
+ return JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-cxf-fastinfoset-client.jar") { {
+ archive
+ .addManifest()
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml"),
"jaxws-client-config.xml");
+ }
+ });
+ }
+
@Test
@RunAsClient
public void testInfoset() throws Exception
@@ -77,11 +93,11 @@
bus.getInInterceptors().add(new LoggingInInterceptor(pwIn));
bus.getOutInterceptors().add(new LoggingOutInterceptor(pwOut));
- URL wsdlURL = new URL(baseURL +
"HelloWorldService/HelloWorldImpl?wsdl");
- QName serviceName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldService");
+ URL wsdlURL = new URL(baseURL +
"HelloWorldService/HelloWorldFIImpl?wsdl");
+ QName serviceName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldFIService");
Service service = Service.create(wsdlURL, serviceName, new
UseThreadBusFeature());
- QName portQName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldImplPort");
- HelloWorld port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
+ QName portQName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldFIImplPort");
+ HelloWorldFI port = (HelloWorldFI) service.getPort(portQName,
HelloWorldFI.class);
assertEquals("helloworld", port.echo("helloworld"));
assertTrue("request is expected fastinfoset",
out.toString().indexOf("application/fastinfoset") > -1);
assertTrue("response is expected fastinfoset",
in.toString().indexOf("application/fastinfoset") > -1);
@@ -123,4 +139,39 @@
}
+ @Test
+ @RunAsClient
+ @WrapThreadContextClassLoader
+ public void testInfosetUsingFeatureProperties() throws Exception
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ByteArrayOutputStream in = new ByteArrayOutputStream();
+ PrintWriter pwIn = new PrintWriter(in);
+ PrintWriter pwOut = new PrintWriter(out);
+ Bus bus = BusFactory.newInstance().createBus();
+ BusFactory.setThreadDefaultBus(bus);
+ try {
+ bus.getInInterceptors().add(new LoggingInInterceptor(pwIn));
+ bus.getOutInterceptors().add(new LoggingOutInterceptor(pwOut));
+
+ URL wsdlURL = new URL(baseURL +
"HelloWorldService/HelloWorldImpl?wsdl");
+ QName serviceName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldService");
+ Service service = Service.create(wsdlURL, serviceName, new
UseThreadBusFeature());
+ QName portQName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldImplPort");
+ HelloWorld port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
+
+ ClientConfigurer configurer = ClientConfigUtil.resolveClientConfigurer();
+ configurer.setConfigProperties(port,
"META-INF/jaxws-client-config.xml", "Custom Client Config");
+
+ assertEquals("helloworld", port.echo("helloworld"));
+ assertTrue("request is expected fastinfoset",
out.toString().indexOf("application/fastinfoset") > -1);
+ assertTrue("response is expected fastinfoset",
in.toString().indexOf("application/fastinfoset") > -1);
+ } finally {
+ bus.shutdown(true);
+ pwOut.close();
+ pwIn.close();
+ }
+
+ }
+
}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java 2015-03-10
16:11:57 UTC (rev 19548)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorld.java 2015-03-10
16:15:03 UTC (rev 19549)
@@ -23,10 +23,7 @@
import javax.jws.WebService;
-import org.apache.cxf.annotations.FastInfoset;
-
@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset")
-@FastInfoset(force = true)
public interface HelloWorld
{
String echo(String input);
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java 2015-03-10
16:15:03 UTC (rev 19549)
@@ -0,0 +1,33 @@
+/*
+ * 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.fastinfoset;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.FastInfoset;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset")
+@FastInfoset(force = true)
+public interface HelloWorldFI
+{
+ String echo(String input);
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFI.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java 2015-03-10
16:15:03 UTC (rev 19549)
@@ -0,0 +1,40 @@
+/*
+ * 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.fastinfoset;
+
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.FastInfoset;
+
+@WebService
+(
+ serviceName = "HelloWorldFIService",
+ targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
+)
+@FastInfoset(force = true)
+public class HelloWorldFIImpl
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFIImpl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java 2015-03-10
16:11:57 UTC (rev 19548)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java 2015-03-10
16:15:03 UTC (rev 19549)
@@ -23,14 +23,11 @@
import javax.jws.WebService;
-import org.apache.cxf.annotations.FastInfoset;
-
@WebService
(
serviceName = "HelloWorldService",
targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
)
-@FastInfoset(force = true)
public class HelloWorldImpl
{
public String echo(String input)
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml 2015-03-10
16:15:03 UTC (rev 19549)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
schema/jbossws-jaxws-config_4_0.xsd">
+
+ <client-config>
+ <config-name>Custom Client Config</config-name>
+ <property>
+ <property-name>cxf.features</property-name>
+
<property-value>org.apache.cxf.feature.FastInfosetFeature</property-value>
+ </property>
+ </client-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF-client/jaxws-client-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml 2015-03-10
16:15:03 UTC (rev 19549)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0
schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+
<config-name>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl</config-name>
+ <property>
+ <property-name>cxf.features</property-name>
+
<property-value>org.apache.cxf.feature.FastInfosetFeature</property-value>
+ </property>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/jaxws-endpoint-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml 2015-03-10
16:11:57 UTC (rev 19548)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml 2015-03-10
16:15:03 UTC (rev 19549)
@@ -12,6 +12,10 @@
<servlet-name>FeatureServlet</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>FIServlet</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFIImpl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
@@ -21,4 +25,8 @@
<servlet-name>FeatureServlet</servlet-name>
<url-pattern>/HelloWorldService/HelloWorldFeatureImpl</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>FIServlet</servlet-name>
+ <url-pattern>/HelloWorldService/HelloWorldFIImpl</url-pattern>
+ </servlet-mapping>
</web-app>
\ No newline at end of file