View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.transport.jms.integration;
8   
9   import org.junit.Test;
10  
11  /**
12   * Message is put to topic with two subscribers
13   */
14  public class JmsTopicTestCase extends AbstractJmsFunctionalTestCase
15  {
16      protected String getConfigResources()
17      {
18          return "integration/jms-topic.xml";
19      }
20  
21      @Test
22      public void testJmsTopic() throws Exception
23      {
24          // One message is sent.
25          dispatchMessage();
26          // The same message is read twice from the same JMS topic.
27          receiveMessage();
28          receiveMessage();
29      }
30  
31      @Test
32      public void testMultipleSend() throws Exception
33      {
34          // One message is sent.
35          dispatchMessage();
36          dispatchMessage();
37          // The same message is read twice from the same JMS topic.
38          receiveMessage();
39          receiveMessage();
40          receiveMessage();
41          receiveMessage();
42      }
43  }