You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/10/04 11:12:01 UTC

[camel] branch main updated: (chores) Removed outdated Java 1.8 checks in tests

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new b638a9a569a (chores) Removed outdated Java 1.8 checks in tests
b638a9a569a is described below

commit b638a9a569a5b755aa334b6b483aab48531579de
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Oct 4 11:16:58 2022 +0200

    (chores) Removed outdated Java 1.8 checks in tests
---
 .../org/apache/camel/test/junit5/TestSupport.java   | 21 +--------------------
 .../component/xmlsecurity/ECDSASignatureTest.java   |  3 +--
 .../xmlsecurity/SignatureAlgorithmTest.java         |  3 +--
 .../xmlsecurity/SignatureDigestMethodTest.java      |  3 +--
 .../xmlsecurity/XAdESSignaturePropertiesTest.java   |  3 +--
 .../component/xmlsecurity/XmlSignatureTest.java     |  5 ++---
 6 files changed, 7 insertions(+), 31 deletions(-)

diff --git a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java
index 74b593d3508..0d40a249fb2 100644
--- a/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java
+++ b/components/camel-test/camel-test-junit5/src/main/java/org/apache/camel/test/junit5/TestSupport.java
@@ -558,25 +558,6 @@ public final class TestSupport {
 
     }
 
-    /**
-     * Tells whether the current Java version is 1.8 and build_no 261 and later.
-     *
-     * @return <tt>true</tt> if its Java 1.8.0_261 and later, <tt>false</tt> if its not (for example Java 1.8.0_251)
-     */
-    // CHECKSTYLE:OFF
-    public static boolean isJava18_261_later() {
-        boolean ret;
-        String version = System.getProperty("java.version");
-        try {
-            ret = version != null && version.startsWith("1.8.0_")
-                && Integer.parseInt(version.substring(6)) >= 261;
-        } catch (NumberFormatException ex) {
-            ret = false;
-        }
-        return ret;
-    }
-    // CHECKSTYLE:ON
-
     /**
      * Tells whether the current Java version is 1.9.
      *
@@ -591,7 +572,7 @@ public final class TestSupport {
      * Returns the current major Java version e.g 8.
      * <p/>
      * Uses <tt>java.specification.version</tt> from the system properties to determine the major version.
-     * 
+     *
      * @return the current major Java version.
      */
     public static int getJavaMajorVersion() {
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java
index b7ee197ed65..76c7dd73f90 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/ECDSASignatureTest.java
@@ -59,8 +59,7 @@ public class ECDSASignatureTest extends CamelTestSupport {
 
     static {
         boolean includeNewLine = true;
-        if (TestSupport.getJavaMajorVersion() >= 9
-                || TestSupport.isJava18_261_later() && !TestSupport.isJavaVendor("Azul")) {
+        if (!TestSupport.isJavaVendor("Azul")) {
             includeNewLine = false;
         }
         payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java
index b179186e68a..6d808e2effe 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureAlgorithmTest.java
@@ -89,8 +89,7 @@ public class SignatureAlgorithmTest extends CamelTestSupport {
 
     static {
         boolean includeNewLine = true;
-        if (TestSupport.getJavaMajorVersion() >= 9
-                || TestSupport.isJava18_261_later() && !TestSupport.isJavaVendor("Azul")) {
+        if (!TestSupport.isJavaVendor("Azul")) {
             includeNewLine = false;
         }
         payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java
index 8f07dbad0fa..b5ad6584e55 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/SignatureDigestMethodTest.java
@@ -88,8 +88,7 @@ public class SignatureDigestMethodTest extends CamelTestSupport {
 
     static {
         boolean includeNewLine = true;
-        if (TestSupport.getJavaMajorVersion() >= 9
-                || TestSupport.isJava18_261_later() && !TestSupport.isJavaVendor("Azul")) {
+        if (!TestSupport.isJavaVendor("Azul")) {
             includeNewLine = false;
         }
         payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
index f6abbd36910..49c5cbff8bc 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XAdESSignaturePropertiesTest.java
@@ -83,8 +83,7 @@ public class XAdESSignaturePropertiesTest extends CamelTestSupport {
 
     static {
         boolean includeNewLine = true;
-        if (TestSupport.getJavaMajorVersion() >= 9
-                || TestSupport.isJava18_261_later() && !TestSupport.isJavaVendor("Azul")) {
+        if (!TestSupport.isJavaVendor("Azul")) {
             includeNewLine = false;
         }
         payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
diff --git a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java
index b8c24826707..b057d302357 100644
--- a/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java
+++ b/components/camel-xmlsecurity/src/test/java/org/apache/camel/component/xmlsecurity/XmlSignatureTest.java
@@ -120,8 +120,7 @@ public class XmlSignatureTest extends CamelTestSupport {
     private KeyPair keyPair;
 
     static {
-        if (TestSupport.getJavaMajorVersion() >= 9
-                || TestSupport.isJava18_261_later() && !TestSupport.isJavaVendor("Azul")) {
+        if (!TestSupport.isJavaVendor("Azul")) {
             includeNewLine = false;
         }
         payload = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
@@ -925,7 +924,7 @@ public class XmlSignatureTest extends CamelTestSupport {
     /**
      * Checks that the processor sorts the xpath expressions in such a way that elements with deeper hierarchy level are
      * signed first.
-     * 
+     *
      */
     @Test
     public void testDetachedSignatureWrongXPathOrder() throws Exception {