1
2
3
4
5
6
7
8
9
10
11 package org.mule.transport.jms.integration;
12
13 import org.junit.Test;
14
15
16
17
18 public class JmsDurableTopicSingleTxTestCase extends JmsDurableTopicTestCase
19 {
20 protected String getConfigResources()
21 {
22 return "integration/jms-durable-topic-single-tx.xml";
23 }
24
25
26
27
28 @Test
29 public void testProviderDurableSubscriber() throws Exception
30 {
31 setClientId("Client1");
32 receive(scenarioNotReceive);
33 setClientId("Client2");
34 receive(scenarioNotReceive);
35
36 setClientId("Sender");
37 send(scenarioCommit);
38
39 setClientId("Client1");
40 receive(scenarioCommit);
41 receive(scenarioNotReceive);
42 setClientId("Client2");
43 receive(scenarioRollback);
44 receive(scenarioCommit);
45 receive(scenarioNotReceive);
46
47 }
48
49 Scenario scenarioCommit = new ScenarioCommit()
50 {
51 public String getOutputDestinationName()
52 {
53 return getJmsConfig().getBroadcastDestinationName();
54 }
55 };
56
57 Scenario scenarioRollback = new ScenarioRollback()
58 {
59 public String getOutputDestinationName()
60 {
61 return getJmsConfig().getBroadcastDestinationName();
62 }
63 };
64
65 Scenario scenarioNotReceive = new ScenarioNotReceive()
66 {
67 public String getOutputDestinationName()
68 {
69 return getJmsConfig().getBroadcastDestinationName();
70 }
71 };
72 }