Hi Nicos,
Do you want an IT test to test the job, or just a UT to test the window
operator?

If you want to test the job, there are examples here:
1. WordCountITCase.java
<https://github.com/apache/flink/blob/master/flink-tests/src/test/java/org/apache/flink/test/example/java/WordCountITCase.java>
2. WindowFunctionITCase.scala
<https://github.com/apache/flink/blob/master/flink-streaming-scala/src/test/scala/org/apache/flink/streaming/api/scala/WindowFunctionITCase.scala>

Also, there are UT tests using test harness to test a window operator:
1. WindowOperatorTest.java
<https://github.com/apache/flink/blob/master/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java>

Best, Hequn

On Thu, Aug 30, 2018 at 9:04 PM Nicos Maris <nicos.ma...@gmail.com> wrote:

> Can the OneInputStreamOperatorTestHarness
> <https://github.com/apache/flink/blob/master/flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java>
> be used to test pipelines with time windows?
>
> Can someone explain this test harness preferably with a tiny example?
>
> I see here
> <https://ci.apache.org/projects/flink/flink-docs-release-1.6/dev/stream/testing.html#testing-checkpointing-and-state-handling>
> that "it is currently not a part of public API and can be subject to
> change", but I assume it is the only thing I can get from flink as regards
> automated testing of pipelines with time windows.
>
> On Tue, Aug 28, 2018 at 3:12 PM Nicos Maris <nicos.ma...@gmail.com> wrote:
>
>> Hi Zhengwen,
>>
>>
>> I have tested my job manually (both by submitting a job and through
>> execute()) and I am trying to write a test.
>>
>> The following project states that it has the feature "Test stream
>> windowing with timestamped input" but I do not want to rely on a project
>> other than flink.
>>
>> https://github.com/ottogroup/flink-spector
>>
>> The following folder doesn't seam to demonstrate such capability for
>> testing.
>>
>>
>> https://github.com/apache/flink/tree/master/flink-examples/flink-examples-streaming/src/test/java/org/apache/flink/streaming/test
>>
>>
>>
>> On Tue, Aug 28, 2018 at 2:55 PM ZhengWen ZHU <ahua...@gmail.com> wrote:
>>
>>> Hi Nicos,
>>> Under the flink-example module, there are many examples, including batch
>>> and streaming.  You could build the project from the source, this way you
>>> could found many jars under the target directory. You can submit these jars
>>> to the Flink cluster. Also, you could run these examples directly from your
>>> IDE by standalone mode.
>>>
>>> best,
>>> Zhengwen
>>>
>>> On Tue, Aug 28, 2018 at 7:35 PM Nicos Maris <nicos.ma...@gmail.com>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>>
>>>> How can I test in Java any streaming job that has a time window?
>>>>
>>>>
>>>> best,
>>>> Nicos
>>>>
>>>
>>>
>>> --
>>>
>>>
>>>
>>>
>>> *_________________________________________Zhu ZhengwenState Key
>>> Laboratory For Novel Software TechnologyDept. of Computer Sci. & Tech.,
>>> Nanjing University*
>>> *9, Hankou Road, Nanjing, China.*
>>>
>>

Reply via email to