Author: alessio.soldano(a)jboss.com
Date: 2008-07-18 10:43:03 -0400 (Fri, 18 Jul 2008)
New Revision: 7858
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Dto.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Hello.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/HelloJavaBean.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/PartialEncryptionTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-client.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-server.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/wsse.keystore
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/wsse.truststore
Modified:
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-2182] Providing test case
Modified: stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2008-07-18
13:16:10 UTC (rev 7857)
+++
stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml 2008-07-18
14:43:03 UTC (rev 7858)
@@ -296,6 +296,27 @@
</metainf>
</jar>
+ <!-- jaxws-jbws2182-->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws2182.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws2182/*.class"/>
+ <exclude
name="org/jboss/test/ws/jaxws/jbws2182/*TestCase.class"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/test-resources/jaxws/jbws2182/META-INF">
+ <include name="jboss-wsse-server.xml"/>
+ </metainf>
+ <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws2182/">
+ <include name="wsse.truststore"/>
+ <include name="wsse.keystore"/>
+ </metainf>
+ </jar>
+ <jar
jarfile="${tests.output.dir}/test-libs/jaxws-jbws2182-client.jar">
+ <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws2182">
+ <include name="wsse.truststore"/>
+ <include name="wsse.keystore"/>
+ </metainf>
+ </jar>
+
<!-- jaxws-webserviceref -->
<war warfile="${tests.output.dir}/test-libs/jaxws-webserviceref.war"
webxml="${tests.output.dir}/test-resources/jaxws/webserviceref/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
@@ -560,4 +581,4 @@
</target>
-</project>
\ No newline at end of file
+</project>
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Dto.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Dto.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Dto.java 2008-07-18
14:43:03 UTC (rev 7858)
@@ -0,0 +1,31 @@
+package org.jboss.test.ws.jaxws.jbws2182;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+(a)XmlAccessorType(XmlAccessType.FIELD)
+public class Dto
+{
+ @XmlElement(namespace="http://org.jboss.ws/jbws2182")
+ private String par1;
+ @XmlElement(namespace="http://org.jboss.ws/jbws2182")
+ private String par2;
+
+ public String getPar1()
+ {
+ return par1;
+ }
+ public void setPar1(String par1)
+ {
+ this.par1 = par1;
+ }
+ public String getPar2()
+ {
+ return par2;
+ }
+ public void setPar2(String par2)
+ {
+ this.par2 = par2;
+ }
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Dto.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Hello.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Hello.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Hello.java 2008-07-18
14:43:03 UTC (rev 7858)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws2182;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name = "Hello")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public interface Hello
+{
+ @WebMethod
+ public Dto echo(Dto dto);
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/Hello.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/HelloJavaBean.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/HelloJavaBean.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/HelloJavaBean.java 2008-07-18
14:43:03 UTC (rev 7858)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws2182;
+
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.ws.annotation.EndpointConfig;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+
+@Stateless
+@WebService(name = "Hello", serviceName = "HelloService",
targetNamespace = "http://org.jboss.ws/jbws2182")
+@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+@WebContext(contextRoot = "/jaxws-jbws2182", urlPattern = "/*")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+public class HelloJavaBean
+{
+ @WebMethod
+ public Dto echo(Dto dto)
+ {
+ return dto;
+ }
+}
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/HelloJavaBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/PartialEncryptionTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/PartialEncryptionTestCase.java
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/PartialEncryptionTestCase.java 2008-07-18
14:43:03 UTC (rev 7858)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jbws2182;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ *
http://jira.jboss.org/jira/browse/JBWS-2182
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-07-2008
+ */
+public class PartialEncryptionTestCase extends JBossWSTest
+{
+ private String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws2182";
+
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(PartialEncryptionTestCase.class,
"jaxws-jbws2182-client.jar,jaxws-jbws2182.jar");
+ }
+
+ public void testAuth() throws Exception
+ {
+ Hello port = getPort();
+ Dto dto = new Dto();
+ dto.setPar1("first parameter");
+ dto.setPar2("second parameter");
+ try
+ {
+ Dto result = port.echo(dto);
+ assertEquals(dto.getPar1(), result.getPar1());
+ assertEquals(dto.getPar2(), result.getPar2());
+ }
+ catch (Exception e)
+ {
+ fail();
+ }
+ }
+
+ private Hello getPort() throws Exception
+ {
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jbws2182",
"HelloService");
+ Hello port = Service.create(wsdlURL, serviceName).getPort(Hello.class);
+ URL securityURL =
getResourceURL("jaxws/jbws2182/META-INF/jboss-wsse-client.xml");
+ ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+ return port;
+ }
+}
\ No newline at end of file
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2182/PartialEncryptionTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-client.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-client.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-client.xml 2008-07-18
14:43:03 UTC (rev 7858)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <key-store-file>META-INF/wsse.keystore</key-store-file>
+ <key-store-password>jbossws</key-store-password>
+ <trust-store-file>META-INF/wsse.truststore</trust-store-file>
+ <trust-store-password>jbossws</trust-store-password>
+ <config>
+ <encrypt type="x509v3" alias="wsse">
+ <targets>
+ <target type="qname"
contentOnly="true">{http://org.jboss.ws/jbws2182}par1</target>
+ </targets>
+ </encrypt>
+ <requires>
+ <encryption>
+ <targets>
+ <target type="qname"
contentOnly="true">{http://org.jboss.ws/jbws2182}par2</target>
+ </targets>
+ </encryption>
+ </requires>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-server.xml
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-server.xml
(rev 0)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-server.xml 2008-07-18
14:43:03 UTC (rev 7858)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <key-store-file>META-INF/wsse.keystore</key-store-file>
+ <key-store-password>jbossws</key-store-password>
+ <trust-store-file>META-INF/wsse.truststore</trust-store-file>
+ <trust-store-password>jbossws</trust-store-password>
+ <config>
+ <encrypt type="x509v3" alias="wsse">
+ <targets>
+ <target type="qname"
contentOnly="true">{http://org.jboss.ws/jbws2182}par2</target>
+ </targets>
+ </encrypt>
+ <requires>
+ <encryption>
+ <targets>
+ <target type="qname"
contentOnly="true">{http://org.jboss.ws/jbws2182}par1</target>
+ </targets>
+ </encryption>
+ </requires>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/META-INF/jboss-wsse-server.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/wsse.keystore
===================================================================
(Binary files differ)
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/wsse.keystore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/wsse.truststore
===================================================================
(Binary files differ)
Property changes on:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws2182/wsse.truststore
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream