anton-vinogradov commented on a change in pull request #49:
URL: https://github.com/apache/ignite-extensions/pull/49#discussion_r656001829



##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";

Review comment:
       Could we have consistent naming?
   Also, what are AA and AP? Could we explain this at Javadoc?

##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";
+
+    /** */
+    public static final byte SRC_CLUSTER_ID = 26;
+
+    /** */
+    public static final byte DEST_CLUSTER_ID = 27;
+
+    /** */
+    public static final int EXISTS = 1;
+
+    /** */
+    public static final int REMOVED = 2;
+
+    /** */
+    public static final int KEYS_CNT = 50;
+
+    /** */
+    protected static IgniteEx[] srcCluster;
+
+    /** */
+    protected static IgniteConfiguration[] srcClusterCliCfg;
+
+    /** */
+    protected static IgniteEx[] destCluster;
+
+    /** */
+    protected static IgniteConfiguration[] destClusterCliCfg;
+
+    /** */
+    private int commPort = TcpCommunicationSpi.DFLT_PORT;
+
+    /** */
+    private int discoPort = TcpDiscoverySpi.DFLT_PORT;
+
+    /** */
+    private byte clusterId = SRC_CLUSTER_ID;

Review comment:
       Any reason for this default when we redefining this at `beforeTest()`?

##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";
+
+    /** */
+    public static final byte SRC_CLUSTER_ID = 26;
+
+    /** */
+    public static final byte DEST_CLUSTER_ID = 27;
+
+    /** */
+    public static final int EXISTS = 1;
+
+    /** */
+    public static final int REMOVED = 2;

Review comment:
       Looks like enum values

##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";
+
+    /** */
+    public static final byte SRC_CLUSTER_ID = 26;
+
+    /** */
+    public static final byte DEST_CLUSTER_ID = 27;
+
+    /** */
+    public static final int EXISTS = 1;
+
+    /** */
+    public static final int REMOVED = 2;
+
+    /** */
+    public static final int KEYS_CNT = 50;
+
+    /** */
+    protected static IgniteEx[] srcCluster;
+
+    /** */
+    protected static IgniteConfiguration[] srcClusterCliCfg;
+
+    /** */
+    protected static IgniteEx[] destCluster;
+
+    /** */
+    protected static IgniteConfiguration[] destClusterCliCfg;
+
+    /** */
+    private int commPort = TcpCommunicationSpi.DFLT_PORT;
+
+    /** */
+    private int discoPort = TcpDiscoverySpi.DFLT_PORT;
+
+    /** */
+    private byte clusterId = SRC_CLUSTER_ID;
+
+    /** */
+    protected int clientsCnt = 1;

Review comment:
       should this be a method with default implementation?

##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";
+
+    /** */
+    public static final byte SRC_CLUSTER_ID = 26;
+
+    /** */
+    public static final byte DEST_CLUSTER_ID = 27;

Review comment:
       magic numbers?
   could we avoid this?

##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";
+
+    /** */
+    public static final byte SRC_CLUSTER_ID = 26;
+
+    /** */
+    public static final byte DEST_CLUSTER_ID = 27;
+
+    /** */
+    public static final int EXISTS = 1;
+
+    /** */
+    public static final int REMOVED = 2;
+
+    /** */
+    public static final int KEYS_CNT = 50;

Review comment:
       The value is too small to find anything unusual.
   How about thousands?

##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,328 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";
+
+    /** */
+    public static final byte SRC_CLUSTER_ID = 26;
+
+    /** */
+    public static final byte DEST_CLUSTER_ID = 27;
+
+    /** */
+    public static final int EXISTS = 1;
+
+    /** */
+    public static final int REMOVED = 2;
+
+    /** */
+    public static final int KEYS_CNT = 50;
+
+    /** */
+    protected static IgniteEx[] srcCluster;
+
+    /** */
+    protected static IgniteConfiguration[] srcClusterCliCfg;
+
+    /** */
+    protected static IgniteEx[] destCluster;

Review comment:
       Could be reversed to have glued semantic units.

##########
File path: 
modules/cdc-ext/src/test/java/org/apache/ignite/cdc/AbstractReplicationTest.java
##########
@@ -0,0 +1,331 @@
+/*
+ * 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.ignite.cdc;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.IntStream;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import 
org.apache.ignite.cdc.conflictresolve.CacheVersionConflictResolverPluginProvider;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
+import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
+import static 
org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi.DFLT_PORT_RANGE;
+import static org.apache.ignite.testframework.GridTestUtils.runAsync;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public abstract class AbstractReplicationTest extends GridCommonAbstractTest {
+    /** Cache mode. */
+    @Parameterized.Parameter
+    public CacheAtomicityMode cacheMode;
+
+    /** */
+    @Parameterized.Parameter(1)
+    public int backupCnt;
+
+    /** @return Test parameters. */
+    @Parameterized.Parameters(name = "cacheMode={0},backupCnt={1}")
+    public static Collection<?> parameters() {
+        List<Object[]> params = new ArrayList<>();
+
+        for (CacheAtomicityMode mode : EnumSet.of(ATOMIC, TRANSACTIONAL))
+            for (int i = 0; i < 2; i++)
+                params.add(new Object[] {mode, i});
+
+        return params;
+    }
+
+    /** */
+    public static final String AP_CACHE = "active-passive-cache";
+
+    /** */
+    public static final String ACTIVE_ACTIVE_CACHE = "active-active-cache";
+
+    /** */
+    public static final byte SRC_CLUSTER_ID = 26;
+
+    /** */
+    public static final byte DEST_CLUSTER_ID = 27;
+
+    /** */
+    public static final int EXISTS = 1;
+
+    /** */
+    public static final int REMOVED = 2;
+
+    /** */
+    public static final int KEYS_CNT = 50;
+
+    /** */
+    protected static IgniteEx[] srcCluster;
+
+    /** */
+    protected static IgniteConfiguration[] srcClusterCliCfg;
+
+    /** */
+    protected static IgniteEx[] destCluster;
+
+    /** */
+    protected static IgniteConfiguration[] destClusterCliCfg;
+
+    /** */
+    private int commPort = TcpCommunicationSpi.DFLT_PORT;
+
+    /** */
+    private int discoPort = TcpDiscoverySpi.DFLT_PORT;
+
+    /** */
+    private byte clusterId = SRC_CLUSTER_ID;
+
+    /** */
+    protected int clientsCnt = 1;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String 
igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName)
+            .setDiscoverySpi(new TcpDiscoverySpi()
+                .setLocalPort(discoPort)
+                .setIpFinder(new TcpDiscoveryVmIpFinder() {{
+                    setAddresses(Collections.singleton("127.0.0.1:" + 
discoPort + ".." + (discoPort + DFLT_PORT_RANGE)));
+                }}))
+            .setCommunicationSpi(new TcpCommunicationSpi()
+                .setLocalPort(commPort));

Review comment:
       Commented this, but tests still green.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to