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