You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2020/03/06 13:39:29 UTC

[cxf] 03/03: back itests-felix

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

commit 1bd346333d234ca3601274550d5438c41f4c38f4
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Wed Jan 29 16:14:28 2020 +0300

    back itests-felix
---
 osgi/itests-felix/pom.xml                          | 15 ++++--
 .../cxf/osgi/itests/NoAriesBlueprintTest.java      | 53 +++++++++++++++-------
 .../apache/cxf/osgi/itests/OSGiTestSupport.java    |  9 +---
 osgi/pom.xml                                       |  2 +-
 4 files changed, 51 insertions(+), 28 deletions(-)

diff --git a/osgi/itests-felix/pom.xml b/osgi/itests-felix/pom.xml
index 9b06534..c20c09c 100644
--- a/osgi/itests-felix/pom.xml
+++ b/osgi/itests-felix/pom.xml
@@ -27,7 +27,11 @@
     <groupId>org.apache.cxf.osgi.itests</groupId>
     <artifactId>org.apache.cxf.osgi.itests-felix</artifactId>
     <name>Apache CXF :: OSGi :: Integration Tests pure felix</name>
-    <packaging>jar</packaging>
+
+    <properties>
+        <cxf.module.name>org.apache.cxf.osgi.itests_felix</cxf.module.name>
+    </properties>
+
     <dependencies>
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -111,10 +115,15 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
-            <version>5.6.2</version>
+            <version>6.0.3</version>
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.configadmin</artifactId>
+            <version>1.9.16</version>
+        </dependency>
+        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
         </dependency>
@@ -138,8 +147,8 @@
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
-
     </dependencies>
+
     <build>
         <plugins>
             <!-- generate dependencies versions -->
diff --git a/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java b/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
index 57ba7fc..10ff3d2 100644
--- a/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
+++ b/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
@@ -19,15 +19,20 @@
 package org.apache.cxf.osgi.itests;
 
 
+import org.apache.cxf.helpers.JavaUtils;
+
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.OptionUtils;
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
+import static org.ops4j.pax.exam.CoreOptions.systemPackages;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import static org.ops4j.pax.exam.CoreOptions.when;
 
@@ -54,22 +59,38 @@ public class NoAriesBlueprintTest extends OSGiTestSupport {
             localRepo = "";
         }
 
-        return new Option[]{
-                systemProperty("java.awt.headless").value("true"),
-                when(!"".equals(localRepo))
-                    .useOptions(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)),
-                mvnBundle("org.apache.ws.xmlschema", "xmlschema-core"),
-                mvnBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.wsdl4j"),
-                mvnBundle("org.apache.cxf", "cxf-core"),
-                mvnBundle("org.apache.cxf", "cxf-rt-wsdl"),
-                mvnBundle("org.apache.cxf", "cxf-rt-databinding-jaxb"),
-                mvnBundle("org.apache.cxf", "cxf-rt-bindings-xml"),
-                mvnBundle("org.apache.cxf", "cxf-rt-bindings-soap"),
-                mvnBundle("org.apache.cxf", "cxf-rt-frontend-simple"),
-                mvnBundle("javax.servlet", "javax.servlet-api"),
-                mvnBundle("org.apache.cxf", "cxf-rt-transports-http"),
-                mvnBundle("org.apache.cxf", "cxf-rt-frontend-jaxws"),
-                junitBundles()
+        final Option[] basicOptions = new Option[] {
+            systemProperty("java.awt.headless").value("true"),
+            when(!"".equals(localRepo))
+                .useOptions(systemProperty("org.ops4j.pax.url.mvn.localRepository").value(localRepo)),
+            mavenBundle("org.apache.ws.xmlschema", "xmlschema-core").versionAsInProject(),
+            mavenBundle("org.apache.servicemix.bundles", "org.apache.servicemix.bundles.wsdl4j").versionAsInProject(),
+            mavenBundle("org.apache.felix", "org.apache.felix.configadmin").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-core").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-rt-wsdl").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-rt-databinding-jaxb").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-rt-bindings-xml").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-rt-bindings-soap").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-rt-frontend-simple").versionAsInProject(),
+            mavenBundle("javax.servlet", "javax.servlet-api").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-rt-transports-http").versionAsInProject(),
+            mavenBundle("org.apache.cxf", "cxf-rt-frontend-jaxws").versionAsInProject(),
+            junitBundles(),
+            systemPackages(
+                "javax.annotation;version=\"1.3\"",
+                "javax.xml.soap;version=\"1.5\""
+            )
         };
+        if (JavaUtils.isJava9Compatible()) {
+            return OptionUtils.combine(basicOptions,
+                mavenBundle("jakarta.annotation", "jakarta.annotation-api").versionAsInProject(),
+                mavenBundle("com.sun.activation", "jakarta.activation").versionAsInProject(),
+                mavenBundle("jakarta.xml.ws", "jakarta.xml.ws-api").versionAsInProject(),
+                mavenBundle("jakarta.xml.bind", "jakarta.xml.bind-api").versionAsInProject(),
+                mavenBundle("jakarta.xml.soap", "jakarta.xml.soap-api").versionAsInProject(),
+                mavenBundle("jakarta.jws", "jakarta.jws-api").versionAsInProject()
+            );
+        }
+        return basicOptions;
     }
 }
diff --git a/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java b/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
index f3fec4f..eb78d8d 100644
--- a/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
+++ b/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
@@ -27,11 +27,7 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.BundleException;
 
 import org.junit.Assert;
-import org.ops4j.pax.exam.CoreOptions;
-import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
-/**
- *
- */
+
 public class OSGiTestSupport {
 
     @Inject
@@ -58,7 +54,4 @@ public class OSGiTestSupport {
         return null;
     }
 
-    public MavenArtifactProvisionOption mvnBundle(String groupId, String artifactId) {
-        return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
-    }
 }
diff --git a/osgi/pom.xml b/osgi/pom.xml
index ccf6d56..d78a49d 100644
--- a/osgi/pom.xml
+++ b/osgi/pom.xml
@@ -32,7 +32,7 @@
     <modules>
         <module>bundle</module>
         <module>itests</module>
-        <!--module>itests-felix</module-->
+        <module>itests-felix</module>
         <module>karaf</module>
         <module>repository</module>
     </modules>