cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/4] git commit: Update the OSGi test support stuff to add some methods to make it easier to use the testutils
Date Thu, 04 Sep 2014 16:44:32 GMT
Update the OSGi test support stuff to add some methods to make it easier to use the testutils


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/491f98b1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/491f98b1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/491f98b1

Branch: refs/heads/master
Commit: 491f98b19f2c61b589a35b0fbf69d48198daef03
Parents: 86d5c83
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Sep 4 12:42:25 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu Sep 4 12:44:05 2014 -0400

----------------------------------------------------------------------
 .../cxf/osgi/itests/CXFOSGiTestSupport.java      | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/491f98b1/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
----------------------------------------------------------------------
diff --git a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
index 4249dff..e98ca8e 100644
--- a/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
+++ b/osgi/itests/src/test/java/org/apache/cxf/osgi/itests/CXFOSGiTestSupport.java
@@ -63,6 +63,7 @@ import org.osgi.util.tracker.ServiceTracker;
 
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 import static org.ops4j.pax.exam.CoreOptions.when;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
@@ -124,12 +125,13 @@ public class CXFOSGiTestSupport {
      * 
      * @return
      */
-    protected Option cxfBaseConfig() {
+    protected Option cxfBaseConfig(boolean testUtils) {
         karafUrl = maven().groupId("org.apache.karaf").artifactId("apache-karaf").version(getKarafVersion())
             .type("tar.gz");
         cxfUrl = maven().groupId("org.apache.cxf.karaf").artifactId("apache-cxf").versionAsInProject()
             .type("xml").classifier("features");
         String localRepo = System.getProperty("localRepository");
+        Object urp = System.getProperty("cxf.useRandomFirstPort");
         return composite(karafDistributionConfiguration()
                              .frameworkUrl(karafUrl)
                              .karafVersion(getKarafVersion())
@@ -138,12 +140,23 @@ public class CXFOSGiTestSupport {
                              .unpackDirectory(new File("target/paxexam/")),
                          features(cxfUrl, "cxf-core", "cxf-jaxws"),
                          systemProperty("java.awt.headless").value("true"),
+                         when(testUtils).useOptions(mavenBundle()
+                                                    .groupId("org.apache.cxf")
+                                                    .artifactId("cxf-testutils")
+                                                    .versionAsInProject()),
                          when(localRepo != null)
                              .useOptions(editConfigurationFilePut("etc/org.ops4j.pax.url.mvn.cfg",
                                                                   "org.ops4j.pax.url.mvn.localRepository",
-                                                                  localRepo)));
+                                                                  localRepo)),
+                         when(urp != null).useOptions(systemProperty("cxf.useRandomFirstPort").value("true")));
     }
-
+    protected Option cxfBaseConfig() {
+        return cxfBaseConfig(false);
+    }
+    protected Option cxfBaseConfigWithTestUtils() {
+        return cxfBaseConfig(true);
+    }
+    
     /**
      * Executes a shell command and returns output as a String. Commands have a default timeout
of 10 seconds.
      * 


Mime
View raw message