1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.jms.integration;
12
13 import static org.junit.Assert.assertEquals;
14
15 import org.mule.api.MuleException;
16 import org.mule.api.MuleMessage;
17 import org.mule.module.client.MuleClient;
18 import org.mule.transport.NullPayload;
19
20 import org.junit.Test;
21
22
23
24
25
26
27 public class JmsTemporaryReplyToTestCase extends AbstractJmsFunctionalTestCase
28 {
29
30 @Override
31 protected String getConfigResources()
32 {
33 return "integration/jms-temporary-replyTo.xml";
34 }
35
36 @Test
37 public void testTemporaryReplyEnabledSync() throws MuleException
38 {
39 MuleClient muleClient = new MuleClient(muleContext);
40 MuleMessage response = muleClient.send("vm://in1Sync", TEST_MESSAGE, null);
41 assertEquals(TEST_MESSAGE + " TestService1", response.getPayload());
42 }
43
44 @Test
45 public void testTemporaryReplyDisabledSync() throws MuleException
46 {
47 MuleClient muleClient = new MuleClient(muleContext);
48 MuleMessage response = muleClient.send("vm://in2Sync", TEST_MESSAGE, null);
49 assertEquals(TEST_MESSAGE, response.getPayload());
50 }
51
52 @Test
53 public void testDisableTemporaryReplyOnTheConnector() throws MuleException
54 {
55 MuleClient muleClient = new MuleClient(muleContext);
56 MuleMessage response = muleClient.send("vm://in3", TEST_MESSAGE, null);
57
58 assertEquals(NullPayload.getInstance(), response.getPayload());
59 }
60
61 @Test
62 public void testExplicitReplyToAsyncSet() throws MuleException
63 {
64 MuleClient muleClient = new MuleClient(muleContext);
65 MuleMessage response = muleClient.send("vm://in4", TEST_MESSAGE, null);
66
67 assertEquals(TEST_MESSAGE + " TestService1", response.getPayload());
68 }
69 }