ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvvinbl...@apache.org
Subject [2/2] ignite git commit: IGNITE-10365: MVCC: Create "Cache 6" test suite for MVCC mode. This closes #5478.
Date Fri, 30 Nov 2018 13:06:20 GMT
IGNITE-10365: MVCC: Create "Cache 6" test suite for MVCC mode. This closes #5478.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/74d342d6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/74d342d6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/74d342d6

Branch: refs/heads/master
Commit: 74d342d666bbe593b98224f0dc73d94bad885a32
Parents: 73f4f91
Author: Andrey V. Mashenkov <andrey.mashenkov@gmail.com>
Authored: Fri Nov 30 16:06:03 2018 +0300
Committer: Igor Seliverstov <gvvinblade@gmail.com>
Committed: Fri Nov 30 16:06:03 2018 +0300

----------------------------------------------------------------------
 .../CacheGetsDistributionAbstractTest.java      | 375 +++++++++++++++++++
 .../cache/CacheNoAffinityExchangeTest.java      |   8 +
 ...titionedAtomicCacheGetsDistributionTest.java |  24 +-
 ...cTxPessimisticCacheGetsDistributionTest.java |  32 ++
 ...onalOptimisticCacheGetsDistributionTest.java |  17 +-
 ...nalPessimisticCacheGetsDistributionTest.java |  24 +-
 ...plicatedAtomicCacheGetsDistributionTest.java | 329 +---------------
 ...cTxPessimisticCacheGetsDistributionTest.java |  32 ++
 ...onalOptimisticCacheGetsDistributionTest.java |   9 +-
 ...nalPessimisticCacheGetsDistributionTest.java |  24 +-
 .../distributed/CacheExchangeMergeTest.java     |   9 +-
 .../CacheTryLockMultithreadedTest.java          |   3 +
 .../distributed/IgniteCache150ClientsTest.java  |  10 +-
 .../IgniteCacheThreadLocalTxTest.java           |   4 +
 .../IgnitePessimisticTxSuspendResumeTest.java   |   5 +
 .../cache/transactions/TxLabelTest.java         |  23 +-
 .../cache/transactions/TxRollbackAsyncTest.java |  40 +-
 .../TxRollbackOnIncorrectParamsTest.java        |  17 +-
 .../transactions/TxRollbackOnTimeoutTest.java   |   9 +
 .../transactions/TxStateChangeEventTest.java    |  78 +++-
 .../testframework/MvccFeatureChecker.java       |   4 +
 .../testsuites/IgniteCacheMvccTestSuite6.java   |  94 +++++
 .../testsuites/IgniteCacheTestSuite6.java       |  83 ++--
 23 files changed, 807 insertions(+), 446 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetsDistributionAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetsDistributionAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetsDistributionAbstractTest.java
new file mode 100644
index 0000000..559a719
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGetsDistributionAbstractTest.java
@@ -0,0 +1,375 @@
+/*
+ * 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.internal.processors.cache;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.UUID;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.TransactionConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.util.lang.GridAbsPredicate;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.apache.ignite.transactions.Transaction;
+import org.apache.ignite.transactions.TransactionConcurrency;
+import org.apache.ignite.transactions.TransactionIsolation;
+
+import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
+import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
+import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
+import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
+
+/**
+ * Tests of replicated cache's 'get' requests distribution.
+ */
+public abstract class CacheGetsDistributionAbstractTest extends GridCommonAbstractTest {
+    /** Client nodes instance's name. */
+    private static final String CLIENT_NAME = "client";
+
+    /** Value prefix. */
+    private static final String VAL_PREFIX = "val";
+
+    /** */
+    private static final int PRIMARY_KEYS_NUMBER = 1_000;
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        assert gridCount() >= 1 : "At least one grid must be started";
+
+        startGridsMultiThreaded(gridCount());
+
+        IgniteConfiguration clientCfg = getConfiguration(CLIENT_NAME);
+
+        clientCfg.setClientMode(true);
+
+        startGrid(clientCfg);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+
+        super.afterTestsStopped();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        super.beforeTest();
+
+        IgniteCache cache = ignite(0).cache(DEFAULT_CACHE_NAME);
+
+        if (cache != null)
+            cache.destroy();
+
+        // Setting different MAC addresses for all nodes
+        Map<UUID, String> macs = getClusterMacs();
+
+        int idx = 0;
+
+        for (Map.Entry<UUID, String> entry : macs.entrySet())
+            entry.setValue("x2-xx-xx-xx-xx-x" + idx++);
+
+        replaceMacAddresses(G.allGrids(), macs);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+        TransactionConfiguration txCfg = new TransactionConfiguration()
+            .setDefaultTxIsolation(transactionIsolation())
+            .setDefaultTxConcurrency(transactionConcurrency());
+
+        cfg.setTransactionConfiguration(txCfg);
+
+        return cfg;
+    }
+
+    /**
+     * @return Grids count to start.
+     */
+    protected int gridCount() {
+        return 4;
+    }
+
+    /**
+     * @return Cache configuration.
+     */
+    protected <K, V> CacheConfiguration<K, V> cacheConfiguration() {
+        CacheConfiguration<K, V> ccfg = defaultCacheConfiguration();
+
+        ccfg.setCacheMode(cacheMode());
+        ccfg.setAtomicityMode(atomicityMode());
+        ccfg.setWriteSynchronizationMode(FULL_SYNC);
+        ccfg.setReadFromBackup(true);
+        ccfg.setStatisticsEnabled(true);
+
+        if (cacheMode() == CacheMode.PARTITIONED)
+            ccfg.setBackups(backupsCount());
+
+        return ccfg;
+    }
+
+    /**
+     * @return Cache mode.
+     */
+    protected abstract CacheMode cacheMode();
+
+    /**
+     * @return Cache atomicity mode.
+     */
+    protected abstract CacheAtomicityMode atomicityMode();
+
+    /**
+     * @return Cache transaction isolation.
+     */
+    protected TransactionIsolation transactionIsolation() {
+        return REPEATABLE_READ;
+    }
+
+    /**
+     * @return Cache transaction concurrency.
+     */
+    protected TransactionConcurrency transactionConcurrency() {
+        return PESSIMISTIC;
+    }
+
+    /**
+     * @return Backups count.
+     */
+    protected int backupsCount() {
+        return gridCount() - 1;
+    }
+
+    /**
+     * Test 'get' operations requests generator distribution.
+     *
+     * @throws Exception In case of an error.
+     * @see #runTestBalancingDistribution(boolean)
+     */
+    public void testGetRequestsGeneratorDistribution() throws Exception {
+        runTestBalancingDistribution(false);
+    }
+
+    /**
+     * Test 'getAll' operations requests generator distribution.
+     *
+     * @throws Exception In case of an error.
+     * @see #runTestBalancingDistribution(boolean)
+     */
+    public void testGetAllRequestsGeneratorDistribution() throws Exception {
+        runTestBalancingDistribution(true);
+    }
+
+    /**
+     * @param batchMode Whenever 'get' or 'getAll' operations are used in the test.
+     * @throws Exception In case of an error.
+     */
+    protected void runTestBalancingDistribution(boolean batchMode) throws Exception {
+        IgniteCache<Integer, String> cache = grid(0).createCache(cacheConfiguration());
+
+        List<Integer> keys = primaryKeys(cache, PRIMARY_KEYS_NUMBER);
+
+        for (Integer key : keys)
+            cache.put(key, VAL_PREFIX + key);
+
+        IgniteCache<Integer, String> clientCache = grid(CLIENT_NAME).cache(DEFAULT_CACHE_NAME)
+            .withAllowAtomicOpsInTx();
+
+        assertTrue(GridTestUtils.waitForCondition(
+            new GridAbsPredicate() {
+                int batchSize = 10;
+                int idx = 0;
+
+                @Override public boolean apply() {
+                    if (idx >= PRIMARY_KEYS_NUMBER)
+                        idx = 0;
+
+                    try (Transaction tx = grid(CLIENT_NAME).transactions().txStart()) {
+                        if (batchMode) {
+                            Set<Integer> keys0 = new TreeSet<>();
+
+                            for (int i = idx; i < idx + batchSize && i < PRIMARY_KEYS_NUMBER; i++)
+                                keys0.add(keys.get(i));
+
+                            idx += batchSize;
+
+                            Map<Integer, String> results = clientCache.getAll(keys0);
+
+                            for (Map.Entry<Integer, String> entry : results.entrySet())
+                                assertEquals(VAL_PREFIX + entry.getKey(), entry.getValue());
+                        }
+                        else {
+                            for (int i = idx; i < idx + gridCount() && i < PRIMARY_KEYS_NUMBER; i++) {
+                                Integer key = keys.get(i);
+
+                                assertEquals(VAL_PREFIX + key, clientCache.get(key));
+                            }
+
+                            idx += gridCount();
+                        }
+
+                        tx.commit();
+                    }
+
+                    for (int i = 0; i < gridCount(); i++) {
+                        IgniteEx ignite = grid(i);
+
+                        long getsCnt = ignite.cache(DEFAULT_CACHE_NAME).localMetrics().getCacheGets();
+
+                        if (getsCnt == 0)
+                            return false;
+                    }
+
+                    return true;
+                }
+            },
+            getTestTimeout())
+        );
+    }
+
+    /**
+     * Tests that the 'get' operation requests are routed to node with same MAC address as at requester.
+     *
+     * @throws Exception In case of an error.
+     * @see #runTestSameHostDistribution(UUID, boolean)
+     */
+    public void testGetRequestsDistribution() throws Exception {
+        UUID destId = grid(0).localNode().id();
+
+        runTestSameHostDistribution(destId, false);
+    }
+
+    /**
+     * Tests that the 'getAll' operation requests are routed to node with same MAC address as at requester.
+     *
+     * @throws Exception In case of an error.
+     * @see #runTestSameHostDistribution(UUID, boolean)
+     */
+    public void testGetAllRequestsDistribution() throws Exception {
+        UUID destId = grid(gridCount() - 1).localNode().id();
+
+        runTestSameHostDistribution(destId, true);
+    }
+
+    /**
+     * Tests that the 'get' and 'getAll' requests are routed to node with same MAC address as at requester.
+     *
+     * @param destId Destination Ignite instance id for requests distribution.
+     * @param batchMode Test mode.
+     * @throws Exception In case of an error.
+     */
+    protected void runTestSameHostDistribution(final UUID destId, final boolean batchMode) throws Exception {
+        Map<UUID, String> macs = getClusterMacs();
+
+        String clientMac = macs.get(grid(CLIENT_NAME).localNode().id());
+
+        macs.put(destId, clientMac);
+
+        replaceMacAddresses(G.allGrids(), macs);
+
+        IgniteCache<Integer, String> cache = grid(0).createCache(cacheConfiguration());
+
+        List<Integer> keys = primaryKeys(cache, PRIMARY_KEYS_NUMBER);
+
+        for (Integer key : keys)
+            cache.put(key, VAL_PREFIX + key);
+
+        IgniteCache<Integer, String> clientCache = grid(CLIENT_NAME).cache(DEFAULT_CACHE_NAME)
+            .withAllowAtomicOpsInTx();
+
+        try (Transaction tx = grid(CLIENT_NAME).transactions().txStart()) {
+            if (batchMode) {
+                Map<Integer, String> results = clientCache.getAll(new TreeSet<>(keys));
+
+                for (Map.Entry<Integer, String> entry : results.entrySet())
+                    assertEquals(VAL_PREFIX + entry.getKey(), entry.getValue());
+            }
+            else {
+                for (Integer key : keys)
+                    assertEquals(VAL_PREFIX + key, clientCache.get(key));
+            }
+
+            tx.commit();
+        }
+
+        for (int i = 0; i < gridCount(); i++) {
+            IgniteEx ignite = grid(i);
+
+            long getsCnt = ignite.cache(DEFAULT_CACHE_NAME).localMetrics().getCacheGets();
+
+            if (destId.equals(ignite.localNode().id()))
+                assertEquals(PRIMARY_KEYS_NUMBER, getsCnt);
+            else
+                assertEquals(0L, getsCnt);
+        }
+    }
+
+    /**
+     * @param instances Started Ignite instances.
+     * @param macs Mapping MAC addresses to UUID.
+     */
+    private void replaceMacAddresses(List<Ignite> instances, Map<UUID, String> macs) {
+        for (Ignite ignite : instances) {
+            for (ClusterNode node : ignite.cluster().nodes()) {
+                String mac = macs.get(node.id());
+
+                assertNotNull(mac);
+
+                Map<String, Object> attrs = new HashMap<>(node.attributes());
+
+                attrs.put(ATTR_MACS, mac);
+
+                ((TcpDiscoveryNode)node).setAttributes(attrs);
+            }
+        }
+    }
+
+    /**
+     * @return Cluster nodes MAC addresses.
+     */
+    private Map<UUID, String> getClusterMacs() {
+        Map<UUID, String> macs = new HashMap<>();
+
+        for (Ignite ignite : G.allGrids()) {
+            ClusterNode node = ignite.cluster().localNode();
+
+            String mac = node.attribute(ATTR_MACS);
+
+            assert mac != null;
+
+            macs.put(node.id(), mac);
+        }
+
+        return macs;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java
index 45c6f25..15cd5ee 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheNoAffinityExchangeTest.java
@@ -35,6 +35,7 @@ import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedM
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeFailedMessage;
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeLeftMessage;
 import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 /**
@@ -52,6 +53,13 @@ public class CacheNoAffinityExchangeTest extends GridCommonAbstractTest {
         .setAddresses(Collections.singleton("127.0.0.1:47500"));
 
     /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        MvccFeatureChecker.failIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
+
+        super.beforeTestsStarted();
+    }
+
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedAtomicCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedAtomicCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedAtomicCacheGetsDistributionTest.java
index 2241a95..963ccc8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedAtomicCacheGetsDistributionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedAtomicCacheGetsDistributionTest.java
@@ -17,33 +17,23 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.configuration.CacheConfiguration;
 
+import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 
 /**
  * Tests of partitioned atomic cache's 'get' requests distribution.
  */
-public class PartitionedAtomicCacheGetsDistributionTest extends ReplicatedAtomicCacheGetsDistributionTest {
+public class PartitionedAtomicCacheGetsDistributionTest extends CacheGetsDistributionAbstractTest {
     /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return PARTITIONED;
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return ATOMIC;
     }
 
     /** {@inheritDoc} */
-    @Override protected <K, V> CacheConfiguration<K, V> cacheConfiguration() {
-        CacheConfiguration<K, V> cacheCfg = super.cacheConfiguration();
-
-        cacheCfg.setBackups(backupsCount());
-
-        return cacheCfg;
-    }
-
-    /**
-     * @return Backups count.
-     */
-    protected int backupsCount() {
-        return gridCount() - 1;
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedMvccTxPessimisticCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedMvccTxPessimisticCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedMvccTxPessimisticCacheGetsDistributionTest.java
new file mode 100644
index 0000000..de9d9a6
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedMvccTxPessimisticCacheGetsDistributionTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.internal.processors.cache;
+
+import org.apache.ignite.transactions.TransactionIsolation;
+
+import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
+
+/**
+ * Tests of pessimistic transactional partitioned cache's 'get' requests distribution.
+ */
+public class PartitionedMvccTxPessimisticCacheGetsDistributionTest extends PartitionedTransactionalPessimisticCacheGetsDistributionTest {
+    /** {@inheritDoc} */
+    @Override protected TransactionIsolation transactionIsolation() {
+        return REPEATABLE_READ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalOptimisticCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalOptimisticCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalOptimisticCacheGetsDistributionTest.java
index 4c88229..e518e32 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalOptimisticCacheGetsDistributionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalOptimisticCacheGetsDistributionTest.java
@@ -18,29 +18,36 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
 import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
 
 /**
  * Tests of optimistic transactional partitioned cache's 'get' requests distribution.
  */
-public class PartitionedTransactionalOptimisticCacheGetsDistributionTest extends PartitionedAtomicCacheGetsDistributionTest {
+public class PartitionedTransactionalOptimisticCacheGetsDistributionTest extends CacheGetsDistributionAbstractTest {
     /** {@inheritDoc} */
-    @Override protected CacheAtomicityMode atomicityMode() {
-        return TRANSACTIONAL;
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
     }
 
     /** {@inheritDoc} */
-    @Override protected TransactionIsolation transactionIsolation() {
-        return READ_COMMITTED;
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
     }
 
     /** {@inheritDoc} */
     @Override protected TransactionConcurrency transactionConcurrency() {
         return OPTIMISTIC;
     }
+
+    /** {@inheritDoc} */
+    @Override protected TransactionIsolation transactionIsolation() {
+        return READ_COMMITTED;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalPessimisticCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalPessimisticCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalPessimisticCacheGetsDistributionTest.java
index 78ea7a6..ce1f7b6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalPessimisticCacheGetsDistributionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/PartitionedTransactionalPessimisticCacheGetsDistributionTest.java
@@ -17,17 +17,37 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.transactions.TransactionConcurrency;
+import org.apache.ignite.transactions.TransactionIsolation;
 
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
+import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
 
 /**
  * Tests of pessimistic transactional partitioned cache's 'get' requests distribution.
  */
-public class PartitionedTransactionalPessimisticCacheGetsDistributionTest
-    extends PartitionedTransactionalOptimisticCacheGetsDistributionTest {
+public class PartitionedTransactionalPessimisticCacheGetsDistributionTest extends CacheGetsDistributionAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+
     /** {@inheritDoc} */
     @Override protected TransactionConcurrency transactionConcurrency() {
         return PESSIMISTIC;
     }
+
+    /** {@inheritDoc} */
+    @Override protected TransactionIsolation transactionIsolation() {
+        return READ_COMMITTED;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedAtomicCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedAtomicCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedAtomicCacheGetsDistributionTest.java
index 1aaea76..ef90408e4a2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedAtomicCacheGetsDistributionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedAtomicCacheGetsDistributionTest.java
@@ -17,350 +17,23 @@
 
 package org.apache.ignite.internal.processors.cache;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.UUID;
-import org.apache.ignite.Ignite;
-import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.cache.CacheMode;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.TransactionConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.util.lang.GridAbsPredicate;
-import org.apache.ignite.internal.util.typedef.G;
-import org.apache.ignite.spi.discovery.tcp.internal.TcpDiscoveryNode;
-import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.transactions.Transaction;
-import org.apache.ignite.transactions.TransactionConcurrency;
-import org.apache.ignite.transactions.TransactionIsolation;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_MACS;
-import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
-import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
 
 /**
  * Tests of replicated cache's 'get' requests distribution.
  */
-public class ReplicatedAtomicCacheGetsDistributionTest extends GridCacheAbstractSelfTest {
-    /** Cache name. */
-    private static final String CACHE_NAME = "getsDistributionTest";
-
-    /** Client nodes instance's name. */
-    private static final String CLIENT_NAME = "client";
-
-    /** Value prefix. */
-    private static final String VAL_PREFIX = "val";
-
-    /** */
-    private static final int PRIMARY_KEYS_NUMBER = 1_000;
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        super.beforeTestsStarted();
-
-        IgniteConfiguration clientCfg = getConfiguration(CLIENT_NAME);
-
-        clientCfg.setClientMode(true);
-
-        startGrid(clientCfg);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        super.beforeTest();
-
-        IgniteCache cache = ignite(0).cache(CACHE_NAME);
-
-        if (cache != null)
-            cache.destroy();
-
-        // Setting different MAC addresses for all nodes
-        Map<UUID, String> macs = getClusterMacs();
-
-        int idx = 0;
-
-        for (Map.Entry<UUID, String> entry : macs.entrySet())
-            entry.setValue("x2-xx-xx-xx-xx-x" + idx++);
-
-        replaceMacAddresses(G.allGrids(), macs);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
-        cfg.setTransactionConfiguration(transactionConfiguration());
-
-        return cfg;
-    }
-
+public class ReplicatedAtomicCacheGetsDistributionTest extends CacheGetsDistributionAbstractTest {
     /** {@inheritDoc} */
     @Override protected CacheAtomicityMode atomicityMode() {
         return ATOMIC;
     }
 
     /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 4;
-    }
-
-    /**
-     * Test 'get' operations requests generator distribution.
-     *
-     * @throws Exception In case of an error.
-     * @see #runTestBalancingDistribution(boolean)
-     */
-    public void testGetRequestsGeneratorDistribution() throws Exception {
-        runTestBalancingDistribution(false);
-    }
-
-    /**
-     * Test 'getAll' operations requests generator distribution.
-     *
-     * @throws Exception In case of an error.
-     * @see #runTestBalancingDistribution(boolean)
-     */
-    public void testGetAllRequestsGeneratorDistribution() throws Exception {
-        runTestBalancingDistribution(true);
-    }
-
-    /**
-     * @param batchMode Whenever 'get' or 'getAll' operations are used in the test.
-     * @throws Exception In case of an error.
-     */
-    protected void runTestBalancingDistribution(boolean batchMode) throws Exception {
-        IgniteCache<Integer, String> cache = grid(0).createCache(cacheConfiguration());
-
-        List<Integer> keys = primaryKeys(cache, PRIMARY_KEYS_NUMBER);
-
-        for (Integer key : keys)
-            cache.put(key, VAL_PREFIX + key);
-
-        IgniteCache<Integer, String> clientCache = grid(CLIENT_NAME).getOrCreateCache(CACHE_NAME)
-            .withAllowAtomicOpsInTx();
-
-        assertTrue(GridTestUtils.waitForCondition(
-            new GridAbsPredicate() {
-                int batchSize = 10;
-                int idx = 0;
-
-                @Override public boolean apply() {
-                    if (idx >= PRIMARY_KEYS_NUMBER)
-                        idx = 0;
-
-                    try (Transaction tx = grid(CLIENT_NAME).transactions().txStart()) {
-                        if (batchMode) {
-                            Set<Integer> keys0 = new TreeSet<>();
-
-                            for (int i = idx; i < idx + batchSize && i < PRIMARY_KEYS_NUMBER; i++)
-                                keys0.add(keys.get(i));
-
-                            idx += batchSize;
-
-                            Map<Integer, String> results = clientCache.getAll(keys0);
-
-                            for (Map.Entry<Integer, String> entry : results.entrySet())
-                                assertEquals(VAL_PREFIX + entry.getKey(), entry.getValue());
-                        }
-                        else {
-                            for (int i = idx; i < idx + gridCount() && i < PRIMARY_KEYS_NUMBER; i++) {
-                                Integer key = keys.get(i);
-
-                                assertEquals(VAL_PREFIX + key, clientCache.get(key));
-                            }
-
-                            idx += gridCount();
-                        }
-
-                        tx.commit();
-                    }
-
-                    for (int i = 0; i < gridCount(); i++) {
-                        IgniteEx ignite = grid(i);
-
-                        long getsCnt = ignite.cache(CACHE_NAME).localMetrics().getCacheGets();
-
-                        if (getsCnt == 0)
-                            return false;
-                    }
-
-                    return true;
-                }
-            },
-            getTestTimeout())
-        );
-    }
-
-    /**
-     * Tests that the 'get' operation requests are routed to node with same MAC address as at requester.
-     *
-     * @throws Exception In case of an error.
-     * @see #runTestSameHostDistribution(UUID, boolean)
-     */
-    public void testGetRequestsDistribution() throws Exception {
-        UUID destId = grid(0).localNode().id();
-
-        runTestSameHostDistribution(destId, false);
-    }
-
-    /**
-     * Tests that the 'getAll' operation requests are routed to node with same MAC address as at requester.
-     *
-     * @throws Exception In case of an error.
-     * @see #runTestSameHostDistribution(UUID, boolean)
-     */
-    public void testGetAllRequestsDistribution() throws Exception {
-        UUID destId = grid(gridCount() - 1).localNode().id();
-
-        runTestSameHostDistribution(destId, true);
-    }
-
-    /**
-     * Tests that the 'get' and 'getAll' requests are routed to node with same MAC address as at requester.
-     *
-     * @param destId Destination Ignite instance id for requests distribution.
-     * @param batchMode Test mode.
-     * @throws Exception In case of an error.
-     */
-    protected void runTestSameHostDistribution(final UUID destId, final boolean batchMode) throws Exception {
-        Map<UUID, String> macs = getClusterMacs();
-
-        String clientMac = macs.get(grid(CLIENT_NAME).localNode().id());
-
-        macs.put(destId, clientMac);
-
-        replaceMacAddresses(G.allGrids(), macs);
-
-        IgniteCache<Integer, String> cache = grid(0).createCache(cacheConfiguration());
-
-        List<Integer> keys = primaryKeys(cache, PRIMARY_KEYS_NUMBER);
-
-        for (Integer key : keys)
-            cache.put(key, VAL_PREFIX + key);
-
-        IgniteCache<Integer, String> clientCache = grid(CLIENT_NAME).getOrCreateCache(CACHE_NAME)
-            .withAllowAtomicOpsInTx();
-
-        try (Transaction tx = grid(CLIENT_NAME).transactions().txStart()) {
-            if (batchMode) {
-                Map<Integer, String> results = clientCache.getAll(new TreeSet<>(keys));
-
-                for (Map.Entry<Integer, String> entry : results.entrySet())
-                    assertEquals(VAL_PREFIX + entry.getKey(), entry.getValue());
-            }
-            else {
-                for (Integer key : keys)
-                    assertEquals(VAL_PREFIX + key, clientCache.get(key));
-            }
-
-            tx.commit();
-        }
-
-        for (int i = 0; i < gridCount(); i++) {
-            IgniteEx ignite = grid(i);
-
-            long getsCnt = ignite.cache(CACHE_NAME).localMetrics().getCacheGets();
-
-            if (destId.equals(ignite.localNode().id()))
-                assertEquals(PRIMARY_KEYS_NUMBER, getsCnt);
-            else
-                assertEquals(0L, getsCnt);
-        }
-    }
-
-    /**
-     * @return Transaction configuration.
-     */
-    protected TransactionConfiguration transactionConfiguration() {
-        TransactionConfiguration txCfg = new TransactionConfiguration();
-
-        txCfg.setDefaultTxIsolation(transactionIsolation());
-        txCfg.setDefaultTxConcurrency(transactionConcurrency());
-
-        return txCfg;
-    }
-
-    /**
-     * @return Cache transaction isolation.
-     */
-    protected TransactionIsolation transactionIsolation() {
-        return REPEATABLE_READ;
-    }
-
-    /**
-     * @return Cache transaction concurrency.
-     */
-    protected TransactionConcurrency transactionConcurrency() {
-        return PESSIMISTIC;
-    }
-
-    /**
-     * @return Caching mode.
-     */
     @Override protected CacheMode cacheMode() {
         return REPLICATED;
     }
-
-    /**
-     * @return Cache configuration.
-     */
-    protected <K, V> CacheConfiguration<K, V> cacheConfiguration() {
-        CacheConfiguration<K, V> cfg = new CacheConfiguration<K, V>(CACHE_NAME);
-
-        cfg.setCacheMode(cacheMode());
-        cfg.setAtomicityMode(atomicityMode());
-        cfg.setWriteSynchronizationMode(FULL_SYNC);
-        cfg.setReadFromBackup(true);
-        cfg.setStatisticsEnabled(true);
-
-        return cfg;
-    }
-
-    /**
-     * @param instances Started Ignite instances.
-     * @param macs Mapping MAC addresses to UUID.
-     */
-    private void replaceMacAddresses(List<Ignite> instances, Map<UUID, String> macs) {
-        for (Ignite ignite : instances) {
-            for (ClusterNode node : ignite.cluster().nodes()) {
-                String mac = macs.get(node.id());
-
-                assertNotNull(mac);
-
-                Map<String, Object> attrs = new HashMap<>(node.attributes());
-
-                attrs.put(ATTR_MACS, mac);
-
-                ((TcpDiscoveryNode)node).setAttributes(attrs);
-            }
-        }
-    }
-
-    /**
-     * @return Cluster nodes MAC addresses.
-     */
-    private Map<UUID, String> getClusterMacs() {
-        Map<UUID, String> macs = new HashMap<>();
-
-        for (Ignite ignite : G.allGrids()) {
-            ClusterNode node = ignite.cluster().localNode();
-
-            String mac = node.attribute(ATTR_MACS);
-
-            assert mac != null;
-
-            macs.put(node.id(), mac);
-        }
-
-        return macs;
-    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedMvccTxPessimisticCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedMvccTxPessimisticCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedMvccTxPessimisticCacheGetsDistributionTest.java
new file mode 100644
index 0000000..6e2d67c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedMvccTxPessimisticCacheGetsDistributionTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.internal.processors.cache;
+
+import org.apache.ignite.transactions.TransactionIsolation;
+
+import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
+
+/**
+ * Tests of pessimistic transactional replicated cache's 'get' requests distribution.
+ */
+public class ReplicatedMvccTxPessimisticCacheGetsDistributionTest extends ReplicatedTransactionalPessimisticCacheGetsDistributionTest {
+    /** {@inheritDoc} */
+    @Override protected TransactionIsolation transactionIsolation() {
+        return REPEATABLE_READ;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalOptimisticCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalOptimisticCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalOptimisticCacheGetsDistributionTest.java
index 3bc6809..4744f0a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalOptimisticCacheGetsDistributionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalOptimisticCacheGetsDistributionTest.java
@@ -18,17 +18,24 @@
 package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.transactions.TransactionConcurrency;
 import org.apache.ignite.transactions.TransactionIsolation;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
 import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
 
 /**
  * Tests of optimistic transactional replicated cache's 'get' requests distribution.
  */
-public class ReplicatedTransactionalOptimisticCacheGetsDistributionTest extends ReplicatedAtomicCacheGetsDistributionTest {
+public class ReplicatedTransactionalOptimisticCacheGetsDistributionTest extends CacheGetsDistributionAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return REPLICATED;
+    }
+
     /** {@inheritDoc} */
     @Override protected CacheAtomicityMode atomicityMode() {
         return TRANSACTIONAL;

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalPessimisticCacheGetsDistributionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalPessimisticCacheGetsDistributionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalPessimisticCacheGetsDistributionTest.java
index 7bace3c..2648851 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalPessimisticCacheGetsDistributionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/ReplicatedTransactionalPessimisticCacheGetsDistributionTest.java
@@ -17,17 +17,37 @@
 
 package org.apache.ignite.internal.processors.cache;
 
+import org.apache.ignite.cache.CacheAtomicityMode;
+import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.transactions.TransactionConcurrency;
+import org.apache.ignite.transactions.TransactionIsolation;
 
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
+import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
 
 /**
  * Tests of pessimistic transactional replicated cache's 'get' requests distribution.
  */
-public class ReplicatedTransactionalPessimisticCacheGetsDistributionTest
-    extends ReplicatedTransactionalOptimisticCacheGetsDistributionTest {
+public class ReplicatedTransactionalPessimisticCacheGetsDistributionTest extends CacheGetsDistributionAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return REPLICATED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicityMode atomicityMode() {
+        return TRANSACTIONAL;
+    }
+
     /** {@inheritDoc} */
     @Override protected TransactionConcurrency transactionConcurrency() {
         return PESSIMISTIC;
     }
+
+    /** {@inheritDoc} */
+    @Override protected TransactionIsolation transactionIsolation() {
+        return READ_COMMITTED;
+    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
index 2dad0b5..9cd2489 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheExchangeMergeTest.java
@@ -79,6 +79,7 @@ import org.apache.ignite.transactions.TransactionIsolation;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_EXCHANGE_HISTORY_SIZE;
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
+import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL_SNAPSHOT;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
@@ -149,7 +150,12 @@ public class CacheExchangeMergeTest extends GridCommonAbstractTest {
                 cacheConfiguration("c7", TRANSACTIONAL, PARTITIONED, 1),
                 cacheConfiguration("c8", TRANSACTIONAL, PARTITIONED, 2),
                 cacheConfiguration("c9", TRANSACTIONAL, PARTITIONED, 10),
-                cacheConfiguration("c10", TRANSACTIONAL, REPLICATED, 0)
+                cacheConfiguration("c10", TRANSACTIONAL, REPLICATED, 0),
+                cacheConfiguration("c11", TRANSACTIONAL_SNAPSHOT, PARTITIONED, 0),
+                cacheConfiguration("c12", TRANSACTIONAL_SNAPSHOT, PARTITIONED, 1),
+                cacheConfiguration("c13", TRANSACTIONAL_SNAPSHOT, PARTITIONED, 2),
+                cacheConfiguration("c14", TRANSACTIONAL_SNAPSHOT, PARTITIONED, 10),
+                cacheConfiguration("c15", TRANSACTIONAL_SNAPSHOT, REPLICATED, 0)
             );
         }
 
@@ -825,7 +831,6 @@ public class CacheExchangeMergeTest extends GridCommonAbstractTest {
         mergeServersAndClientsFail(true);
     }
 
-
     /**
      * @param waitRebalance Wait for rebalance end before start tested topology change.
      * @throws Exception If failed.

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheTryLockMultithreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheTryLockMultithreadedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheTryLockMultithreadedTest.java
index 82d9c12..bccc703 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheTryLockMultithreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheTryLockMultithreadedTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -68,6 +69,8 @@ public class CacheTryLockMultithreadedTest extends GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {
+        MvccFeatureChecker.failIfNotSupported(MvccFeatureChecker.Feature.ENTRY_LOCK);
+
         super.beforeTestsStarted();
 
         startGridsMultiThreaded(SRVS);

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCache150ClientsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCache150ClientsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCache150ClientsTest.java
index b7ae844..6230501 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCache150ClientsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCache150ClientsTest.java
@@ -25,6 +25,7 @@ import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.ClientConnectorConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
@@ -37,8 +38,6 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
-import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
 
@@ -52,6 +51,9 @@ public class IgniteCache150ClientsTest extends GridCommonAbstractTest {
     /** */
     private static final int CACHES = 10;
 
+    /** */
+    private static final int CLIENTS = 150;
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
@@ -80,7 +82,7 @@ public class IgniteCache150ClientsTest extends GridCommonAbstractTest {
             CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
 
             ccfg.setCacheMode(PARTITIONED);
-            ccfg.setAtomicityMode(i % 2 == 0 ? ATOMIC : TRANSACTIONAL);
+            ccfg.setAtomicityMode(CacheAtomicityMode.values()[i % 3]);
             ccfg.setWriteSynchronizationMode(PRIMARY_SYNC);
             ccfg.setBackups(1);
 
@@ -114,8 +116,6 @@ public class IgniteCache150ClientsTest extends GridCommonAbstractTest {
 
         assertFalse(srv.configuration().isClientMode());
 
-        final int CLIENTS = 150;
-
         final AtomicInteger idx = new AtomicInteger(1);
 
         final CountDownLatch latch = new CountDownLatch(CLIENTS);

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheThreadLocalTxTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheThreadLocalTxTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheThreadLocalTxTest.java
index c8eac20..cab6c72 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheThreadLocalTxTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheThreadLocalTxTest.java
@@ -29,6 +29,7 @@ import org.apache.ignite.lang.IgniteFuture;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
@@ -106,6 +107,9 @@ public class IgniteCacheThreadLocalTxTest extends GridCommonAbstractTest {
 
         for (TransactionConcurrency concurrency : TransactionConcurrency.values()) {
             for (TransactionIsolation isolation : TransactionIsolation.values()) {
+                if (MvccFeatureChecker.forcedMvcc() && !MvccFeatureChecker.isSupported(concurrency, isolation))
+                    continue;
+
                 for (boolean read : reads) {
                     for (boolean write : writes) {
                         for (int i = 0; i < endOps; i++)

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgnitePessimisticTxSuspendResumeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgnitePessimisticTxSuspendResumeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgnitePessimisticTxSuspendResumeTest.java
index 57a1470..dba769d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgnitePessimisticTxSuspendResumeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgnitePessimisticTxSuspendResumeTest.java
@@ -24,6 +24,7 @@ import org.apache.ignite.IgniteTransactions;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
@@ -70,6 +71,10 @@ public class IgnitePessimisticTxSuspendResumeTest extends GridCommonAbstractTest
             IgniteTransactions txs = g.transactions();
 
             for (TransactionIsolation isolation : TransactionIsolation.values()) {
+                if (MvccFeatureChecker.forcedMvcc() &&
+                    !MvccFeatureChecker.isSupported(TransactionConcurrency.PESSIMISTIC, isolation))
+                    continue;
+
                 final Transaction tx = txs.txStart(TransactionConcurrency.PESSIMISTIC, isolation);
 
                 cache.put(1, "1");

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxLabelTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxLabelTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxLabelTest.java
index d89ba0b..50b107d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxLabelTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxLabelTest.java
@@ -18,13 +18,27 @@
 package org.apache.ignite.internal.processors.cache.transactions;
 
 import org.apache.ignite.Ignite;
-import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 
 /**
  * Tests transaction labels.
  */
-public class TxLabelTest extends GridCacheAbstractSelfTest {
+public class TxLabelTest extends GridCommonAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        startGrid(0).getOrCreateCache(defaultCacheConfiguration());
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+
+        super.afterTestsStopped();
+    }
+
     /**
      * Tests transaction labels.
      */
@@ -55,9 +69,4 @@ public class TxLabelTest extends GridCacheAbstractSelfTest {
             tx.commit();
         }
     }
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 1;
-    }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java
index e5e35b8..612d6ce 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackAsyncTest.java
@@ -81,6 +81,7 @@ import org.apache.ignite.plugin.extensions.communication.Message;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils.SF;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
@@ -124,6 +125,14 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
     public static final String LABEL = "wLockTx";
 
     /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        if (MvccFeatureChecker.forcedMvcc())
+            fail("https://issues.apache.org/jira/browse/IGNITE-10410");
+
+        super.beforeTestsStarted();
+    }
+
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
@@ -165,10 +174,11 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
     }
 
     /**
-     *
      * @return {@code True} if persistence must be enabled for test.
      */
-    protected boolean persistenceEnabled() { return false; }
+    protected boolean persistenceEnabled() {
+        return false;
+    }
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
@@ -339,14 +349,13 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
     }
 
     /**
-     *
      * @param holdLockNode Node holding the write lock.
      * @param tryLockNode Node trying to acquire lock.
      * @param useTimeout {@code True} if need to start tx with timeout.
-     *
      * @throws Exception If failed.
      */
-    private void testSynchronousRollback0(Ignite holdLockNode, final Ignite tryLockNode, final boolean useTimeout) throws Exception {
+    private void testSynchronousRollback0(Ignite holdLockNode, final Ignite tryLockNode,
+        final boolean useTimeout) throws Exception {
         final CountDownLatch keyLocked = new CountDownLatch(1);
 
         CountDownLatch waitCommit = new CountDownLatch(1);
@@ -409,7 +418,7 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
 
                 int proc = 1;
 
-                while(true) {
+                while (true) {
                     try {
                         Transaction tx = txReadyFut.get();
 
@@ -490,11 +499,11 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
         testEnlistMany(true, SERIALIZABLE, OPTIMISTIC);
     }
 
-
     /**
      *
      */
-    private void testEnlistMany(boolean write, TransactionIsolation isolation, TransactionConcurrency conc) throws Exception {
+    private void testEnlistMany(boolean write, TransactionIsolation isolation,
+        TransactionConcurrency conc) throws Exception {
         final Ignite client = startClient();
 
         Map<Integer, Integer> entries = new HashMap<>();
@@ -504,7 +513,7 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
 
         IgniteInternalFuture<?> fut = null;
 
-        try(Transaction tx = client.transactions().txStart(conc, isolation, 0, 0)) {
+        try (Transaction tx = client.transactions().txStart(conc, isolation, 0, 0)) {
             fut = rollbackAsync(tx, 200);
 
             if (write)
@@ -549,7 +558,7 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
             }
         }, "tx-rollback-thread");
 
-        try(final Transaction tx = client.transactions().txStart()) {
+        try (final Transaction tx = client.transactions().txStart()) {
             client.cache(CACHE_NAME).put(0, 0);
 
             fail();
@@ -608,7 +617,7 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
             }
         }, "tx-rollback-thread");
 
-        try(final Transaction tx = client.transactions().txStart()) {
+        try (final Transaction tx = client.transactions().txStart()) {
             txRef.set(tx);
 
             client.cache(CACHE_NAME).put(0, 0);
@@ -757,7 +766,7 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
                 Transaction tx;
 
                 // Rollback all transaction
-                while((tx = nodeQ.poll()) != null) {
+                while ((tx = nodeQ.poll()) != null) {
                     rolledBack.increment();
 
                     doSleep(r.nextInt(50)); // Add random sleep to increase completed txs count.
@@ -791,7 +800,7 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
         for (BlockingQueue<Transaction> queue : perNodeTxs.values()) {
             Transaction tx;
 
-            while((tx = queue.poll()) != null) {
+            while ((tx = queue.poll()) != null) {
                 rolledBack.increment();
 
                 rollbackClo.apply(tx);
@@ -940,12 +949,12 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
             @Override public boolean apply(Event evt) {
                 runAsync(new Runnable() {
                     @Override public void run() {
-                        try(Transaction tx = crd.transactions().withLabel("testLbl").txStart()) {
+                        try (Transaction tx = crd.transactions().withLabel("testLbl").txStart()) {
                             // Wait for node start.
                             waitForCondition(new GridAbsPredicate() {
                                 @Override public boolean apply() {
                                     return crd.cluster().topologyVersion() != GRID_CNT +
-                                        /** client node */ 1  + /** stop server node */ 1 + /** start server node */ 1;
+                                        /** client node */1 + /** stop server node */1 + /** start server node */1;
                                 }
                             }, 10_000);
 
@@ -1021,7 +1030,6 @@ public class TxRollbackAsyncTest extends GridCommonAbstractTest {
      * @param keyLocked Latch for notifying until key is locked.
      * @param waitCommit Latch for waiting until commit is allowed.
      * @param timeout Timeout.
-     *
      * @return tx completion future.
      */
     private IgniteInternalFuture<?> lockInTx(final Ignite node, final CountDownLatch keyLocked,

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnIncorrectParamsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnIncorrectParamsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnIncorrectParamsTest.java
index 8aafa8b..75b7625 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnIncorrectParamsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnIncorrectParamsTest.java
@@ -28,6 +28,7 @@ import org.apache.ignite.events.TransactionStateChangedEvent;
 import org.apache.ignite.lang.IgniteBiPredicate;
 import org.apache.ignite.lang.IgnitePredicate;
 import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
@@ -39,6 +40,14 @@ import static org.apache.ignite.events.EventType.EVT_TX_STARTED;
  * Tests transaction rollback on incorrect tx params.
  */
 public class TxRollbackOnIncorrectParamsTest extends GridCommonAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        if (MvccFeatureChecker.forcedMvcc())
+            fail("https://issues.apache.org/jira/browse/IGNITE-10415");
+
+        super.beforeTestsStarted();
+    }
+
     /**
      *
      */
@@ -61,14 +70,14 @@ public class TxRollbackOnIncorrectParamsTest extends GridCommonAbstractTest {
         IgniteCache cache = ignite.getOrCreateCache(defaultCacheConfiguration());
 
         try (Transaction tx = ignite.transactions().txStart(
-            TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ, 200, 2)) {
+            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ, 200, 2)) {
             cache.put(1, 1);
 
             tx.commit();
         }
 
         try (Transaction tx = ignite.transactions().txStart(
-            TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ, 100, 2)) {
+            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ, 100, 2)) {
             cache.put(1, 2);
 
             tx.commit();
@@ -216,14 +225,14 @@ public class TxRollbackOnIncorrectParamsTest extends GridCommonAbstractTest {
             EVT_TX_STARTED);
 
         try (Transaction tx = ignite.transactions().txStart(
-            TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ, 100, 2)) {
+            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ, 100, 2)) {
             cacheLocal.put(1, 1);
 
             tx.commit();
         }
 
         try (Transaction tx = remote.transactions().txStart(
-            TransactionConcurrency.OPTIMISTIC, TransactionIsolation.REPEATABLE_READ, 100, 2)) {
+            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ, 100, 2)) {
             cacheRemote.put(1, 2);
 
             tx.commit();

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
index 61e39ff..0ae15b0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxRollbackOnTimeoutTest.java
@@ -57,6 +57,7 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
 import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.GridTestUtils.SF;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
@@ -94,6 +95,14 @@ public class TxRollbackOnTimeoutTest extends GridCommonAbstractTest {
     private static final int GRID_CNT = 3;
 
     /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        if (MvccFeatureChecker.forcedMvcc())
+            fail("https://issues.apache.org/jira/browse/IGNITE-7388");
+
+        super.beforeTestsStarted();
+    }
+
+    /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxStateChangeEventTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxStateChangeEventTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxStateChangeEventTest.java
index 01c87ae..446609f 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxStateChangeEventTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/transactions/TxStateChangeEventTest.java
@@ -21,10 +21,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
 import org.apache.ignite.IgniteEvents;
+import org.apache.ignite.IgniteTransactions;
+import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.events.Event;
 import org.apache.ignite.events.TransactionStateChangedEvent;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgnitePredicate;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.apache.ignite.transactions.Transaction;
 import org.apache.ignite.transactions.TransactionConcurrency;
@@ -67,20 +71,20 @@ public class TxStateChangeEventTest extends GridCommonAbstractTest {
      *
      */
     public void testLocal() throws Exception {
-        test(true);
+        check(true);
     }
 
     /**
      *
      */
     public void testRemote() throws Exception {
-        test(false);
+        check(false);
     }
 
     /**
      *
      */
-    private void test(boolean loc) throws Exception {
+    private void check(boolean loc) throws Exception {
         Ignite ignite = startGrids(5);
 
         final IgniteEvents evts = loc ? ignite.events() : grid(3).events();
@@ -104,27 +108,51 @@ public class TxStateChangeEventTest extends GridCommonAbstractTest {
                 },
                 EVTS_TX);
 
-        IgniteCache cache = ignite.getOrCreateCache(defaultCacheConfiguration().setBackups(2));
+        IgniteTransactions txs = ignite.transactions();
 
-        // create & commit
-        try (Transaction tx = ignite.transactions().withLabel(lb).txStart(
-            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.SERIALIZABLE, timeout, 3)) {
-            cache.put(1, 1);
+        IgniteCache<Integer, Integer> cache = ignite.getOrCreateCache(getCacheConfig());
 
-            tx.commit();
+        checkCommit(txs, cache);
+
+        if (!MvccFeatureChecker.forcedMvcc())
+            checkSuspendResume(txs, cache);
+
+        checkRollback(txs, cache);
+    }
+
+    /** */
+    @SuppressWarnings("unchecked")
+    private CacheConfiguration<Integer, Integer> getCacheConfig() {
+        return defaultCacheConfiguration().setBackups(2);
+    }
+
+    /**
+     * @param txs Transaction manager.
+     * @param cache Ignite cache.
+     */
+    private void checkRollback(IgniteTransactions txs, IgniteCache<Integer, Integer> cache) {
+        // create & rollback (pessimistic)
+        try (Transaction tx = txs.withLabel(lb).txStart(
+            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ, timeout, 3)) {
+            cache.put(4, 5);
         }
 
         assertTrue(
             creation.get() &&
-                commit.get() &&
-                !rollback.get() &&
+                !commit.get() &&
+                rollback.get() &&
                 !suspend.get() &&
                 !resume.get());
+    }
 
-        clear();
-
+    /**
+     * @param txs Transaction manager.
+     * @param cache Ignite cache.
+     */
+    private void checkSuspendResume(IgniteTransactions txs,
+        IgniteCache<Integer, Integer> cache) throws IgniteInterruptedCheckedException {
         // create & suspend & resume & commit
-        try (Transaction tx = ignite.transactions().withLabel(lb).txStart(
+        try (Transaction tx = txs.withLabel(lb).txStart(
             TransactionConcurrency.OPTIMISTIC, TransactionIsolation.SERIALIZABLE, timeout, 3)) {
             cache.put(2, 7);
 
@@ -145,19 +173,29 @@ public class TxStateChangeEventTest extends GridCommonAbstractTest {
                 resume.get());
 
         clear();
+    }
 
-        // create & rollback (pessimistic)
-        try (Transaction tx = ignite.transactions().withLabel(lb).txStart(
-            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.SERIALIZABLE, timeout, 3)) {
-            cache.put(4, 5);
+    /**
+     * @param txs Transaction manager.
+     * @param cache Ignite cache.
+     */
+    private void checkCommit(IgniteTransactions txs, IgniteCache<Integer, Integer> cache) {
+        // create & commit
+        try (Transaction tx = txs.withLabel(lb).txStart(
+            TransactionConcurrency.PESSIMISTIC, TransactionIsolation.REPEATABLE_READ, timeout, 3)) {
+            cache.put(1, 1);
+
+            tx.commit();
         }
 
         assertTrue(
             creation.get() &&
-                !commit.get() &&
-                rollback.get() &&
+                commit.get() &&
+                !rollback.get() &&
                 !suspend.get() &&
                 !resume.get());
+
+        clear();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java b/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java
index 2ea77b4..07947a9 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/MvccFeatureChecker.java
@@ -42,6 +42,7 @@ public class MvccFeatureChecker {
         CACHE_EVENTS,
         EVICTION,
         EXPIRATION,
+        METRICS
         INTERCEPTOR
     }
 
@@ -134,6 +135,9 @@ public class MvccFeatureChecker {
             case EXPIRATION:
                 fail("https://issues.apache.org/jira/browse/IGNITE-7311");
 
+            case METRICS:
+                fail("https://issues.apache.org/jira/browse/IGNITE-9224");
+
             case INTERCEPTOR:
                 fail("https://issues.apache.org/jira/browse/IGNITE-9323");
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/74d342d6/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java
new file mode 100644
index 0000000..688c572
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheMvccTestSuite6.java
@@ -0,0 +1,94 @@
+/*
+ * 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.testsuites;
+
+import java.util.HashSet;
+import java.util.Set;
+import junit.framework.TestSuite;
+import org.apache.ignite.IgniteSystemProperties;
+import org.apache.ignite.internal.processors.cache.PartitionedAtomicCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.PartitionedMvccTxPessimisticCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.PartitionedTransactionalOptimisticCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.PartitionedTransactionalPessimisticCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.PartitionsExchangeCoordinatorFailoverTest;
+import org.apache.ignite.internal.processors.cache.ReplicatedAtomicCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.ReplicatedMvccTxPessimisticCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.ReplicatedTransactionalOptimisticCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.ReplicatedTransactionalPessimisticCacheGetsDistributionTest;
+import org.apache.ignite.internal.processors.cache.datastructures.IgniteExchangeLatchManagerCoordinatorFailTest;
+import org.apache.ignite.internal.processors.cache.distributed.CacheExchangeMergeTest;
+import org.apache.ignite.internal.processors.cache.distributed.CacheParallelStartTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteCache150ClientsTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteOptimisticTxSuspendResumeMultiServerTest;
+import org.apache.ignite.internal.processors.cache.distributed.IgniteOptimisticTxSuspendResumeTest;
+import org.apache.ignite.internal.processors.cache.transactions.TxOptimisticOnPartitionExchangeTest;
+import org.apache.ignite.internal.processors.cache.transactions.TxOptimisticPrepareOnUnstableTopologyTest;
+import org.apache.ignite.internal.processors.cache.transactions.TxRollbackOnTimeoutOnePhaseCommitTest;
+import org.apache.ignite.internal.processors.cache.transactions.TxStateChangeEventTest;
+
+/**
+ * Test suite.
+ */
+public class IgniteCacheMvccTestSuite6 extends TestSuite {
+    /**
+     * @return IgniteCache test suite.
+     */
+    public static TestSuite suite() {
+        System.setProperty(IgniteSystemProperties.IGNITE_FORCE_MVCC_MODE_IN_TESTS, "true");
+
+        Set<Class> ignoredTests = new HashSet<>();
+
+        // Skip classes that already contains Mvcc tests
+        ignoredTests.add(TxStateChangeEventTest.class);
+
+        // Atomic cache tests.
+        ignoredTests.add(ReplicatedAtomicCacheGetsDistributionTest.class);
+        ignoredTests.add(PartitionedAtomicCacheGetsDistributionTest.class);
+
+        // Irrelevant Tx tests.
+        ignoredTests.add(IgniteOptimisticTxSuspendResumeTest.class);
+        ignoredTests.add(IgniteOptimisticTxSuspendResumeMultiServerTest.class);
+        ignoredTests.add(TxOptimisticPrepareOnUnstableTopologyTest.class);
+        ignoredTests.add(ReplicatedTransactionalOptimisticCacheGetsDistributionTest.class);
+        ignoredTests.add(PartitionedTransactionalOptimisticCacheGetsDistributionTest.class);
+        ignoredTests.add(TxOptimisticOnPartitionExchangeTest.class);
+
+        ignoredTests.add(TxRollbackOnTimeoutOnePhaseCommitTest.class);
+
+        // Other non-tx tests.
+        ignoredTests.add(CacheExchangeMergeTest.class);
+        ignoredTests.add(IgniteExchangeLatchManagerCoordinatorFailTest.class);
+        ignoredTests.add(PartitionsExchangeCoordinatorFailoverTest.class);
+        ignoredTests.add(CacheParallelStartTest.class);
+        ignoredTests.add(IgniteCache150ClientsTest.class);
+
+        // Skip tests that has Mvcc clones.
+        ignoredTests.add(PartitionedTransactionalPessimisticCacheGetsDistributionTest.class); // See PartitionedMvccTxPessimisticCacheGetsDistributionTest.
+        ignoredTests.add(ReplicatedTransactionalPessimisticCacheGetsDistributionTest.class); //See ReplicatedMvccTxPessimisticCacheGetsDistributionTest
+
+        TestSuite suite = new TestSuite("IgniteCache Mvcc Test Suite part 6");
+
+        suite.addTest(IgniteCacheTestSuite6.suite(ignoredTests));
+
+        // Add mvcc versions for skipped tests.
+        suite.addTestSuite(PartitionedMvccTxPessimisticCacheGetsDistributionTest.class);
+        suite.addTestSuite(ReplicatedMvccTxPessimisticCacheGetsDistributionTest.class);
+
+        return suite;
+    }
+}


Mime
View raw message