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