You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by James Sandys-Lumsdaine <ja...@hotmail.com> on 2022/02/14 17:06:26 UTC

Unit test harness for Sources

Hi all,

I've been using the test harness classes to unit test my stateful 1 and 2 stream functions. But I also have some stateful legacy Source classes I would like to unit test and can't find any documentation or example for that - is this possible?

Thanks,

James.

Re: Unit test harness for Sources

Posted by James Sandys-Lumsdaine <ja...@hotmail.com>.
Thanks for the reply. If I upgrade my legacy Sources to use the new split Sources is there a better unit test harness for that?

Thanks,

James.

Sent from my iPhone

On 15 Feb 2022, at 13:24, Chesnay Schepler <ch...@apache.org> wrote:


I don't think there is anything of the sort for the legacy sources. I would suggest to follow the example at https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/datastream/testing/#testing-flink-jobs and using a job that only contains the source (+ something to either extract the results or verify it within the job).

On 14/02/2022 18:06, James Sandys-Lumsdaine wrote:
Hi all,

I've been using the test harness classes to unit test my stateful 1 and 2 stream functions. But I also have some stateful legacy Source classes I would like to unit test and can't find any documentation or example for that - is this possible?

Thanks,

James.


Re: Unit test harness for Sources

Posted by Chesnay Schepler <ch...@apache.org>.
I don't think there is anything of the sort for the legacy sources. I 
would suggest to follow the example at 
https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/datastream/testing/#testing-flink-jobs 
and using a job that only contains the source (+ something to either 
extract the results or verify it within the job).

On 14/02/2022 18:06, James Sandys-Lumsdaine wrote:
> Hi all,
>
> I've been using the test harness classes to unit test my stateful 1 
> and 2 stream functions. But I also have some stateful legacy Source 
> classes I would like to unit test and can't find any documentation or 
> example for that - is this possible?
>
> Thanks,
>
> James.