Search in sources :

Example 1 with CountOccurance

use of org.apache.apex.malhar.lib.testbench.CountOccurance in project apex-malhar by apache.

the class CountOccuranceTest method testProcess.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void testProcess() {
    CountOccurance oper = new CountOccurance();
    oper.setup(null);
    CollectorTestSink sink = new CollectorTestSink();
    oper.outport.setSink(sink);
    oper.beginWindow(1);
    oper.inport.process("a");
    oper.inport.process("b");
    oper.endWindow();
    Assert.assertEquals("number emitted tuples", 1, sink.collectedTuples.size());
}
Also used : CountOccurance(org.apache.apex.malhar.lib.testbench.CountOccurance) CollectorTestSink(org.apache.apex.malhar.lib.testbench.CollectorTestSink) Test(org.junit.Test)

Aggregations

CollectorTestSink (org.apache.apex.malhar.lib.testbench.CollectorTestSink)1 CountOccurance (org.apache.apex.malhar.lib.testbench.CountOccurance)1 Test (org.junit.Test)1