[jbossws-commits] JBossWS SVN: r9612 - in stack/native/trunk/modules/testsuite/native-tests: src/test/java/org/jboss/test/ws/jaxws and 4 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Mar 17 10:37:03 EDT 2009


Author: alessio.soldano at jboss.com
Date: 2009-03-17 10:37:03 -0400 (Tue, 17 Mar 2009)
New Revision: 9612

Added:
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/Dto.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/EndpointInterface.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/HelloBean.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/HelloRemoteInterface.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/JBWS1309TestCase.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss-wsse-client.xml
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss-wsse-server.xml
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss.xml
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/wsse.keystore
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/wsse.truststore
Modified:
   stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml
Log:
[JBWS-1309] Adding another testcase showing a ws-security endpoint set up with the jboss.xml descriptor only


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	2009-03-17 13:24:14 UTC (rev 9611)
+++ stack/native/trunk/modules/testsuite/native-tests/scripts/build-jars-jaxws.xml	2009-03-17 14:37:03 UTC (rev 9612)
@@ -183,6 +183,28 @@
       </webinf>
     </war>
     
+    <!-- jaxws-jbws1309-->
+    <jar destfile="${tests.output.dir}/test-libs/jaxws-jbws1309.jar">
+      <fileset dir="${tests.output.dir}/test-classes">
+        <include name="org/jboss/test/ws/jaxws/jbws1309/*.class"/>
+        <exclude name="org/jboss/test/ws/jaxws/jbws1309/*TestCase.class"/>
+      </fileset>
+      <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws1309/META-INF">
+        <include name="jboss-wsse-server.xml"/>
+        <include name="jboss.xml"/>
+      </metainf>
+      <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws1309/">
+        <include name="wsse.truststore"/>
+      	<include name="wsse.keystore"/>
+      </metainf>
+    </jar>
+    <jar jarfile="${tests.output.dir}/test-libs/jaxws-jbws1309-client.jar">
+      <metainf dir="${tests.output.dir}/test-resources/jaxws/jbws1309">
+        <include name="wsse.truststore"/>
+        <include name="wsse.keystore"/>
+      </metainf>
+    </jar>
+    
     <!-- jaxws-jbws1666 -->
     <war destfile="${tests.output.dir}/test-libs/jaxws-jbws1666.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws1666/WEB-INF/web.xml">
       <classes dir="${tests.output.dir}/test-classes">

Added: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/Dto.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/Dto.java	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/Dto.java	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws1309;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+
+ at 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/jbws1309/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/jbws1309/EndpointInterface.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/EndpointInterface.java	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/EndpointInterface.java	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws1309;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(name = "HelloBean")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public interface EndpointInterface
+{
+   @WebMethod
+   Dto echo(Dto dto);
+}


Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/EndpointInterface.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/jbws1309/HelloBean.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/HelloBean.java	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/HelloBean.java	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws1309;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+ at Stateless
+ at Remote(HelloRemoteInterface.class)
+ at WebService(name = "HelloBean", serviceName = "HelloService", targetNamespace = "http://org.jboss.ws/jbws1309")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public class HelloBean implements HelloRemoteInterface
+{
+   @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/jbws1309/HelloBean.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/jbws1309/HelloRemoteInterface.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/HelloRemoteInterface.java	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/HelloRemoteInterface.java	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,27 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws1309;
+
+public interface HelloRemoteInterface
+{
+   Dto echo(Dto dto);
+}


Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/HelloRemoteInterface.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/jbws1309/JBWS1309TestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/JBWS1309TestCase.java	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/JBWS1309TestCase.java	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.jbws1309;
+
+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-1309
+ * 
+ * Testing WS-Security setting up the endpoint configuration
+ * without using JBoss-specific annotations -> i.e. using jboss.xml descriptor
+ *
+ * @author alessio.soldano at jboss.com
+ * @since 17-Mar-2009
+ */
+public class JBWS1309TestCase extends JBossWSTest
+{
+   private String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-jbws1309";
+
+   public static Test suite() throws Exception
+   {
+      return new JBossWSTestSetup(JBWS1309TestCase.class, "jaxws-jbws1309-client.jar,jaxws-jbws1309.jar");
+   }
+   
+   public void testAuth() throws Exception
+   {
+      EndpointInterface 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)
+      {
+         e.printStackTrace();
+         fail(e.getMessage());
+      }
+   }
+
+   private EndpointInterface getPort() throws Exception
+   {
+      URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+      QName serviceName = new QName("http://org.jboss.ws/jbws1309", "HelloService");
+      EndpointInterface port = Service.create(wsdlURL, serviceName).getPort(EndpointInterface.class);
+      URL securityURL = getResourceURL("jaxws/jbws1309/META-INF/jboss-wsse-client.xml");
+      ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+      ((StubExt)port).setConfigName("Standard WSSecurity Client");
+      return port;
+   }
+}


Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1309/JBWS1309TestCase.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss-wsse-client.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss-wsse-client.xml	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss-wsse-client.xml	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,15 @@
+<?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"/>
+    <requires>
+      <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/jbws1309/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/jbws1309/META-INF/jboss-wsse-server.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss-wsse-server.xml	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss-wsse-server.xml	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,15 @@
+<?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"/>
+    <requires>
+      <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/jbws1309/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/jbws1309/META-INF/jboss.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss.xml	                        (rev 0)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss.xml	2009-03-17 14:37:03 UTC (rev 9612)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_2.dtd">
+
+<jboss>
+  <webservices>
+    <context-root>/jaxws-jbws1309</context-root>
+    <webservice-description>
+      <webservice-description-name>jbws1309-ws-description</webservice-description-name>
+      <config-name>Standard WSSecurity Endpoint</config-name>
+    </webservice-description>
+  </webservices>
+  <enterprise-beans>
+    <session>
+      <ejb-name>HelloBean</ejb-name>
+      <jndi-name>ejb/HelloBean</jndi-name>
+      <port-component>
+        <port-component-name>TestPortComponent</port-component-name>
+        <port-component-uri>/*</port-component-uri>
+      </port-component>
+    </session>
+  </enterprise-beans>
+</jboss>
\ No newline at end of file


Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/META-INF/jboss.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/wsse.keystore
===================================================================
(Binary files differ)


Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/wsse.keystore
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/wsse.truststore
===================================================================
(Binary files differ)


Property changes on: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/jbws1309/wsse.truststore
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jbossws-commits mailing list