cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject cxf git commit: Update and improve error reporting in felix tests
Date Mon, 08 May 2017 09:30:49 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 9cb53caf8 -> c91f436fa


Update and improve error reporting in felix tests


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

Branch: refs/heads/master
Commit: c91f436fab0356e8f1341890805f157c707d921d
Parents: 9cb53ca
Author: Christian Schneider <chris@die-schneider.net>
Authored: Mon May 8 11:30:43 2017 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Mon May 8 11:30:43 2017 +0200

----------------------------------------------------------------------
 osgi/itests-felix/pom.xml                           | 16 +---------------
 .../org/apache/cxf/osgi/itests/OSGiTestSupport.java | 11 +++++++++--
 2 files changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c91f436f/osgi/itests-felix/pom.xml
----------------------------------------------------------------------
diff --git a/osgi/itests-felix/pom.xml b/osgi/itests-felix/pom.xml
index 76dc850..cb36cd2 100644
--- a/osgi/itests-felix/pom.xml
+++ b/osgi/itests-felix/pom.xml
@@ -28,9 +28,6 @@
     <artifactId>org.apache.cxf.osgi.itests-felix</artifactId>
     <name>Apache CXF :: OSGi :: Integration Tests pure felix</name>
     <packaging>jar</packaging>
-    <properties>
-        <pax.url.version>1.2.8</pax.url.version>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -87,11 +84,6 @@
         </dependency>
         
         <dependency>
-            <groupId>org.apache.aries.blueprint</groupId>
-            <artifactId>org.apache.aries.blueprint.core</artifactId>
-        </dependency>
-    
-        <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam-container-native</artifactId>
             <version>${cxf.pax.exam.version}</version>
@@ -116,26 +108,20 @@
             <scope>test</scope>
         </dependency>
        
-        <!--Updated the felix and osgi version to support JDK8 -->  
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.framework</artifactId>
-            <version>4.4.0</version>
+            <version>5.6.2</version>
             <scope>test</scope>
         </dependency>
-
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
-            <version>4.3.0</version>
         </dependency>
-
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.compendium</artifactId>
-            <version>4.3.0</version>
         </dependency>
-        
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-atinject_1.0_spec</artifactId>

http://git-wip-us.apache.org/repos/asf/cxf/blob/c91f436f/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 9523faf..12ea5ea 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,6 +27,7 @@ import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
 
 /**
  *
@@ -38,8 +39,14 @@ public class OSGiTestSupport {
 
     protected void assertBundleStarted(String name) {
         Bundle bundle = findBundleByName(name);
-        Assert.assertNotNull("Bundle " + name + " should be installed", bundle);
-        Assert.assertEquals("Bundle " + name + " should be started", Bundle.ACTIVE, bundle.getState());
+        Assert.assertNotNull("Bundle " + name + " should be deployed", bundle);
+        if (bundle.getState() != Bundle.ACTIVE) {
+            try {
+                bundle.start();
+            } catch (BundleException e) {
+                throw new RuntimeException("Bundle " + name + " should be started but we
get this error", e);
+            }
+        }
     }
 
     protected Bundle findBundleByName(String symbolicName) {


Mime
View raw message