Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4530#discussion_r133843667
  
    --- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/operators/KeyedCoProcessOperatorWithWatermarkDelayTest.scala
 ---
    @@ -0,0 +1,91 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.flink.table.runtime.operators
    +
    +import java.util.concurrent.ConcurrentLinkedQueue
    +
    +import org.apache.flink.api.common.typeinfo.BasicTypeInfo
    +import org.apache.flink.api.java.functions.KeySelector
    +import org.apache.flink.streaming.api.functions.co.CoProcessFunction
    +import org.apache.flink.streaming.api.watermark.Watermark
    +import 
org.apache.flink.streaming.util.{KeyedTwoInputStreamOperatorTestHarness, 
TestHarnessUtil}
    +import org.apache.flink.util.{Collector, TestLogger}
    +
    +import org.junit.{Assert, Test}
    +
    +/**
    +  * Tests {@link KeyedProcessOperatorWithWatermarkDelay}.
    +  */
    +class KeyedCoProcessOperatorWithWatermarkDelayTest extends TestLogger {
    +
    +  @Test
    +  def testHoldingBackWatermarks(): Unit = {
    +    val operator = new KeyedCoProcessOperatorWithWatermarkDelay[String, 
Integer, String, String](
    +      new EmptyCoProcessFunction, 100)
    +    val testHarness = new KeyedTwoInputStreamOperatorTestHarness[String, 
Integer, String, String](
    +      operator, new IntToStringKeySelector, new 
CoIdentityKeySelector[String],
    +      BasicTypeInfo.STRING_TYPE_INFO)
    +    testHarness.setup()
    +    testHarness.open()
    +    testHarness.processWatermark1(new Watermark(101))
    +    testHarness.processWatermark2(new Watermark(202))
    +    testHarness.processWatermark1(new Watermark(103))
    +    testHarness.processWatermark2(new Watermark(204))
    +    val expectedOutput = new ConcurrentLinkedQueue[AnyRef]
    +    expectedOutput.add(new Watermark(1))
    +    expectedOutput.add(new Watermark(3))
    +    TestHarnessUtil.assertOutputEquals("Output was not correct.", 
expectedOutput,
    +      testHarness.getOutput)
    +    testHarness.close()
    +  }
    +
    +  @Test
    --- End diff --
    
    use `@Test(expected = classOf[IllegalArgumentException])` instead of 
try-catch with `isInstanceOf`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to