Author: gnodet
Date: Tue Dec  7 16:29:47 2010
New Revision: 1043115

URL: http://svn.apache.org/viewvc?rev=1043115&view=rev
Log:
Make sure properties substitution works with blueprint

Added:
    
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml
    
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/cheese.properties
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=1043115&r1=1043114&r2=1043115&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:29:47 2010
@@ -133,6 +133,15 @@ public class OSGiBlueprintTestSupport ex
         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)", 5000);
+        CamelContext ctx = getOsgiService(CamelContext.class, 
"(camel.context.symbolicname=CamelBlueprintTestBundle8)", 5000);
+        assertEquals(1, ctx.getRoutes().size());
+        assertEquals("direct://start", 
ctx.getRoutes().get(0).getEndpoint().getEndpointUri());
+    }
+
     @Before
     public void setUp() throws Exception {
     }
@@ -186,6 +195,13 @@ public class OSGiBlueprintTestSupport ex
                         .set(Constants.BUNDLE_SYMBOLICNAME, 
"CamelBlueprintTestBundle7")
                         .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.DYNAMICIMPORT_PACKAGE, "*")
+                        .set(Constants.BUNDLE_SYMBOLICNAME, 
"CamelBlueprintTestBundle8")
+                        .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)

Added: 
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=1043115&view=auto
==============================================================================
--- 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml
 (added)
+++ 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/blueprint-8.xml
 Tue Dec  7 16:29:47 2010
@@ -0,0 +1,31 @@
+<?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="properties" 
class="org.apache.camel.component.properties.PropertiesComponent">
+        <property name="location" 
value="classpath:org/apache/camel/component/properties/cheese.properties"/>
+    </bean>
+
+    <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
+        <route>
+            <from uri="{{input}}"/>
+            <to uri="mock:result"/>
+        </route>
+    </camelContext>
+
+</blueprint>

Added: 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/cheese.properties
URL: 
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/cheese.properties?rev=1043115&view=auto
==============================================================================
--- 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/cheese.properties
 (added)
+++ 
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/blueprint/cheese.properties
 Tue Dec  7 16:29:47 2010
@@ -0,0 +1,3 @@
+input=direct:start
+
+


Reply via email to