cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: Minor test change
Date Fri, 24 Oct 2014 11:11:28 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 312fcaf09 -> 623a827d6


Minor test change


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/623a827d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/623a827d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/623a827d

Branch: refs/heads/master
Commit: 623a827d65721c3fee9edc3a31b4e1b00bcf2451
Parents: 312fcaf
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Fri Oct 24 12:11:07 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Fri Oct 24 12:11:07 2014 +0100

----------------------------------------------------------------------
 .../cxf/systest/ws/common/SecurityTestUtil.java | 38 +++++++++++---------
 1 file changed, 22 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/623a827d/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java
b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java
index 25f61f0..d0b8bc0 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/common/SecurityTestUtil.java
@@ -33,6 +33,27 @@ import org.example.contract.doubleit.DoubleItPortType;
  */
 public final class SecurityTestUtil {
     
+    private static final boolean UNRESTRICTED_POLICIES_INSTALLED;
+    static {
+        boolean ok = 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);
+            ok = true;
+        } catch (Exception e) {
+            //
+        }
+        UNRESTRICTED_POLICIES_INSTALLED = ok;
+    }
+    
     private SecurityTestUtil() {
         // complete
     }
@@ -55,22 +76,7 @@ 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;
+        return UNRESTRICTED_POLICIES_INSTALLED;
     }
     
     public static void enableStreaming(DoubleItPortType port) {


Mime
View raw message