cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [2/2] cxf git commit: [CXF-6085] Adding basic JwsJsonProducer tests
Date Thu, 12 Feb 2015 16:02:46 GMT
[CXF-6085] Adding basic JwsJsonProducer tests


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

Branch: refs/heads/3.0.x-fixes
Commit: d995f24b2bb47cea8d218f4aabb240ecba82dba4
Parents: e94a1b6
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Feb 12 16:02:14 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Feb 12 16:02:14 2015 +0000

----------------------------------------------------------------------
 .../cxf/rs/security/jose/jwe/JweJsonProducerTest.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d995f24b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
index 9fb7b3f..43c5062 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonProducerTest.java
@@ -82,6 +82,13 @@ public class JweJsonProducerTest extends Assert {
         + "[\"gender\",{},\"text\",\"M\"]"
         + "]]";
     
+    private static final Boolean SKIP_AES_GCM_TESTS = isJava6();
+    
+    private static boolean isJava6() {
+        String version = System.getProperty("java.version");
+        return 1.6D == Double.parseDouble(version.substring(0, 3));    
+    }
+
     @BeforeClass
     public static void registerBouncyCastleIfNeeded() throws Exception {
         try {
@@ -107,6 +114,9 @@ public class JweJsonProducerTest extends Assert {
     }
     
     private void doTestSingleRecipientFlat(String expectedOutput, boolean canBeFlat) throws
Exception {
+        if (SKIP_AES_GCM_TESTS) {
+            return;
+        }
         final String text = "The true sign of intelligence is not knowledge but imagination.";
         SecretKey wrapperKey = CryptoUtils.createSecretKeySpec(SECRET_BYTES, "AES");
         JweHeaders headers = new JweHeaders(JoseConstants.A128KW_ALGO,
@@ -125,6 +135,9 @@ public class JweJsonProducerTest extends Assert {
     }
     @Test
     public void testSingleRecipientAllTypeOfHeadersAndAad() {
+        if (SKIP_AES_GCM_TESTS) {
+            return;
+        }
         final String text = "The true sign of intelligence is not knowledge but imagination.";
         SecretKey wrapperKey = CryptoUtils.createSecretKeySpec(SECRET_BYTES, "AES");
         


Mime
View raw message