1   /*
2    * $Id: JmsDurableTopicSingleTxTestCase.java 10489 2008-01-23 17:53:38Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.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  package org.mule.transport.jms.integration;
11  
12  
13  /**
14   * Testing durable topic with external subscriber
15   */
16  public class JmsDurableTopicSingleTxTestCase extends JmsDurableTopicTestCase
17  {
18  
19      public static final String TOPIC_QUEUE_NAME = "durable.broadcast";
20  
21      protected String getConfigResources()
22      {
23          return "providers/activemq/jms-durable-topic-single-tx.xml";
24      }
25  
26      /**
27       * @throws Exception
28       */
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 getOutputQueue()
52          {
53              return TOPIC_QUEUE_NAME;
54          }
55      };
56  
57      Scenario scenarioRollback = new ScenarioRollback()
58      {
59          public String getOutputQueue()
60          {
61              return TOPIC_QUEUE_NAME;
62          }
63      };
64  
65      Scenario scenarioNotReceive = new ScenarioNotReceive()
66      {
67          public String getOutputQueue()
68          {
69              return TOPIC_QUEUE_NAME;
70          }
71      };
72  }