/[Apache-SVN]/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOnlyWithReplyToAsHeaderTest.java
ViewVC logotype

Contents of /camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsInOnlyWithReplyToAsHeaderTest.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1209585 - (show annotations) (download)
Fri Dec 2 17:03:07 2011 UTC (6 years, 11 months ago) by dkulp
File size: 2895 byte(s)
Add a BUNCH of svn properties to all the files to make sure eolstyle, mime type, etc... are all set and svn:ignores are all set on directories with poms and such.

1 /**
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.camel.component.jms;
18
19 import javax.jms.ConnectionFactory;
20
21 import org.apache.camel.CamelContext;
22 import org.apache.camel.builder.RouteBuilder;
23 import org.apache.camel.test.junit4.CamelTestSupport;
24 import org.junit.Test;
25
26 import static org.apache.camel.component.jms.JmsComponent.jmsComponentAutoAcknowledge;
27
28 /**
29 * @version
30 */
31 public class JmsInOnlyWithReplyToAsHeaderTest extends CamelTestSupport {
32
33 @Test
34 public void testSendInOnlyWithReplyTo() throws Exception {
35 getMockEndpoint("mock:foo").expectedBodiesReceived("World");
36 getMockEndpoint("mock:bar").expectedBodiesReceived("Bye World");
37 getMockEndpoint("mock:done").expectedBodiesReceived("World");
38
39 template.sendBodyAndHeader("direct:start", "World", "JMSReplyTo", "queue:bar");
40
41 assertMockEndpointsSatisfied();
42 }
43
44 protected CamelContext createCamelContext() throws Exception {
45 CamelContext camelContext = super.createCamelContext();
46 ConnectionFactory connectionFactory = CamelJmsTestHelper.createConnectionFactory();
47 camelContext.addComponent("activemq", jmsComponentAutoAcknowledge(connectionFactory));
48 return camelContext;
49 }
50
51 @Override
52 protected RouteBuilder createRouteBuilder() throws Exception {
53 return new RouteBuilder() {
54 @Override
55 public void configure() throws Exception {
56 from("direct:start")
57 // must enable preserveMessageQos to force Camel to use the JMSReplyTo header
58 .to("activemq:queue:foo?preserveMessageQos=true")
59 .to("mock:done");
60
61 from("activemq:queue:foo")
62 .to("log:foo?showAll=true", "mock:foo")
63 .transform(body().prepend("Bye "));
64
65 // we should disable reply to to avoid sending the message back to our self
66 // after we have consumed it
67 from("activemq:queue:bar?disableReplyTo=true")
68 .to("log:bar?showAll=true", "mock:bar");
69 }
70 };
71 }
72 }

Properties

Name Value
svn:eol-style native

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.22