1
2
3
4
5
6
7 package org.mule.module.atom;
8
9 import org.mule.tck.functional.CounterCallback;
10 import org.mule.tck.functional.FunctionalTestComponent;
11 import org.mule.tck.junit4.FunctionalTestCase;
12
13 import org.junit.Test;
14
15 import static org.junit.Assert.assertEquals;
16 import static org.junit.Assert.assertTrue;
17
18 public class HttpOnlyFeedConsumeAndSplitTestCase extends FunctionalTestCase
19 {
20
21 private static final long SLEEP_TIME = 10000;
22
23 private final CounterCallback counter = new CounterCallback();
24
25 @Override
26 protected String getConfigResources()
27 {
28 return "http-only-consume-and-split.xml";
29 }
30
31 @Override
32 protected void doSetUp() throws Exception
33 {
34 FunctionalTestComponent comp = (FunctionalTestComponent)getComponent("feedConsumer");
35 comp.setEventCallback(counter);
36 }
37
38 @Test
39 public void testConsume() throws Exception
40 {
41
42 Thread.sleep(SLEEP_TIME);
43
44 int count = counter.getCallbackCount();
45 assertTrue("did not receive any artices from feed", count > 0);
46
47
48 Thread.sleep(SLEEP_TIME);
49
50 assertEquals(count, counter.getCallbackCount());
51 }
52
53 }