/*
 * 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.connector.kafka.source;

import org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer;
import org.apache.flink.streaming.connectors.kafka.KafkaConsumerTestBase;
import org.apache.flink.streaming.connectors.kafka.KafkaProducerTestBase;
import org.apache.flink.streaming.connectors.kafka.KafkaTestEnvironmentImpl;

import org.junit.BeforeClass;
import org.junit.Test;

/**
 * An IT case class that runs all the IT cases of the legacy {@link
 * org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer} with the new {@link KafkaSource}.
 */
public class KafkaSourceLegacyITCase extends KafkaConsumerTestBase {

    public KafkaSourceLegacyITCase() throws Exception {
        super(true);
    }

    @BeforeClass
    public static void prepare() throws Exception {
        KafkaProducerTestBase.prepare();
        ((KafkaTestEnvironmentImpl) kafkaServer)
                .setProducerSemantic(FlinkKafkaProducer.Semantic.AT_LEAST_ONCE);
    }

    @Test(timeout = 120000)
    public void testFailOnNoBroker() throws Exception {
        runFailOnNoBrokerTest();
    }

    @Test(timeout = 60000)
    public void testConcurrentProducerConsumerTopology() throws Exception {
        runSimpleConcurrentProducerConsumerTopology();
    }

    @Test(timeout = 60000)
    public void testKeyValueSupport() throws Exception {
        runKeyValueTest();
    }

    // --- canceling / failures ---

    @Test(timeout = 60000)
    public void testCancelingEmptyTopic() throws Exception {
        runCancelingOnEmptyInputTest();
    }

    @Test(timeout = 60000)
    public void testCancelingFullTopic() throws Exception {
        runCancelingOnFullInputTest();
    }

    // --- source to partition mappings and exactly once ---

    @Test(timeout = 60000)
    public void testOneToOneSources() throws Exception {
        runOneToOneExactlyOnceTest();
    }

    @Test(timeout = 60000)
    public void testOneSourceMultiplePartitions() throws Exception {
        runOneSourceMultiplePartitionsExactlyOnceTest();
    }

    @Test(timeout = 60000)
    public void testMultipleSourcesOnePartition() throws Exception {
        runMultipleSourcesOnePartitionExactlyOnceTest();
    }

    // --- broker failure ---

    @Test(timeout = 60000)
    public void testBrokerFailure() throws Exception {
        runBrokerFailureTest();
    }

    // --- special executions ---

    @Test(timeout = 60000)
    public void testBigRecordJob() throws Exception {
        runBigRecordTestTopology();
    }

    @Test(timeout = 60000)
    public void testMultipleTopicsWithLegacySerializer() throws Exception {
        runProduceConsumeMultipleTopics(true);
    }

    @Test(timeout = 60000)
    public void testMultipleTopicsWithKafkaSerializer() throws Exception {
        runProduceConsumeMultipleTopics(false);
    }

    @Test(timeout = 60000)
    public void testAllDeletes() throws Exception {
        runAllDeletesTest();
    }

    // --- startup mode ---

    @Test(timeout = 60000)
    public void testStartFromEarliestOffsets() throws Exception {
        runStartFromEarliestOffsets();
    }

    @Test(timeout = 60000)
    public void testStartFromLatestOffsets() throws Exception {
        runStartFromLatestOffsets();
    }

    @Test(timeout = 60000)
    public void testStartFromGroupOffsets() throws Exception {
        runStartFromGroupOffsets();
    }

    @Test(timeout = 60000)
    public void testStartFromSpecificOffsets() throws Exception {
        runStartFromSpecificOffsets();
    }

    @Test(timeout = 60000)
    public void testStartFromTimestamp() throws Exception {
        runStartFromTimestamp();
    }

    // --- offset committing ---

    @Test(timeout = 60000)
    public void testCommitOffsetsToKafka() throws Exception {
        runCommitOffsetsToKafka();
    }

    @Test(timeout = 60000)
    public void testAutoOffsetRetrievalAndCommitToKafka() throws Exception {
        runAutoOffsetRetrievalAndCommitToKafka();
    }

    @Test(timeout = 60000)
    public void testCollectingSchema() throws Exception {
        runCollectingSchemaTest();
    }
}

@@ -1792,27 +1792,9 @@
 Test
-(timeout = 120000)
 %0A
+
     
@@ -1894,33 +1894,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -2042,33 +2042,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -2180,33 +2180,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -2298,33 +2298,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -2476,33 +2476,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -2588,33 +2588,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -2731,33 +2731,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -2905,33 +2905,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3044,33 +3044,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3151,33 +3151,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3291,33 +3291,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3431,33 +3431,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3558,33 +3558,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3680,33 +3680,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3798,33 +3798,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -3914,33 +3914,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -4036,33 +4036,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -4180,33 +4180,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -4294,33 +4294,16 @@
    @Test
-(timeout = 60000)
 %0A    pub
@@ -4421,32 +4421,32 @@
 Kafka();%0A    %7D%0A%0A
+
     @Test(timeou
@@ -4442,25 +4442,8 @@
 Test
-(timeout = 60000)
 %0A   

Remove timeouts from KafkaSourceLegacyITCase