You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/03/12 10:31:37 UTC

[4/5] camel git commit: Change camel-itest-karaf to use camel-blueprint instead of camel-spring and make it work with karaf4 also.

Change camel-itest-karaf to use camel-blueprint instead of camel-spring and make it work with karaf4 also.


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

Branch: refs/heads/master
Commit: 8c2fa7321aa6e19c433c2b104daaff332ecc175e
Parents: a6d19be
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Mar 12 10:26:17 2016 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Mar 12 10:31:26 2016 +0100

----------------------------------------------------------------------
 tests/camel-itest-karaf/pom.xml                     |  7 ++++++-
 .../camel/itest/karaf/AbstractFeatureTest.java      | 16 +++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8c2fa732/tests/camel-itest-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/pom.xml b/tests/camel-itest-karaf/pom.xml
index 31b0051..0fbb7a1 100644
--- a/tests/camel-itest-karaf/pom.xml
+++ b/tests/camel-itest-karaf/pom.xml
@@ -97,13 +97,18 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-core</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
-      <artifactId>camel-spring</artifactId>
+      <artifactId>camel-blueprint</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/8c2fa732/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
index 3d60a13..60218ec 100644
--- a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
+++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/AbstractFeatureTest.java
@@ -26,9 +26,9 @@ import java.util.Properties;
 import javax.inject.Inject;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.blueprint.BlueprintCamelContext;
 import org.apache.camel.impl.DefaultRouteContext;
 import org.apache.camel.model.DataFormatDefinition;
-import org.apache.camel.osgi.CamelContextFactory;
 import org.junit.After;
 import org.junit.Before;
 import org.ops4j.pax.exam.Option;
@@ -38,6 +38,7 @@ import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
 import org.ops4j.pax.exam.options.UrlReference;
 import org.ops4j.pax.exam.rbc.Constants;
 import org.osgi.framework.BundleContext;
+import org.osgi.service.blueprint.container.BlueprintContainer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -54,6 +55,9 @@ public abstract class AbstractFeatureTest {
     @Inject
     protected BundleContext bundleContext;
 
+    @Inject
+    protected BlueprintContainer blueprintContainer;
+
     @Before
     public void setUp() throws Exception {
         LOG.info("Calling the setUp method ");
@@ -125,12 +129,10 @@ public abstract class AbstractFeatureTest {
     }
 
     protected CamelContext createCamelContext() throws Exception {
-        LOG.info("Creating the CamelContext ...");
+        LOG.info("Creating CamelContext using BundleContext: {} and BlueprintContainer: {}", bundleContext, blueprintContainer);
         setThreadContextClassLoader();
-        CamelContextFactory factory = new CamelContextFactory();
-        factory.setBundleContext(bundleContext);
-        LOG.info("Get the bundleContext is " + bundleContext);
-        return factory.createContext();
+        BlueprintCamelContext context = new BlueprintCamelContext(bundleContext, blueprintContainer);
+        return context;
     }
 
     protected void setThreadContextClassLoader() {
@@ -212,7 +214,7 @@ public abstract class AbstractFeatureTest {
 
         List<String> list = new ArrayList<String>();
         list.add("camel-core");
-        list.add("camel-spring");
+        list.add("camel-blueprint");
         list.add("camel-" + mainFeature);
         for (String extra : extraFeatures) {
             list.add("camel-" + extra);