Author: alessio.soldano(a)jboss.com
Date: 2013-06-06 14:27:28 -0400 (Thu, 06 Jun 2013)
New Revision: 17661
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
Modified:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
Log:
More tests
Modified:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
---
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-06-06
18:26:55 UTC (rev 17660)
+++
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2013-06-06
18:27:28 UTC (rev 17661)
@@ -332,6 +332,17 @@
</manifest>
</jar>
+ <!-- jaxws-cxf-jbws3648 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-cxf-jbws3648.war"
needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo*.class"/>
+ </classes>
+ <manifest>
+ <attribute name="Dependencies"
value="org.jboss.ws.cxf.jbossws-cxf-client"/>
+ </manifest>
+ </war>
+
<!-- jaxws-cxf-logging -->
<jar destfile="${tests.output.dir}/test-libs/jaxws-cxf-logging.jar">
<fileset dir="${tests.output.dir}/test-classes">
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java
===================================================================
---
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java
(rev 0)
+++
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOne.java 2013-06-06
18:27:28 UTC (rev 17661)
@@ -0,0 +1,32 @@
+/*
+ * 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.jbws3648;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "EndpointOne", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/jbws3648", serviceName = "ServiceOne")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointOne
+{
+ String echo(String input);
+}
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java
===================================================================
---
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java
(rev 0)
+++
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointOneImpl.java 2013-06-06
18:27:28 UTC (rev 17661)
@@ -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 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.jbws3648;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.stack.cxf.policy.PolicySets;
+
+@WebService(name = "EndpointOne", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/jbws3648", serviceName = "ServiceOne")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@PolicySets({"WS-RM_Policy_spec_example",
"WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt", "WS-Addressing"})
+public class EndpointOneImpl
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo: " + input);
+ return input;
+ }
+}
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java
===================================================================
---
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java
(rev 0)
+++
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwo.java 2013-06-06
18:27:28 UTC (rev 17661)
@@ -0,0 +1,35 @@
+/*
+ * 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.jbws3648;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.wsf.stack.cxf.policy.PolicySets;
+
+@WebService(name = "EndpointTwo", targetNamespace =
"http://org.jboss.ws.jaxws.cxf/jbws3648")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@PolicySets({"WS-RM_Policy_spec_example",
"WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt", "WS-Addressing"})
+public interface EndpointTwo
+{
+ String echo(String input);
+}
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java
===================================================================
---
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java
(rev 0)
+++
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/EndpointTwoImpl.java 2013-06-06
18:27:28 UTC (rev 17661)
@@ -0,0 +1,43 @@
+/*
+ * 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.jbws3648;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(name = "EndpointTwo",
+ targetNamespace = "http://org.jboss.ws.jaxws.cxf/jbws3648",
+ serviceName = "ServiceTwo",
+ endpointInterface =
"org.jboss.test.ws.jaxws.cxf.jbws3648.EndpointTwo")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class EndpointTwoImpl implements EndpointTwo
+{
+ @WebMethod
+ public String echo(String input)
+ {
+ Logger.getLogger(this.getClass()).info("echo: " + input);
+ return input;
+ }
+}
Added:
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
===================================================================
---
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java
(rev 0)
+++
stack/cxf/branches/JBWS-3648/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3648/PolicyAttachmentWSDLTestCase.java 2013-06-06
18:27:28 UTC (rev 17661)
@@ -0,0 +1,82 @@
+/*
+ * 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.jbws3648;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ *
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 06-Jun-2013
+ */
+public class PolicyAttachmentWSDLTestCase extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(PolicyAttachmentWSDLTestCase.class,
"jaxws-cxf-jbws3648.war");
+ }
+
+ public void testEndpointOneWSDL() throws Exception {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3648/ServiceOne" + "?wsdl");
+ checkPolicyAttachments(wsdlURL, new
String[]{"WS-RM_Policy_spec_example",
+ "WS-SP-EX223_binding_policy",
+ "WS-SP-EX223_Binding_Operation_Input_Policy",
+ "WS-SP-EX223_Binding_Operation_Output_Policy",
+ "WS-Addressing_binding_policy"});
+ }
+
+ public void testEndpointTwoWSDL() throws Exception
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-cxf-jbws3648/ServiceTwo" + "?wsdl");
+ checkPolicyAttachments(wsdlURL, new
String[]{"WS-RM_Policy_spec_example",
+ "WS-SP-EX223_binding_policy",
+ "WS-SP-EX223_Binding_Operation_Input_Policy",
+ "WS-SP-EX223_Binding_Operation_Output_Policy",
+ "WS-Addressing_binding_policy"});
+ }
+
+ private void checkPolicyAttachments(URL wsdlURL, String[] refIds) throws Exception {
+ BufferedReader br = new BufferedReader(new InputStreamReader(wsdlURL.openStream(),
"UTF-8"));
+ StringBuilder sb = new StringBuilder();
+ try {
+ String s;
+ while ((s = br.readLine()) != null) {
+ sb.append(s);
+ }
+ } finally {
+ br.close();
+ }
+ String wsdl = sb.toString();
+ for (String refId : refIds) {
+ assertTrue("WSDL does not contain '" + refId + "'",
wsdl.contains(refId));
+ }
+ }
+
+}