View Javadoc

1   /*
2    * $Id: JmsDurableTopicSingleTxTestCase.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.jms.integration;
12  
13  import org.junit.Test;
14  
15  /**
16   * Testing durable topic with external subscriber
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       * @throws Exception
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  }