[cxf] branch master updated: cxf-tools-java2ws: fix tests on Java9+

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[cxf] branch master updated: cxf-tools-java2ws: fix tests on Java9+

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

buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new c58d2cd  cxf-tools-java2ws: fix tests on Java9+
c58d2cd is described below

commit c58d2cd38003a90608aa04e40756c042cbaf7e03
Author: Alexey Markevich <[hidden email]>
AuthorDate: Mon Nov 16 16:18:10 2020 +0300

    cxf-tools-java2ws: fix tests on Java9+
---
 .../apache/cxf/tools/java2js/processor/JavaToJSProcessorTest.java | 8 +++++---
 .../apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java | 7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessorTest.java b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessorTest.java
index c753313..e525c9a 100755
--- a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessorTest.java
+++ b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2js/processor/JavaToJSProcessorTest.java
@@ -53,11 +53,13 @@ public class JavaToJSProcessorTest extends ProcessorTestBase {
     public void testDocLitUseClassPathFlag() throws Exception {
         File classFile = new java.io.File(output.getCanonicalPath() + "/classes");
         classFile.mkdir();
+
+        String oldCP = System.getProperty("java.class.path");
         if (JavaUtils.isJava9Compatible()) {
             System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
             String java9PlusFolder = output.getParent() + java.io.File.separator + "java9";
-            System.setProperty("java.class.path", System.getProperty("java.class.path")
-                               + java.io.File.pathSeparator + java9PlusFolder + java.io.File.separator + "*");
+            System.setProperty("java.class.path",
+                oldCP + java.io.File.pathSeparator + java9PlusFolder + java.io.File.separator + "*");
         }
 
 
@@ -73,7 +75,7 @@ public class JavaToJSProcessorTest extends ProcessorTestBase {
         w2jProcessor.setContext(env);
         w2jProcessor.execute();
 
-        System.setProperty("java.class.path", "");
+        System.setProperty("java.class.path", oldCP);
 
         //      test flag
         String[] args = new String[] {"-o",
diff --git a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
index 62308c2..2e54bb3 100644
--- a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
+++ b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
@@ -159,11 +159,12 @@ public class JavaToProcessorTest extends ProcessorTestBase {
         File classFile = new java.io.File(output.getCanonicalPath() + "/classes");
         classFile.mkdir();
 
+        String oldCP = System.getProperty("java.class.path");
         if (JavaUtils.isJava9Compatible()) {
             System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
             String java9PlusFolder = output.getParent() + java.io.File.separator + "java9";
-            System.setProperty("java.class.path", System.getProperty("java.class.path")
-                               + java.io.File.pathSeparator + java9PlusFolder + java.io.File.separator + "*");
+            System.setProperty("java.class.path",
+                oldCP + java.io.File.pathSeparator + java9PlusFolder + java.io.File.separator + "*");
         }
 
         env.put(ToolConstants.CFG_COMPILE, ToolConstants.CFG_COMPILE);
@@ -183,7 +184,7 @@ public class JavaToProcessorTest extends ProcessorTestBase {
         String serviceName = "cxfService";
         String portName = "cxfPort";
 
-        System.setProperty("java.class.path", "");
+        System.setProperty("java.class.path", oldCP);
 
         //      test flag
         String[] args = new String[] {"-o",