1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.jms.integration;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15
16 import java.util.HashMap;
17 import java.util.Map;
18
19 import org.junit.Test;
20
21 public class JmsReplyToPropertyTestCase extends AbstractJmsFunctionalTestCase
22 {
23
24 @Override
25 protected String getConfigResources()
26 {
27 return "integration/jms-replyto-property.xml";
28 }
29
30 @Test
31 public void testReplyTo() throws Exception
32 {
33 MuleClient client = new MuleClient(muleContext);
34 Map<String, String> props = new HashMap<String, String>();
35 props.put("JMSReplyTo", "middle");
36 client.dispatch("in", DEFAULT_INPUT_MESSAGE, props);
37
38
39 MuleMessage output = client.request("out", 2000);
40 assertNotNull(output);
41 final Object o = output.getOutboundProperty("JMSReplyTo");
42 assertTrue(o.toString().contains("middle"));
43
44
45 output = client.request("middle", 2000);
46 assertNotNull(output);
47 assertEquals(DEFAULT_OUTPUT_MESSAGE, output.getPayload());
48 }
49 }