1
2
3
4
5
6
7
8
9
10 package org.mule.transport.http.functional;
11
12 import org.mule.tck.DynamicPortTestCase;
13 import org.mule.tck.functional.CounterCallback;
14 import org.mule.tck.functional.FunctionalTestComponent;
15
16 import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
17
18 public class PollingEtagTestCase extends DynamicPortTestCase
19 {
20 private static final int WAIT_TIME = 2500;
21
22 protected String getConfigResources()
23 {
24 return "polling-etag-test.xml";
25 }
26
27 public void testPollingReceiversRestart() throws Exception
28 {
29 Object ftc = getComponent("Test");
30 assertTrue("FunctionalTestComponent expected", ftc instanceof FunctionalTestComponent);
31
32 AtomicInteger pollCounter = new AtomicInteger(0);
33 ((FunctionalTestComponent) ftc).setEventCallback(new CounterCallback(pollCounter));
34
35
36 Thread.sleep(WAIT_TIME);
37
38 assertEquals(1, pollCounter.get());
39 }
40
41 @Override
42 protected int getNumPortsToFind()
43 {
44 return 1;
45 }
46 }
47