Simplify test

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

Branch: refs/heads/3.0.x-fixes
Commit: 66502264aa200f761182f7e2465794b10a8cad3f
Parents: c2a4dd4
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Thu Nov 27 15:55:12 2014 +0100
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Mon Apr 13 11:14:55 2015 +0800

----------------------------------------------------------------------
 .../cxf/osgi/itests/NoAriesBlueprintTest.java   | 35 +++++++++++---------
 .../apache/cxf/osgi/itests/OSGiTestSupport.java |  5 +++
 2 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/66502264/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/NoAriesBlueprintTest.java
----------------------------------------------------------------------
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 58f5e22..1bf2ae5 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
@@ -18,9 +18,9 @@
  */
 package org.apache.cxf.osgi.itests;
 
+
 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.junit.PaxExam;
@@ -28,8 +28,9 @@ 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.systemProperty;
+import static org.ops4j.pax.exam.CoreOptions.when;
+
 
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
@@ -48,21 +49,25 @@ public class NoAriesBlueprintTest extends OSGiTestSupport {
 
     @Configuration
     public Option[] config() {
+        String localRepo = System.getProperty("localRepository");
+        if (localRepo == null) {
+            localRepo = "";
+        }
+
         return new Option[]{
                 systemProperty("java.awt.headless").value("true"),
-                systemProperty("org.ops4j.pax.url.mvn.localRepository")
-                    .value(System.getProperty("localRepository")),
-                
mavenBundle().groupId("org.apache.ws.xmlschema").artifactId("xmlschema-core").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-core").versionAsInProject(),
-                mavenBundle().groupId("org.apache.servicemix.bundles")
-                    
.artifactId("org.apache.servicemix.bundles.wsdl4j").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-rt-wsdl").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-rt-databinding-jaxb").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-rt-bindings-xml").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-rt-bindings-soap").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-rt-frontend-simple").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-rt-transports-http").versionAsInProject(),
-                
mavenBundle().groupId("org.apache.cxf").artifactId("cxf-rt-frontend-jaxws").versionAsInProject(),
+                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("org.apache.cxf", "cxf-rt-transports-http"),
+                mvnBundle("org.apache.cxf", "cxf-rt-frontend-jaxws"),
                 junitBundles()
         };
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/66502264/osgi/itests-felix/src/test/java/org/apache/cxf/osgi/itests/OSGiTestSupport.java
----------------------------------------------------------------------
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 933348a..5d842ff 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
@@ -23,6 +23,8 @@ package org.apache.cxf.osgi.itests;
 import javax.inject.Inject;
 
 import org.junit.Assert;
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 
@@ -49,4 +51,7 @@ public class OSGiTestSupport {
         return null;
     }
 
+    public MavenArtifactProvisionOption mvnBundle(String groupId, String 
artifactId) {
+        return 
CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
+    }
 }

Reply via email to