[jbossws-commits] JBossWS SVN: r7284 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/samples/wsse and 2 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Jun 3 08:25:21 EDT 2008


Author: alessio.soldano at jboss.com
Date: 2008-06-03 08:25:21 -0400 (Tue, 03 Jun 2008)
New Revision: 7284

Added:
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoader.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoaderMBean.java
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/META-INF/jboss-service.xml
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/bcprov-jdk14.jar
Modified:
   stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
   stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignEncryptTestCase.java
Log:
[JBWS-2098] Dynamically install bouncy castle provider when running encryption test


Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml	2008-06-03 12:21:28 UTC (rev 7283)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml	2008-06-03 12:25:21 UTC (rev 7284)
@@ -95,6 +95,17 @@
           <include name="bob.properties" />
        </zipfileset>
     </war>
+    <jar destfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-sign-encrypt.sar">
+	  <metainf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/sign-encrypt/META-INF">
+        <include name="jboss-service.xml" />
+      </metainf>
+      <fileset dir="${tests.output.dir}/test-classes">
+        <include name="org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoader*.class"/>
+      </fileset>
+      <fileset dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/sign-encrypt">
+        <include name="bcprov*.jar" />
+      </fileset>
+    </jar>
   	
     <!-- jaxws-samples-wsse-sign-encrypt-client -->
     <jar destfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-sign-encrypt-client.jar">

Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoader.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoader.java	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoader.java	2008-06-03 12:25:21 UTC (rev 7284)
@@ -0,0 +1,54 @@
+/*
+ * 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.samples.wsse;
+
+import java.security.Security;
+import org.jboss.logging.Logger;
+
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import javax.crypto.Cipher;
+
+//$Id$
+
+/**
+ * Loads / unloads the Bouncy Castle JCE provider
+ * 
+ */
+public class BouncyCastleLoader implements BouncyCastleLoaderMBean
+{
+   private static Logger log = Logger.getLogger(BouncyCastleLoader.class);
+   
+   public void start() throws Exception
+   {
+      BouncyCastleProvider bcp = new BouncyCastleProvider();
+      Security.addProvider(bcp);
+      Cipher c = Cipher.getInstance("RSA", "BC");
+      log.info("Created RSA cipher: " + c + ", provider:" + c.getProvider());
+   }
+
+   public void stop() throws Exception
+   {
+      BouncyCastleProvider bcp = new BouncyCastleProvider();
+      Security.removeProvider(bcp.getName());
+      log.info("Bouncy Castle provider removed.");
+   }
+}


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

Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoaderMBean.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoaderMBean.java	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/BouncyCastleLoaderMBean.java	2008-06-03 12:25:21 UTC (rev 7284)
@@ -0,0 +1,29 @@
+/*
+ * 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.samples.wsse;
+
+public interface BouncyCastleLoaderMBean
+{
+   public void start() throws Exception;
+
+   public void stop() throws Exception;
+}


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

Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignEncryptTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignEncryptTestCase.java	2008-06-03 12:21:28 UTC (rev 7283)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/SignEncryptTestCase.java	2008-06-03 12:25:21 UTC (rev 7284)
@@ -56,7 +56,8 @@
    
    public static Test suite()
    {
-      return new JBossWSTestSetup(SignEncryptTestCase.class,"jaxws-samples-wsse-sign-encrypt-client.jar jaxws-samples-wsse-sign-encrypt.war");
+      return new JBossWSTestSetup(SignEncryptTestCase.class,
+            "jaxws-samples-wsse-sign-encrypt.sar jaxws-samples-wsse-sign-encrypt-client.jar jaxws-samples-wsse-sign-encrypt.war");
    }
 
    public void test() throws Exception

Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/META-INF/jboss-service.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/META-INF/jboss-service.xml	                        (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/META-INF/jboss-service.xml	2008-06-03 12:25:21 UTC (rev 7284)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+  <mbean code="org.jboss.test.ws.jaxws.samples.wsse.BouncyCastleLoader" name="org.jboss.test.ws.jaxws.samples.wsse:service=BouncyCastleLoader"/>
+</server>


Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/bcprov-jdk14.jar
===================================================================
(Binary files differ)


Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/sign-encrypt/bcprov-jdk14.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jbossws-commits mailing list