You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gn...@apache.org on 2008/06/16 18:11:40 UTC
svn commit: r668217 - in /activemq/trunk: ./ activemq-all/ activemq-camel/
activemq-camel/src/ activemq-camel/src/main/ activemq-camel/src/main/java/
activemq-camel/src/main/java/org/ activemq-camel/src/main/java/org/apache/
activemq-camel/src/main/jav...
Author: gnodet
Date: Mon Jun 16 09:11:38 2008
New Revision: 668217
URL: http://svn.apache.org/viewvc?rev=668217&view=rev
Log:
AMQ-1801: Extract camel component in its own module
Added:
activemq/trunk/activemq-camel/
activemq/trunk/activemq-camel/pom.xml (with props)
activemq/trunk/activemq-camel/src/
activemq/trunk/activemq-camel/src/main/
activemq/trunk/activemq-camel/src/main/java/
activemq/trunk/activemq-camel/src/main/java/org/
activemq/trunk/activemq-camel/src/main/java/org/apache/
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/
- copied from r668163, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelConnection.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelConnection.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelConnectionFactory.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelConnectionFactory.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelDestination.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelDestination.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelMessageConsumer.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageConsumer.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelMessageProducer.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelMessageProducer.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelQueue.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueue.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelQueueReceiver.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueueReceiver.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelQueueSender.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelQueueSender.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelTopic.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopic.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelTopicPublisher.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicPublisher.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/CamelTopicSubscriber.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/CamelTopicSubscriber.java
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/component/
- copied from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/component/
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/converter/
- copied from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/converter/
activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/package.html
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/package.html
activemq/trunk/activemq-camel/src/main/resources/
activemq/trunk/activemq-camel/src/main/resources/META-INF/
activemq/trunk/activemq-camel/src/main/resources/META-INF/services/
activemq/trunk/activemq-camel/src/main/resources/META-INF/services/org/
activemq/trunk/activemq-camel/src/main/resources/META-INF/services/org/apache/
activemq/trunk/activemq-camel/src/main/resources/META-INF/services/org/apache/camel/
- copied from r668163, activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/camel/
activemq/trunk/activemq-camel/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
- copied unchanged from r668196, activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/camel/TypeConverter
activemq/trunk/activemq-camel/src/main/resources/META-INF/services/org/apache/camel/component/
- copied from r668196, activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/camel/component/
activemq/trunk/activemq-camel/src/test/
activemq/trunk/activemq-camel/src/test/data/
- copied from r668163, activemq/trunk/activemq-core/src/test/data/
activemq/trunk/activemq-camel/src/test/data/message1.xml
- copied unchanged from r668196, activemq/trunk/activemq-core/src/test/data/message1.xml
activemq/trunk/activemq-camel/src/test/java/
activemq/trunk/activemq-camel/src/test/java/org/
activemq/trunk/activemq-camel/src/test/java/org/apache/
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/
- copied from r668163, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/CamelEmbeddedBrokerTestSupport.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/CamelEmbeddedBrokerTestSupport.java
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/CamelJmsTest.java
- copied, changed from r668196, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/SetGroupIdProcessor.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/SetGroupIdProcessor.java
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/SetHeaderTest.java
- copied unchanged from r668196, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/SetHeaderTest.java
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/
- copied from r668196, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/component/
activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/converter/
- copied from r668196, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/converter/
activemq/trunk/activemq-camel/src/test/resources/
activemq/trunk/activemq-camel/src/test/resources/org/
activemq/trunk/activemq-camel/src/test/resources/org/apache/
activemq/trunk/activemq-camel/src/test/resources/org/apache/activemq/
activemq/trunk/activemq-camel/src/test/resources/org/apache/activemq/camel/
- copied from r668163, activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/camel/
activemq/trunk/activemq-camel/src/test/resources/org/apache/activemq/camel/SetHeaderTest-context.xml
- copied unchanged from r668196, activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/camel/SetHeaderTest-context.xml
activemq/trunk/activemq-camel/src/test/resources/org/apache/activemq/camel/component/
- copied from r668196, activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/camel/component/
activemq/trunk/activemq-camel/src/test/resources/org/apache/activemq/camel/spring.xml
- copied unchanged from r668196, activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/camel/spring.xml
Removed:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/camel/
activemq/trunk/activemq-core/src/main/resources/META-INF/services/org/apache/camel/
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/
activemq/trunk/activemq-core/src/test/resources/org/apache/activemq/camel/
Modified:
activemq/trunk/activemq-all/pom.xml
activemq/trunk/activemq-core/pom.xml
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/message/security/MessageAuthenticationTest.java
activemq/trunk/assembly/pom.xml
activemq/trunk/assembly/src/main/descriptors/common-bin.xml
activemq/trunk/pom.xml
Modified: activemq/trunk/activemq-all/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-all/pom.xml?rev=668217&r1=668216&r2=668217&view=diff
==============================================================================
--- activemq/trunk/activemq-all/pom.xml (original)
+++ activemq/trunk/activemq-all/pom.xml Mon Jun 16 09:11:38 2008
@@ -35,6 +35,10 @@
<!-- activemq -->
<dependency>
<groupId>${pom.groupId}</groupId>
+ <artifactId>activemq-camel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
<artifactId>activemq-console</artifactId>
</dependency>
<dependency>
@@ -65,6 +69,7 @@
<artifactSet>
<includes>
+ <include>${project.groupId}:activemq-camel</include>
<include>${project.groupId}:activemq-core</include>
<include>${project.groupId}:activemq-console</include>
<include>${project.groupId}:activemq-jaas</include>
Added: activemq/trunk/activemq-camel/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/pom.xml?rev=668217&view=auto
==============================================================================
--- activemq/trunk/activemq-camel/pom.xml (added)
+++ activemq/trunk/activemq-camel/pom.xml Mon Jun 16 09:11:38 2008
@@ -0,0 +1,134 @@
+<?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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-parent</artifactId>
+ <version>5.2-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>activemq-camel</artifactId>
+ <packaging>bundle</packaging>
+ <name>ActiveMQ :: Camel</name>
+ <description>ActiveMQ component for Camel</description>
+
+ <properties>
+ <activemq.osgi.import.pkg>
+ com.thoughtworks.xstream*;resolution:=optional,
+ org.apache.activeio*;resolution:=optional,
+ org.apache.camel*;resolution:=optional,
+ org.apache.commons.pool*;resolution:=optional,
+ org.apache.derby*;resolution:=optional,
+ org.apache.tools.ant*;resolution:=optional,
+ org.apache.xbean*;resolution:=optional,
+ '=org.apache.xbean.spring.context.v2;resolution:=optional',
+ org.apache.xpath*;resolution:=optional,
+ org.codehaus.jam*;resolution:=optional,
+ org.springframework*;resolution:=optional,
+ org.springframework.beans.factory.xml;resolution:=optional,
+ org.w3c.dom.traversal*;resolution:=optional,
+ *
+ </activemq.osgi.import.pkg>
+ <activemq.osgi.export>
+ org.apache.activemq.camel*;version=${project.version},
+ '=META-INF.services.org.apache.camel'
+ </activemq.osgi.export>
+ </properties>
+
+ <dependencies>
+
+ <!-- =============================== -->
+ <!-- Required Dependencies -->
+ <!-- =============================== -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>activemq-core</artifactId>
+ </dependency>
+
+ <!-- testing helpers -->
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>activemq-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-swing</artifactId>
+ <version>${camel-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Configure which tests are included/excuded -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkMode>pertest</forkMode>
+ <childDelegation>false</childDelegation>
+ <useFile>true</useFile>
+ <argLine>-Xmx512M</argLine>
+
+ <systemProperties>
+ <property>
+ <name>org.apache.activemq.default.directory.prefix</name>
+ <value>target/</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Propchange: activemq/trunk/activemq-camel/pom.xml
------------------------------------------------------------------------------
svn:executable = *
Copied: activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/CamelJmsTest.java (from r668196, activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java)
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/CamelJmsTest.java?p2=activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/CamelJmsTest.java&p1=activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java&r1=668196&r2=668217&rev=668217&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/camel/CamelJmsTest.java (original)
+++ activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/CamelJmsTest.java Mon Jun 16 09:11:38 2008
@@ -30,6 +30,7 @@
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.CamelTemplate;
+import org.apache.camel.impl.DefaultProducerTemplate;
import org.apache.camel.spring.SpringTestSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -72,7 +73,7 @@
// lets create a message
Destination destination = getMandatoryBean(Destination.class, "consumeFrom");
ConnectionFactory factory = getMandatoryBean(ConnectionFactory.class, "connectionFactory");
- CamelTemplate template = getMandatoryBean(CamelTemplate.class, "camelTemplate");
+ DefaultProducerTemplate template = getMandatoryBean(DefaultProducerTemplate.class, "camelTemplate");
Connection connection = factory.createConnection();
connection.start();
Modified: activemq/trunk/activemq-core/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/pom.xml?rev=668217&r1=668216&r2=668217&view=diff
==============================================================================
--- activemq/trunk/activemq-core/pom.xml (original)
+++ activemq/trunk/activemq-core/pom.xml Mon Jun 16 09:11:38 2008
@@ -43,6 +43,7 @@
org.apache.xpath*;resolution:=optional,
org.codehaus.jam*;resolution:=optional,
org.springframework*;resolution:=optional,
+ org.springframework.beans.factory.xml;resolution:=optional,
org.w3c.dom.traversal*;resolution:=optional,
*
</activemq.osgi.import.pkg>
Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/message/security/MessageAuthenticationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/message/security/MessageAuthenticationTest.java?rev=668217&r1=668216&r2=668217&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/message/security/MessageAuthenticationTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/message/security/MessageAuthenticationTest.java Mon Jun 16 09:11:38 2008
@@ -19,27 +19,60 @@
import java.io.IOException;
+import javax.jms.Connection;
+import javax.jms.Session;
+import javax.jms.Destination;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.TextMessage;
+import javax.jms.JMSException;
+
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.ConnectionContext;
-import org.apache.activemq.camel.CamelEmbeddedBrokerTestSupport;
import org.apache.activemq.command.Message;
+import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.security.MessageAuthorizationPolicy;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.CamelContext;
-import org.apache.camel.builder.RouteBuilder;
+import org.apache.activemq.EmbeddedBrokerTestSupport;
+import org.apache.activemq.spring.ConsumerBean;
/**
* @version $Revision: 1.1 $
*/
-public class MessageAuthenticationTest extends CamelEmbeddedBrokerTestSupport {
+public class MessageAuthenticationTest extends EmbeddedBrokerTestSupport {
+
+ private Connection connection;
+
public void testSendInvalidMessage() throws Exception {
- MockEndpoint results = getMockEndpoint("mock:results");
- results.expectedBodiesReceived("validBody");
+ if (connection == null) {
+ connection = createConnection();
+ }
+ connection.start();
+
+ ConsumerBean messageList = new ConsumerBean();
+ messageList.setVerbose(true);
+
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ Destination destination = new ActiveMQQueue("MyQueue");
+
+ MessageConsumer c1 = session.createConsumer(destination);
+
+ c1.setMessageListener(messageList);
- template.sendBodyAndHeader("activemq:MyQueue", "invalidBody", "myHeader", "xyz");
- template.sendBodyAndHeader("activemq:MyQueue", "validBody", "myHeader", "abc");
+ MessageProducer producer = session.createProducer(destination);
+ assertNotNull(producer);
- assertMockEndpointsSatisifed();
+ producer.send(createMessage(session, "invalidBody", "myHeader", "xyz"));
+ producer.send(createMessage(session, "validBody", "myHeader", "abc"));
+
+ messageList.assertMessagesArrived(1);
+ assertEquals("validBody", ((TextMessage) messageList.flushMessages().get(0)).getText());
+ }
+
+ private javax.jms.Message createMessage(Session session, String body, String header, String value) throws JMSException {
+ TextMessage msg = session.createTextMessage(body);
+ msg.setStringProperty(header, value);
+ return msg;
}
@Override
@@ -63,12 +96,4 @@
return answer;
}
- @Override
- protected void addCamelRoutes(CamelContext camelContext) throws Exception {
- camelContext.addRoutes(new RouteBuilder() {
- public void configure() throws Exception {
- from("activemq:MyQueue").to("mock:results");
- }
- });
- }
}
Modified: activemq/trunk/assembly/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/assembly/pom.xml?rev=668217&r1=668216&r2=668217&view=diff
==============================================================================
--- activemq/trunk/assembly/pom.xml (original)
+++ activemq/trunk/assembly/pom.xml Mon Jun 16 09:11:38 2008
@@ -22,6 +22,10 @@
</dependency>
<dependency>
<groupId>${pom.groupId}</groupId>
+ <artifactId>activemq-camel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
<artifactId>activemq-core</artifactId>
</dependency>
<dependency>
Modified: activemq/trunk/assembly/src/main/descriptors/common-bin.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/assembly/src/main/descriptors/common-bin.xml?rev=668217&r1=668216&r2=668217&view=diff
==============================================================================
--- activemq/trunk/assembly/src/main/descriptors/common-bin.xml (original)
+++ activemq/trunk/assembly/src/main/descriptors/common-bin.xml Mon Jun 16 09:11:38 2008
@@ -112,7 +112,7 @@
<include>org.apache.camel:camel-core</include>
<include>org.apache.camel:camel-spring</include>
<include>org.apache.camel:camel-jms</include>
- <include>org.apache.camel:camel-activemq</include>
+ <include>org.apache.activemq:activemq-camel</include>
<!-- Java 5 only -->
<include>javax.xml.bind:jaxb-api</include>
<include>javax.activation:activation</include>
Modified: activemq/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/pom.xml?rev=668217&r1=668216&r2=668217&view=diff
==============================================================================
--- activemq/trunk/pom.xml (original)
+++ activemq/trunk/pom.xml Mon Jun 16 09:11:38 2008
@@ -121,8 +121,8 @@
<modules>
<module>activemq-all</module>
<module>activemq-book</module>
+ <module>activemq-camel</module>
<module>activemq-core</module>
- <module>activemq-console</module>
<module>activemq-fileserver</module>
<module>activemq-jaas</module>
<module>activemq-jpa-store</module>
@@ -159,6 +159,11 @@
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-camel</artifactId>
+ <version>${activemq-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>${activemq-version}</version>
</dependency>