ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [23/53] [abbrv] [partial] incubator-ignite git commit: # ignite-164 : GridAbstractTest -> IgniteAbstractTest - auto-renaming with all suggested options + rename all methods and fields inside AbstractTest
Date Wed, 04 Feb 2015 14:37:57 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
deleted file mode 100644
index c413403..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentSelfTest.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * 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.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.marshaller.optimized.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-import org.apache.ignite.transactions.*;
-
-import java.lang.reflect.*;
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CachePreloadMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-import static org.apache.ignite.configuration.IgniteDeploymentMode.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-
-/**
- * Cache + Deployment test.
- */
-public class GridCacheDeploymentSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Name for grid without cache. */
-    private static final String GRID_NAME = "grid-no-cache";
-
-    /** First test task name. */
-    private static final String TEST_TASK_1 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask1";
-
-    /** Second test task name. */
-    private static final String TEST_TASK_2 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask2";
-
-    /** Third test task name. */
-    private static final String TEST_TASK_3 = "org.apache.ignite.tests.p2p.CacheDeploymentTestTask3";
-
-    /** Test value 1. */
-    private static final String TEST_KEY = "org.apache.ignite.tests.p2p.CacheDeploymentTestKey";
-
-    /** Test value 1. */
-    private static final String TEST_VALUE_1 = "org.apache.ignite.tests.p2p.CacheDeploymentTestValue";
-
-    /** Test value 2. */
-    private static final String TEST_VALUE_2 = "org.apache.ignite.tests.p2p.CacheDeploymentTestValue2";
-
-    /** */
-    private IgniteDeploymentMode depMode;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setDeploymentMode(depMode);
-
-        if (GRID_NAME.equals(gridName))
-            cfg.setCacheConfiguration();
-        else
-            cfg.setCacheConfiguration(cacheConfiguration());
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        cfg.setRestEnabled(false);
-
-        cfg.setMarshaller(new IgniteOptimizedMarshaller(false));
-
-        return cfg;
-    }
-
-    /**
-     * @return Cache configuration.
-     * @throws Exception In case of error.
-     */
-    protected CacheConfiguration cacheConfiguration() throws Exception {
-        CacheConfiguration cfg = defaultCacheConfiguration();
-
-        cfg.setCacheMode(PARTITIONED);
-        cfg.setWriteSynchronizationMode(FULL_SYNC);
-        cfg.setPreloadMode(SYNC);
-        cfg.setStoreValueBytes(true);
-        cfg.setAtomicityMode(TRANSACTIONAL);
-        cfg.setDistributionMode(NEAR_PARTITIONED);
-        cfg.setBackups(1);
-
-        return cfg;
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("unchecked")
-    public void testDeployment() throws Exception {
-        try {
-            depMode = CONTINUOUS;
-
-            Ignite g1 = startGrid(1);
-            Ignite g2 = startGrid(2);
-
-            Ignite g0 = startGrid(GRID_NAME);
-
-            ClassLoader ldr = getExternalClassLoader();
-
-            Class cls = ldr.loadClass(TEST_TASK_1);
-
-            g0.compute().execute(cls, g1.cluster().localNode());
-
-            cls = ldr.loadClass(TEST_TASK_2);
-
-            g0.compute().execute(cls, g2.cluster().localNode());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("unchecked")
-    public void testDeployment2() throws Exception {
-        try {
-            depMode = CONTINUOUS;
-
-            Ignite g1 = startGrid(1);
-            Ignite g2 = startGrid(2);
-
-            Ignite g0 = startGrid(GRID_NAME);
-
-            ClassLoader ldr = getExternalClassLoader();
-
-            Class cls = ldr.loadClass(TEST_TASK_3);
-
-            String key = "";
-
-            for (int i = 0; i < 1000; i++) {
-                key = "1" + i;
-
-                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()))
-                    break;
-            }
-
-            g0.compute().execute(cls, new T2<>(g1.cluster().localNode(), key));
-
-            cls = ldr.loadClass(TEST_TASK_2);
-
-            g0.compute().execute(cls, g2.cluster().localNode());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("unchecked")
-    public void testDeployment3() throws Exception {
-        try {
-            depMode = SHARED;
-
-            Ignite g1 = startGrid(1);
-            Ignite g2 = startGrid(2);
-
-            Ignite g0 = startGrid(GRID_NAME);
-
-            ClassLoader ldr = getExternalClassLoader();
-
-            Class cls = ldr.loadClass(TEST_TASK_3);
-
-            String key = "";
-
-            for (int i = 0; i < 1000; i++) {
-                key = "1" + i;
-
-                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()))
-                    break;
-            }
-
-            g0.compute().execute(cls, new T2<>(g1.cluster().localNode(), key));
-
-            stopGrid(GRID_NAME);
-
-            for (int i = 0; i < 10; i++) {
-                if (g1.cache(null).isEmpty() && g2.cache(null).isEmpty())
-                    break;
-
-                U.sleep(500);
-            }
-
-            assert g1.cache(null).isEmpty();
-            assert g2.cache(null).isEmpty();
-
-            startGrid(3);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("unchecked")
-    public void testDeployment4() throws Exception {
-        try {
-            depMode = CONTINUOUS;
-
-            Ignite g1 = startGrid(1);
-            Ignite g2 = startGrid(2);
-
-            Ignite g0 = startGrid(GRID_NAME);
-
-            info("Started grids:");
-            info("g0: " + g0.cluster().localNode().id());
-            info("g1: " + g1.cluster().localNode().id());
-            info("g2: " + g2.cluster().localNode().id());
-
-            ClassLoader ldr = getExternalClassLoader();
-
-            Class cls = ldr.loadClass(TEST_TASK_3);
-
-            String key = "";
-
-            for (int i = 0; i < 1000; i++) {
-                key = "1" + i;
-
-                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()))
-                    break;
-            }
-
-            g0.compute().execute(cls, new T2<>(g1.cluster().localNode(), key));
-
-            stopGrid(GRID_NAME);
-
-            assert g1.cache(null).size() == 1;
-            assert g1.cache(null).size() == 1;
-
-            assert g2.cache(null).size() == 1;
-            assert g2.cache(null).size() == 1;
-
-            startGrid(3);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("unchecked")
-    public void testDeployment5() throws Exception {
-        ClassLoader ldr = getExternalClassLoader();
-
-        Class val1Cls = ldr.loadClass(TEST_VALUE_1);
-        Class val2Cls = ldr.loadClass(TEST_VALUE_2);
-        Class task2Cls = ldr.loadClass(TEST_TASK_2);
-
-        try {
-            depMode = SHARED;
-
-            Ignite g0 = startGrid(0);
-            Ignite g1 = startGrid(1);
-            Ignite g2 = startGrid(2);
-
-            info(">>>>>>> Grid 0: " + g0.cluster().localNode().id());
-            info(">>>>>>> Grid 1: " + g1.cluster().localNode().id());
-            info(">>>>>>> Grid 2: " + g2.cluster().localNode().id());
-
-            int key = 0;
-
-            key = getNextKey(key, g0, g1.cluster().localNode(), g2.cluster().localNode(), g0.cluster().localNode());
-
-            info("Key: " + key);
-
-            GridCache<Object, Object> cache = g0.cache(null);
-
-            assert cache != null;
-
-            cache.put(key, Arrays.asList(val1Cls.newInstance()));
-
-            info(">>>>>>> First put completed.");
-
-            key = getNextKey(key + 1, g0, g2.cluster().localNode(), g0.cluster().localNode(), g1.cluster().localNode());
-
-            info("Key: " + key);
-
-            cache.put(key, val1Cls.newInstance());
-
-            info(">>>>>>> Second put completed.");
-
-            key = getNextKey(key + 1, g0, g1.cluster().localNode(), g2.cluster().localNode(), g0.cluster().localNode());
-
-            info("Key: " + key);
-
-            cache.put(key, val2Cls.newInstance());
-
-            info(">>>>>>> Third put completed.");
-
-            g0.compute().execute(task2Cls, g1.cluster().localNode());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("unchecked")
-    public void testDeployment6() throws Exception {
-        try {
-            depMode = SHARED;
-
-            Ignite g1 = startGrid(1);
-            Ignite g2 = startGrid(2);
-
-            ClassLoader ldr = getExternalClassLoader();
-
-            Class cls = ldr.loadClass(TEST_TASK_3);
-
-            String key = "";
-
-            for (int i = 0; i < 1000; i++) {
-                key = "1" + i;
-
-                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()))
-                    break;
-            }
-
-            g1.compute().execute(cls, new T2<>(g2.cluster().localNode(), key));
-
-            stopGrid(1);
-
-            startGrid(3);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("unchecked")
-    public void testDeployment7() throws Exception {
-        try {
-            depMode = SHARED;
-
-            Ignite g1 = startGrid(1);
-            Ignite g2 = startGrid(2);
-
-            ClassLoader ldr = getExternalClassLoader();
-
-            Class cls = ldr.loadClass(TEST_TASK_3);
-
-            String key = "";
-
-            for (int i = 0; i < 1000; i++) {
-                key = "1" + i;
-
-                if (g1.cluster().mapKeyToNode(null, key).id().equals(g2.cluster().localNode().id()))
-                    break;
-            }
-
-            g2.compute().execute(cls, new T2<>(g2.cluster().localNode(), key));
-
-            stopGrid(2);
-
-            startGrid(3);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedDeploymentPreloading() throws Exception {
-        ClassLoader ldr = getExternalClassLoader();
-
-        Class valCls = ldr.loadClass(TEST_VALUE_1);
-
-        try {
-            depMode = SHARED;
-
-            Ignite g = startGrid(0);
-
-            g.cache(null).put(0, valCls.newInstance());
-
-            info("Added value to cache 0.");
-
-            startGrid(1);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void _testDeploymentGroupLock() throws Exception {
-        ClassLoader ldr = getExternalClassLoader();
-
-        Class<?> keyCls = ldr.loadClass(TEST_KEY);
-
-        try {
-            depMode = SHARED;
-
-            Ignite g1 = startGrid(1);
-            startGrid(2);
-
-            Constructor<?> constructor = keyCls.getDeclaredConstructor(String.class);
-
-            Object affKey;
-
-            int i = 0;
-
-            do {
-                affKey = constructor.newInstance(String.valueOf(i));
-
-                i++;
-            }
-            while (!g1.cluster().mapKeyToNode(null, affKey).id().equals(g1.cluster().localNode().id()));
-
-            GridCache<Object, Object> cache = g1.cache(null);
-
-            try (IgniteTx tx = cache.txStartAffinity(affKey, PESSIMISTIC, REPEATABLE_READ, 0, 1)) {
-                cache.put(new CacheAffinityKey<>("key1", affKey), "val1");
-
-                tx.commit();
-            }
-
-            assertEquals("val1", cache.get(new CacheAffinityKey<>("key1", affKey)));
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * Looks for next key starting from {@code start} for which primary node is {@code primary} and backup is {@code
-     * backup}.
-     *
-     * @param start Key to start search from, inclusive.
-     * @param g Grid on which check will be performed.
-     * @param primary Expected primary node.
-     * @param backup Expected backup node.
-     * @param near Expected near node.
-     * @return Key with described properties.
-     * @throws IllegalStateException if such a key could not be found after 10000 iterations.
-     */
-    private int getNextKey(int start, Ignite g, ClusterNode primary, ClusterNode backup, ClusterNode near) {
-        info("Primary: " + primary);
-        info("Backup: " + backup);
-        info("Near: " + near);
-
-        for (int i = start; i < start + 10000; i++) {
-            if (g.cache(null).affinity().isPrimary(primary, i) && g.cache(null).affinity().isBackup(backup, i)) {
-                assert !g.cache(null).affinity().isPrimary(near, i) : "Key: " + i;
-                assert !g.cache(null).affinity().isBackup(near, i) : "Key: " + i;
-
-                return i;
-            }
-        }
-
-        throw new IllegalStateException("Unable to find matching key [start=" + start + ", primary=" + primary.id() +
-            ", backup=" + backup.id() + ']');
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
deleted file mode 100644
index a1fe573..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryMemorySizeSelfTest.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * 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.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.processors.cache.distributed.dht.*;
-import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.marshaller.*;
-import org.apache.ignite.marshaller.optimized.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Tests from {@link org.apache.ignite.cache.CacheEntry#memorySize()} method.
- */
-public class GridCacheEntryMemorySizeSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Null reference size (optimized marshaller writes one byte for null reference). */
-    private static final int NULL_REF_SIZE = 1;
-
-    /** Entry overhead. */
-    private static final int ENTRY_OVERHEAD;
-
-    /** Replicated entry overhead. */
-    private static final int REPLICATED_ENTRY_OVERHEAD;
-
-    /** DHT entry overhead. */
-    private static final int DHT_ENTRY_OVERHEAD;
-
-    /** Near entry overhead. */
-    private static final int NEAR_ENTRY_OVERHEAD;
-
-    /** Reader size. */
-    private static final int READER_SIZE = 24;
-
-    /** Key size in bytes. */
-    private static final int KEY_SIZE;
-
-    /** 1KB value size in bytes. */
-    private static final int ONE_KB_VAL_SIZE;
-
-    /** 2KB value size in bytes. */
-    private static final int TWO_KB_VAL_SIZE;
-
-    /**
-     *
-     */
-    static {
-        try {
-            ENTRY_OVERHEAD = U.<Integer>staticField(GridCacheMapEntry.class, "SIZE_OVERHEAD");
-            DHT_ENTRY_OVERHEAD = U.<Integer>staticField(GridDhtCacheEntry.class, "DHT_SIZE_OVERHEAD");
-            NEAR_ENTRY_OVERHEAD = U.<Integer>staticField(GridNearCacheEntry.class, "NEAR_SIZE_OVERHEAD");
-            REPLICATED_ENTRY_OVERHEAD = DHT_ENTRY_OVERHEAD;
-
-            IgniteMarshaller marsh = new IgniteOptimizedMarshaller();
-
-            KEY_SIZE = marsh.marshal(1).length;
-            ONE_KB_VAL_SIZE = marsh.marshal(new Value(new byte[1024])).length;
-            TWO_KB_VAL_SIZE = marsh.marshal(new Value(new byte[2048])).length;
-        }
-        catch (IgniteCheckedException e) {
-            throw new IgniteException(e);
-        }
-    }
-
-    /** Cache mode. */
-    private CacheMode mode;
-
-    /** Near cache enabled flag. */
-    private boolean nearEnabled;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setCacheMode(mode);
-        cacheCfg.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : PARTITIONED_ONLY);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        if (mode == PARTITIONED)
-            cacheCfg.setBackups(0);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        return cfg;
-    }
-
-    /** @throws Exception If failed. */
-    public void testLocal() throws Exception {
-        mode = LOCAL;
-
-        try {
-            GridCache<Integer, Value> cache = startGrid().cache(null);
-
-            assertTrue(cache.putx(1, new Value(new byte[1024])));
-            assertTrue(cache.putx(2, new Value(new byte[2048])));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + extrasSize(cache.entry(0)),
-                cache.entry(0).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + extrasSize(cache.entry(1)),
-                cache.entry(1).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + extrasSize(cache.entry(2)),
-                cache.entry(2).memorySize());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testReplicated() throws Exception {
-        mode = REPLICATED;
-
-        try {
-            GridCache<Integer, Value> cache = startGrid().cache(null);
-
-            assertTrue(cache.putx(1, new Value(new byte[1024])));
-            assertTrue(cache.putx(2, new Value(new byte[2048])));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + REPLICATED_ENTRY_OVERHEAD +
-                extrasSize(cache.entry(0)), cache.entry(0).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + REPLICATED_ENTRY_OVERHEAD +
-                extrasSize(cache.entry(1)), cache.entry(1).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + REPLICATED_ENTRY_OVERHEAD +
-                extrasSize(cache.entry(2)), cache.entry(2).memorySize());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearEnabled() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = true;
-
-        try {
-            startGridsMultiThreaded(2);
-
-            int[] keys = new int[3];
-
-            int key = 0;
-
-            for (int i = 0; i < keys.length; i++) {
-                while (true) {
-                    key++;
-
-                    if (grid(0).mapKeyToNode(null, key).equals(grid(0).localNode())) {
-                        if (i > 0)
-                            assertTrue(cache(0).putx(key, new Value(new byte[i * 1024])));
-
-                        keys[i] = key;
-
-                        break;
-                    }
-                }
-            }
-
-            // Create near entries.
-            assertNotNull(cache(1).get(keys[1]));
-            assertNotNull(cache(1).get(keys[2]));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[0])), cache(0).entry(keys[0]).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE +
-                extrasSize(cache(0).entry(keys[1])), cache(0).entry(keys[1]).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD + READER_SIZE +
-                extrasSize(cache(0).entry(keys[2])), cache(0).entry(keys[2]).memorySize());
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD +
-                extrasSize(cache(1).entry(keys[0])), cache(1).entry(keys[0]).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD +
-                extrasSize(cache(1).entry(keys[1])), cache(1).entry(keys[1]).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + NEAR_ENTRY_OVERHEAD +
-                extrasSize(cache(1).entry(keys[2])), cache(1).entry(keys[2]).memorySize());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearDisabled() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = false;
-
-        try {
-            startGridsMultiThreaded(2);
-
-            int[] keys = new int[3];
-
-            int key = 0;
-
-            for (int i = 0; i < keys.length; i++) {
-                while (true) {
-                    key++;
-
-                    if (grid(0).mapKeyToNode(null, key).equals(grid(0).localNode())) {
-                        if (i > 0)
-                            assertTrue(cache(0).putx(key, new Value(new byte[i * 1024])));
-
-                        keys[i] = key;
-
-                        break;
-                    }
-                }
-            }
-
-            // Create near entries.
-            assertNotNull(cache(1).get(keys[1]));
-            assertNotNull(cache(1).get(keys[2]));
-
-            assertEquals(KEY_SIZE + NULL_REF_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[0])), cache(0).entry(keys[0]).memorySize());
-            assertEquals(KEY_SIZE + ONE_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[1])), cache(0).entry(keys[1]).memorySize());
-            assertEquals(KEY_SIZE + TWO_KB_VAL_SIZE + ENTRY_OVERHEAD + DHT_ENTRY_OVERHEAD +
-                extrasSize(cache(0).entry(keys[2])), cache(0).entry(keys[2]).memorySize());
-
-            // Do not test other node since there are no backups.
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * Get entry extras size.
-     *
-     * @param entry Entry.
-     * @return Extras size.
-     * @throws Exception If failed.
-     */
-    private int extrasSize(CacheEntry entry) throws Exception {
-        Method mthd = GridCacheMapEntry.class.getDeclaredMethod("extrasSize");
-
-        mthd.setAccessible(true);
-
-        GridCacheContext ctx = U.field(entry, "ctx");
-
-        GridCacheEntryEx entry0 = ((GridCacheEntryImpl)entry).entryEx(false, ctx.discovery().topologyVersion());
-
-        return (Integer)mthd.invoke(entry0);
-    }
-
-    /** Value. */
-    @SuppressWarnings("UnusedDeclaration")
-    private static class Value implements Serializable {
-        /** Byte array. */
-        private byte[] arr;
-
-        /** @param arr Byte array. */
-        private Value(byte[] arr) {
-            this.arr = arr;
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object o) {
-            if (this == o)
-                return true;
-
-            if (o == null || getClass() != o.getClass())
-                return false;
-
-            Value val = (Value)o;
-
-            return Arrays.equals(arr, val.arr);
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return arr != null ? Arrays.hashCode(arr) : 0;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
deleted file mode 100644
index 40ce6fb..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEntryVersionSelfTest.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-import static org.apache.ignite.internal.processors.cache.version.GridCacheVersionManager.*;
-
-/**
- * Tests that entry version is
- */
-public class GridCacheEntryVersionSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Atomicity mode. */
-    private CacheAtomicityMode atomicityMode;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(IP_FINDER);
-
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        ccfg.setCacheMode(PARTITIONED);
-        ccfg.setAtomicWriteOrderMode(PRIMARY);
-        ccfg.setBackups(1);
-        ccfg.setAtomicityMode(atomicityMode);
-        ccfg.setWriteSynchronizationMode(FULL_SYNC);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        return cfg;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testVersionAtomic() throws Exception {
-        atomicityMode = ATOMIC;
-
-        checkVersion();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testVersionTransactional() throws Exception {
-        atomicityMode = TRANSACTIONAL;
-
-        checkVersion();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    private void checkVersion() throws Exception {
-        startGridsMultiThreaded(3);
-
-        try {
-            Map<Integer,Integer> map = F.asMap(1, 1, 2, 2, 3, 3);
-
-            for (Integer key : map.keySet()) {
-                info("Affinity nodes [key=" + key + ", nodes=" +
-                    F.viewReadOnly(grid(0).cache(null).affinity().mapKeyToPrimaryAndBackups(key), F.node2id()) + ']');
-            }
-
-            grid(0).cache(null).putAll(map);
-
-            for (int g = 0; g < 3; g++) {
-                IgniteKernal grid = (IgniteKernal)grid(g);
-
-                for (Integer key : map.keySet()) {
-                    GridCacheAdapter<Object, Object> cache = grid.internalCache();
-
-                    GridCacheEntryEx<Object, Object> entry = cache.peekEx(key);
-
-                    if (entry != null) {
-                        GridCacheVersion ver = entry.version();
-
-                        long order = cache.affinity().mapKeyToNode(key).order();
-
-                        // Check topology version.
-                        assertEquals(3, ver.topologyVersion() -
-                            (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME) / 1000);
-
-                        // Check node order.
-                        assertEquals("Failed for key: " + key, order, ver.nodeOrder());
-                    }
-                }
-            }
-
-            startGrid(3);
-
-            grid(0).cache(null).putAll(map);
-
-            for (int g = 0; g < 4; g++) {
-                IgniteKernal grid = (IgniteKernal)grid(g);
-
-                for (Integer key : map.keySet()) {
-                    GridCacheAdapter<Object, Object> cache = grid.internalCache();
-
-                    GridCacheEntryEx<Object, Object> entry = cache.peekEx(key);
-
-                    if (entry != null) {
-                        GridCacheVersion ver = entry.version();
-
-                        long order = cache.affinity().mapKeyToNode(key).order();
-
-                        // Check topology version.
-                        assertEquals(4, ver.topologyVersion() -
-                            (grid.context().discovery().gridStartTime() - TOP_VER_BASE_TIME) / 1000);
-
-                        // Check node order.
-                        assertEquals("Failed for key: " + key, order, ver.nodeOrder());
-                    }
-                }
-            }
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
deleted file mode 100644
index 517ffd2..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheEvictionEventAbstractTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.events.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.events.IgniteEventType.*;
-
-/**
- * Eviction event self test.
- */
-public abstract class GridCacheEvictionEventAbstractTest extends GridCommonAbstractTest {
-    /** */
-    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /**
-     *
-     */
-    protected GridCacheEvictionEventAbstractTest() {
-        super(true); // Start node.
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration() throws Exception {
-        IgniteConfiguration c = super.getConfiguration();
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(cacheMode());
-        cc.setAtomicityMode(atomicityMode());
-        cc.setEvictNearSynchronized(isNearEvictSynchronized());
-
-        c.setCacheConfiguration(cc);
-
-        c.setIncludeEventTypes(EVT_CACHE_ENTRY_EVICTED, EVT_TASK_FAILED, EVT_TASK_FINISHED, EVT_JOB_MAPPED);
-
-        return c;
-    }
-
-    /**
-     * @return Cache mode.
-     */
-    protected abstract CacheMode cacheMode();
-
-    /**
-     * @return Atomicity mode.
-     */
-    protected abstract CacheAtomicityMode atomicityMode();
-
-    /**
-     * @return {@code True} if near evicts synchronized.
-     */
-    protected boolean isNearEvictSynchronized() {
-        return false;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testEvictionEvent() throws Exception {
-        Ignite g = grid();
-
-        final CountDownLatch latch = new CountDownLatch(1);
-
-        final AtomicReference<String> oldVal = new AtomicReference<>();
-
-        g.events().localListen(new IgnitePredicate<IgniteEvent>() {
-            @Override public boolean apply(IgniteEvent evt) {
-                IgniteCacheEvent e = (IgniteCacheEvent) evt;
-
-                oldVal.set((String) e.oldValue());
-
-                latch.countDown();
-
-                return true;
-            }
-        }, IgniteEventType.EVT_CACHE_ENTRY_EVICTED);
-
-        GridCache<String, String> c = g.cache(null);
-
-        c.put("1", "val1");
-
-        c.evict("1");
-
-        latch.await();
-
-        assertNotNull(oldVal.get());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheExAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheExAbstractFullApiSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheExAbstractFullApiSelfTest.java
deleted file mode 100644
index 1da816d..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheExAbstractFullApiSelfTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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.cache.*;
-import org.apache.ignite.events.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.transactions.*;
-
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.events.IgniteEventType.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-
-/**
- * Abstract test for private cache interface.
- */
-public abstract class GridCacheExAbstractFullApiSelfTest extends GridCacheAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 4;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheDistributionMode distributionMode() {
-        return PARTITIONED_ONLY;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testGetOutTx() throws Exception {
-        final AtomicInteger lockEvtCnt = new AtomicInteger();
-
-        IgnitePredicate<IgniteEvent> lsnr = new IgnitePredicate<IgniteEvent>() {
-            @Override public boolean apply(IgniteEvent evt) {
-                lockEvtCnt.incrementAndGet();
-
-                return true;
-            }
-        };
-
-        try {
-            grid(0).events().localListen(lsnr, EVT_CACHE_OBJECT_LOCKED, EVT_CACHE_OBJECT_UNLOCKED);
-
-            GridCache<String, Integer> cache = cache();
-
-            try (IgniteTx tx = cache.txStart(PESSIMISTIC, REPEATABLE_READ)) {
-                int key = 0;
-
-                for (int i = 0; i < 1000; i++) {
-                    if (cache.affinity().mapKeyToNode("key" + i).id().equals(grid(0).localNode().id())) {
-                        key = i;
-
-                        break;
-                    }
-                }
-
-                cache.get("key" + key);
-
-                for (int i = key + 1; i < 1000; i++) {
-                    if (cache.affinity().mapKeyToNode("key" + i).id().equals(grid(0).localNode().id())) {
-                        key = i;
-
-                        break;
-                    }
-                }
-
-                ((GridCacheProjectionEx<String, Integer>)cache).getAllOutTx(F.asList("key" + key));
-            }
-
-            assertTrue(GridTestUtils.waitForCondition(new PA() {
-                @Override public boolean apply() {
-                    info("Lock event count: " + lockEvtCnt.get());
-
-                    return lockEvtCnt.get() == (nearEnabled() ? 4 : 2);
-                }
-            }, 15000));
-        }
-        finally {
-            grid(0).events().stopLocalListen(lsnr, EVT_CACHE_OBJECT_LOCKED, EVT_CACHE_OBJECT_UNLOCKED);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFieldsQueryNoDataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFieldsQueryNoDataSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFieldsQueryNoDataSelfTest.java
deleted file mode 100644
index 037fcb8..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFieldsQueryNoDataSelfTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.cache.*;
-import org.apache.ignite.cache.query.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Test for local query on partitioned cache without data.
- */
-public class GridCacheFieldsQueryNoDataSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        CacheConfiguration cache = defaultCacheConfiguration();
-
-        cache.setCacheMode(PARTITIONED);
-        cache.setBackups(1);
-        cache.setWriteSynchronizationMode(FULL_SYNC);
-
-        cfg.setCacheConfiguration(cache);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        startGrid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        stopGrid();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testQuery() throws Exception {
-        CacheQuery<List<?>> qry = grid().cache(null).queries().createSqlFieldsQuery("select _VAL from Integer");
-
-        Collection<List<?>> res = qry.execute().get();
-
-        assert res != null;
-        assert res.isEmpty();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
deleted file mode 100644
index 0ef71a8..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFinishPartitionsSelfTest.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * 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.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.transactions.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-import java.util.concurrent.locks.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-
-/**
- * Abstract class for cache tests.
- */
-public class GridCacheFinishPartitionsSelfTest extends GridCacheAbstractSelfTest {
-    /** */
-    private static final int GRID_CNT = 1;
-
-    /** Grid kernal. */
-    private IgniteKernal grid;
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return GRID_CNT;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        grid = (IgniteKernal)grid(0);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        grid = null;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(PARTITIONED);
-        cc.setBackups(1);
-        cc.setAtomicityMode(TRANSACTIONAL);
-        cc.setDistributionMode(NEAR_PARTITIONED);
-
-        c.setCacheConfiguration(cc);
-
-        return c;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTxFinishPartitions() throws Exception {
-        String key = "key";
-        String val = "value";
-
-        GridCache<String, String> cache = grid.cache(null);
-
-        int keyPart = grid.<String, String>internalCache().context().affinity().partition(key);
-
-        cache.put(key, val);
-
-        // Wait for tx-enlisted partition.
-        long waitTime = runTransactions(key, keyPart, F.asList(keyPart));
-
-        info("Wait time, ms: " + waitTime);
-
-        // Wait for not enlisted partition.
-        waitTime = runTransactions(key, keyPart, F.asList(keyPart + 1));
-
-        info("Wait time, ms: " + waitTime);
-
-        // Wait for both partitions.
-        waitTime = runTransactions(key, keyPart, F.asList(keyPart, keyPart + 1));
-
-        info("Wait time, ms: " + waitTime);
-    }
-
-    /**
-     * @param key Key.
-     * @param keyPart Key partition.
-     * @param waitParts Partitions to wait.
-     * @return Wait time.
-     * @throws Exception If failed.
-     */
-    private long runTransactions(final String key, final int keyPart, final Collection<Integer> waitParts)
-        throws Exception {
-        int threadNum = 1;
-
-        final CyclicBarrier barrier = new CyclicBarrier(threadNum);
-        final CountDownLatch latch = new CountDownLatch(threadNum);
-
-        final AtomicLong start = new AtomicLong();
-
-        GridTestUtils.runMultiThreaded(new Callable() {
-            @Override public Object call() throws Exception {
-                if (barrier.await() == 0)
-                    start.set(System.currentTimeMillis());
-
-                GridCache<String, String> cache = grid(0).cache(null);
-
-                IgniteTx tx = cache.txStart(PESSIMISTIC, REPEATABLE_READ);
-
-                cache.get(key);
-
-                IgniteInternalFuture<?> fut = grid.context().cache().context().partitionReleaseFuture(GRID_CNT + 1);
-
-                fut.listenAsync(new CI1<IgniteInternalFuture<?>>() {
-                    @Override public void apply(IgniteInternalFuture<?> e) {
-                        latch.countDown();
-                    }
-                });
-
-                assert !fut.isDone() : "Failed waiting for locks " +
-                    "[keyPart=" + keyPart + ", waitParts=" + waitParts + ", done=" + fut.isDone() + ']';
-
-                tx.commit();
-
-                return null;
-            }
-        }, threadNum, "test-finish-partitions-thread");
-
-        latch.await();
-
-        return System.currentTimeMillis() - start.get();
-    }
-
-    /**
-     * Tests method {@link GridCacheMvccManager#finishLocks(org.apache.ignite.lang.IgnitePredicate, long)}.
-     *
-     * @throws Exception If failed.
-     */
-    public void testMvccFinishPartitions() throws Exception {
-        String key = "key";
-
-        int keyPart = grid.internalCache().context().affinity().partition(key);
-
-        // Wait for tx-enlisted partition.
-        long waitTime = runLock(key, keyPart, F.asList(keyPart));
-
-        info("Wait time, ms: " + waitTime);
-
-        // Wait for not enlisted partition.
-        waitTime = runLock(key, keyPart, F.asList(keyPart + 1));
-
-        info("Wait time, ms: " + waitTime);
-
-        // Wait for both partitions.
-        waitTime = runLock(key, keyPart, F.asList(keyPart, keyPart + 1));
-
-        info("Wait time, ms: " + waitTime);
-    }
-
-    /**
-     * Tests finish future for particular set of keys.
-     *
-     * @throws Exception If failed.
-     */
-    public void testMvccFinishKeys() throws Exception {
-        GridCache<String, Integer> cache = grid(0).cache(null);
-
-        try (IgniteTx tx = cache.txStart(PESSIMISTIC, REPEATABLE_READ)) {
-            final String key = "key";
-
-            cache.get(key);
-
-            GridCacheAdapter<String, Integer> internal = grid.internalCache();
-
-            IgniteInternalFuture<?> nearFut = internal.context().mvcc().finishKeys(Collections.singletonList(key), 2);
-
-            IgniteInternalFuture<?> dhtFut = internal.context().near().dht().context().mvcc().finishKeys(
-                Collections.singletonList(key), 2);
-
-            assert !nearFut.isDone();
-            assert !dhtFut.isDone();
-
-            tx.commit();
-        }
-    }
-
-    /**
-     * Tests chained locks and partitions release future.
-     *
-     * @throws Exception If failed.
-     */
-    public void testMvccFinishPartitionsContinuousLockAcquireRelease() throws Exception {
-        int key = 1;
-
-        GridCacheSharedContext<Object, Object> ctx = grid.context().cache().context();
-
-        final AtomicLong end = new AtomicLong(0);
-
-        final CountDownLatch latch = new CountDownLatch(1);
-
-        IgniteCache<Integer, String> cache = grid.jcache(null);
-
-        Lock lock = cache.lock(key);
-
-        lock.lock();
-
-        long start = System.currentTimeMillis();
-
-        info("Start time: " + start);
-
-        IgniteInternalFuture<?> fut = ctx.partitionReleaseFuture(GRID_CNT + 1);
-
-        assert fut != null;
-
-        fut.listenAsync(new CI1<IgniteInternalFuture<?>>() {
-            @Override public void apply(IgniteInternalFuture<?> e) {
-                end.set(System.currentTimeMillis());
-
-                latch.countDown();
-
-                info("End time: " + end.get());
-            }
-        });
-
-        Lock lock1 = cache.lock(key + 1);
-
-        lock1.lock();
-
-        lock.unlock();
-
-        Lock lock2 = cache.lock(key + 2);
-
-        lock2.lock();
-
-        lock1.unlock();
-
-        assert !fut.isDone() : "Failed waiting for locks";
-
-        lock2.unlock();
-
-        latch.await();
-    }
-
-    /**
-     * @param key Key.
-     * @param keyPart Key partition.
-     * @param waitParts Partitions to wait.
-     * @return Wait time.
-     * @throws Exception If failed.
-     */
-    private long runLock(String key, int keyPart, Collection<Integer> waitParts) throws Exception {
-
-        GridCacheSharedContext<Object, Object> ctx = grid.context().cache().context();
-
-        final AtomicLong end = new AtomicLong(0);
-
-        final CountDownLatch latch = new CountDownLatch(1);
-
-        IgniteCache<String, String> cache = grid.jcache(null);
-
-        Lock lock = cache.lock(key);
-
-        lock.lock();
-
-        long start;
-        try {
-            start = System.currentTimeMillis();
-
-            info("Start time: " + start);
-
-            IgniteInternalFuture<?> fut = ctx.partitionReleaseFuture(GRID_CNT + 1);
-
-            assert fut != null;
-
-            fut.listenAsync(new CI1<IgniteInternalFuture<?>>() {
-                @Override public void apply(IgniteInternalFuture<?> e) {
-                    end.set(System.currentTimeMillis());
-
-                    latch.countDown();
-
-                    info("End time: " + end.get());
-                }
-            });
-
-            assert !fut.isDone() : "Failed waiting for locks [keyPart=" + keyPart + ", waitParts=" + waitParts + ", done="
-                + fut.isDone() + ']';
-        }
-        finally {
-            lock.unlock();
-        }
-
-        latch.await();
-
-        return end.get() - start;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
deleted file mode 100644
index 09d92d8..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheFullTextQueryMultithreadedSelfTest.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * 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.cache.*;
-import org.apache.ignite.cache.query.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Multithreaded reduce query tests with lots of data.
- */
-public class GridCacheFullTextQueryMultithreadedSelfTest extends GridCacheAbstractSelfTest {
-    /** */
-    private static final int GRID_CNT = 3;
-
-    /** */
-    private static final int TEST_TIMEOUT = 15 * 60 * 1000;
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return GRID_CNT;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return TEST_TIMEOUT;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
-        CacheConfiguration cfg = super.cacheConfiguration(gridName);
-
-        cfg.setCacheMode(PARTITIONED);
-        cfg.setBackups(1);
-        cfg.setWriteSynchronizationMode(FULL_SYNC);
-
-        return cfg;
-    }
-
-    /**
-     * JUnit.
-     *
-     * @throws Exception In case of error.
-     */
-    @SuppressWarnings({"TooBroadScope"})
-    public void testH2Text() throws Exception {
-        int duration = 60 * 1000;
-        final int keyCnt = 5000;
-        final int logFreq = 50;
-        final String txt = "Value";
-
-        final GridCache<Integer, H2TextValue> c = grid(0).cache(null);
-
-        IgniteInternalFuture<?> fut1 = multithreadedAsync(new Callable() {
-                @Override public Object call() throws Exception {
-                    for (int i = 0; i < keyCnt; i++) {
-                        c.putx(i, new H2TextValue(txt));
-
-                        if (i % logFreq == 0)
-                            X.println("Stored values: " + i);
-                    }
-
-                    return null;
-                }
-            }, 1);
-
-        // Create query.
-        final CacheQuery<Map.Entry<Integer, H2TextValue>> qry = c.queries().createFullTextQuery(
-            H2TextValue.class, txt);
-
-        qry.enableDedup(false);
-        qry.includeBackups(false);
-        qry.timeout(TEST_TIMEOUT);
-
-        final AtomicBoolean stop = new AtomicBoolean();
-
-        IgniteInternalFuture<?> fut2 = multithreadedAsync(new Callable() {
-                @Override public Object call() throws Exception {
-                    int cnt = 0;
-
-                    while (!stop.get()) {
-                        Collection<Map.Entry<Integer, H2TextValue>> res = qry.execute().get();
-
-                        cnt++;
-
-                        if (cnt % logFreq == 0) {
-                            X.println("Result set: " + res.size());
-                            X.println("Executed queries: " + cnt);
-                        }
-                    }
-
-                    return null;
-                }
-            }, 1);
-
-        Thread.sleep(duration);
-
-        fut1.get();
-
-        stop.set(true);
-
-        fut2.get();
-    }
-
-    /**
-     *
-     */
-    private static class H2TextValue {
-        /** */
-        @CacheQueryTextField
-        private final String val;
-
-        /**
-         * @param val String value.
-         */
-        H2TextValue(String val) {
-            this.val = val;
-        }
-
-        /**
-         * @return String field value.
-         */
-        String value() {
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String toString() {
-            return S.toString(H2TextValue.class, this);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java
deleted file mode 100644
index 64cc3a6..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGetAndTransformStoreAbstractTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * 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.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import javax.cache.configuration.*;
-import javax.cache.processor.*;
-import java.io.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CachePreloadMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Basic get and transform store test.
- */
-public abstract class GridCacheGetAndTransformStoreAbstractTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Cache store. */
-    private static final GridCacheTestStore store = new GridCacheTestStore();
-
-    /**
-     *
-     */
-    protected GridCacheGetAndTransformStoreAbstractTest() {
-        super(true /*start grid. */);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        store.resetTimestamp();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        cache().clearAll();
-
-        store.reset();
-    }
-
-    /** @return Caching mode. */
-    protected abstract CacheMode cacheMode();
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected final IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        c.setDiscoverySpi(disco);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(cacheMode());
-        cc.setWriteSynchronizationMode(FULL_SYNC);
-        cc.setSwapEnabled(false);
-        cc.setAtomicityMode(atomicityMode());
-        cc.setDistributionMode(distributionMode());
-        cc.setPreloadMode(SYNC);
-
-        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
-        cc.setReadThrough(true);
-        cc.setWriteThrough(true);
-        cc.setLoadPreviousValue(true);
-
-        c.setCacheConfiguration(cc);
-
-        return c;
-    }
-
-    /**
-     * @return Distribution mode.
-     */
-    protected CacheDistributionMode distributionMode() {
-        return NEAR_PARTITIONED;
-    }
-
-    /**
-     * @return Cache atomicity mode.
-     */
-    protected CacheAtomicityMode atomicityMode() {
-        return TRANSACTIONAL;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testGetAndTransform() throws Exception {
-        final AtomicBoolean finish = new AtomicBoolean();
-
-        try {
-            startGrid(0);
-            startGrid(1);
-            startGrid(2);
-
-            final Processor entryProcessor = new Processor();
-
-            IgniteInternalFuture<?> fut = multithreadedAsync(
-                new Callable<Object>() {
-                    @Override public Object call() throws Exception {
-                        IgniteCache<Integer, String> c = jcache(ThreadLocalRandom.current().nextInt(3));
-
-                        while (!finish.get() && !Thread.currentThread().isInterrupted()) {
-                            c.get(ThreadLocalRandom.current().nextInt(100));
-
-                            c.put(ThreadLocalRandom.current().nextInt(100), "s");
-
-                            c.invoke(
-                                ThreadLocalRandom.current().nextInt(100),
-                                entryProcessor);
-                        }
-
-                        return null;
-                    }
-                },
-                20);
-
-            Thread.sleep(15_000);
-
-            finish.set(true);
-
-            fut.get();
-        }
-        finally {
-            stopGrid(0);
-            stopGrid(1);
-            stopGrid(2);
-
-            while (!cache().isEmpty())
-                cache().globalClearAll(Long.MAX_VALUE);
-        }
-    }
-
-    /**
-     *
-     */
-    private static class Processor implements EntryProcessor<Integer, String, Void>, Serializable {
-        /** {@inheritDoc} */
-        @Override public Void process(MutableEntry<Integer, String> e, Object... args) {
-            e.setValue("str");
-
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGlobalClearAllSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGlobalClearAllSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGlobalClearAllSelfTest.java
deleted file mode 100644
index b72fb80..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheGlobalClearAllSelfTest.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Test {@link org.apache.ignite.cache.GridCache#globalClearAll()} operation in multinode environment with nodes
- * having caches with different names.
- */
-public class GridCacheGlobalClearAllSelfTest extends GridCommonAbstractTest {
-    /** Grid nodes count. */
-    private static final int GRID_CNT = 3;
-
-    /** Amount of keys stored in the default cache. */
-    private static final int KEY_CNT = 20;
-
-    /** Amount of keys stored in cache other than default. */
-    private static final int KEY_CNT_OTHER = 10;
-
-    /** Default cache name. */
-    private static final String CACHE_NAME = "cache_name";
-
-    /** Cache name which differs from the default one. */
-    private static final String CACHE_NAME_OTHER = "cache_name_other";
-
-    /** VM IP finder for TCP discovery SPI. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Cache name which will be passed to grid configuration. */
-    private CacheMode cacheMode = PARTITIONED;
-
-    /** Cache mode which will be passed to grid configuration. */
-    private String cacheName = CACHE_NAME;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        CacheConfiguration ccfg = defaultCacheConfiguration();
-
-        ccfg.setName(cacheName);
-        ccfg.setCacheMode(cacheMode);
-        ccfg.setAtomicityMode(TRANSACTIONAL);
-        ccfg.setDistributionMode(NEAR_PARTITIONED);
-
-        if (cacheMode == PARTITIONED)
-            ccfg.setBackups(1);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * Start GRID_CNT nodes. All nodes except the last one will have one cache with particular name, while the last
-     * one will have one cache of the same type, but with different name.
-     *
-     * @throws Exception In case of exception.
-     */
-    private void startNodes() throws Exception {
-        cacheName = CACHE_NAME;
-
-        for (int i = 0; i < GRID_CNT - 1; i++)
-            startGrid(i);
-
-        cacheName = CACHE_NAME_OTHER;
-
-        startGrid(GRID_CNT - 1);
-    }
-
-    /**
-     * Test for partitioned cache.
-     *
-     * @throws Exception In case of exception.
-     */
-    public void testGlobalClearAllPartitioned() throws Exception {
-        cacheMode = PARTITIONED;
-
-        startNodes();
-
-        performTest();
-    }
-
-    /**
-     * Test for replicated cache.
-     *
-     * @throws Exception In case of exception.
-     */
-    public void testGlobalClearAllReplicated() throws Exception {
-        cacheMode = REPLICATED;
-
-        startNodes();
-
-        performTest();
-    }
-
-    /**
-     * Ensure that globalClearAll() clears correct cache and is only executed on nodes with the cache excluding
-     * master-node where it is executed locally.
-     *
-     * @throws Exception If failed.
-     */
-    public void performTest() throws Exception {
-        // Put values into normal replicated cache.
-        for (int i = 0; i < KEY_CNT; i++)
-            grid(0).cache(CACHE_NAME).put(i, "val" + i);
-
-        // Put values into a cache with another name.
-        for (int i = 0; i < KEY_CNT_OTHER; i++)
-            grid(GRID_CNT - 1).cache(CACHE_NAME_OTHER).put(i, "val" + i);
-
-        // Check cache sizes.
-        for (int i = 0; i < GRID_CNT - 1; i++) {
-            GridCache<Object, Object> cache = grid(i).cache(CACHE_NAME);
-
-            assertEquals("Key set [i=" + i + ", keys=" + cache.keySet() + ']', KEY_CNT, cache.size());
-        }
-
-        assert grid(GRID_CNT - 1).cache(CACHE_NAME_OTHER).size() == KEY_CNT_OTHER;
-
-        // Perform clear.
-        grid(0).cache(CACHE_NAME).globalClearAll();
-
-        // Expect caches with the given name to be clear on all nodes.
-        for (int i = 0; i < GRID_CNT - 1; i++)
-            assert grid(i).cache(CACHE_NAME).isEmpty();
-
-        // ... but cache with another name should remain untouched.
-        assert grid(GRID_CNT - 1).cache(CACHE_NAME_OTHER).size() == KEY_CNT_OTHER;
-    }
-}


Mime
View raw message