Testing process functions

Posted by Manas Kale on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Testing-process-functions-tp35158.html

Hi,
How do I test process functions? I tried by implementing a sink function that stores myProcessFunction's output in a list. After env.execute(), I use assertions.
If I set a breakpoint in the myTestSink's invoke() method, I see that that method is being called correctly. However, after env.execute() returns, all data in sink functions is wiped clean. 

TestSink myTestSink = new myTestSink();
testStream.process(new myProcessFunction()).addSink(myTestSink);
env.execute("test");
assertEquals(expectedOutput, myTestSink.actual);

What am I doing wrong?
 Also, I see that a ProcessFunctionTestHarnesses has been added in 1.10. I wasn't able to download its sources to understand how I could use that. Have the sources not been added to maven or is it a problem at my end? 

Regards,
Manas