You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2018/07/24 00:57:57 UTC
[cxf] branch 3.2.x-fixes updated: [CXF-7725]ensure all tests on
3.2.x branch can pass with java10
This is an automated email from the ASF dual-hosted git repository.
ffang pushed a commit to branch 3.2.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/3.2.x-fixes by this push:
new efed7cf [CXF-7725]ensure all tests on 3.2.x branch can pass with java10
efed7cf is described below
commit efed7cf569e9dcc874d3435219985e44ab70e0b0
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Tue Jul 24 08:57:37 2018 +0800
[CXF-7725]ensure all tests on 3.2.x branch can pass with java10
---
.../databinding/source/XMLStreamDataWriter.java | 3 +
.../main/java/org/apache/cxf/helpers/DOMUtils.java | 27 ++++-
integration/jca/pom.xml | 2 +-
.../cxf/osgi/itests/soap/JmsServiceTest.java | 1 +
.../karaf/features/src/main/resources/features.xml | 1 +
parent/pom.xml | 13 +--
.../binding/soap/saaj/SAAJOutInterceptorTest.java | 1 +
rt/bindings/xml/pom.xml | 2 +-
.../cxf/endpoint/dynamic/DynamicClientFactory.java | 3 +-
.../sts-features/src/main/resources/features.xml | 1 +
.../xkms-features/src/main/resources/features.xml | 1 +
.../cxf/xkms/itests/BasicIntegrationTest.java | 115 ++++++++++++++++-----
.../cxf/systest/aegis/AegisClientServerTest.java | 3 +-
.../systest/jaxrs/security/JAXRSHttpsBookTest.java | 4 -
.../org/apache/cxf/systest/jaxws/CXF5061Test.java | 3 +-
.../cxf/systest/jaxws/ClientServerMiscTest.java | 3 +-
.../cxf/systest/jaxws/JaxWsDynamicClientTest.java | 3 +-
.../https/ciphersuites/CipherSuitesTest.java | 11 +-
.../java2js/processor/JavaToJSProcessorTest.java | 3 +-
.../generator/wsdl11/FaultBeanGeneratorTest.java | 3 +-
.../generator/wsdl11/WrapperBeanGeneratorTest.java | 3 +-
.../java2wsdl/processor/JavaToProcessorTest.java | 3 +-
.../cxf/tools/wsdlto/AbstractCodeGenTest.java | 3 +-
23 files changed, 157 insertions(+), 55 deletions(-)
diff --git a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
index 45fdcac..04eb109 100644
--- a/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
+++ b/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
@@ -84,6 +84,9 @@ public class XMLStreamDataWriter implements DataWriter<XMLStreamWriter> {
}
} else if (obj instanceof Node) {
+ if (obj instanceof DocumentFragment) {
+ obj = org.apache.cxf.helpers.DOMUtils.getDomDocumentFragment((DocumentFragment)obj);
+ }
if (schema != null) {
Validator schemaValidator = schema.newValidator();
schemaValidator.setErrorHandler(
diff --git a/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java b/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java
index 56ecae9..0280a2e 100644
--- a/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java
+++ b/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java
@@ -21,6 +21,7 @@ package org.apache.cxf.helpers;
import java.io.IOException;
import java.io.StringReader;
+import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -42,6 +43,7 @@ import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Attr;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -739,13 +741,13 @@ public final class DOMUtils {
}
/**
- * Try to get the DOM Node from the SAAJ Node with JAVA9
+ * Try to get the DOM Node from the SAAJ Node with JAVA9 afterwards
* @param node The original node we need check
* @return The DOM node
*/
public static Node getDomElement(Node node) {
if (node != null && isJava9SAAJ()) {
- //java9 hack since EA 159
+ //java9plus hack
try {
Method method = node.getClass().getMethod("getDomElement");
node = (Node)method.invoke(node);
@@ -757,6 +759,27 @@ public final class DOMUtils {
}
return node;
}
+
+ /**
+ * Try to get the DOM DocumentFragment from the SAAJ DocumentFragment with JAVA9 afterwards
+ * @param DocumentFragment The original documentFragment we need check
+ * @return The DOM DocumentFragment
+ */
+ public static DocumentFragment getDomDocumentFragment(DocumentFragment fragment) {
+ if (fragment != null && isJava9SAAJ()) {
+ //java9 plus hack
+ try {
+ Field f = fragment.getClass().getDeclaredField("documentFragment");
+ f.setAccessible(true);
+ fragment = (DocumentFragment) f.get(fragment);
+ } catch (NoSuchFieldException e) {
+ //best effort to try, do nothing if NoSuchFieldException
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return fragment;
+ }
private static void findAllElementsByTagNameNS(Element el, String nameSpaceURI, String localName,
List<Element> elementList) {
diff --git a/integration/jca/pom.xml b/integration/jca/pom.xml
index 4ae1903..e7bf74d 100644
--- a/integration/jca/pom.xml
+++ b/integration/jca/pom.xml
@@ -124,7 +124,7 @@
<!-- needed for easymock-->
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
- <version>6.0_ALPHA</version>
+ <version>6.2</version>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
diff --git a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java
index ee2594e..d163546 100644
--- a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java
+++ b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/soap/JmsServiceTest.java
@@ -75,6 +75,7 @@ public class JmsServiceTest extends CXFOSGiTestSupport {
return new Option[] {
cxfBaseConfig(),
testUtils(),
+ features(karafUrl, "spring"),
features(cxfUrl, "cxf-core", "cxf-jaxws", "cxf-transports-jms"),
features(amqUrl, "aries-blueprint", "shell-compat", "activemq-broker-noweb"),
provision(serviceBundle())
diff --git a/osgi/karaf/features/src/main/resources/features.xml b/osgi/karaf/features/src/main/resources/features.xml
index 5614dad..0912076 100644
--- a/osgi/karaf/features/src/main/resources/features.xml
+++ b/osgi/karaf/features/src/main/resources/features.xml
@@ -24,6 +24,7 @@
<bundle start-level="9">mvn:org.apache.geronimo.specs/geronimo-osgi-registry/1.1</bundle>
<bundle start-level="10" dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/${cxf.servicemix.specs.version}</bundle>
<bundle start-level="10">mvn:javax.annotation/javax.annotation-api/${cxf.javax.annotation-api.version}</bundle>
+ <bundle start-level="10" dependency="true">mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3</bundle>
<bundle start-level="10" dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/${cxf.servicemix.specs.version}</bundle>
<bundle start-level="10" dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${cxf.servicemix.specs.version}</bundle>
<bundle start-level="10" dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/${cxf.servicemix.specs.version}</bundle>
diff --git a/parent/pom.xml b/parent/pom.xml
index 67d141d..314e728 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -48,7 +48,7 @@
<cxf.asm.groupId>org.ow2.asm</cxf.asm.groupId>
<cxf.asm.artifactId>asm</cxf.asm.artifactId>
<cxf.asm.version>5.2</cxf.asm.version>
- <cxf.osgi.asm.version>[3.0,6.1)</cxf.osgi.asm.version>
+ <cxf.osgi.asm.version>[3.0,6.3)</cxf.osgi.asm.version>
<!-- OSGi related properties -->
<cxf.fragment.host />
<cxf.bundle.activator />
@@ -195,7 +195,7 @@
<cxf.osgi.version>5.0.0</cxf.osgi.version>
<cxf.karaf.version>4.1.2</cxf.karaf.version>
<cxf.pax.logging.version>1.6.0</cxf.pax.logging.version>
- <cxf.pax.exam.version>4.10.0</cxf.pax.exam.version>
+ <cxf.pax.exam.version>4.12.0</cxf.pax.exam.version>
<cxf.felix.configadmin.version>1.2.4</cxf.felix.configadmin.version>
<cxf.servicemix.aspectj.version>1.8.7_2</cxf.servicemix.aspectj.version>
<cxf.servicemix.cglib.version>3.2.0_1</cxf.servicemix.cglib.version>
@@ -2874,10 +2874,11 @@
<profile>
<id>java9-plus</id>
<properties>
- <cxf.karaf.version>4.1.0</cxf.karaf.version>
- <cxf.pax.exam.version>4.11.0</cxf.pax.exam.version>
- <cxf.server.launcher.vmargs>-ea --patch-module java.xml.ws.annotation=${project.basedir}/target/java9/javax.annotation-api-${cxf.javax.annotation-api.version}.jar --patch-module java.transaction=${project.basedir}/target/java9 --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime.reflect=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.in [...]
- <cxf.surefire.fork.vmargs>-ea --patch-module java.xml.ws.annotation=${project.basedir}/target/java9/javax.annotation-api-${cxf.javax.annotation-api.version}.jar --patch-module java.transaction=${project.basedir}/target/java9 --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.run [...]
+ <cxf.asm.version>6.2</cxf.asm.version>
+ <cxf.karaf.version>4.2.1-SNAPSHOT</cxf.karaf.version>
+ <cxf.pax.exam.version>4.12.0</cxf.pax.exam.version>
+ <cxf.server.launcher.vmargs>-ea --patch-module java.xml.ws.annotation=${project.basedir}/target/java9/javax.annotation-api-${cxf.javax.annotation-api.version}.jar --patch-module java.transaction=${project.basedir}/target/java9 --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime.reflect=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.in [...]
+ <cxf.surefire.fork.vmargs>-ea --patch-module java.xml.ws.annotation=${project.basedir}/target/java9/javax.annotation-api-${cxf.javax.annotation-api.version}.jar --patch-module java.transaction=${project.basedir}/target/java9 --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.run [...]
</properties>
<activation>
<jdk>[9,)</jdk>
diff --git a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptorTest.java b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptorTest.java
index 3cceb15..d9aab86 100644
--- a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptorTest.java
+++ b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptorTest.java
@@ -66,6 +66,7 @@ public class SAAJOutInterceptorTest extends TestBase {
m.getSOAPPart().setContent(new StreamSource(ins));
Element el = DOMUtils.getFirstElement(m.getSOAPPart().getEnvelope().getHeader());
+ el = (Element)DOMUtils.getDomElement(el);
List<Header> h = soapMessage.getHeaders();
while (el != null) {
h.add(new SoapHeader(DOMUtils.getElementQName(el), el));
diff --git a/rt/bindings/xml/pom.xml b/rt/bindings/xml/pom.xml
index 47455cf..28c58db 100644
--- a/rt/bindings/xml/pom.xml
+++ b/rt/bindings/xml/pom.xml
@@ -137,7 +137,7 @@
<!-- needed for easymock-->
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
- <version>6.0_ALPHA</version>
+ <version>6.1</version>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java b/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
index 31aae70..e21d362 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
@@ -99,6 +99,7 @@ import org.apache.cxf.endpoint.EndpointImplFactory;
import org.apache.cxf.endpoint.SimpleEndpointImplFactory;
import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.helpers.FileUtils;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.jaxb.JAXBDataBinding;
import org.apache.cxf.resource.URIResolver;
import org.apache.cxf.service.Service;
@@ -627,7 +628,7 @@ public class DynamicClientFactory {
javaCompiler.setClassPath(classPath);
javaCompiler.setOutputDir(dest);
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
javaCompiler.setTarget("9");
} else {
javaCompiler.setTarget("1.8");
diff --git a/services/sts/systests/sts-features/src/main/resources/features.xml b/services/sts/systests/sts-features/src/main/resources/features.xml
index 4ad83b3..1ce63f5 100644
--- a/services/sts/systests/sts-features/src/main/resources/features.xml
+++ b/services/sts/systests/sts-features/src/main/resources/features.xml
@@ -20,6 +20,7 @@
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="cxf-sts-osgi">
<repository>mvn:org.apache.cxf.karaf/apache-cxf/${project.version}/xml/features</repository>
<feature name="cxf-sts-service" version="${project.version}">
+ <feature>aries-blueprint</feature>
<feature>cxf</feature>
<feature>cxf-sts</feature>
<bundle>mvn:${project.groupId}/cxf-services-sts-systests-osgi/${project.version}</bundle>
diff --git a/services/xkms/xkms-features/src/main/resources/features.xml b/services/xkms/xkms-features/src/main/resources/features.xml
index ea91739..971a849 100644
--- a/services/xkms/xkms-features/src/main/resources/features.xml
+++ b/services/xkms/xkms-features/src/main/resources/features.xml
@@ -20,6 +20,7 @@
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0">
<repository>mvn:org.apache.cxf.karaf/apache-cxf/${project.version}/xml/features</repository>
<feature name="cxf-xkms-client" version="${project.version}">
+ <feature>aries-blueprint</feature>
<feature>cxf-jaxws</feature>
<feature>cxf-http</feature>
<feature>cxf-ws-security</feature>
diff --git a/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java b/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java
index 2f27d6d..5d8e2ba 100644
--- a/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java
+++ b/services/xkms/xkms-itests/src/test/java/org/apache/cxf/xkms/itests/BasicIntegrationTest.java
@@ -33,10 +33,13 @@ import org.w3._2002._03.xkms_wsdl.XKMSPortType;
import org.junit.Assert;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
+import org.ops4j.pax.exam.options.extra.VMOption;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
+
import static org.ops4j.pax.exam.CoreOptions.maven;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.when;
@@ -62,7 +65,7 @@ public class BasicIntegrationTest {
System.setProperty("BasicIntegrationTest.PORT", port);
String xkmsEndpoint = "http://localhost:" + port + "/cxf/XKMS";
- String karafVersion = System.getProperty("karaf.version", "4.0.8");
+ String karafVersion = System.getProperty("karaf.version", "4.2.1-SNAPSHOT");
String localRepository = System.getProperty("localRepository");
MavenArtifactUrlReference karafUrl = maven() //
.groupId("org.apache.karaf") //
@@ -74,32 +77,90 @@ public class BasicIntegrationTest {
.artifactId("cxf-services-xkms-features") //
.versionAsInProject() //
.type("xml");
-
- return new Option[] {
- karafDistributionConfiguration().frameworkUrl(karafUrl).karafVersion(karafVersion)
- .unpackDirectory(new File("target/paxexam/unpack/")).useDeployFolder(false),
- systemProperty("java.awt.headless").value("true"),
- systemProperty("BasicIntegrationTest.PORT").value(port),
-
- copy("data/xkms/certificates/trusted_cas/root.cer"),
- copy("data/xkms/certificates/trusted_cas/wss40CA.cer"),
- copy("data/xkms/certificates/cas/alice.cer"),
- copy("data/xkms/certificates/dave.cer"),
- copy("data/xkms/certificates/http___localhost_8080_services_TestService.cer"),
- copy("etc/org.ops4j.pax.logging.cfg"),
- //editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg", "org.ops4j.pax.url.mvn.repositories", REPOS),
- editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", port),
- editConfigurationFilePut("etc/org.apache.cxf.xkms.client.cfg", "xkms.endpoint", xkmsEndpoint),
- when(localRepository != null)
- .useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
- "org.ops4j.pax.url.mvn.localRepository",
- localRepository)),
- features(xkmsFeatures, "cxf-xkms-service", "cxf-xkms-client", "cxf-xkms-ldap"),
- configureConsole().ignoreLocalConsole(),
-
- //org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder(),
- //CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005")
- };
+ if (JavaVersionUtil.getMajorVersion() >= 9) {
+ return new Option[] {
+ karafDistributionConfiguration().frameworkUrl(karafUrl)
+ .karafVersion(karafVersion)
+ .unpackDirectory(new File("target/paxexam/unpack/"))
+ .useDeployFolder(false),
+ systemProperty("java.awt.headless").value("true"),
+ systemProperty("BasicIntegrationTest.PORT").value(port),
+
+ copy("data/xkms/certificates/trusted_cas/root.cer"),
+ copy("data/xkms/certificates/trusted_cas/wss40CA.cer"),
+ copy("data/xkms/certificates/cas/alice.cer"),
+ copy("data/xkms/certificates/dave.cer"),
+ copy("data/xkms/certificates/http___localhost_8080_services_TestService.cer"),
+ copy("etc/org.ops4j.pax.logging.cfg"),
+ // editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
+ // "org.ops4j.pax.url.mvn.repositories", REPOS),
+ editConfigurationFilePut("etc/org.ops4j.pax.web.cfg",
+ "org.osgi.service.http.port", port),
+ editConfigurationFilePut("etc/org.apache.cxf.xkms.client.cfg",
+ "xkms.endpoint", xkmsEndpoint),
+ when(localRepository != null)
+ .useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
+ "org.ops4j.pax.url.mvn.localRepository",
+ localRepository)),
+ features(xkmsFeatures, "cxf-xkms-service", "cxf-xkms-client",
+ "cxf-xkms-ldap"),
+ editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "featuresBoot",
+ "(transaction, instance, package, log, ssh, framework, "
+ + "system, eventadmin, "
+ + "feature, shell, management, service, "
+ + "jaas, deployer, diagnostic, "
+ + "wrap, bundle, config, kar),"
+ + "cxf-xkms-service,cxf-xkms-client,"
+ + "cxf-xkms-ldap,exam,test-dependencies"),
+ configureConsole().ignoreLocalConsole(),
+ new VMOption("--add-opens"),
+ new VMOption("java.base/java.security=ALL-UNNAMED"),
+ new VMOption("--add-opens"), new VMOption("java.base/java.net=ALL-UNNAMED"),
+ new VMOption("--add-opens"), new VMOption("java.base/java.lang=ALL-UNNAMED"),
+ new VMOption("--add-opens"), new VMOption("java.base/java.util=ALL-UNNAMED"),
+ new VMOption("--add-opens"),
+ new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
+ new VMOption("--add-opens"),
+ new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
+ new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+ new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+ new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+ new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED")
+ };
+
+ } else {
+ return new Option[] {
+ karafDistributionConfiguration().frameworkUrl(karafUrl)
+ .karafVersion(karafVersion)
+ .unpackDirectory(new File("target/paxexam/unpack/"))
+ .useDeployFolder(false),
+ systemProperty("java.awt.headless").value("true"),
+ systemProperty("BasicIntegrationTest.PORT").value(port),
+
+ copy("data/xkms/certificates/trusted_cas/root.cer"),
+ copy("data/xkms/certificates/trusted_cas/wss40CA.cer"),
+ copy("data/xkms/certificates/cas/alice.cer"),
+ copy("data/xkms/certificates/dave.cer"),
+ copy("data/xkms/certificates/http___localhost_8080_services_TestService.cer"),
+ copy("etc/org.ops4j.pax.logging.cfg"),
+ // editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
+ // "org.ops4j.pax.url.mvn.repositories", REPOS),
+ editConfigurationFilePut("etc/org.ops4j.pax.web.cfg",
+ "org.osgi.service.http.port", port),
+ editConfigurationFilePut("etc/org.apache.cxf.xkms.client.cfg",
+ "xkms.endpoint", xkmsEndpoint),
+ when(localRepository != null)
+ .useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
+ "org.ops4j.pax.url.mvn.localRepository",
+ localRepository)),
+ features(xkmsFeatures, "cxf-xkms-service", "cxf-xkms-client",
+ "cxf-xkms-ldap"),
+ configureConsole().ignoreLocalConsole(),
+
+ // org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder(),
+ // CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005")
+ };
+ }
}
protected Option copy(String path) {
diff --git a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java b/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
index 3c87558..c179b9e 100644
--- a/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
+++ b/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisClientServerTest.java
@@ -39,6 +39,7 @@ import org.apache.cxf.endpoint.dynamic.DynamicClientFactory;
import org.apache.cxf.ext.logging.LoggingInInterceptor;
import org.apache.cxf.ext.logging.LoggingOutInterceptor;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.staxutils.StaxUtils;
import org.apache.cxf.systest.aegis.SportsService.Pair;
@@ -259,7 +260,7 @@ public class AegisClientServerTest extends AbstractBusClientServerTestBase {
@Test
public void testDynamicClient() throws Exception {
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
index fdfb11e..60ff8b8 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/JAXRSHttpsBookTest.java
@@ -112,10 +112,6 @@ public class JAXRSHttpsBookTest extends AbstractBusClientServerTestBase {
@Test
public void testCustomVerbProxyFromSpringWildcard() throws Exception {
- if (System.getProperty("java.version").startsWith("9")) {
- //CXF-7270
- return;
- }
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(new String[] {CLIENT_CONFIG_FILE3});
Object bean = ctx.getBean("bookService.proxyFactory");
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java
index 5f2bb16..ac3368b 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/CXF5061Test.java
@@ -22,6 +22,7 @@ package org.apache.cxf.systest.jaxws;
import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
@@ -62,7 +63,7 @@ public class CXF5061Test extends AbstractBusClientServerTestBase {
@Test
public void testCxf5061() throws Exception {
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
//using dcf to generate client from the wsdl which ensure the wsdl is valid
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
index 4ec4b0e..2d7a22a 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
@@ -62,6 +62,7 @@ import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.frontend.ClientProxyFactoryBean;
import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.helpers.XPathUtils;
import org.apache.cxf.jaxb_element_test.JaxbElementTest;
import org.apache.cxf.jaxb_element_test.JaxbElementTest_Service;
@@ -891,7 +892,7 @@ public class ClientServerMiscTest extends AbstractBusClientServerTestBase {
@Test
public void testDynamicClientExceptions() throws Exception {
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
JaxWsDynamicClientFactory dcf =
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
index 9dfae2f..6d2b746 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/JaxWsDynamicClientTest.java
@@ -30,6 +30,7 @@ import org.apache.cxf.endpoint.ClientCallback;
import org.apache.cxf.ext.logging.LoggingInInterceptor;
import org.apache.cxf.ext.logging.LoggingOutInterceptor;
import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.no_body_parts.types.Operation1;
import org.apache.cxf.no_body_parts.types.Operation1Response;
@@ -64,7 +65,7 @@ public class JaxWsDynamicClientTest extends AbstractBusClientServerTestBase {
@Before
public void setUp() throws Exception {
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
}
diff --git a/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java b/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java
index b6f5b43..d55f5f6 100644
--- a/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java
+++ b/systests/transports/src/test/java/org/apache/cxf/systest/https/ciphersuites/CipherSuitesTest.java
@@ -37,6 +37,7 @@ import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.configuration.jsse.TLSClientParameters;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.cxf.transport.http.HTTPConduit;
import org.apache.hello_world.Greeter;
@@ -240,8 +241,9 @@ public class CipherSuitesTest extends AbstractBusClientServerTestBase {
@org.junit.Test
public void testRC4Included() throws Exception {
String version = System.getProperty("java.version");
- if (version.length() > 1 && 1.8D <= Double.parseDouble(version.substring(0, 3))
- || version.length() == 1 && 9 <= Integer.parseInt(version.substring(0, 1))) {
+ if (JavaUtils.isJava9Compatible()
+ || version.length() > 1 && 1.8D <= Double.parseDouble(version.substring(0, 3))
+ ) {
// RC4 not supported since JDK8
return;
}
@@ -270,8 +272,9 @@ public class CipherSuitesTest extends AbstractBusClientServerTestBase {
@org.junit.Test
public void testRC4IncludedAsync() throws Exception {
String version = System.getProperty("java.version");
- if (version.length() > 1 && 1.8D <= Double.parseDouble(version.substring(0, 3))
- || version.length() == 1 && 9 <= Integer.parseInt(version.substring(0, 1))) {
+ if (JavaUtils.isJava9Compatible()
+ || version.length() > 1 && 1.8D <= Double.parseDouble(version.substring(0, 3))
+ ) {
// RC4 not supported since JDK8
return;
}
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 15b519e..c599df2 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
@@ -21,6 +21,7 @@ package org.apache.cxf.tools.java2js.processor;
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;
@@ -43,7 +44,7 @@ public class JavaToJSProcessorTest extends ProcessorTestBase {
env = new ToolContext();
classPath = System.getProperty("java.class.path");
System.setProperty("java.class.path", getClassPath());
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
}
diff --git a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java
index 1cdebcc..a932d16 100644
--- a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java
+++ b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/FaultBeanGeneratorTest.java
@@ -25,6 +25,7 @@ import java.net.URI;
import java.util.HashSet;
import java.util.Set;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.tools.common.ProcessorTestBase;
import org.apache.cxf.tools.common.ToolConstants;
@@ -42,7 +43,7 @@ public class FaultBeanGeneratorTest extends ProcessorTestBase {
public void setUp() throws Exception {
classPath = System.getProperty("java.class.path");
System.setProperty("java.class.path", getClassPath());
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
processor.setEnvironment(env);
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 1385787..12028e1 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
@@ -27,6 +27,7 @@ import java.nio.file.Files;
import javax.xml.bind.annotation.XmlList;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.tools.common.ProcessorTestBase;
import org.apache.cxf.tools.common.ToolConstants;
@@ -57,7 +58,7 @@ public class WrapperBeanGeneratorTest extends ProcessorTestBase {
@Before
public void setUp() throws Exception {
processor.setEnvironment(env);
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
}
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 9609478..cf3c19c 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
@@ -42,6 +42,7 @@ import org.w3c.dom.Node;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.helpers.JavaUtils;
import org.apache.cxf.helpers.XPathUtils;
import org.apache.cxf.jaxb.JAXBEncoderDecoder;
import org.apache.cxf.service.model.FaultInfo;
@@ -75,7 +76,7 @@ public class JavaToProcessorTest extends ProcessorTestBase {
classPath = System.getProperty("java.class.path");
System.setProperty("java.class.path", getClassPath());
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
diff --git a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/AbstractCodeGenTest.java b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/AbstractCodeGenTest.java
index 315cbf3..d2d72e6 100644
--- a/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/AbstractCodeGenTest.java
+++ b/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/AbstractCodeGenTest.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
+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.wsdlto.core.DataBindingProfile;
@@ -63,7 +64,7 @@ public abstract class AbstractCodeGenTest extends ProcessorTestBase {
@Before
public void setUp() throws Exception {
processor = new JAXWSContainer(null);
- if (System.getProperty("java.version").startsWith("9")) {
+ if (JavaUtils.isJava9Compatible()) {
System.setProperty("org.apache.cxf.common.util.Compiler-fork", "true");
}
}