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.FunctionalTestCase;
14 import org.mule.tck.functional.CounterCallback;
15 import org.mule.tck.functional.FunctionalTestComponent;
16
17 public class FeedConsumeAndSplitExplicitNonHttpTestCase extends FunctionalTestCase
18 {
19 private final CounterCallback counter = new CounterCallback();
20
21 @Override
22 protected String getConfigResources()
23 {
24 return "rss-consume-and-explicit-split-non-http.xml";
25 }
26
27 @Override
28 protected void doSetUp() throws Exception
29 {
30 FunctionalTestComponent comp = (FunctionalTestComponent)getComponent("feedConsumer");
31 comp.setEventCallback(counter);
32 }
33
34 public void testConsume() throws Exception
35 {
36 LocalMuleClient client = muleContext.getClient();
37 String feed = loadResourceAsString("sample-feed.rss");
38 client.dispatch("vm://feed.in", feed, null);
39 Thread.sleep(2000);
40 int count = counter.getCallbackCount();
41 assertEquals(10, count);
42 }
43 }