cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r897950 - in /cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11: WSSecurity111Test.java WSSecurity112Test.java WSSecurity11Common.java
Date Mon, 11 Jan 2010 17:10:12 GMT
Author: dkulp
Date: Mon Jan 11 17:10:11 2010
New Revision: 897950

URL: http://svn.apache.org/viewvc?rev=897950&view=rev
Log:
[CXF-2613] Fix tests with IBM 1.6 JDK and restricted jars
Patch from Eamonn Dwyer applied

Modified:
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java?rev=897950&r1=897949&r2=897950&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
Mon Jan 11 17:10:11 2010
@@ -46,6 +46,11 @@
                     launchServer(Server.class, true)
             );
         } else {
+            if (WSSecurity11Common.isIBMJDK16()) {
+                System.out.println("Not running as there is a problem with 1.6 jdk and restricted
jars");
+                return;
+            }
+
             assertTrue(
                     "Server failed to launch",
                     // run the server in the same process
@@ -57,6 +62,11 @@
 
     @Test
     public void testClientServer() {
+        if ((!unrestrictedPoliciesInstalled)
+                && (WSSecurity11Common.isIBMJDK16())) {
+            System.out.println("Not running as there is a problem with 1.6 jdk and restricted
jars");
+            return;
+        }
         String[] argv = new String[] {
             "A",
             "A-NoTimestamp",

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java?rev=897950&r1=897949&r2=897950&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
Mon Jan 11 17:10:11 2010
@@ -47,6 +47,11 @@
                     launchServer(Server.class, true)
             );
         } else {
+            if (WSSecurity11Common.isIBMJDK16()) {
+                System.out.println("Not running as there is a problem with 1.6 jdk and restricted
jars");
+                return;
+            }
+
             assertTrue(
                     "Server failed to launch",
                     // run the server in the same process
@@ -58,6 +63,12 @@
 
     @Test
     public void testClientServer() {
+        if ((!unrestrictedPoliciesInstalled) 
+                && (WSSecurity11Common.isIBMJDK16())) {
+            System.out.println("Not running as there is a problem with 1.6 jdk and restricted
jars");
+            return;
+        }
+
         String[] argv = null;
         if (unrestrictedPoliciesInstalled) {
             argv = new String[] {

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java?rev=897950&r1=897949&r2=897950&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
(original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
Mon Jan 11 17:10:11 2010
@@ -106,4 +106,28 @@
         return unrestrictedPoliciesInstalled;
     }
     
+    public static boolean isIBMJDK16() {
+        String fullVersion = System.getProperty("java.fullversion");
+        if (fullVersion == null) {
+            //Maybe one of the non IBM JDKs dont set this property, but
+            //the IBM one definitely does
+            return false;
+        }
+        if (fullVersion.indexOf("IBM") == -1) {
+            return false;
+        }
+
+        String javaVersion = System.getProperty("java.version");
+        double javaVersionNum = 0.0;
+        if (javaVersion.length() > 3) {
+            javaVersionNum = new Double(javaVersion.substring(0, 3)).doubleValue();
+        } else {
+            javaVersionNum = new Double(javaVersion).doubleValue();
+        }
+        if (javaVersionNum < 1.6) {
+            return false;
+        }
+        
+        return true;
+    }
 }



Mime
View raw message