You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2012/10/09 12:16:07 UTC

svn commit: r1395941 [1/2] - in /cxf/trunk/systests: ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/ ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/secconv/ ws-security-examples/src/test/java/org...

Author: coheigea
Date: Tue Oct  9 10:16:06 2012
New Revision: 1395941

URL: http://svn.apache.org/viewvc?rev=1395941&view=rev
Log:
Some updates to the WS-Security system tests
 - Much more tests are now run with restricted security policies
 - Some work done to try to prevent random failures on some JDKs

Modified:
    cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java
    cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/secconv/SecureConversationTest.java
    cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java
    cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/x509/X509TokenTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/gcm/GCMTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/PolicyAlternativeTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenDerivedTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10UsernameAuthorizationTest.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
    cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/saml/DoubleItSaml.wsdl
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/x509/DoubleItX509.wsdl
    cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/x509/DoubleItX509Signature.wsdl

Modified: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java (original)
+++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/saml/SamlTokenTest.java Tue Oct  9 10:16:06 2012
@@ -94,6 +94,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -119,6 +120,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -144,6 +146,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -169,6 +172,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -194,6 +198,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -220,6 +225,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -245,6 +251,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -270,6 +277,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -295,6 +303,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     
@@ -321,6 +330,7 @@ public class SamlTokenTest extends Abstr
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     

Modified: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/secconv/SecureConversationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/secconv/SecureConversationTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/secconv/SecureConversationTest.java (original)
+++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/secconv/SecureConversationTest.java Tue Oct  9 10:16:06 2012
@@ -83,6 +83,7 @@ public class SecureConversationTest exte
         
         samlPort.doubleIt(25);
         
+        ((java.io.Closeable)samlPort).close();
         bus.shutdown(true);
     }
     

Modified: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java (original)
+++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/ut/UsernameTokenTest.java Tue Oct  9 10:16:06 2012
@@ -83,6 +83,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -108,6 +109,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -133,6 +135,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -158,6 +161,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -183,6 +187,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -208,6 +213,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -233,6 +239,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
 }

Modified: cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/x509/X509TokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/x509/X509TokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/x509/X509TokenTest.java (original)
+++ cxf/trunk/systests/ws-security-examples/src/test/java/org/apache/cxf/systest/wssec/examples/x509/X509TokenTest.java Tue Oct  9 10:16:06 2012
@@ -82,6 +82,7 @@ public class X509TokenTest extends Abstr
         
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
@@ -107,6 +108,7 @@ public class X509TokenTest extends Abstr
         
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
@@ -132,6 +134,7 @@ public class X509TokenTest extends Abstr
         
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
@@ -157,6 +160,7 @@ public class X509TokenTest extends Abstr
         
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java Tue Oct  9 10:16:06 2012
@@ -20,6 +20,10 @@ package org.apache.cxf.systest.ws.common
 
 import java.io.File;
 
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+
 /**
  * A utility class for security tests
  */
@@ -44,4 +48,23 @@ public final class SecurityTestUtil {
         }
     }
     
+    public static boolean checkUnrestrictedPoliciesInstalled() {
+        try {
+            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
+
+            SecretKey key192 = new SecretKeySpec(
+                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
+                            "AES");
+            Cipher c = Cipher.getInstance("AES");
+            c.init(Cipher.ENCRYPT_MODE, key192);
+            c.doFinal(data);
+            return true;
+        } catch (Exception e) {
+            //
+        }
+        return false;
+    }
+    
 }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/coverage_checker/DefaultCryptoCoverageCheckerTest.java Tue Oct  9 10:16:06 2012
@@ -23,9 +23,6 @@ import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 
@@ -47,15 +44,13 @@ public class DefaultCryptoCoverageChecke
     private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
 
-    private boolean unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
-    
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue(
-            "Server failed to launch",
-            // run the server in the same process
-            // set this to false to fork
-            launchServer(Server.class, true)
+                "Server failed to launch",
+                // run the server in the same process
+                // set this to false to fork
+                launchServer(Server.class, true)
         );
     }
     
@@ -67,10 +62,6 @@ public class DefaultCryptoCoverageChecke
     
     @org.junit.Test
     public void testSignedBodyTimestamp() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -101,15 +92,12 @@ public class DefaultCryptoCoverageChecke
         
         port.doubleIt(25);
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSignedBodyOnly() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -143,15 +131,12 @@ public class DefaultCryptoCoverageChecke
             // expected
         }
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSignedTimestampOnly() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -186,15 +171,12 @@ public class DefaultCryptoCoverageChecke
             // expected
         }
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSignedBodyTimestampSoap12() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -225,15 +207,12 @@ public class DefaultCryptoCoverageChecke
         
         port.doubleIt(25);
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
    
     @org.junit.Test
     public void testSignedBodyOnlySoap12() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -267,15 +246,12 @@ public class DefaultCryptoCoverageChecke
             // expected
         }
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSignedTimestampOnlySoap12() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -310,15 +286,12 @@ public class DefaultCryptoCoverageChecke
             // expected
         }
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSignedEncryptedBody() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -352,15 +325,12 @@ public class DefaultCryptoCoverageChecke
         
         port.doubleIt(25);
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSignedNotEncryptedBody() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -400,15 +370,12 @@ public class DefaultCryptoCoverageChecke
             // expected
         }
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testWSAddressing() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = DefaultCryptoCoverageCheckerTest.class.getResource("client/client.xml");
 
@@ -459,26 +426,8 @@ public class DefaultCryptoCoverageChecke
         
         port.doubleIt(25);
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
-    private boolean checkUnrestrictedPoliciesInstalled() {
-        try {
-            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-            SecretKey key192 = new SecretKeySpec(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
-                            "AES");
-            Cipher c = Cipher.getInstance("AES");
-            c.init(Cipher.ENCRYPT_MODE, key192);
-            c.doFinal(data);
-            return true;
-        } catch (Exception e) {
-            //
-        }
-        return false;
-    }
-    
 }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/gcm/GCMTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/gcm/GCMTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/gcm/GCMTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/gcm/GCMTest.java Tue Oct  9 10:16:06 2012
@@ -21,9 +21,6 @@ package org.apache.cxf.systest.ws.gcm;
 
 import java.net.URL;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 
@@ -32,9 +29,7 @@ import org.apache.cxf.bus.spring.SpringB
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.gcm.server.Server;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-
 import org.example.contract.doubleit.DoubleItPortType;
-
 import org.junit.BeforeClass;
 
 /**
@@ -46,15 +41,16 @@ public class GCMTest extends AbstractBus
     private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
 
-    private boolean unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
+    private static boolean unrestrictedPoliciesInstalled = 
+            SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
     
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue(
-            "Server failed to launch",
-            // run the server in the same process
-            // set this to false to fork
-            launchServer(Server.class, true)
+                "Server failed to launch",
+                // run the server in the same process
+                // set this to false to fork
+                launchServer(Server.class, true)
         );
     }
     
@@ -66,10 +62,6 @@ public class GCMTest extends AbstractBus
     
     @org.junit.Test
     public void testAESGCM128() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = GCMTest.class.getResource("client/client.xml");
 
@@ -85,6 +77,7 @@ public class GCMTest extends AbstractBus
         updateAddressPort(gcmPort, PORT);
         gcmPort.doubleIt(25);
         
+        ((java.io.Closeable)gcmPort).close();
         bus.shutdown(true);
     }
     
@@ -109,6 +102,7 @@ public class GCMTest extends AbstractBus
         updateAddressPort(gcmPort, PORT);
         gcmPort.doubleIt(25);
         
+        ((java.io.Closeable)gcmPort).close();
         bus.shutdown(true);
     }
     
@@ -133,26 +127,8 @@ public class GCMTest extends AbstractBus
         updateAddressPort(gcmPort, PORT);
         gcmPort.doubleIt(25);
         
+        ((java.io.Closeable)gcmPort).close();
         bus.shutdown(true);
     }
     
-    private boolean checkUnrestrictedPoliciesInstalled() {
-        try {
-            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-            SecretKey key192 = new SecretKeySpec(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
-                            "AES");
-            Cipher c = Cipher.getInstance("AES");
-            c.init(Cipher.ENCRYPT_MODE, key192);
-            c.doFinal(data);
-            return true;
-        } catch (Exception e) {
-            //
-        }
-        return false;
-    }
-    
 }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/kerberos/KerberosTokenTest.java Tue Oct  9 10:16:06 2012
@@ -21,9 +21,6 @@ package org.apache.cxf.systest.ws.kerber
 
 import java.net.URL;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 
@@ -32,9 +29,7 @@ import org.apache.cxf.bus.spring.SpringB
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.kerberos.server.Server;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-
 import org.example.contract.doubleit.DoubleItPortType;
-
 import org.junit.BeforeClass;
 
 /**
@@ -50,6 +45,7 @@ import org.junit.BeforeClass;
  * See here for more information:
  * http://coheigea.blogspot.com/2011/10/using-kerberos-with-web-services-part.html
  */
+@org.junit.Ignore
 public class KerberosTokenTest extends AbstractBusClientServerTestBase {
     static final String PORT = allocatePort(Server.class);
     static final String PORT2 = allocatePort(Server.class, 2);
@@ -57,7 +53,8 @@ public class KerberosTokenTest extends A
     private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
 
-    private boolean unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
+    private static boolean unrestrictedPoliciesInstalled = 
+            SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
     
     @BeforeClass
     public static void startServers() throws Exception {
@@ -76,7 +73,6 @@ public class KerberosTokenTest extends A
     }
 
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverTransport() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
@@ -96,11 +92,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverSymmetric() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -125,11 +121,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverSymmetricSupporting() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -154,11 +150,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverAsymmetric() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -183,11 +179,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverTransportEndorsing() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
@@ -207,11 +203,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverAsymmetricEndorsing() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
@@ -231,11 +227,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverSymmetricProtection() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
@@ -255,12 +251,12 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverSymmetricDerivedProtection() throws Exception {
 
         SpringBusFactory bf = new SpringBusFactory();
@@ -280,11 +276,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverAsymmetricSignedEndorsing() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -309,11 +305,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverAsymmetricSignedEncrypted() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -338,11 +334,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverSymmetricEndorsingEncrypted() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -367,11 +363,11 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testKerberosOverSymmetricSignedEndorsingEncrypted() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -396,26 +392,9 @@ public class KerberosTokenTest extends A
         int result = kerberosPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)kerberosPort).close();
         bus.shutdown(true);
     }
     
     
-    private boolean checkUnrestrictedPoliciesInstalled() {
-        try {
-            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-            SecretKey key192 = new SecretKeySpec(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
-                            "AES");
-            Cipher c = Cipher.getInstance("AES");
-            c.init(Cipher.ENCRYPT_MODE, key192);
-            c.doFinal(data);
-            return true;
-        } catch (Exception e) {
-            //
-        }
-        return false;
-    }
 }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/PolicyAlternativeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/PolicyAlternativeTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/PolicyAlternativeTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/PolicyAlternativeTest.java Tue Oct  9 10:16:06 2012
@@ -83,6 +83,7 @@ public class PolicyAlternativeTest exten
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -113,6 +114,7 @@ public class PolicyAlternativeTest exten
             // expected
         }
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -138,6 +140,7 @@ public class PolicyAlternativeTest exten
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -168,6 +171,9 @@ public class PolicyAlternativeTest exten
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
             // expected
         }
+        
+        ((java.io.Closeable)transportPort).close();
+        bus.shutdown(true);
     }
     
     /**
@@ -198,6 +204,9 @@ public class PolicyAlternativeTest exten
         } catch (javax.xml.ws.soap.SOAPFaultException ex) {
             // expected
         }
+        
+        ((java.io.Closeable)transportPort).close();
+        bus.shutdown(true);
     }
     
 }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/saml/SamlTokenTest.java Tue Oct  9 10:16:06 2012
@@ -21,9 +21,6 @@ package org.apache.cxf.systest.ws.saml;
 
 import java.net.URL;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Service;
@@ -36,9 +33,7 @@ import org.apache.cxf.systest.ws.saml.se
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.ws.security.saml.ext.bean.KeyInfoBean.CERT_IDENTIFIER;
 import org.apache.ws.security.saml.ext.builder.SAML2Constants;
-
 import org.example.contract.doubleit.DoubleItPortType;
-
 import org.junit.BeforeClass;
 
 /**
@@ -51,8 +46,6 @@ public class SamlTokenTest extends Abstr
     private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
 
-    private boolean unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
-    
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue(
@@ -109,15 +102,13 @@ public class SamlTokenTest extends Abstr
         int result = saml1Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml1Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSaml2OverSymmetric() throws Exception {
 
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SamlTokenTest.class.getResource("client/client.xml");
 
@@ -168,6 +159,7 @@ public class SamlTokenTest extends Abstr
             assertTrue(ex.getMessage().contains("SAML token security failure"));
         }
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
@@ -179,9 +171,6 @@ public class SamlTokenTest extends Abstr
     @org.junit.Test
     public void testSaml2OverSymmetricSupporting() throws Exception {
 
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SamlTokenTest.class.getResource("client/client.xml");
 
@@ -207,16 +196,13 @@ public class SamlTokenTest extends Abstr
             assertTrue(ex.getMessage().contains("Assertion fails sender-vouches requirements"));
         }
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
 
     @org.junit.Test
     public void testSaml2OverAsymmetric() throws Exception {
 
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-        
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SamlTokenTest.class.getResource("client/client.xml");
 
@@ -254,6 +240,7 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
@@ -280,6 +267,7 @@ public class SamlTokenTest extends Abstr
         int result = saml1Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml1Port).close();
         bus.shutdown(true);
     }
     
@@ -306,15 +294,13 @@ public class SamlTokenTest extends Abstr
         int result = saml1Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml1Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricSamlInitiator() throws Exception {
 
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SamlTokenTest.class.getResource("client/client.xml");
 
@@ -337,15 +323,13 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSaml2OverSymmetricSignedElements() throws Exception {
 
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SamlTokenTest.class.getResource("client/client.xml");
 
@@ -366,6 +350,7 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
@@ -395,6 +380,7 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
@@ -425,6 +411,7 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
@@ -454,16 +441,13 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
 
     @org.junit.Test
     public void testSaml2OverAsymmetricSignedEncrypted() throws Exception {
 
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-        
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SamlTokenTest.class.getResource("client/client.xml");
 
@@ -484,16 +468,13 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSaml2OverAsymmetricEncrypted() throws Exception {
 
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
-        
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = SamlTokenTest.class.getResource("client/client.xml");
 
@@ -516,6 +497,7 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
@@ -546,6 +528,7 @@ public class SamlTokenTest extends Abstr
         int result = saml2Port.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
@@ -574,26 +557,9 @@ public class SamlTokenTest extends Abstr
             assertTrue(ex.getMessage().contains(error));
         }
         
+        ((java.io.Closeable)saml2Port).close();
         bus.shutdown(true);
     }
     
     
-    private boolean checkUnrestrictedPoliciesInstalled() {
-        try {
-            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-            SecretKey key192 = new SecretKeySpec(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
-                            "AES");
-            Cipher c = Cipher.getInstance("AES");
-            c.init(Cipher.ENCRYPT_MODE, key192);
-            c.doFinal(data);
-            return true;
-        } catch (Exception e) {
-            //
-        }
-        return false;
-    }
 }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java Tue Oct  9 10:16:06 2012
@@ -236,6 +236,7 @@ public class SecurityPolicyTest extends 
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, 
                                                       getClass().getResource("bob.properties"));
         assertEquals(10, pt.doubleIt(5));
+        ((java.io.Closeable)pt).close();
         
         portQName = new QName(NAMESPACE, "DoubleItPortEncryptThenSign");
         pt = service.getPort(portQName, DoubleItPortType.class);
@@ -247,6 +248,7 @@ public class SecurityPolicyTest extends 
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, 
                                                       getClass().getResource("bob.properties"));
         pt.doubleIt(5);
+        ((java.io.Closeable)pt).close();
 
         portQName = new QName(NAMESPACE, "DoubleItPortSign");
         pt = service.getPort(portQName, DoubleItPortType.class);
@@ -258,6 +260,7 @@ public class SecurityPolicyTest extends 
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, 
                                                       getClass().getResource("bob.properties"));
         pt.doubleIt(5);
+        ((java.io.Closeable)pt).close();
 
         portQName = new QName(NAMESPACE, "DoubleItPortSignThenEncrypt");
         pt = service.getPort(portQName, DoubleItPortType.class);
@@ -274,6 +277,7 @@ public class SecurityPolicyTest extends 
                                                       POLICY_SIGNENC_PROVIDER_ADDRESS);
         int x = pt.doubleIt(5);
         assertEquals(10, x);
+        ((java.io.Closeable)pt).close();
         
         portQName = new QName(NAMESPACE, "DoubleItPortHttps");
         pt = service.getPort(portQName, DoubleItPortType.class);
@@ -290,6 +294,7 @@ public class SecurityPolicyTest extends 
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "bob");
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.PASSWORD, "pwd");
         pt.doubleIt(25);
+        ((java.io.Closeable)pt).close();
         
         try {
             portQName = new QName(NAMESPACE, "DoubleItPortHttp");
@@ -304,6 +309,7 @@ public class SecurityPolicyTest extends 
             }
         }
         
+        ((java.io.Closeable)pt).close();
         bus.shutdown(true);
     }
     
@@ -333,6 +339,7 @@ public class SecurityPolicyTest extends 
                                                       getClass().getResource("bob.properties"));
         //This should work as it should be properly signed.
         assertEquals(10, pt.doubleIt(5));
+        ((java.io.Closeable)pt).close();
         
         //Try sending a message with the "TimestampOnly" policy into affect to the 
         //service running the "signed only" policy.  This SHOULD fail as the
@@ -348,6 +355,7 @@ public class SecurityPolicyTest extends 
             assertTrue(ex.getMessage().contains("policy alternatives"));
         }
         
+        ((java.io.Closeable)pt).close();
         bus.shutdown(true);
     }
     
@@ -478,6 +486,7 @@ public class SecurityPolicyTest extends 
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, 
                                                       getClass().getResource("alice.properties"));
         assertEquals(10, pt.doubleIt(5));
+        
         ((java.io.Closeable)pt).close();
         bus.shutdown(true);
     }
@@ -509,6 +518,7 @@ public class SecurityPolicyTest extends 
         DoubleIt di = new DoubleIt();
         di.setNumberToDouble(5);
         assertEquals(10, pt.doubleIt(di, 1).getDoubledNumber());
+        
         ((java.io.Closeable)pt).close();
         bus.shutdown(true);
     }
@@ -551,6 +561,7 @@ public class SecurityPolicyTest extends 
                        || errorMessage.contains("Certificate revocation")
                        || errorMessage.contains("Error during certificate path validation"));
         }
+        
         ((java.io.Closeable)pt).close();
         bus.shutdown(true);
     }
@@ -570,8 +581,6 @@ public class SecurityPolicyTest extends 
         EndpointInfo ei = ep.getServer().getEndpoint().getEndpointInfo();
         setCryptoProperties(ei, "bob.properties", "revocation.properties");
         ei.setProperty(SecurityConstants.ENABLE_REVOCATION, Boolean.TRUE);
-
-        
         
         SpringBusFactory bf = new SpringBusFactory();
 
@@ -602,6 +611,7 @@ public class SecurityPolicyTest extends 
                        || errorMessage.contains("Certificate revocation")
                        || errorMessage.contains("Error during certificate path validation"));
         }
+        
         ((java.io.Closeable)pt).close();
         ep.stop();
         epBus.shutdown(true);

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/spnego/SpnegoTokenTest.java Tue Oct  9 10:16:06 2012
@@ -21,9 +21,6 @@ package org.apache.cxf.systest.ws.spnego
 
 import java.net.URL;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 
@@ -32,9 +29,7 @@ import org.apache.cxf.bus.spring.SpringB
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.spnego.server.Server;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-
 import org.example.contract.doubleit.DoubleItPortType;
-
 import org.junit.BeforeClass;
 
 /**
@@ -48,32 +43,37 @@ import org.junit.BeforeClass;
  *     -Djava.security.auth.login.config=src/test/resources/kerberos.jaas
  * 
  */
+@org.junit.Ignore
 public class SpnegoTokenTest extends AbstractBusClientServerTestBase {
     static final String PORT = allocatePort(Server.class);
 
     private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
     
-    private boolean unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
+    private static boolean unrestrictedPoliciesInstalled = 
+            SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
     
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue(
-            "Server failed to launch",
-            // run the server in the same process
-            // set this to false to fork
-            launchServer(Server.class, true)
-        );
+        if (unrestrictedPoliciesInstalled) {
+            assertTrue(
+                "Server failed to launch",
+                // run the server in the same process
+                // set this to false to fork
+                launchServer(Server.class, true)
+            );
+        }
     }
     
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
-        SecurityTestUtil.cleanup();
-        stopAllServers();
+        if (unrestrictedPoliciesInstalled) {
+            SecurityTestUtil.cleanup();
+            stopAllServers();
+        }
     }
 
     @org.junit.Test
-    @org.junit.Ignore
     public void testSpnegoOverSymmetric() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -97,11 +97,11 @@ public class SpnegoTokenTest extends Abs
         int result = spnegoPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)spnegoPort).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testSpnegoOverSymmetricDerived() throws Exception {
         
         if (!unrestrictedPoliciesInstalled) {
@@ -125,26 +125,8 @@ public class SpnegoTokenTest extends Abs
         int result = spnegoPort.doubleIt(25);
         assertTrue(result == 50);
         
+        ((java.io.Closeable)spnegoPort).close();
         bus.shutdown(true);
     }
     
-    
-    private boolean checkUnrestrictedPoliciesInstalled() {
-        try {
-            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-            SecretKey key192 = new SecretKeySpec(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
-                            "AES");
-            Cipher c = Cipher.getInstance("AES");
-            c.init(Cipher.ENCRYPT_MODE, key192);
-            c.doFinal(data);
-            return true;
-        } catch (Exception e) {
-            //
-        }
-        return false;
-    }
 }

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenDerivedTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenDerivedTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenDerivedTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenDerivedTest.java Tue Oct  9 10:16:06 2012
@@ -83,6 +83,7 @@ public class UsernameTokenDerivedTest ex
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -109,6 +110,7 @@ public class UsernameTokenDerivedTest ex
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -135,6 +137,7 @@ public class UsernameTokenDerivedTest ex
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -161,6 +164,7 @@ public class UsernameTokenDerivedTest ex
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -187,6 +191,7 @@ public class UsernameTokenDerivedTest ex
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -213,6 +218,7 @@ public class UsernameTokenDerivedTest ex
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -239,6 +245,7 @@ public class UsernameTokenDerivedTest ex
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/ut/UsernameTokenTest.java Tue Oct  9 10:16:06 2012
@@ -78,6 +78,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -100,6 +101,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -122,6 +124,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -144,6 +147,7 @@ public class UsernameTokenTest extends A
         
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -165,6 +169,7 @@ public class UsernameTokenTest extends A
         updateAddressPort(utPort, PORT);
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -186,6 +191,7 @@ public class UsernameTokenTest extends A
         updateAddressPort(utPort, PORT);
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -207,6 +213,7 @@ public class UsernameTokenTest extends A
         updateAddressPort(utPort, PORT);
         utPort.doubleIt(25);
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -235,6 +242,7 @@ public class UsernameTokenTest extends A
             assertTrue(ex.getMessage().contains(error));
         }
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     
@@ -271,6 +279,7 @@ public class UsernameTokenTest extends A
             assertTrue(ex.getMessage().contains(error));
         }
         
+        ((java.io.Closeable)utPort).close();
         bus.shutdown(true);
     }
     

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java Tue Oct  9 10:16:06 2012
@@ -32,11 +32,9 @@ import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.frontend.ClientProxy;
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.wssec10.server.Server;
-import org.apache.cxf.systest.ws.wssec11.WSSecurity11Common;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
-
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -55,7 +53,7 @@ public class WSSecurity10Test extends Ab
     private static boolean unrestrictedPoliciesInstalled;
     
     static {
-        unrestrictedPoliciesInstalled = WSSecurity11Common.checkUnrestrictedPoliciesInstalled();
+        unrestrictedPoliciesInstalled = SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
     };    
 
     @BeforeClass
@@ -119,6 +117,8 @@ public class WSSecurity10Test extends Ab
             http.setClient(httpClientPolicy);
             final String output = port.echo(INPUT);
             assertEquals(INPUT, output);
+            
+            cl.destroy();
         }
         
         bus.shutdown(true);

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10UsernameAuthorizationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10UsernameAuthorizationTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10UsernameAuthorizationTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10UsernameAuthorizationTest.java Tue Oct  9 10:16:06 2012
@@ -20,6 +20,7 @@
 package org.apache.cxf.systest.ws.wssec10;
 
 
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 
@@ -66,7 +67,7 @@ public class WSSecurity10UsernameAuthori
     }
 
     @Test
-    public void testClientServerUTOnlyAuthorized() {
+    public void testClientServerUTOnlyAuthorized() throws IOException {
 
         String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml";
         Bus bus = new SpringBusFactory().createBus(configName);
@@ -75,11 +76,12 @@ public class WSSecurity10UsernameAuthori
         final String output = port.echo(INPUT);
         assertEquals(INPUT, output);
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @Test
-    public void testClientServerUTOnlyUnauthorized() {
+    public void testClientServerUTOnlyUnauthorized() throws IOException {
 
         String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted_unauthorized.xml";
         Bus bus = new SpringBusFactory().createBus(configName);
@@ -92,11 +94,12 @@ public class WSSecurity10UsernameAuthori
             assertEquals("Unauthorized", ex.getMessage());
         }
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @Test
-    public void testClientServerComplexPolicyAuthorized() {
+    public void testClientServerComplexPolicyAuthorized() throws IOException {
 
         String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml";
         Bus bus = new SpringBusFactory().createBus(configName);
@@ -105,11 +108,12 @@ public class WSSecurity10UsernameAuthori
         final String output = port.echo(INPUT);
         assertEquals(INPUT, output);
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     
     @Test
-    public void testClientServerComplexPolicyUnauthorized() {
+    public void testClientServerComplexPolicyUnauthorized() throws IOException {
 
         String configName = "org/apache/cxf/systest/ws/wssec10/client/client_restricted_unauthorized.xml";
         Bus bus = new SpringBusFactory().createBus(configName);
@@ -122,6 +126,7 @@ public class WSSecurity10UsernameAuthori
             assertEquals("Unauthorized", ex.getMessage());
         }
         
+        ((java.io.Closeable)port).close();
         bus.shutdown(true);
     }
     

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java Tue Oct  9 10:16:06 2012
@@ -21,7 +21,7 @@ package org.apache.cxf.systest.ws.wssec1
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.systest.ws.wssec11.WSSecurity11Common;
+import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
@@ -32,7 +32,7 @@ public class Server extends AbstractBusT
     private static String configFileName;
     
     static {
-        unrestrictedPoliciesInstalled = WSSecurity11Common.checkUnrestrictedPoliciesInstalled();
+        unrestrictedPoliciesInstalled = SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
         if (unrestrictedPoliciesInstalled) {
             configFileName = "org/apache/cxf/systest/ws/wssec10/server/server.xml";
         } else {

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java Tue Oct  9 10:16:06 2012
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.systest.ws.wssec11;
 
+import java.io.IOException;
+
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.wssec11.server.Server11;
 import org.apache.cxf.systest.ws.wssec11.server.Server11Restricted;
@@ -34,7 +36,7 @@ public class WSSecurity111Test extends W
     private static boolean unrestrictedPoliciesInstalled;
     
     static {
-        unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
+        unrestrictedPoliciesInstalled = SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
     };
 
     @BeforeClass
@@ -68,7 +70,7 @@ public class WSSecurity111Test extends W
     }
 
     @Test
-    public void testClientServer() {
+    public void testClientServer() throws IOException {
         if ((!unrestrictedPoliciesInstalled)
                 && (WSSecurity11Common.isIBMJDK16())) {
             System.out.println("Not running as there is a problem with 1.6 jdk and restricted jars");

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java Tue Oct  9 10:16:06 2012
@@ -20,6 +20,8 @@
 package org.apache.cxf.systest.ws.wssec11;
 
 
+import java.io.IOException;
+
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.wssec11.server.Server12;
 import org.apache.cxf.systest.ws.wssec11.server.Server12Restricted;
@@ -35,7 +37,7 @@ public class WSSecurity112Test extends W
     private static boolean unrestrictedPoliciesInstalled;
     
     static {
-        unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
+        unrestrictedPoliciesInstalled = SecurityTestUtil.checkUnrestrictedPoliciesInstalled();
     };
       
     @BeforeClass
@@ -69,7 +71,7 @@ public class WSSecurity112Test extends W
     }
 
     @Test
-    public void testClientServer() {
+    public void testClientServer() throws IOException {
         if ((!unrestrictedPoliciesInstalled) 
                 && (WSSecurity11Common.isIBMJDK16())) {
             System.out.println("Not running as there is a problem with 1.6 jdk and restricted jars");

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java Tue Oct  9 10:16:06 2012
@@ -20,12 +20,10 @@
 package org.apache.cxf.systest.ws.wssec11;
 
 
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
@@ -35,7 +33,6 @@ import org.apache.cxf.systest.ws.wssec11
 import org.apache.cxf.systest.ws.wssec11.server.Server12;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 
-
 import wssec.wssec11.IPingService;
 import wssec.wssec11.PingService11;
 
@@ -49,7 +46,7 @@ public class WSSecurity11Common extends 
 
     public void runClientServer(
         String[] argv, boolean unrestrictedPoliciesInstalled, boolean wssecurity12
-    ) {
+    ) throws IOException {
         
         Bus bus = null;
         if (unrestrictedPoliciesInstalled) {
@@ -84,6 +81,8 @@ public class WSSecurity11Common extends 
             
             final String output = port.echo(INPUT);
             assertEquals(INPUT, output);
+            
+            ((java.io.Closeable)port).close();
         }
         
         bus.shutdown(true);
@@ -100,26 +99,6 @@ public class WSSecurity11Common extends 
     }
 
     
-    public static boolean checkUnrestrictedPoliciesInstalled() {
-        boolean unrestrictedPoliciesInstalled = false;
-        try {
-            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-            SecretKey key192 = new SecretKeySpec(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
-                            "AES");
-            Cipher c = Cipher.getInstance("AES");
-            c.init(Cipher.ENCRYPT_MODE, key192);
-            c.doFinal(data);
-            unrestrictedPoliciesInstalled = true;
-        } catch (Exception e) {
-            return unrestrictedPoliciesInstalled;
-        }
-        return unrestrictedPoliciesInstalled;
-    }
-    
     public static boolean isIBMJDK16() {
         String fullVersion = System.getProperty("java.fullversion");
         if (fullVersion == null) {

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java (original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java Tue Oct  9 10:16:06 2012
@@ -21,9 +21,6 @@ package org.apache.cxf.systest.ws.x509;
 
 import java.net.URL;
 
-import javax.crypto.Cipher;
-import javax.crypto.SecretKey;
-import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Service;
@@ -38,9 +35,7 @@ import org.apache.cxf.systest.ws.x509.se
 import org.apache.cxf.systest.ws.x509.server.Server;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.ws.security.SecurityConstants;
-
 import org.example.contract.doubleit.DoubleItPortType;
-
 import org.junit.BeforeClass;
 
 /**
@@ -54,21 +49,19 @@ public class X509TokenTest extends Abstr
     private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
     private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
 
-    private boolean unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
-    
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue(
-            "Server failed to launch",
-            // run the server in the same process
-            // set this to false to fork
-            launchServer(Server.class, true)
+                "Server failed to launch",
+                // run the server in the same process
+                // set this to false to fork
+                launchServer(Server.class, true)
         );
         assertTrue(
-            "Intermediary failed to launch",
-            // run the server in the same process
-            // set this to false to fork
-            launchServer(Intermediary.class, true)
+                "Intermediary failed to launch",
+                // run the server in the same process
+                // set this to false to fork
+                launchServer(Intermediary.class, true)
         );
     }
     
@@ -80,9 +73,6 @@ public class X509TokenTest extends Abstr
 
     @org.junit.Test
     public void testKeyIdentifier() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -99,14 +89,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testKeyIdentifierJaxwsClient() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/jaxws-client.xml");
@@ -128,14 +116,12 @@ public class X509TokenTest extends Abstr
         
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testIntermediary() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/intermediary-client.xml");
@@ -153,14 +139,12 @@ public class X509TokenTest extends Abstr
         
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testIssuerSerial() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -177,14 +161,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testThumbprint() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -201,14 +183,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testContentEncryptedElements() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -225,14 +205,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricIssuerSerial() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -249,14 +227,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricThumbprint() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -273,14 +249,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricProtectTokens() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -297,14 +271,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testSymmetricProtectTokens() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -321,14 +293,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportEndorsing() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -345,14 +315,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT2);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportEndorsingSP11() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -369,14 +337,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT2);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportSignedEndorsing() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -393,14 +359,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT2);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportEndorsingEncrypted() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -417,14 +381,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT2);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportSignedEndorsingEncrypted() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -441,14 +403,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT2);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricSignature() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -465,14 +425,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricSignatureSP11() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -489,14 +447,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricEncryption() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -513,14 +469,12 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testAsymmetricSignatureReplay() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -551,14 +505,12 @@ public class X509TokenTest extends Abstr
             assertTrue(ex.getMessage().contains(error));
         }
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportSupportingSigned() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -574,13 +526,13 @@ public class X509TokenTest extends Abstr
                 service.getPort(portQName, DoubleItPortType.class);
         updateAddressPort(x509Port, PORT2);
         x509Port.doubleIt(25);
+        
+        ((java.io.Closeable)x509Port).close();
+        bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportSupportingSignedCertConstraints() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -612,13 +564,13 @@ public class X509TokenTest extends Abstr
         ((BindingProvider)x509Port).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "alice");
     
         x509Port.doubleIt(25);
+        
+        ((java.io.Closeable)x509Port).close();
+        bus.shutdown(true);
     }
     
     @org.junit.Test
     public void testTransportKVT() throws Exception {
-        if (!unrestrictedPoliciesInstalled) {
-            return;
-        }
 
         SpringBusFactory bf = new SpringBusFactory();
         URL busFile = X509TokenTest.class.getResource("client/client.xml");
@@ -635,26 +587,8 @@ public class X509TokenTest extends Abstr
         updateAddressPort(x509Port, PORT2);
         x509Port.doubleIt(25);
         
+        ((java.io.Closeable)x509Port).close();
         bus.shutdown(true);
     }
     
-    private boolean checkUnrestrictedPoliciesInstalled() {
-        try {
-            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-
-            SecretKey key192 = new SecretKeySpec(
-                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
-                            "AES");
-            Cipher c = Cipher.getInstance("AES");
-            c.init(Cipher.ENCRYPT_MODE, key192);
-            c.doFinal(data);
-            return true;
-        } catch (Exception e) {
-            //
-        }
-        return false;
-    }
-    
 }

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/saml/DoubleItSaml.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/saml/DoubleItSaml.wsdl?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/saml/DoubleItSaml.wsdl (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/saml/DoubleItSaml.wsdl Tue Oct  9 10:16:06 2012
@@ -564,7 +564,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -614,7 +614,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -664,7 +664,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -727,7 +727,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -787,7 +787,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -837,7 +837,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -897,7 +897,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>

Modified: cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/x509/DoubleItX509.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/x509/DoubleItX509.wsdl?rev=1395941&r1=1395940&r2=1395941&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/x509/DoubleItX509.wsdl (original)
+++ cxf/trunk/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/x509/DoubleItX509.wsdl Tue Oct  9 10:16:06 2012
@@ -402,7 +402,7 @@
                     <sp:OnlySignEntireHeadersAndBody/>
                     <sp:AlgorithmSuite>
                        <wsp:Policy>
-                          <sp:Basic256/>
+                          <sp:Basic128/>
                        </wsp:Policy>
                     </sp:AlgorithmSuite>
                  </wsp:Policy>
@@ -436,7 +436,7 @@
                     <sp:OnlySignEntireHeadersAndBody/>
                     <sp:AlgorithmSuite>
                        <wsp:Policy>
-                          <sp:Basic256/>
+                          <sp:Basic128/>
                        </wsp:Policy>
                     </sp:AlgorithmSuite>
                  </wsp:Policy>
@@ -471,7 +471,7 @@
                     <sp:SignBeforeEncrypting/>
                     <sp:AlgorithmSuite>
                        <wsp:Policy>
-                          <sp:Basic256/>
+                          <sp:Basic128/>
                        </wsp:Policy>
                     </sp:AlgorithmSuite>
                  </wsp:Policy>
@@ -516,7 +516,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -561,7 +561,7 @@
                   <sp:OnlySignEntireHeadersAndBody/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -606,7 +606,7 @@
                   <sp:ProtectTokens/>
                   <sp:AlgorithmSuite>
                      <wsp:Policy>
-                        <sp:Basic256/>
+                        <sp:Basic128/>
                      </wsp:Policy>
                   </sp:AlgorithmSuite>
                </wsp:Policy>
@@ -641,7 +641,7 @@
                     <sp:SignBeforeEncrypting/>
                     <sp:AlgorithmSuite>
                        <wsp:Policy>
-                          <sp:Basic256/>
+                          <sp:Basic128/>
                        </wsp:Policy>
                     </sp:AlgorithmSuite>
                  </wsp:Policy>