camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggrzy...@apache.org
Subject [2/2] camel git commit: [CAMEL-10602] Don't wait for BP container in blueprint camel:run - we don't have to synchronize there
Date Fri, 16 Dec 2016 12:59:20 GMT
[CAMEL-10602] Don't wait for BP container in blueprint camel:run - we don't have to synchronize
there

(cherry picked from commit ddcbd0f948d0f4b8c2a4a5b99f78f2880c4d21de)


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

Branch: refs/heads/camel-2.18.x
Commit: 74fd151016b0cc64e6eddd098bf355fc35743ce0
Parents: cdb9d39
Author: Grzegorz Grzybek <gr.grzybek@gmail.com>
Authored: Fri Dec 16 13:58:29 2016 +0100
Committer: Grzegorz Grzybek <gr.grzybek@gmail.com>
Committed: Fri Dec 16 13:58:51 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/test/blueprint/Main.java    |  2 --
 .../camel/test/blueprint/BlueprintPropertiesTest.java | 14 ++++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/74fd1510/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
index 3cd8c30..c1c8c2a 100644
--- a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
+++ b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/Main.java
@@ -108,8 +108,6 @@ public class Main extends MainSupport {
             }
             Set<Long> eventHistory = new HashSet<>();
 
-            CamelBlueprintHelper.waitForBlueprintContainer(eventHistory, bundleContext, bundleName,
BlueprintEvent.CREATED, null);
-
             camelContext = CamelBlueprintHelper.getOsgiService(bundleContext, CamelContext.class);
             if (camelContext == null) {
                 throw new IllegalArgumentException("Cannot find CamelContext in blueprint
XML file: " + descriptors);

http://git-wip-us.apache.org/repos/asf/camel/blob/74fd1510/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java
b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java
index 09ccc35..a702064 100644
--- a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java
+++ b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/BlueprintPropertiesTest.java
@@ -18,6 +18,7 @@ package org.apache.camel.test.blueprint;
 
 import org.junit.Test;
 import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
 import org.osgi.service.blueprint.container.BlueprintContainer;
 import org.osgi.service.blueprint.container.BlueprintEvent;
 
@@ -49,8 +50,17 @@ public class BlueprintPropertiesTest extends CamelBlueprintTestSupport
{
             // Expected timeout
         }
 
-        camelCore.start();
-        CamelBlueprintHelper.waitForBlueprintContainer(null, test.getBundleContext(), getClass().getSimpleName(),
BlueprintEvent.CREATED, null);
+        CamelBlueprintHelper.waitForBlueprintContainer(null, test.getBundleContext(), getClass().getSimpleName(),
BlueprintEvent.CREATED,
+                new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    camelCore.start();
+                } catch (BundleException e) {
+                    throw new RuntimeException(e.getMessage(), e);
+                }
+            }
+        });
         getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname="
+ getClass().getSimpleName() + ")", 500);
     }
 


Mime
View raw message