Author: asoldano
Date: 2015-03-09 17:53:55 -0400 (Mon, 09 Mar 2015)
New Revision: 19545
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java
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/HelloWorldImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml
Log:
Extending fastinfost tests to use CXF Features
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-09
17:40:15 UTC (rev 19544)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/FastInfosetTestCase.java 2015-03-09
21:53:55 UTC (rev 19545)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2015, 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.
*
@@ -57,8 +57,8 @@
WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-cxf-fastinfoset.war");
archive.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "Dependencies: org.apache.cxf\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorld.class)
.addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl.class)
+
.addClass(org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl.class)
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/cxf/fastinfoset/WEB-INF/web.xml"));
return archive;
}
@@ -93,5 +93,34 @@
}
+ @Test
+ @RunAsClient
+ public void testInfosetUsingFeature() 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/HelloWorldFeatureImpl?wsdl");
+ QName serviceName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldFeatureService");
+ Service service = Service.create(wsdlURL, serviceName, new
UseThreadBusFeature());
+ QName portQName = new
QName("http://org.jboss.ws/jaxws/cxf/fastinfoset",
"HelloWorldFeatureImplPort");
+ HelloWorldFeature port = (HelloWorldFeature) service.getPort(portQName,
HelloWorldFeature.class);
+ assertEquals("helloworldFeature",
port.echo("helloworldFeature"));
+ 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();
+ }
+ }
+
}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.java 2015-03-09
21:53:55 UTC (rev 19545)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, 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.feature.Features;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset")
+@Features(features = {"org.apache.cxf.feature.FastInfosetFeature"})
+public interface HelloWorldFeature
+{
+ String echo(String input);
+}
Property changes on:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeature.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/HelloWorldFeatureImpl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldFeatureImpl.java 2015-03-09
21:53:55 UTC (rev 19545)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2015, 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.feature.FastInfosetFeature;
+import org.apache.cxf.feature.Features;
+
+@WebService
+(
+ serviceName = "HelloWorldFeatureService",
+ targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
+)
+@Features(classes = FastInfosetFeature.class)
+public class HelloWorldFeatureImpl
+{
+ 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/HelloWorldFeatureImpl.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-09
17:40:15 UTC (rev 19544)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/fastinfoset/HelloWorldImpl.java 2015-03-09
21:53:55 UTC (rev 19545)
@@ -28,11 +28,10 @@
@WebService
(
serviceName = "HelloWorldService",
- endpointInterface = "org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorld",
targetNamespace = "http://org.jboss.ws/jaxws/cxf/fastinfoset"
)
@FastInfoset(force = true)
-public class HelloWorldImpl implements HelloWorld
+public class HelloWorldImpl
{
public String echo(String input)
{
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF 2015-03-09
17:40:15 UTC (rev 19544)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/META-INF/MANIFEST.MF 2015-03-09
21:53:55 UTC (rev 19545)
@@ -1,2 +1,2 @@
Manifest-Version: 1.0
-Dependencies: org.apache.cxf.impl
\ No newline at end of file
+Dependencies: org.apache.cxf
\ No newline at end of file
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-09
17:40:15 UTC (rev 19544)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/fastinfoset/WEB-INF/web.xml 2015-03-09
21:53:55 UTC (rev 19545)
@@ -8,9 +8,17 @@
<servlet-name>TestServlet</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>FeatureServlet</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.cxf.fastinfoset.HelloWorldFeatureImpl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/HelloWorldService/HelloWorldImpl</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>FeatureServlet</servlet-name>
+ <url-pattern>/HelloWorldService/HelloWorldFeatureImpl</url-pattern>
+ </servlet-mapping>
</web-app>
\ No newline at end of file