use of com.ibm.streamsx.topology.spl.SPLStream in project streamsx.topology by IBMStreams.
the class SimpleStandaloneTest method testSimple.
@Test
public void testSimple() throws Exception {
Topology topology = new Topology("testSimple");
TStream<String> hw = topology.strings("Hello", "World!", "Test!!");
SPLStream hws = SPLStreams.stringToSPLStream(hw);
Tester tester = topology.getTester();
StreamCounter<Tuple> counter = tester.splHandler(hws, new StreamCounter<Tuple>());
StreamCollector<LinkedList<Tuple>, Tuple> collector = tester.splHandler(hws, StreamCollector.newLinkedListCollector());
StreamsContextFactory.getStreamsContext(StreamsContext.Type.STANDALONE_TESTER).submit(topology).get();
assertEquals(3, counter.getTupleCount());
assertEquals("Hello", collector.getTuples().get(0).getString(0));
assertEquals("World!", collector.getTuples().get(1).getString(0));
assertEquals("Test!!", collector.getTuples().get(2).getString(0));
}
Aggregations