Author: jstrachan
Date: Sat May 12 08:51:01 2007
New Revision: 537470
URL: http://svn.apache.org/viewvc?view=rev&rev=537470
Log:
test that the JMS component can be configured in XML while still using the jms:
name
Added:
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringAndJmsNameTest.xml
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringWithAutoWireTest.xml
Modified:
activemq/camel/trunk/camel-jms/pom.xml
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java
Modified: activemq/camel/trunk/camel-jms/pom.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/pom.xml?view=diff&rev=537470&r1=537469&r2=537470
==============================================================================
--- activemq/camel/trunk/camel-jms/pom.xml (original)
+++ activemq/camel/trunk/camel-jms/pom.xml Sat May 12 08:51:01 2007
@@ -75,4 +75,21 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <childDelegation>false</childDelegation>
+ <useFile>true</useFile>
+ <excludes>
+ <!-- TODO - FIXME ASAP -->
+ <exclude>**/JmsRouteUsingSpringWithAutoWireTest.*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
</project>
Modified:
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java?view=diff&rev=537470&r1=537469&r2=537470
==============================================================================
---
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
(original)
+++
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
Sat May 12 08:51:01 2007
@@ -31,8 +31,8 @@
*/
public class JmsRouteTest extends ContextTestSupport {
protected MockEndpoint resultEndpoint;
- protected String startEndpointUri = "activemq:queue:test.a";
-;
+ protected String componentName = "activemq";
+ protected String startEndpointUri;
public void testJmsRouteWithTextMessage() throws Exception {
String expectedBody = "Hello there!";
@@ -63,6 +63,8 @@
@Override
protected void setUp() throws Exception {
+ startEndpointUri = componentName + ":queue:test.a";
+
super.setUp();
resultEndpoint = (MockEndpoint) context.getEndpoint("mock:result");
@@ -72,7 +74,7 @@
CamelContext camelContext = super.createCamelContext();
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
- camelContext.addComponent("activemq",
jmsComponentClientAcknowledge(connectionFactory));
+ camelContext.addComponent(componentName,
jmsComponentClientAcknowledge(connectionFactory));
return camelContext;
}
@@ -80,14 +82,14 @@
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
- from(startEndpointUri).to("activemq:queue:test.b");
- from("activemq:queue:test.b").to("mock:result");
+ from(startEndpointUri).to(componentName + ":queue:test.b");
+ from(componentName + ":queue:test.b").to("mock:result");
- JmsEndpoint endpoint1 = (JmsEndpoint)
endpoint("activemq:topic:quote.IONA");
+ JmsEndpoint endpoint1 = (JmsEndpoint) endpoint(componentName +
":topic:quote.IONA");
endpoint1.getConfiguration().setTransacted(true);
from(endpoint1).to("mock:transactedClient");
- JmsEndpoint endpoint2 = (JmsEndpoint)
endpoint("activemq:topic:quote.IONA");
+ JmsEndpoint endpoint2 = (JmsEndpoint) endpoint(componentName +
":topic:quote.IONA");
endpoint1.getConfiguration().setTransacted(true);
from(endpoint2).to("mock:nonTrasnactedClient");
}
Added:
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java?view=auto&rev=537470
==============================================================================
---
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java
(added)
+++
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java
Sat May 12 08:51:01 2007
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+package org.apache.camel.component.jms;
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision: $
+ */
+public class JmsRouteUsingSpringAndJmsNameTest extends JmsRouteUsingSpringTest
{
+
+ protected ClassPathXmlApplicationContext createApplicationContext() {
+ return new
ClassPathXmlApplicationContext("org/apache/camel/component/jms/jmsRouteUsingSpringAndJmsNameTest.xml");
+ }
+
+
+ @Override
+ protected void setUp() throws Exception {
+ componentName = "jms";
+ super.setUp();
+ }
+}
Modified:
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java?view=diff&rev=537470&r1=537469&r2=537470
==============================================================================
---
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java
(original)
+++
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java
Sat May 12 08:51:01 2007
@@ -17,7 +17,6 @@
package org.apache.camel.component.jms;
import org.apache.camel.CamelContext;
-import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.spring.SpringCamelContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -28,10 +27,13 @@
private ClassPathXmlApplicationContext applicationContext;
protected CamelContext createCamelContext() throws Exception {
- applicationContext = new
ClassPathXmlApplicationContext("org/apache/camel/component/jms/jmsRouteUsingSpringTest.xml");
+ applicationContext = createApplicationContext();
return SpringCamelContext.springCamelContext(applicationContext);
}
+ protected ClassPathXmlApplicationContext createApplicationContext() {
+ return new
ClassPathXmlApplicationContext("org/apache/camel/component/jms/jmsRouteUsingSpringTest.xml");
+ }
@Override
protected void tearDown() throws Exception {
Added:
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java?view=auto&rev=537470
==============================================================================
---
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java
(added)
+++
activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java
Sat May 12 08:51:01 2007
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+package org.apache.camel.component.jms;
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision: $
+ */
+public class JmsRouteUsingSpringWithAutoWireTest extends
JmsRouteUsingSpringAndJmsNameTest {
+
+ protected ClassPathXmlApplicationContext createApplicationContext() {
+ return new
ClassPathXmlApplicationContext("org/apache/camel/component/jms/jmsRouteUsingSpringWithAutoWireTest.xml");
+ }
+
+}
Added:
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringAndJmsNameTest.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringAndJmsNameTest.xml?view=auto&rev=537470
==============================================================================
---
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringAndJmsNameTest.xml
(added)
+++
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringAndJmsNameTest.xml
Sat May 12 08:51:01 2007
@@ -0,0 +1,38 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://activemq.apache.org/camel/schema/camel-1.0.xsd
http://activemq.apache.org/camel/schema/camel-1.0.xsd
+ ">
+
+ <!-- START SNIPPET: example -->
+ <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/camel-1.0.xsd">
+ </camelContext>
+
+ <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
+ <property name="connectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL"
value="vm://localhost?broker.persistent=false"/>
+ </bean>
+ </property>
+ </bean>
+ <!-- END SNIPPET: example -->
+
+</beans>
Added:
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringWithAutoWireTest.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringWithAutoWireTest.xml?view=auto&rev=537470
==============================================================================
---
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringWithAutoWireTest.xml
(added)
+++
activemq/camel/trunk/camel-jms/src/test/resources/org/apache/camel/component/jms/jmsRouteUsingSpringWithAutoWireTest.xml
Sat May 12 08:51:01 2007
@@ -0,0 +1,34 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://activemq.apache.org/camel/schema/camel-1.0.xsd
http://activemq.apache.org/camel/schema/camel-1.0.xsd
+ ">
+
+ <!-- START SNIPPET: example -->
+ <camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/camel-1.0.xsd">
+ </camelContext>
+
+ <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
+ </bean>
+ <!-- END SNIPPET: example -->
+
+</beans>