View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.module.atom;
8   
9   import org.mule.tck.junit4.FunctionalTestCase;
10  import org.mule.tck.functional.CounterCallback;
11  import org.mule.tck.functional.FunctionalTestComponent;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertTrue;
16  
17  public class FeedConsumeNoSplitTestCase extends FunctionalTestCase
18  {
19  
20      private final CounterCallback counter = new CounterCallback();
21  
22      @Override
23      protected String getConfigResources()
24      {
25          return "atom-consume-no-split.xml";
26      }
27  
28      @Override
29      protected void doSetUp() throws Exception
30      {
31          FunctionalTestComponent comp = (FunctionalTestComponent)getComponent("feedConsumer");
32          comp.setEventCallback(counter);
33      }
34  
35      @Test
36      public void testConsume() throws Exception {
37  
38          Thread.sleep(1500);
39          int count = counter.getCallbackCount();
40          //We just receive the feed, not split
41          assertTrue(count < 3);
42      }
43  }