Author: ningjiang
Date: Wed Dec 10 18:45:29 2008
New Revision: 725548
URL: http://svn.apache.org/viewvc?rev=725548&view=rev
Log:
CAMEL-1179 added an example to show how to reference route builder instance in
camel context
Modified:
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/EndpointUriSetFromSpringTest.java
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
Modified:
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java?rev=725548&r1=725547&r2=725548&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
(original)
+++
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
Wed Dec 10 18:45:29 2008
@@ -25,6 +25,10 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
import org.apache.camel.ExchangePattern;
import org.apache.camel.builder.xml.Namespaces;
import org.apache.camel.model.dataformat.ArtixDSDataFormat;
@@ -53,11 +57,6 @@
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
/**
* Camel namespace for the spring XML configuration file.
*/
Modified:
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java?rev=725548&r1=725547&r2=725548&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java
(original)
+++
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java
Wed Dec 10 18:45:29 2008
@@ -58,8 +58,8 @@
CamelContext context = (CamelContext)
applicationContext.getBean("camel3");
assertValidContext(context);
- }
-
+ }
+
public void testXMLRouteLoading() throws Exception {
ApplicationContext applicationContext = new
ClassPathXmlApplicationContext("org/apache/camel/spring/camelContextFactoryBean.xml");
@@ -81,6 +81,15 @@
assertEndpointUri(key, "seda:test.c");
}
}
+
+ public void testRouteBuilderRef() throws Exception {
+ ApplicationContext applicationContext = new
ClassPathXmlApplicationContext("org/apache/camel/spring/camelContextRouteBuilderRef.xml");
+
+ CamelContext context = (CamelContext)
applicationContext.getBean("camel5");
+ assertNotNull("No context found!", context);
+
+ assertValidContext(context);
+ }
public void testShouldStartContext() throws Exception {
ApplicationContext applicationContext = new
ClassPathXmlApplicationContext("org/apache/camel/spring/camelContextFactoryBean.xml");
Modified:
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/EndpointUriSetFromSpringTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/EndpointUriSetFromSpringTest.java?rev=725548&r1=725547&r2=725548&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/EndpointUriSetFromSpringTest.java
(original)
+++
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/EndpointUriSetFromSpringTest.java
Wed Dec 10 18:45:29 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -17,13 +16,13 @@
*/
package org.apache.camel.spring.config;
-import
org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
-import org.springframework.test.context.ContextConfiguration;
+import javax.annotation.Resource;
+
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import javax.annotation.Resource;
+import org.springframework.test.context.ContextConfiguration;
+import
org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
/**
* @version $Revision: 1.1 $
Modified:
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml?rev=725548&r1=725547&r2=725548&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
(original)
+++
activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/camelContextFactoryBean.xml
Wed Dec 10 18:45:29 2008
@@ -47,6 +47,7 @@
<camelContext id="camel4"
xmlns="http://activemq.apache.org/camel/schema/spring"
shouldStartContext="false">
<package>org.apache.camel.spring.example</package>
</camelContext>
- <!-- END SNIPPET: example3 -->
+ <!-- END SNIPPET: example4 -->
+
</beans>