1
2
3
4
5
6
7
8
9
10 package org.mule.module.rss;
11
12 import org.mule.api.client.LocalMuleClient;
13 import org.mule.tck.junit4.FunctionalTestCase;
14
15 import org.junit.Test;
16
17 import static org.junit.Assert.assertEquals;
18
19 public class JmsRssFeedConsumeTestCase extends FunctionalTestCase
20 {
21
22 @Override
23 protected String getConfigResources()
24 {
25 return "jms-rss-consume.xml";
26 }
27
28 @Test
29 public void testConsumeFeed() throws Exception
30 {
31 LocalMuleClient client = muleContext.getClient();
32 String feed = SampleFeed.feedAsString();
33 client.dispatch("jms://feed.in", feed, null);
34 Thread.sleep(3000);
35 FeedReceiver component = (FeedReceiver) getComponent("feedConsumer");
36 assertEquals(25, component.getCount());
37 }
38
39 @Test
40 public void testConsumeSplitFeed() throws Exception
41 {
42 LocalMuleClient client = muleContext.getClient();
43 String feed = SampleFeed.feedAsString();
44 client.dispatch("jms://feed.split.in", feed, null);
45 Thread.sleep(3000);
46 EntryReceiver component = (EntryReceiver) getComponent("feedSplitterConsumer");
47 assertEquals(25, component.getCount());
48 }
49 }