camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1348328 - in /camel/trunk/components: camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/ camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/ camel-test-blueprint/src/test/resources/org/apache/camel/test...
Date Sat, 09 Jun 2012 07:38:51 GMT
Author: davsclaus
Date: Sat Jun  9 07:38:51 2012
New Revision: 1348328

URL: http://svn.apache.org/viewvc?rev=1348328&view=rev
Log:
Fixed camel-blueprint to inject custom namespaces when using routeContext

Added:
    camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java
      - copied, changed from r1348324, camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterWithNamespaceTest.java
    camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterRouteContextWithNamespaceTest.xml
      - copied, changed from r1348324, camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterWithNamespaceTest.xml
Modified:
    camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java

Modified: camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java?rev=1348328&r1=1348327&r2=1348328&view=diff
==============================================================================
--- camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
(original)
+++ camel/trunk/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/handler/CamelNamespaceHandler.java
Sat Jun  9 07:38:51 2012
@@ -298,6 +298,9 @@ public class CamelNamespaceHandler imple
         ctx.setFactoryComponent(factory2);
         ctx.setFactoryMethod("getRoutes");
 
+        // lets inject the namespaces into any namespace aware POJOs
+        injectNamespaces(element, binder);
+
         LOG.trace("Parsing RouteContext done, returning {}", element, ctx);
         return ctx;
     }

Copied: camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java
(from r1348324, camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterWithNamespaceTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java?p2=camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java&p1=camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterWithNamespaceTest.java&r1=1348324&r2=1348328&rev=1348328&view=diff
==============================================================================
--- camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterWithNamespaceTest.java
(original)
+++ camel/trunk/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/xpath/XPathFilterRouteContextWithNamespaceTest.java
Sat Jun  9 07:38:51 2012
@@ -16,35 +16,11 @@
  */
 package org.apache.camel.test.blueprint.xpath;
 
-import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
-import org.junit.Test;
-
-public class XPathFilterWithNamespaceTest extends CamelBlueprintTestSupport {
-
-    protected String matchingBody = "<person name='James' city='London' xmlns='http://example.com/person'/>";
-    protected String notMatchingBody = "<person name='Hiram' city='Tampa' xmlns='http://example.com/person'/>";
+public class XPathFilterRouteContextWithNamespaceTest extends XPathFilterWithNamespaceTest
{
 
     @Override
     protected String getBlueprintDescriptor() {
-        return "org/apache/camel/test/blueprint/xpath/xpathFilterWithNamespaceTest.xml";
-    }
-
-    @Test
-    public void testSendMatchingMessage() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived(matchingBody);
-
-        sendBody("direct:start", matchingBody);
-
-        assertMockEndpointsSatisfied();
-    }
-
-    @Test
-    public void testSendNotMatchingMessage() throws Exception {
-        getMockEndpoint("mock:result").expectedMessageCount(0);
-
-        sendBody("direct:start", notMatchingBody);
-
-        assertMockEndpointsSatisfied();
+        return "org/apache/camel/test/blueprint/xpath/xpathFilterRouteContextWithNamespaceTest.xml";
     }
 
 }

Copied: camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterRouteContextWithNamespaceTest.xml
(from r1348324, camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterWithNamespaceTest.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterRouteContextWithNamespaceTest.xml?p2=camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterRouteContextWithNamespaceTest.xml&p1=camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterWithNamespaceTest.xml&r1=1348324&r2=1348328&rev=1348328&view=diff
==============================================================================
--- camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterWithNamespaceTest.xml
(original)
+++ camel/trunk/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/xpath/xpathFilterRouteContextWithNamespaceTest.xml
Sat Jun  9 07:38:51 2012
@@ -22,6 +22,10 @@
              http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
 
   <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+    <routeContextRef ref="myRoutes"/>
+  </camelContext>
+
+  <routeContext id="myRoutes" xmlns="http://camel.apache.org/schema/blueprint">
     <route>
       <from uri="direct:start"/>
       <filter>
@@ -29,6 +33,6 @@
         <to uri="mock:result"/>
       </filter>
     </route>
-  </camelContext>
+  </routeContext>
 
 </blueprint>
\ No newline at end of file



Mime
View raw message