Remove old cruft about karaf 2 and 3

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

Branch: refs/heads/master
Commit: 24b87c02943419aff1a60699eba041ce26f715d6
Parents: 59c4c8e
Author: Claus Ibsen <davscl...@apache.org>
Authored: Fri Sep 8 09:21:04 2017 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Fri Sep 8 09:29:07 2017 +0200

----------------------------------------------------------------------
 components/camel-test-karaf/pom.xml             | 11 +++--
 .../camel/test/karaf/CamelKarafTestSupport.java | 49 +++++++++++++-------
 parent/pom.xml                                  |  1 -
 tests/camel-itest-karaf/pom.xml                 | 10 ++--
 4 files changed, 42 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/24b87c02/components/camel-test-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-karaf/pom.xml 
b/components/camel-test-karaf/pom.xml
index 41d24bb..e2bba1b 100644
--- a/components/camel-test-karaf/pom.xml
+++ b/components/camel-test-karaf/pom.xml
@@ -68,7 +68,7 @@
     <dependency>
       <groupId>org.apache.karaf.features</groupId>
       <artifactId>org.apache.karaf.features.core</artifactId>
-      <version>${karaf-version}</version>
+      <version>${karaf4-version}</version>
       <scope>provided</scope>
     </dependency>
 
@@ -83,6 +83,11 @@
       <artifactId>org.apache.felix.configadmin</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.apache.felix.gogo.runtime</artifactId>
+      <version>1.0.6</version>
+    </dependency>
+    <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
     </dependency>
@@ -161,7 +166,7 @@
           <!-- not supported by older version of surefire -->
           <!--<rerunFailingTestsCount>0</rerunFailingTestsCount>-->
           <systemPropertyVariables>
-            <karafVersion>${karaf-version}</karafVersion>
+            <karafVersion>${karaf4-version}</karafVersion>
           </systemPropertyVariables>
         </configuration>
       </plugin>
@@ -208,7 +213,7 @@
               -->
               
<argLine>-Dorg.ops4j.pax.url.mvn.localRepository=${maven.repo.local}</argLine>
               <systemPropertyVariables>
-                <karafVersion>${karaf-version}</karafVersion>
+                <karafVersion>${karaf4-version}</karafVersion>
               </systemPropertyVariables>
             </configuration>
           </plugin>

http://git-wip-us.apache.org/repos/asf/camel/blob/24b87c02/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/CamelKarafTestSupport.java
----------------------------------------------------------------------
diff --git 
a/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/CamelKarafTestSupport.java
 
b/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/CamelKarafTestSupport.java
index 9068a60..897f60f 100644
--- 
a/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/CamelKarafTestSupport.java
+++ 
b/components/camel-test-karaf/src/main/java/org/apache/camel/test/karaf/CamelKarafTestSupport.java
@@ -42,6 +42,7 @@ import javax.management.remote.JMXServiceURL;
 import javax.security.auth.Subject;
 
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.felix.service.command.CommandProcessor;
 import org.apache.felix.service.command.CommandSession;
 import org.apache.karaf.features.Feature;
@@ -294,23 +295,31 @@ public class CamelKarafTestSupport extends 
CamelTestSupport {
     }
 
     public void assertFeatureInstalled(String featureName) {
-        Feature[] features = featuresService.listInstalledFeatures();
-        for (Feature feature : features) {
-            if (featureName.equals(feature.getName())) {
-                return;
+        try {
+            Feature[] features = featuresService.listInstalledFeatures();
+            for (Feature feature : features) {
+                if (featureName.equals(feature.getName())) {
+                    return;
+                }
             }
+            fail("Feature " + featureName + " should be installed but is not");
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
         }
-        fail("Feature " + featureName + " should be installed but is not");
     }
 
     public void assertFeatureInstalled(String featureName, String 
featureVersion) {
-        Feature[] features = featuresService.listInstalledFeatures();
-        for (Feature feature : features) {
-            if (featureName.equals(feature.getName()) && 
featureVersion.equals(feature.getVersion())) {
-                return;
+        try {
+            Feature[] features = featuresService.listInstalledFeatures();
+            for (Feature feature : features) {
+                if (featureName.equals(feature.getName()) && 
featureVersion.equals(feature.getVersion())) {
+                    return;
+                }
             }
+            fail("Feature " + featureName + "/" + featureVersion + " should be 
installed but is not");
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
         }
-        fail("Feature " + featureName + "/" + featureVersion + " should be 
installed but is not");
     }
     
     protected void installAndAssertFeature(String feature) throws Exception {
@@ -360,16 +369,20 @@ public class CamelKarafTestSupport extends 
CamelTestSupport {
      * So we need to make sure we uninstall all features that were newly 
installed.
      */
     protected void uninstallNewFeatures(Set<Feature> featuresBefore) {
-        Feature[] features = featuresService.listInstalledFeatures();
-        for (Feature curFeature : features) {
-            if (!featuresBefore.contains(curFeature)) {
-                try {
-                    System.out.println("Uninstalling " + curFeature.getName());
-                    featuresService.uninstallFeature(curFeature.getName(), 
curFeature.getVersion());
-                } catch (Exception e) {
-                    // ignore
+        try {
+            Feature[] features = featuresService.listInstalledFeatures();
+            for (Feature curFeature : features) {
+                if (!featuresBefore.contains(curFeature)) {
+                    try {
+                        System.out.println("Uninstalling " + 
curFeature.getName());
+                        featuresService.uninstallFeature(curFeature.getName(), 
curFeature.getVersion());
+                    } catch (Exception e) {
+                        // ignore
+                    }
                 }
             }
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/24b87c02/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index aa3283d..4766afe 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -429,7 +429,6 @@
     <kafka-version>0.11.0.0</kafka-version>
     <kafka-bundle-version>0.11.0.0_1</kafka-bundle-version>
     <karaf-version>2.4.4</karaf-version>
-    <karaf3-version>3.0.8</karaf3-version>
     <karaf4-version>4.1.2</karaf4-version>
     <kie-version>6.5.0.Final</kie-version>
     <krati-version>0.4.9</krati-version>

http://git-wip-us.apache.org/repos/asf/camel/blob/24b87c02/tests/camel-itest-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/pom.xml b/tests/camel-itest-karaf/pom.xml
index 976744e..8f77f3d 100644
--- a/tests/camel-itest-karaf/pom.xml
+++ b/tests/camel-itest-karaf/pom.xml
@@ -32,10 +32,6 @@
   <name>Camel :: Integration Tests :: Karaf</name>
   <description>Performs Karaf compliance integration tests</description>
 
-  <properties>
-    <karaf-test-version>${karaf4-version}</karaf-test-version>
-  </properties>
-
   <dependencies>
     <dependency>
       <groupId>org.apache.camel</groupId>
@@ -66,7 +62,7 @@
     <dependency>
       <groupId>org.apache.karaf</groupId>
       <artifactId>apache-karaf</artifactId>
-      <version>${karaf-test-version}</version>
+      <version>${karaf4-version}</version>
       <type>tar.gz</type>
       <scope>test</scope>
       <exclusions>
@@ -200,7 +196,7 @@
           <!-- not supported by older version of surefire -->
           <!--<rerunFailingTestsCount>0</rerunFailingTestsCount>-->
           <systemPropertyVariables>
-            <karafVersion>${karaf-version}</karafVersion>
+            <karafVersion>${karaf4-version}</karafVersion>
             
<camelKarafFeatureVersion>${project.version}</camelKarafFeatureVersion>
           </systemPropertyVariables>
         </configuration>
@@ -233,7 +229,7 @@
               -->
               
<argLine>-Dorg.ops4j.pax.url.mvn.localRepository=${maven.repo.local}</argLine>
               <systemPropertyVariables>
-                <karafVersion>${karaf-version}</karafVersion>
+                <karafVersion>${karaf4-version}</karafVersion>
                 
<camelKarafFeatureVersion>${project.version}</camelKarafFeatureVersion>
               </systemPropertyVariables>
             </configuration>

Reply via email to