You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2021/06/19 15:45:19 UTC

[cxf] branch 3.4.x-fixes updated (dad173b -> c014484)

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

reta pushed a change to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from dad173b  Updated Jenkins pipeline build matrix to use JDK-16 instead of JDK-15
     new 5e7f410  cxf-tools-common: remove ProcessorTestBase.getClassPath
     new 5e2269a  cxf-tools-java2ws: fix tests on Java9+
     new c014484  Updated TCK Jenkins file with Ant 1.10.10

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tck/Jenkinsfile                                    |  2 +-
 .../apache/cxf/tools/common/ProcessorTestBase.java | 46 ----------------------
 .../java2js/processor/JavaToJSProcessorTest.java   | 26 +++---------
 .../generator/wsdl11/WrapperBeanGeneratorTest.java |  2 -
 .../java2wsdl/processor/JavaToProcessorTest.java   | 19 +++------
 5 files changed, 11 insertions(+), 84 deletions(-)

[cxf] 01/03: cxf-tools-common: remove ProcessorTestBase.getClassPath

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 5e7f4103b84fd0ddde45e8959294b35c96db8e8d
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Mon Nov 16 11:35:26 2020 +0300

    cxf-tools-common: remove ProcessorTestBase.getClassPath
---
 .../apache/cxf/tools/common/ProcessorTestBase.java | 46 ----------------------
 .../java2js/processor/JavaToJSProcessorTest.java   | 18 ---------
 .../generator/wsdl11/WrapperBeanGeneratorTest.java |  2 -
 .../java2wsdl/processor/JavaToProcessorTest.java   | 12 +-----
 4 files changed, 1 insertion(+), 77 deletions(-)

diff --git a/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java b/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
index a8e4a7e..653488b 100644
--- a/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
+++ b/tools/common/src/test/java/org/apache/cxf/tools/common/ProcessorTestBase.java
@@ -22,10 +22,7 @@ package org.apache.cxf.tools.common;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -36,8 +33,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
@@ -108,47 +103,6 @@ public class ProcessorTestBase {
         }
     }
 
-    protected String getClassPath() throws URISyntaxException, IOException {
-        ClassLoader loader = getClass().getClassLoader();
-        StringBuilder classPath = new StringBuilder();
-        if (loader instanceof URLClassLoader) {
-            for (URL url : ((URLClassLoader)loader).getURLs()) {
-                File file = new File(url.toURI());
-                String filename = file.getAbsolutePath();
-                if (filename.indexOf("junit") == -1) {
-                    classPath.append(filename);
-                    classPath.append(System.getProperty("path.separator"));
-                }
-                if (filename.indexOf("surefirebooter") != -1) {
-                    //surefire 2.4 uses a MANIFEST classpath that javac doesn't like
-                    try (JarFile jar = new JarFile(filename)) {
-                        Attributes attr = jar.getManifest().getMainAttributes();
-                        if (attr != null) {
-                            String cp = attr.getValue("Class-Path");
-                            while (cp != null) {
-                                String fileName = cp;
-                                int idx = fileName.indexOf(' ');
-                                if (idx != -1) {
-                                    fileName = fileName.substring(0, idx);
-                                    cp = cp.substring(idx + 1).trim();
-                                } else {
-                                    cp = null;
-                                }
-                                URI uri = new URI(fileName);
-                                File f2 = new File(uri);
-                                if (f2.exists()) {
-                                    classPath.append(f2.getAbsolutePath());
-                                    classPath.append(System.getProperty("path.separator"));
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return classPath.toString();
-    }
-
     protected String getLocation(String wsdlFile) throws URISyntaxException {
         return getClass().getResource(wsdlFile).toURI().toString();
     }
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 7dfeb89..c753313 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
@@ -24,36 +24,18 @@ import java.io.File;
 import org.apache.cxf.helpers.JavaUtils;
 import org.apache.cxf.tools.common.ProcessorTestBase;
 import org.apache.cxf.tools.common.ToolConstants;
-import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.java2js.JavaToJS;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
 import org.apache.cxf.tools.wsdlto.core.FrontEndProfile;
 import org.apache.cxf.tools.wsdlto.core.PluginLoader;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer;
 
-import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 
 import static org.junit.Assert.assertTrue;
 
 public class JavaToJSProcessorTest extends ProcessorTestBase {
     JavaToJSProcessor processor = new JavaToJSProcessor();
-    String classPath = "";
-
-    @Before
-    public void startUp() throws Exception {
-        env = new ToolContext();
-        classPath = System.getProperty("java.class.path");
-        System.setProperty("java.class.path", getClassPath());
-    }
-
-    @After
-    public void tearDown() {
-        super.tearDown();
-        System.setProperty("java.class.path", classPath);
-    }
-
 
     @Test
     public void testSimpleClass() throws Exception {
diff --git a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java
index 5c31d4e..32d9989 100644
--- a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java
+++ b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/WrapperBeanGeneratorTest.java
@@ -49,8 +49,6 @@ public class WrapperBeanGeneratorTest extends ProcessorTestBase {
     @Rule
     public ExternalResource envRule = new ExternalResource() {
         protected void before() throws Throwable {
-            System.setProperty("java.class.path", getClassPath() + tmpDir.getRoot().getCanonicalPath()
-                                                  + File.separatorChar);
             classLoader = new URLClassLoader(new URL[] {tmpDir.getRoot().toURI().toURL()},
                                              Thread.currentThread().getContextClassLoader());
         }
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 6d79af8..62308c2 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
@@ -64,7 +64,6 @@ import org.apache.cxf.tools.wsdlto.core.PluginLoader;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.JAXWSContainer;
 import org.apache.cxf.wsdl.WSDLConstants;
 
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -77,19 +76,10 @@ import static org.junit.Assert.fail;
 
 public class JavaToProcessorTest extends ProcessorTestBase {
     JavaToWSDLProcessor processor = new JavaToWSDLProcessor();
-    String classPath = "";
+
     @Before
     public void startUp() throws Exception {
-        env = new ToolContext();
         env.put(ToolConstants.CFG_WSDL, ToolConstants.CFG_WSDL);
-
-        classPath = System.getProperty("java.class.path");
-        System.setProperty("java.class.path", getClassPath());
-    }
-    @After
-    public void tearDown() {
-        super.tearDown();
-        System.setProperty("java.class.path", classPath);
     }
 
     @Test

[cxf] 03/03: Updated TCK Jenkins file with Ant 1.10.10

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit c014484a5bb740bae2e3bcee071c936f159869c5
Author: Andriy Redko <dr...@gmail.com>
AuthorDate: Sat Jun 19 10:53:01 2021 -0400

    Updated TCK Jenkins file with Ant 1.10.10
    
    (cherry picked from commit 0e3284bdbff75fe01986db685c874979118b4e7d)
---
 tck/Jenkinsfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tck/Jenkinsfile b/tck/Jenkinsfile
index c9bce5a..b66ed0e 100644
--- a/tck/Jenkinsfile
+++ b/tck/Jenkinsfile
@@ -4,7 +4,7 @@ pipeline {
    }
    
     tools { 
-        ant 'ant_1.10.6'
+        ant 'ant_1.10.10'
         maven 'maven_3.6.3' 
         jdk 'jdk_1.8.0_241' 
     }

[cxf] 02/03: cxf-tools-java2ws: fix tests on Java9+

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 5e2269afb8b5d59f36d1e0dfd67bae9e6548f4a2
Author: Alexey Markevich <bu...@gmail.com>
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",