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 2011/03/03 12:06:56 UTC
svn commit: r1076584 - in /camel/trunk/tests/camel-itest-osgi/src/test:
java/org/apache/camel/itest/osgi/blueprint/
resources/org/apache/camel/itest/osgi/blueprint/
Author: davsclaus
Date: Thu Mar 3 11:06:55 2011
New Revision: 1076584
URL: http://svn.apache.org/viewvc?rev=1076584&view=rev
Log:
Fixed blueprint tests, they now all run on both felix and equionox.
Added:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java
- copied, changed from r1076533, camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
Modified:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintExplicitPropertiesRouteTest.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintPropertiesRouteTest.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-2.xml
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-3.xml
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintExplicitPropertiesRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintExplicitPropertiesRouteTest.java?rev=1076584&r1=1076583&r2=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintExplicitPropertiesRouteTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintExplicitPropertiesRouteTest.java Thu Mar 3 11:06:55 2011
@@ -48,7 +48,7 @@ public class BlueprintExplicitProperties
getInstalledBundle(name).start();
// must use the camel context from osgi
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")", 5000);
+ CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")", 10000);
ProducerTemplate myTemplate = ctx.createProducerTemplate();
myTemplate.start();
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintPropertiesRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintPropertiesRouteTest.java?rev=1076584&r1=1076583&r2=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintPropertiesRouteTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/BlueprintPropertiesRouteTest.java Thu Mar 3 11:06:55 2011
@@ -48,7 +48,7 @@ public class BlueprintPropertiesRouteTes
getInstalledBundle(name).start();
// must use the camel context from osgi
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")", 5000);
+ CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")", 10000);
ProducerTemplate myTemplate = ctx.createProducerTemplate();
myTemplate.start();
Copied: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java (from r1076533, camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java?p2=camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java&p1=camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java&r1=1076533&r2=1076584&rev=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprint2Test.java Thu Mar 3 11:06:55 2011
@@ -19,9 +19,7 @@ package org.apache.camel.itest.osgi.blue
import java.lang.reflect.Method;
import org.apache.camel.CamelContext;
-import org.apache.camel.Route;
import org.apache.camel.builder.DeadLetterChannelBuilder;
-import org.apache.camel.builder.ErrorHandlerBuilderRef;
import org.apache.camel.model.RouteDefinition;
import org.junit.Ignore;
import org.junit.Test;
@@ -33,11 +31,11 @@ import org.osgi.framework.Constants;
import org.osgi.service.blueprint.container.BlueprintContainer;
import static org.ops4j.pax.exam.CoreOptions.equinox;
+import static org.ops4j.pax.exam.CoreOptions.felix;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.profile;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
@@ -45,109 +43,7 @@ import static org.ops4j.pax.swissbox.tin
* @version
*/
@RunWith(JUnit4TestRunner.class)
-public class CamelBlueprintTest extends OSGiBlueprintTestSupport {
-
- @Test
- public void testRouteWithAllComponents() throws Exception {
- try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle1)", 1000);
- fail("The blueprint container should not be available");
- } catch (Exception e) {
- }
- getInstalledBundle("CamelBlueprintTestBundle1").start();
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle1)", 10000);
- getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle1)", 10000);
- }
-
- @Test
- public void testRouteWithMissingComponent() throws Exception {
- getInstalledBundle("org.apache.camel.camel-mail").stop();
- try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 1000);
- fail("The blueprint container should not be available");
- } catch (Exception e) {
- }
- getInstalledBundle("CamelBlueprintTestBundle2").start();
- try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 1000);
- fail("The blueprint container should not be available");
- } catch (Exception e) {
- }
- getInstalledBundle("org.apache.camel.camel-mail").start();
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 10000);
- getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle2)", 10000);
- }
-
- @Test
- public void testRouteWithMissingDataFormat() throws Exception {
- getInstalledBundle("org.apache.camel.camel-jaxb").stop();
- try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 1000);
- fail("The blueprint container should not be available");
- } catch (Exception e) {
- }
- getInstalledBundle("CamelBlueprintTestBundle3").start();
- try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 1000);
- fail("The blueprint container should not be available");
- } catch (Exception e) {
- }
- getInstalledBundle("org.apache.camel.camel-jaxb").start();
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 10000);
- getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle3)", 10000);
- }
-
- @Test
- public void testRouteWithPackage() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle4").start();
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle4)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle4)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- }
-
- @Test
- public void testRouteWithPackageScan() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle5").start();
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle5)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle5)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- }
-
- @Test
- public void testRouteWithComponentFromBlueprint() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle6").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle6)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle6)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- assertSame(ctn.getComponentInstance("seda"), ctx.getComponent("seda"));
- }
-
- @Test
- public void testRouteWithInterceptStrategy() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle7").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle7)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle7)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- assertEquals(1, ctx.getInterceptStrategies().size());
- assertEquals(TestInterceptStrategy.class.getName(), ctx.getInterceptStrategies().get(0).getClass().getName());
- }
-
- @Test
- public void testComponentProperties() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle8").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle8)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle8)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- assertEquals("direct://start", ctx.getRoutes().get(0).getEndpoint().getEndpointUri());
- }
-
- @Test
- public void testRouteBuilderRef() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle9").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle9)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle9)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- }
+public class CamelBlueprint2Test extends OSGiBlueprintTestSupport {
@Test
public void testEndpointInjection() throws Exception {
@@ -208,62 +104,6 @@ public class CamelBlueprintTest extends
Option[] options = options(
bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-1.xml"))
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle1")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-2.xml"))
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle2")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-3.xml"))
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle3")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-4.xml"))
- .add(TestRouteBuilder.class)
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle4")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-5.xml"))
- .add(TestRouteBuilder.class)
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle5")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-6.xml"))
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle6")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-7.xml"))
- .add(TestInterceptStrategy.class)
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle7")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-8.xml"))
- .add("org/apache/camel/component/properties/cheese.properties", OSGiBlueprintTestSupport.class.getResource("cheese.properties"))
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle8")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-9.xml"))
- .add(TestRouteBuilder.class)
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle9")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
.add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-10.xml"))
.add(TestProducer.class)
.set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle10")
@@ -316,7 +156,7 @@ public class CamelBlueprintTest extends
// vmOption("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5008"),
- //felix(),
+ felix(),
equinox());
return options;
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java?rev=1076584&r1=1076583&r2=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelBlueprintTest.java Thu Mar 3 11:06:55 2011
@@ -16,14 +16,7 @@
*/
package org.apache.camel.itest.osgi.blueprint;
-import java.lang.reflect.Method;
-
import org.apache.camel.CamelContext;
-import org.apache.camel.Route;
-import org.apache.camel.builder.DeadLetterChannelBuilder;
-import org.apache.camel.builder.ErrorHandlerBuilderRef;
-import org.apache.camel.model.RouteDefinition;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
@@ -33,11 +26,11 @@ import org.osgi.framework.Constants;
import org.osgi.service.blueprint.container.BlueprintContainer;
import static org.ops4j.pax.exam.CoreOptions.equinox;
+import static org.ops4j.pax.exam.CoreOptions.felix;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.profile;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
@@ -61,38 +54,38 @@ public class CamelBlueprintTest extends
@Test
public void testRouteWithMissingComponent() throws Exception {
- getInstalledBundle("org.apache.camel.camel-mail").stop();
+ getInstalledBundle("org.apache.camel.camel-ftp").stop();
try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 1000);
+ getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 500);
fail("The blueprint container should not be available");
} catch (Exception e) {
}
getInstalledBundle("CamelBlueprintTestBundle2").start();
try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 1000);
+ getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 500);
fail("The blueprint container should not be available");
} catch (Exception e) {
}
- getInstalledBundle("org.apache.camel.camel-mail").start();
+ getInstalledBundle("org.apache.camel.camel-ftp").start();
getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle2)", 10000);
getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle2)", 10000);
}
@Test
public void testRouteWithMissingDataFormat() throws Exception {
- getInstalledBundle("org.apache.camel.camel-jaxb").stop();
+ getInstalledBundle("org.apache.camel.camel-jackson").stop();
try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 1000);
+ getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 500);
fail("The blueprint container should not be available");
} catch (Exception e) {
}
getInstalledBundle("CamelBlueprintTestBundle3").start();
try {
- getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 1000);
+ getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 500);
fail("The blueprint container should not be available");
} catch (Exception e) {
}
- getInstalledBundle("org.apache.camel.camel-jaxb").start();
+ getInstalledBundle("org.apache.camel.camel-jackson").start();
getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle3)", 10000);
getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle3)", 10000);
}
@@ -149,59 +142,6 @@ public class CamelBlueprintTest extends
assertEquals(1, ctx.getRoutes().size());
}
- @Test
- public void testEndpointInjection() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle10").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle10)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle10)", 10000);
- Object producer = ctn.getComponentInstance("producer");
- assertNotNull(producer);
- assertEquals(TestProducer.class.getName(), producer.getClass().getName());
- Method mth = producer.getClass().getMethod("getTestEndpoint");
- assertNotNull(mth.invoke(producer));
- }
-
- @Test
- public void testRouteContext() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle11").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle11)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle11)", 10000);
- assertEquals(3, ctx.getRoutes().size());
- }
-
- @Test
- @Ignore("TODO: Does not work")
- public void testProxy() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle12").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle12)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle12)", 10000);
- Object proxy = ctn.getComponentInstance("myProxySender");
- assertNotNull(proxy);
- assertEquals(1, proxy.getClass().getInterfaces().length);
- assertEquals(TestProxySender.class.getName(), proxy.getClass().getInterfaces()[0].getName());
- }
-
- @Test
- public void testErrorHandler() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle14").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle14)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle14)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- RouteDefinition rd = ctx.getRouteDefinitions().get(0);
- assertNotNull(rd.getErrorHandlerRef());
- Object eh = ctx.getRegistry().lookup(rd.getErrorHandlerRef());
- assertEquals(DeadLetterChannelBuilder.class.getName(), eh.getClass().getName());
- }
-
- @Test
- public void testRouteWithNonStdComponentFromBlueprint() throws Exception {
- getInstalledBundle("CamelBlueprintTestBundle15").start();
- BlueprintContainer ctn = getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle15)", 10000);
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle15)", 10000);
- assertEquals(1, ctx.getRoutes().size());
- assertSame(ctn.getComponentInstance("mycomp"), ctx.getComponent("mycomp"));
- }
-
@Configuration
public static Option[] configure() throws Exception {
@@ -263,39 +203,6 @@ public class CamelBlueprintTest extends
.set(Constants.DYNAMICIMPORT_PACKAGE, "*")
.build()).noStart(),
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-10.xml"))
- .add(TestProducer.class)
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle10")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-11.xml"))
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle11")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-12.xml"))
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle12")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-14.xml"))
- .add(TestProxySender.class)
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle14")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
- bundle(newBundle()
- .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-15.xml"))
- .add(TestProxySender.class)
- .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle15")
- .set(Constants.DYNAMICIMPORT_PACKAGE, "*")
- .build()).noStart(),
-
// install the spring dm profile
profile("spring.dm").version("1.2.0"),
// this is how you set the default log level when using pax logging (logProfile)
@@ -310,13 +217,13 @@ public class CamelBlueprintTest extends
// using the features to install the camel components
scanFeatures(getCamelKarafFeatureUrl(),
- "camel-core", "camel-blueprint", "camel-test", "camel-mail", "camel-jaxb", "camel-jms"),
+ "camel-core", "camel-blueprint", "camel-test", "camel-ftp", "camel-jackson", "camel-jms"),
workingDirectory("target/paxrunner/"),
// vmOption("-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5008"),
- //felix(),
+ felix(),
equinox());
return options;
Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java?rev=1076584&r1=1076583&r2=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java Thu Mar 3 11:06:55 2011
@@ -56,7 +56,7 @@ public class OSGiBlueprintHelloWorldTest
getInstalledBundle(name).start();
// must use the camel context from osgi
- CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")", 5000);
+ CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + name + ")", 10000);
ProducerTemplate myTemplate = ctx.createProducerTemplate();
myTemplate.start();
Modified: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-2.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-2.xml?rev=1076584&r1=1076583&r2=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-2.xml (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-2.xml Thu Mar 3 11:06:55 2011
@@ -20,7 +20,7 @@
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="direct:start"/>
- <to uri="smtp://james@localhost"/>
+ <to uri="ftp://someserver.com?username=foo&password=secret"/>
</route>
</camelContext>
Modified: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-3.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-3.xml?rev=1076584&r1=1076583&r2=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-3.xml (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-3.xml Thu Mar 3 11:06:55 2011
@@ -21,7 +21,7 @@
<route>
<from uri="direct:start"/>
<marshal>
- <jaxb />
+ <json library="Jackson"/>
</marshal>
<to uri="mock:result"/>
</route>
Modified: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml?rev=1076584&r1=1076583&r2=1076584&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml (original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml Thu Mar 3 11:06:55 2011
@@ -17,11 +17,9 @@
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <bean id="properties" class="org.apache.camel.component.properties.PropertiesComponent">
- <property name="location" value="classpath:org/apache/camel/component/properties/cheese.properties"/>
- </bean>
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+ <propertyPlaceholder location="classpath:org/apache/camel/component/properties/cheese.properties"/>
- <camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="{{input}}"/>
<to uri="mock:result"/>