Author: alessio.soldano(a)jboss.com
Date: 2012-05-10 15:54:15 -0400 (Thu, 10 May 2012)
New Revision: 16257
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/Endpoint.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/EndpointBean.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/WSMexTestCase.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
[JBWS-3496] Adding testcase
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2012-05-10
15:59:16 UTC (rev 16256)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2012-05-10
19:54:15 UTC (rev 16257)
@@ -250,6 +250,14 @@
</manifest>
</war>
+ <!-- jaxws-cxf-wsmex -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-wsmex.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/cxf/wsmex/Endpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/wsmex/EndpointBean.class"/>
+ </fileset>
+ </jar>
+
<!-- saaj-soap-connection -->
<war
warfile="${tests.output.dir}/test-libs/saaj-soap-connection.war"
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/Endpoint.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/Endpoint.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/Endpoint.java 2012-05-10
19:54:15 UTC (rev 16257)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsmex;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "EndpointService", targetNamespace =
"http://org.jboss.ws/cxf/wsmex")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
+public interface Endpoint
+{
+ public String echo(String user);
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/EndpointBean.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/EndpointBean.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/EndpointBean.java 2012-05-10
19:54:15 UTC (rev 16257)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsmex;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "EndpointService", targetNamespace =
"http://org.jboss.ws/cxf/wsmex")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
+@Stateless
+public class EndpointBean implements Endpoint
+{
+ public String echo(String user)
+ {
+ System.out.println("user: " + user);
+ return user;
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/WSMexTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/WSMexTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/wsmex/WSMexTestCase.java 2012-05-10
19:54:15 UTC (rev 16257)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, 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.wsmex;
+
+import junit.framework.Test;
+
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.apache.cxf.ws.mex.MetadataExchange;
+import org.apache.cxf.ws.mex.model._2004_09.Metadata;
+import org.apache.cxf.ws.mex.model._2004_09.MetadataSection;
+import org.jboss.ws.common.DOMWriter;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.w3c.dom.Node;
+
+/**
+ * Test WS-MetadataExchange
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-May-2012
+ */
+public class WSMexTestCase extends JBossWSTest
+{
+ private String endpointAddress = "http://" + getServerHost() +
":8080/jaxws-cxf-wsmex/EndpointService";
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(WSMexTestCase.class,
"jaxws-cxf-wsmex.jar");
+ }
+
+ public void testEndpoint() throws Exception
+ {
+ JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
+ proxyFac.setAddress(endpointAddress);
+ MetadataExchange exc = proxyFac.create(MetadataExchange.class);
+ Metadata metadata = exc.get2004();
+
+ assertNotNull(metadata);
+ assertEquals(1, metadata.getMetadataSection().size());
+
+ MetadataSection ms = metadata.getMetadataSection().get(0);
+
assertEquals("http://schemas.xmlsoap.org/wsdl/", ms.getDialect());
+ assertEquals("http://org.jboss.ws/cxf/wsmex", ms.getIdentifier());
+
+ String wsdl = DOMWriter.printNode((Node)ms.getAny(), true);
+ assertTrue(wsdl.contains("EndpointBeanServiceSoapBinding"));
+ }
+}