mirror of
https://github.com/apache/activemq.git
synced 2025-02-16 15:08:10 +00:00
AMQ-1801: Extract camel component in its own module
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@668217 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0d8586903a
commit
702e2a0170
@ -33,6 +33,10 @@
|
||||
<dependencies>
|
||||
|
||||
<!-- activemq -->
|
||||
<dependency>
|
||||
<groupId>${pom.groupId}</groupId>
|
||||
<artifactId>activemq-camel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${pom.groupId}</groupId>
|
||||
<artifactId>activemq-console</artifactId>
|
||||
@ -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>
|
||||
|
134
activemq-camel/pom.xml
Executable file
134
activemq-camel/pom.xml
Executable file
@ -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>
|
22
activemq-camel/src/test/data/message1.xml
Normal file
22
activemq-camel/src/test/data/message1.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?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.
|
||||
-->
|
||||
<person user="james">
|
||||
<firstName>James</firstName>
|
||||
<lastName>Strachan</lastName>
|
||||
<city>London</city>
|
||||
</person>
|
@ -30,6 +30,7 @@ import junit.framework.Assert;
|
||||
|
||||
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 @@ public class CamelJmsTest extends SpringTestSupport {
|
||||
// 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();
|
@ -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>
|
||||
|
@ -19,27 +19,60 @@ package org.apache.activemq.broker.message.security;
|
||||
|
||||
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();
|
||||
|
||||
template.sendBodyAndHeader("activemq:MyQueue", "invalidBody", "myHeader", "xyz");
|
||||
template.sendBodyAndHeader("activemq:MyQueue", "validBody", "myHeader", "abc");
|
||||
ConsumerBean messageList = new ConsumerBean();
|
||||
messageList.setVerbose(true);
|
||||
|
||||
assertMockEndpointsSatisifed();
|
||||
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
|
||||
Destination destination = new ActiveMQQueue("MyQueue");
|
||||
|
||||
MessageConsumer c1 = session.createConsumer(destination);
|
||||
|
||||
c1.setMessageListener(messageList);
|
||||
|
||||
MessageProducer producer = session.createProducer(destination);
|
||||
assertNotNull(producer);
|
||||
|
||||
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 @@ public class MessageAuthenticationTest extends CamelEmbeddedBrokerTestSupport {
|
||||
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");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,10 @@
|
||||
<groupId>${pom.groupId}</groupId>
|
||||
<artifactId>activemq-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${pom.groupId}</groupId>
|
||||
<artifactId>activemq-camel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${pom.groupId}</groupId>
|
||||
<artifactId>activemq-core</artifactId>
|
||||
|
@ -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>
|
||||
|
7
pom.xml
7
pom.xml
@ -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>
|
||||
@ -157,6 +157,11 @@
|
||||
<artifactId>activemq-all</artifactId>
|
||||
<version>${activemq-version}</version>
|
||||
</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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user