View Javadoc

1   /*
2    * $Id: JmsDurableTopicSingleTxTestCase.java 22431 2011-07-18 07:40:35Z dirk.olmes $
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  
21      @Override
22      protected String getConfigResources()
23      {
24          return "integration/jms-durable-topic-single-tx.xml";
25      }
26  
27      /**
28       * @throws Exception
29       */
30      @Override
31      @Test
32      public void testProviderDurableSubscriber() throws Exception
33      {
34          setClientId("Client1");
35          receive(scenarioNotReceive);
36          setClientId("Client2");
37          receive(scenarioNotReceive);
38  
39          setClientId("Sender");
40          send(scenarioCommit);
41  
42          setClientId("Client1");
43          receive(scenarioCommit);
44          receive(scenarioNotReceive);
45          setClientId("Client2");
46          receive(scenarioRollback);
47          receive(scenarioCommit);
48          receive(scenarioNotReceive);
49  
50      }
51  
52      Scenario scenarioCommit = new ScenarioCommit()
53      {
54  
55          @Override
56          public String getOutputDestinationName()
57          {
58              return getJmsConfig().getBroadcastDestinationName();
59          }
60      };
61  
62      Scenario scenarioRollback = new ScenarioRollback()
63      {
64  
65          @Override
66          public String getOutputDestinationName()
67          {
68              return getJmsConfig().getBroadcastDestinationName();
69          }
70      };
71  
72      Scenario scenarioNotReceive = new ScenarioNotReceive()
73      {
74  
75          @Override
76          public String getOutputDestinationName()
77          {
78              return getJmsConfig().getBroadcastDestinationName();
79          }
80      };
81  }