Author: gnodet
Date: Tue Dec  7 16:34:54 2010
New Revision: 1043119

URL: http://svn.apache.org/viewvc?rev=1043119&view=rev
Log:
[CAMEL-3390] Add a test case to make sure RouteBuilder references work

Added:
    
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-9.xml
Modified:
    
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java

Modified: 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java?rev=1043119&r1=1043118&r2=1043119&view=diff
==============================================================================
--- 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java
 (original)
+++ 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java
 Tue Dec  7 16:34:54 2010
@@ -142,6 +142,14 @@ public class OSGiBlueprintTestSupport ex
         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)", 5000);
+        CamelContext ctx = getOsgiService(CamelContext.class, 
"(camel.context.symbolicname=CamelBlueprintTestBundle9)", 5000);
+        assertEquals(1, ctx.getRoutes().size());
+    }
+
     @Before
     public void setUp() throws Exception {
     }
@@ -202,6 +210,12 @@ public class OSGiBlueprintTestSupport ex
                         .set(Constants.BUNDLE_SYMBOLICNAME, 
"CamelBlueprintTestBundle8")
                         .build()).noStart(),
 
+                bundle(newBundle()
+                        .add("OSGI-INF/blueprint/test.xml", 
OSGiBlueprintTestSupport.class.getResource("blueprint-9.xml"))
+                        .add(TestRouteBuilder.class)
+                        .set(Constants.BUNDLE_SYMBOLICNAME, 
"CamelBlueprintTestBundle9")
+                        .build(withBnd())).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)

Added: 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-9.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-9.xml?rev=1043119&view=auto
==============================================================================
--- 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-9.xml
 (added)
+++ 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-9.xml
 Tue Dec  7 16:34:54 2010
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";>
+
+    <bean id="routeBuilder" 
class="org.apache.camel.itest.osgi.blueprint.TestRouteBuilder" />
+
+    <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
+        <routeBuilder ref="routeBuilder" />
+    </camelContext>
+
+</blueprint>


Reply via email to