Package org.apache.flink.streaming.api.streamvertex

Examples of org.apache.flink.streaming.api.streamvertex.MockRecordWriter


public class MockRecordWriterFactory {

  @SuppressWarnings("unchecked")
  public static MockRecordWriter create() {
    MockRecordWriter recWriter = mock(MockRecordWriter.class);
   
    Mockito.when(recWriter.initList()).thenCallRealMethod();
    doCallRealMethod().when(recWriter).emit(Mockito.any(SerializationDelegate.class));
   
    recWriter.initList();
   
    return recWriter;
  }
View Full Code Here


public class StreamCollectorTest {

  @Test
  public void testCollect() {
    MockRecordWriter recWriter = MockRecordWriterFactory.create();
    SerializationDelegate<StreamRecord<Tuple1<Integer>>> sd = new SerializationDelegate<StreamRecord<Tuple1<Integer>>>(
        null);
    sd.setInstance(new StreamRecord<Tuple1<Integer>>().setObject(new Tuple1<Integer>()));

    StreamCollector<Tuple1<Integer>> collector = new StreamCollector<Tuple1<Integer>>(2, sd);
View Full Code Here

TOP

Related Classes of org.apache.flink.streaming.api.streamvertex.MockRecordWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.