ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [15/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:49 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java
deleted file mode 100644
index 76a2997..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexingDisabledSelfTest.java
+++ /dev/null
@@ -1,98 +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.query.*;
-import org.apache.ignite.testframework.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-
-/**
- *
- */
-public class GridCacheQueryIndexingDisabledSelfTest extends GridCacheAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 2;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
-        CacheConfiguration ccfg = super.cacheConfiguration(gridName);
-
-        ccfg.setCacheMode(CacheMode.PARTITIONED);
-        ccfg.setQueryIndexEnabled(false);
-
-        return ccfg;
-    }
-
-    /**
-     * @param c Closure.
-     */
-    private void doTest(Callable<Object> c) {
-        GridTestUtils.assertThrows(log, c, IgniteCheckedException.class, "Indexing is disabled for cache: null");
-    }
-
-    /**
-     * @throws IgniteCheckedException If failed.
-     */
-    public void testSqlFieldsQuery() throws IgniteCheckedException {
-        doTest(new Callable<Object>() {
-            @Override public Object call() throws IgniteCheckedException {
-                return cache().queries().createSqlFieldsQuery("select * from dual").execute()
-                    .get();
-            }
-        });
-    }
-
-    /**
-     * @throws IgniteCheckedException If failed.
-     */
-    public void testTextQuery() throws IgniteCheckedException {
-        doTest(new Callable<Object>() {
-            @Override public Object call() throws IgniteCheckedException {
-                return cache().queries().createFullTextQuery(String.class, "text")
-                    .execute().get();
-            }
-        });
-    }
-
-    /**
-     * @throws IgniteCheckedException If failed.
-     */
-    public void testSqlQuery() throws IgniteCheckedException {
-        doTest(new Callable<Object>() {
-            @Override public Object call() throws IgniteCheckedException {
-                return cache().queries().createSqlQuery(String.class, "1 = 1")
-                    .execute().get();
-            }
-        });
-    }
-
-    /**
-     * @throws IgniteCheckedException If failed.
-     */
-    public void testScanQuery() throws IgniteCheckedException {
-        CacheQuery<Map.Entry<String, Integer>> qry = cache().queries().createScanQuery(null);
-
-        qry.execute().get();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
deleted file mode 100644
index ade174f..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryInternalKeysSelfTest.java
+++ /dev/null
@@ -1,112 +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.cluster.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.processors.cache.datastructures.*;
-import org.apache.ignite.internal.processors.cache.distributed.near.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CachePreloadMode.*;
-
-/**
- * Test for http://gridgain.jira.com/browse/GG-3979.
- */
-public class GridCacheQueryInternalKeysSelfTest extends GridCacheAbstractSelfTest {
-    /** Grid count. */
-    private static final int GRID_CNT = 2;
-
-    /** Entry count. */
-    private static final int ENTRY_CNT = 10;
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return GRID_CNT;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
-        CacheConfiguration cc = super.cacheConfiguration(gridName);
-
-        cc.setQueryIndexEnabled(false);
-        cc.setPreloadMode(SYNC);
-
-        return cc;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    @SuppressWarnings("unchecked")
-    public void testInternalKeysPreloading() throws Exception {
-        try {
-            GridCache<Object, Object> cache = grid(0).cache(null);
-
-            for (int i = 0; i < ENTRY_CNT; i++)
-                cache.dataStructures().queue("queue" + i, Integer.MAX_VALUE, false, true);
-
-            startGrid(GRID_CNT); // Start additional node.
-
-            for (int i = 0; i < ENTRY_CNT; i++) {
-                GridCacheQueueHeaderKey internalKey = new GridCacheQueueHeaderKey("queue" + i);
-
-                Collection<ClusterNode> nodes = cache.affinity().mapKeyToPrimaryAndBackups(internalKey);
-
-                for (ClusterNode n : nodes) {
-                    Ignite g = findGridForNodeId(n.id());
-
-                    assertNotNull(g);
-
-                    assertTrue("Affinity node doesn't contain internal key [key=" + internalKey + ", node=" + n + ']',
-                        ((GridNearCacheAdapter)((IgniteKernal)g).internalCache()).dht().containsKey(internalKey, null));
-                }
-            }
-        }
-        finally {
-            stopGrid(GRID_CNT);
-        }
-    }
-
-    /**
-     * Finds the {@link org.apache.ignite.Ignite}, which has a local node
-     * with given ID.
-     *
-     * @param nodeId ID for grid's local node.
-     * @return A grid instance or {@code null}, if the grid
-     * is not found.
-     */
-    @Nullable private Ignite findGridForNodeId(final UUID nodeId) {
-        return F.find(G.allGrids(), null, new P1<Ignite>() {
-            @Override public boolean apply(Ignite e) {
-                return nodeId.equals(e.cluster().localNode().id());
-            }
-        });
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
deleted file mode 100644
index f499ff5..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReferenceCleanupSelfTest.java
+++ /dev/null
@@ -1,502 +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.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.*;
-import org.apache.ignite.testframework.junits.common.*;
-import org.apache.ignite.transactions.*;
-
-import java.lang.ref.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.testframework.GridTestUtils.*;
-
-/**
- *
- */
-public class GridCacheReferenceCleanupSelfTest extends GridCommonAbstractTest {
-    /** */
-    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** Cache mode for the current test. */
-    private CacheMode mode;
-
-    /** */
-    private boolean cancel;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        cfg.setDiscoverySpi(disco);
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setCacheMode(mode);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-        cacheCfg.setDistributionMode(NEAR_PARTITIONED);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        cfg.setMarshaller(new IgniteOptimizedMarshaller(false));
-
-        return cfg;
-    }
-
-    /** @throws Exception If failed. */
-    public void testAtomicLongPartitioned() throws Exception {
-        mode = CacheMode.PARTITIONED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(atomicLongCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testAtomicLongReplicated() throws Exception {
-        mode = CacheMode.REPLICATED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(atomicLongCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testAtomicLongLocal() throws Exception {
-        mode = CacheMode.LOCAL;
-
-        try {
-            checkReferenceCleanup(atomicLongCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testOneAsyncOpPartitioned() throws Exception {
-        mode = CacheMode.PARTITIONED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(oneAsyncOpCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testOneAsyncOpReplicated() throws Exception {
-        mode = CacheMode.REPLICATED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(oneAsyncOpCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testOneAsyncOpLocal() throws Exception {
-        mode = CacheMode.LOCAL;
-
-        try {
-            checkReferenceCleanup(oneAsyncOpCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testSeveralAsyncOpsPartitioned() throws Exception {
-        mode = CacheMode.PARTITIONED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(severalAsyncOpsCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testSeveralAsyncOpsReplicated() throws Exception {
-        mode = CacheMode.REPLICATED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(severalAsyncOpsCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testSeveralAsyncOpsLocal() throws Exception {
-        mode = CacheMode.LOCAL;
-
-        try {
-            checkReferenceCleanup(severalAsyncOpsCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testSyncOpAsyncCommitPartitioned() throws Exception {
-        mode = CacheMode.PARTITIONED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(syncOpAsyncCommitCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testSyncOpAsyncCommitReplicated() throws Exception {
-        mode = CacheMode.REPLICATED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(syncOpAsyncCommitCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testSyncOpAsyncCommitLocal() throws Exception {
-        mode = CacheMode.LOCAL;
-
-        try {
-            checkReferenceCleanup(syncOpAsyncCommitCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testAsyncOpsAsyncCommitPartitioned() throws Exception {
-        mode = CacheMode.PARTITIONED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(asyncOpsAsyncCommitCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testAsyncOpsAsyncCommitReplicated() throws Exception {
-        mode = CacheMode.REPLICATED;
-
-        startGrids(2);
-
-        try {
-            checkReferenceCleanup(asyncOpsAsyncCommitCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    public void testAsyncOpsAsyncCommitLocal() throws Exception {
-        mode = CacheMode.LOCAL;
-
-        try {
-            checkReferenceCleanup(asyncOpsAsyncCommitCallable());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @param call Callable.
-     * @throws Exception If failed.
-     */
-    public void checkReferenceCleanup(Callable<Collection<WeakReference<Object>>> call) throws Exception {
-        for (boolean cancel : new boolean[] {true, false}) {
-            this.cancel = cancel;
-
-            final Collection<WeakReference<Object>> refs = call.call();
-
-            GridTestUtils.retryAssert(log, 10, 1000, new CA() {
-                @Override public void apply() {
-                    System.gc();
-                    System.gc();
-                    System.gc();
-
-                    for (WeakReference<?> ref : refs)
-                        assertNull(ref.get());
-                }
-            });
-        }
-    }
-
-    /**
-     * Crates callable for atomic long test.
-     *
-     * @return Callable.
-     * @throws Exception If failed.
-     */
-    private Callable<Collection<WeakReference<Object>>> atomicLongCallable() throws Exception {
-        return new Callable<Collection<WeakReference<Object>>>() {
-            @Override public Collection<WeakReference<Object>> call() throws Exception {
-                Collection<WeakReference<Object>> refs = new ArrayList<>();
-
-                Ignite g = startGrid();
-
-                try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
-
-                    refs.add(new WeakReference<Object>(cacheContext(cache)));
-
-                    Map<Integer, TestValue> m = new HashMap<>();
-
-                    for (int i = 0; i < 10; i++) {
-                        TestValue val = new TestValue(i);
-
-                        refs.add(new WeakReference<Object>(val));
-
-                        m.put(i, val);
-
-                        cache.dataStructures().atomicLong("testLong" + i, 0, true).incrementAndGet();
-                    }
-
-                    cache.putAll(m);
-                }
-                finally {
-                    G.stop(g.name(), cancel);
-                }
-
-                return refs;
-            }
-        };
-    }
-
-    /**
-     * Crates callable for one async op test.
-     *
-     * @return Callable.
-     * @throws Exception If failed.
-     */
-    private Callable<Collection<WeakReference<Object>>> oneAsyncOpCallable() throws Exception {
-        return new Callable<Collection<WeakReference<Object>>>() {
-            @Override public Collection<WeakReference<Object>> call() throws Exception {
-                Collection<WeakReference<Object>> refs = new ArrayList<>();
-
-                Ignite g = startGrid();
-
-                try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
-
-                    refs.add(new WeakReference<Object>(cacheContext(cache)));
-
-                    TestValue val = new TestValue(0);
-
-                    refs.add(new WeakReference<Object>(val));
-
-                    cache.putxAsync(0, val).get();
-                }
-                finally {
-                    G.stop(g.name(), cancel);
-                }
-
-                return refs;
-            }
-        };
-    }
-
-    /**
-     * Crates callable for several async ops test.
-     *
-     * @return Callable.
-     * @throws Exception If failed.
-     */
-    private Callable<Collection<WeakReference<Object>>> severalAsyncOpsCallable() throws Exception {
-        return new Callable<Collection<WeakReference<Object>>>() {
-            @Override public Collection<WeakReference<Object>> call() throws Exception {
-                Collection<WeakReference<Object>> refs = new ArrayList<>();
-
-                Ignite g = startGrid();
-
-                try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
-
-                    refs.add(new WeakReference<Object>(cacheContext(cache)));
-
-                    Collection<IgniteInternalFuture<?>> futs = new ArrayList<>(1000);
-
-                    for (int i = 0; i < 1000; i++) {
-                        TestValue val = new TestValue(i);
-
-                        refs.add(new WeakReference<Object>(val));
-
-                        futs.add(cache.putxAsync(i, val));
-                    }
-
-                    for (IgniteInternalFuture<?> fut : futs)
-                        fut.get();
-                }
-                finally {
-                    G.stop(g.name(), cancel);
-                }
-
-                return refs;
-            }
-        };
-    }
-
-    /**
-     * Crates callable for sync op with async commit test.
-     *
-     * @return Callable.
-     * @throws Exception If failed.
-     */
-    private Callable<Collection<WeakReference<Object>>> syncOpAsyncCommitCallable() throws Exception {
-        return new Callable<Collection<WeakReference<Object>>>() {
-            @Override public Collection<WeakReference<Object>> call() throws Exception {
-                Collection<WeakReference<Object>> refs = new ArrayList<>();
-
-                Ignite g = startGrid();
-
-                try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
-
-                    refs.add(new WeakReference<Object>(cacheContext(cache)));
-
-                    IgniteTx tx = cache.txStart();
-
-                    TestValue val = new TestValue(0);
-
-                    refs.add(new WeakReference<Object>(val));
-
-                    cache.putx(0, val);
-
-                    tx.commit();
-                }
-                finally {
-                    G.stop(g.name(), cancel);
-                }
-
-                return refs;
-            }
-        };
-    }
-
-    /**
-     * Crates callable for async ops with async commit test.
-     *
-     * @return Callable.
-     * @throws Exception If failed.
-     */
-    private Callable<Collection<WeakReference<Object>>> asyncOpsAsyncCommitCallable() throws Exception {
-        return new Callable<Collection<WeakReference<Object>>>() {
-            @Override public Collection<WeakReference<Object>> call() throws Exception {
-                Collection<WeakReference<Object>> refs = new ArrayList<>();
-
-                Ignite g = startGrid();
-
-                try {
-                    GridCache<Integer, TestValue> cache = g.cache(null);
-
-                    refs.add(new WeakReference<Object>(cacheContext(cache)));
-
-                    IgniteTx tx = cache.txStart();
-
-                    for (int i = 0; i < 1000; i++) {
-                        TestValue val = new TestValue(i);
-
-                        refs.add(new WeakReference<Object>(val));
-
-                        cache.putxAsync(i, val);
-                    }
-
-                    tx.commit();
-                }
-                finally {
-                    G.stop(g.name(), cancel);
-                }
-
-                return refs;
-            }
-        };
-    }
-
-    /** Test value class. Created mostly to simplify heap dump analysis. */
-    private static class TestValue {
-        /** */
-        @SuppressWarnings("UnusedDeclaration")
-        private final int i;
-
-        /** @param i Value. */
-        private TestValue(int i) {
-            this.i = i;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java
deleted file mode 100644
index e846b16..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReloadSelfTest.java
+++ /dev/null
@@ -1,177 +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.eviction.lru.*;
-import org.apache.ignite.cache.store.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import javax.cache.configuration.*;
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Checks that CacheProjection.reload() operations are performed correctly.
- */
-public class GridCacheReloadSelfTest extends GridCommonAbstractTest {
-    /** Maximum allowed number of cache entries. */
-    public static final int MAX_CACHE_ENTRIES = 500;
-
-    /** Number of entries to load from store. */
-    public static final int N_ENTRIES = 5000;
-
-    /** Cache name. */
-    private static final String CACHE_NAME = "test";
-
-    /** Cache mode. */
-    private CacheMode cacheMode;
-
-    /** Near enabled flag. */
-    private boolean nearEnabled = true;
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        cacheMode = null;
-        nearEnabled = true;
-    }
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setLocalHost("127.0.0.1");
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
-        ipFinder.setAddresses(Collections.singleton("127.0.0.1:47500"));
-
-        discoSpi.setIpFinder(ipFinder);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-        cacheCfg.setName(CACHE_NAME);
-        cacheCfg.setCacheMode(cacheMode);
-        cacheCfg.setEvictionPolicy(new CacheLruEvictionPolicy(MAX_CACHE_ENTRIES));
-        cacheCfg.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : PARTITIONED_ONLY);
-
-        final CacheStore store = new CacheStoreAdapter<Integer, Integer>() {
-            @Override public Integer load(Integer key) {
-                return key;
-            }
-
-            @Override public void write(javax.cache.Cache.Entry<? extends Integer, ? extends Integer> e) {
-                //No-op.
-            }
-
-            @Override public void delete(Object key) {
-                //No-op.
-            }
-        };
-
-        cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
-        cacheCfg.setReadThrough(true);
-        cacheCfg.setWriteThrough(true);
-        cacheCfg.setLoadPreviousValue(true);
-
-        if (cacheMode == PARTITIONED)
-            cacheCfg.setBackups(1);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        return cfg;
-    }
-
-    /**
-     * Checks that eviction works with reload() on local cache.
-     *
-     * @throws Exception If error occurs.
-     */
-    public void testReloadEvictionLocalCache() throws Exception {
-        cacheMode = CacheMode.LOCAL;
-
-        doTest();
-    }
-
-    /**
-     * Checks that eviction works with reload() on partitioned cache
-     * with near enabled.
-     *
-     * @throws Exception If error occurs.
-     */
-    //TODO: Active when ticket GG-3926 will be ready.
-    public void _testReloadEvictionPartitionedCacheNearEnabled() throws Exception {
-        cacheMode = PARTITIONED;
-
-        doTest();
-    }
-
-    /**
-     * Checks that eviction works with reload() on partitioned cache
-     * with near disabled.
-     *
-     * @throws Exception If error occurs.
-     */
-    public void testReloadEvictionPartitionedCacheNearDisabled() throws Exception {
-        cacheMode = PARTITIONED;
-        nearEnabled = false;
-
-        doTest();
-    }
-
-    /**
-     * Checks that eviction works with reload() on replicated cache.
-     *
-     * @throws Exception If error occurs.
-     */
-    public void testReloadEvictionReplicatedCache() throws Exception {
-        cacheMode = CacheMode.REPLICATED;
-
-        doTest();
-    }
-
-    /**
-     * Actual test logic.
-     *
-     * @throws Exception If error occurs.
-     */
-    private void doTest() throws Exception {
-        Ignite ignite = startGrid();
-
-        try {
-            GridCache<Integer, Integer> cache = ignite.cache(CACHE_NAME);
-
-            for (int i = 0; i < N_ENTRIES; i++)
-                cache.reload(i);
-
-            assertEquals(MAX_CACHE_ENTRIES, cache.size());
-        }
-        finally {
-            stopGrid();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
deleted file mode 100644
index d37eab5..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedSynchronousCommitTest.java
+++ /dev/null
@@ -1,202 +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.cluster.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.managers.communication.*;
-import org.apache.ignite.internal.processors.cache.distributed.*;
-import org.apache.ignite.internal.util.direct.*;
-import org.apache.ignite.spi.*;
-import org.apache.ignite.spi.communication.tcp.*;
-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.jdk8.backport.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Test cases for preload tests.
- */
-public class GridCacheReplicatedSynchronousCommitTest extends GridCommonAbstractTest {
-    /** */
-    private static final int ADDITION_CACHE_NUMBER = 2;
-
-    /** */
-    private static final String NO_COMMIT = "no_commit";
-
-    /** */
-    private final Collection<TestCommunicationSpi> commSpis = new ConcurrentLinkedDeque8<>();
-
-    /** */
-    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /**
-     *
-     */
-    public GridCacheReplicatedSynchronousCommitTest() {
-        super(false /*start grid. */);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(CacheMode.REPLICATED);
-
-        cc.setWriteSynchronizationMode(FULL_SYNC);
-
-        c.setCacheConfiguration(cc);
-
-        TestCommunicationSpi commSpi = new TestCommunicationSpi(gridName.equals(NO_COMMIT));
-
-        c.setCommunicationSpi(commSpi);
-
-        commSpis.add(commSpi);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        return c;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        commSpis.clear();
-    }
-
-    /**
-     * @throws Exception If test failed.
-     */
-    public void testSynchronousCommit() throws Exception {
-        try {
-            Ignite firstIgnite = startGrid("1");
-
-            GridCache<Integer, String> firstCache = firstIgnite.cache(null);
-
-            for (int i = 0; i < ADDITION_CACHE_NUMBER; i++)
-                startGrid(String.valueOf(i + 2));
-
-            firstCache.put(1, "val1");
-
-            int cnt = 0;
-
-            for (TestCommunicationSpi commSpi : commSpis)
-                cnt += commSpi.messagesCount();
-
-            assert cnt == ADDITION_CACHE_NUMBER;
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If test failed.
-     */
-    public void testSynchronousCommitNodeLeave() throws Exception {
-        try {
-            Ignite ignite1 = startGrid("1");
-
-            startGrid(NO_COMMIT);
-
-            Ignite ignite3 = startGrid("3");
-
-            GridCache<Integer, String> cache1 = ignite1.cache(null);
-            GridCache<Integer, String> cache3 = ignite3.cache(null);
-
-            IgniteInternalFuture<?> fut = multithreadedAsync(
-                new Callable<Object>() {
-                    @Nullable @Override public Object call() throws Exception {
-                        Thread.sleep(1000);
-
-                        stopGrid(NO_COMMIT);
-
-                        return null;
-                    }
-                },
-                1);
-
-            cache1.put(1, "val1");
-
-            assert cache3.get(1) != null;
-
-            fut.get();
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     *
-     */
-    private static class TestCommunicationSpi extends TcpCommunicationSpi {
-        /** */
-        private final AtomicInteger msgCnt = new AtomicInteger();
-
-        /** */
-        private boolean noCommit;
-
-        /**
-         * @param noCommit Send Commit or not.
-         */
-        private TestCommunicationSpi(boolean noCommit) {
-            this.noCommit = noCommit;
-        }
-
-        /**
-         * @return Number of transaction finish messages that was sent.
-         */
-        public int messagesCount() {
-            return msgCnt.get();
-        }
-
-        /** {@inheritDoc} */
-        @Override public void sendMessage(ClusterNode node, GridTcpCommunicationMessageAdapter msg)
-            throws IgniteSpiException {
-            Object obj = ((GridIoMessage)msg).message();
-
-            if (obj instanceof GridDistributedTxFinishResponse) {
-                msgCnt.incrementAndGet();
-
-                if (noCommit)
-                    return;
-            }
-
-            super.sendMessage(node, msg);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedTxStoreExceptionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedTxStoreExceptionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedTxStoreExceptionSelfTest.java
deleted file mode 100644
index aab23be..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReplicatedTxStoreExceptionSelfTest.java
+++ /dev/null
@@ -1,38 +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 static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- *
- */
-public class GridCacheReplicatedTxStoreExceptionSelfTest extends IgniteTxStoreExceptionAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return REPLICATED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheDistributionMode distributionMode() {
-        return PARTITIONED_ONLY;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
deleted file mode 100644
index 45d28ac..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheReturnValueTransferSelfTest.java
+++ /dev/null
@@ -1,206 +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.testframework.junits.common.*;
-
-import javax.cache.processor.*;
-import java.io.*;
-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.internal.processors.cache.CacheFlag.*;
-
-/**
- * Tests transform for extra traffic.
- */
-public class GridCacheReturnValueTransferSelfTest extends GridCommonAbstractTest {
-    /** Distribution mode. */
-    private CacheDistributionMode distroMode;
-
-    /** Atomicity mode. */
-    private CacheAtomicityMode atomicityMode;
-
-    /** Atomic write order mode. */
-    private CacheAtomicWriteOrderMode writeOrderMode;
-
-    /** Number of backups. */
-    private int backups;
-
-    /** Fail deserialization flag. */
-    private static volatile boolean failDeserialization;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        ccfg.setBackups(backups);
-        ccfg.setCacheMode(PARTITIONED);
-        ccfg.setAtomicityMode(atomicityMode);
-        ccfg.setAtomicWriteOrderMode(writeOrderMode);
-
-        ccfg.setDistributionMode(distroMode);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        return cfg;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTransformAtomicPrimaryNoBackups() throws Exception {
-        checkTransform(ATOMIC, PRIMARY, 0);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTransformAtomicClockNoBackups() throws Exception {
-        checkTransform(ATOMIC, CLOCK, 0);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTransformAtomicPrimaryOneBackup() throws Exception {
-        checkTransform(ATOMIC, PRIMARY, 1);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTransformAtomicClockOneBackup() throws Exception {
-        checkTransform(ATOMIC, CLOCK, 1);
-    }
-
-    /**
-     * @throws Exception If failed.
-     * TODO gg-8273 enable when fixed
-     */
-    public void _testTransformTransactionalNoBackups() throws Exception {
-        checkTransform(TRANSACTIONAL, PRIMARY, 0);
-    }
-
-    /**
-     * @throws Exception If failed.
-     * TODO gg-8273 enable when fixed
-     */
-    public void _testTransformTransactionalOneBackup() throws Exception {
-        checkTransform(TRANSACTIONAL, PRIMARY, 1);
-    }
-
-    /**
-     * @param mode Atomicity mode.
-     * @param order Atomic cache write order mode.
-     * @param b Number of backups.
-     * @throws Exception If failed.
-     */
-    private void checkTransform(CacheAtomicityMode mode, CacheAtomicWriteOrderMode order, int b)
-        throws Exception {
-        try {
-            atomicityMode = mode;
-
-            backups = b;
-
-            writeOrderMode = order;
-
-            distroMode = CacheDistributionMode.PARTITIONED_ONLY;
-
-            startGrids(2);
-
-            distroMode = CacheDistributionMode.CLIENT_ONLY;
-
-            startGrid(2);
-
-            failDeserialization = false;
-
-            // Get client grid.
-            IgniteCache<Integer, TestObject> cache = grid(2).jcache(null);
-
-            if (backups > 0 && atomicityMode == ATOMIC)
-                cache = ((IgniteCacheProxy<Integer, TestObject>)cache).flagOn(FORCE_TRANSFORM_BACKUP);
-
-            for (int i = 0; i < 100; i++)
-                cache.put(i, new TestObject());
-
-            failDeserialization = true;
-
-            info(">>>>>> Transforming");
-
-            // Transform (check non-existent keys also).
-            for (int i = 0; i < 200; i++)
-                cache.invoke(i, new Transform());
-
-            Set<Integer> keys = new HashSet<>();
-
-            // Check transformAll.
-            for (int i = 0; i < 300; i++)
-                keys.add(i);
-
-            cache.invokeAll(keys, new Transform());
-
-            // Avoid errors during stop.
-            failDeserialization = false;
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     *
-     */
-    private static class Transform implements EntryProcessor<Integer, TestObject, Void>, Serializable {
-        /** {@inheritDoc} */
-        @Override public Void process(MutableEntry<Integer, TestObject> entry, Object... args) {
-            entry.setValue(new TestObject());
-
-            return null;
-        }
-    }
-
-    /**
-     *
-     */
-    private static class TestObject implements Externalizable {
-        /**
-         *
-         */
-        public TestObject() {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeExternal(ObjectOutput out) throws IOException {
-            assert !failDeserialization;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-            assert !failDeserialization;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java
deleted file mode 100644
index d546966..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSlowTxWarnTest.java
+++ /dev/null
@@ -1,147 +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 org.apache.ignite.transactions.*;
-
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Test to check slow TX warning timeout defined by
- * {@link org.apache.ignite.IgniteSystemProperties#IGNITE_SLOW_TX_WARN_TIMEOUT}
- * system property.
- */
-public class GridCacheSlowTxWarnTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        CacheConfiguration cc1 = defaultCacheConfiguration();
-
-        cc1.setName("partitioned");
-        cc1.setCacheMode(PARTITIONED);
-        cc1.setBackups(1);
-
-        CacheConfiguration cc2 = defaultCacheConfiguration();
-
-        cc2.setName("replicated");
-        cc2.setCacheMode(REPLICATED);
-
-        CacheConfiguration cc3 = defaultCacheConfiguration();
-
-        cc3.setName("local");
-        cc3.setCacheMode(LOCAL);
-
-        c.setCacheConfiguration(cc1, cc2, cc3);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        return c;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testWarningOutput() throws Exception {
-        try {
-            IgniteKernal g = (IgniteKernal)startGrid(1);
-
-            info(">>> Slow tx timeout is not set, long-live txs simulated.");
-
-            checkCache(g, "partitioned", true, false);
-            checkCache(g, "replicated", true, false);
-            checkCache(g, "local", true, false);
-
-            info(">>> Slow tx timeout is set, long-live tx simulated.");
-
-            checkCache(g, "partitioned", true, true);
-            checkCache(g, "replicated", true, true);
-            checkCache(g, "local", true, true);
-
-            info(">>> Slow tx timeout is set, no long-live txs.");
-
-            checkCache(g, "partitioned", false, true);
-            checkCache(g, "replicated", false, true);
-            checkCache(g, "local", false, true);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @param g Grid.
-     * @param cacheName Cache.
-     * @param simulateTimeout Simulate timeout.
-     * @param configureTimeout Alter configuration of TX manager.
-     * @throws Exception If failed.
-     */
-    private void checkCache(Ignite g, String cacheName, boolean simulateTimeout,
-        boolean configureTimeout) throws Exception {
-        if (configureTimeout) {
-            GridCacheAdapter<Integer, Integer> cache = ((IgniteKernal)g).internalCache(cacheName);
-
-            cache.context().tm().slowTxWarnTimeout(500);
-        }
-
-        GridCache<Object, Object> cache1 = g.cache(cacheName);
-
-        IgniteTx tx = cache1.txStart();
-
-        try {
-            cache1.put(1, 1);
-
-            if (simulateTimeout)
-                Thread.sleep(800);
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        tx = cache1.txStart();
-
-        try {
-            cache1.put(1, 1);
-
-            if (simulateTimeout)
-                Thread.sleep(800);
-
-            tx.rollback();
-        }
-        finally {
-            tx.close();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
deleted file mode 100644
index 468dd39..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStopSelfTest.java
+++ /dev/null
@@ -1,201 +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.vm.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.testframework.junits.common.*;
-import org.apache.ignite.transactions.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Tests correct cache stopping.
- */
-public class GridCacheStopSelfTest extends GridCommonAbstractTest {
-    /** */
-    private static final String EXPECTED_MSG = "Grid is in invalid state to perform this operation. " +
-        "It either not started yet or has already being or have stopped";
-
-    /** */
-    private boolean atomic;
-
-    /** */
-    private boolean replicated;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi disc = new TcpDiscoverySpi();
-
-        disc.setIpFinder(new TcpDiscoveryVmIpFinder(true));
-
-        cfg.setDiscoverySpi(disc);
-
-        CacheConfiguration ccfg  = new CacheConfiguration();
-
-        ccfg.setCacheMode(replicated ? REPLICATED : PARTITIONED);
-
-        ccfg.setAtomicityMode(atomic ? ATOMIC : TRANSACTIONAL);
-
-        ccfg.setQueryIndexEnabled(true);
-        ccfg.setSwapEnabled(true);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testStopExplicitTransactions() throws Exception {
-        testStop(true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testStopImplicitTransactions() throws Exception {
-        testStop(false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testStopExplicitTransactionsReplicated() throws Exception {
-        replicated = true;
-
-        testStop(true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testStopImplicitTransactionsReplicated() throws Exception {
-        replicated = true;
-
-        testStop(false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testStopAtomic() throws Exception {
-        atomic = true;
-
-        testStop(false);
-    }
-
-    /**
-     * @param startTx If {@code true} starts transactions.
-     * @throws Exception If failed.
-     */
-    private void testStop(final boolean startTx) throws Exception {
-        for (int i = 0; i < 10; i++) {
-            startGrid(0);
-
-            final int PUT_THREADS = 50;
-
-            final CountDownLatch stopLatch = new CountDownLatch(1);
-
-            final CountDownLatch readyLatch = new CountDownLatch(PUT_THREADS);
-
-            final GridCache<Integer, Integer> cache = grid(0).cache(null);
-
-            assertNotNull(cache);
-
-            assertEquals(atomic ? ATOMIC : TRANSACTIONAL, cache.configuration().getAtomicityMode());
-            assertEquals(replicated ? REPLICATED : PARTITIONED, cache.configuration().getCacheMode());
-
-            Collection<IgniteInternalFuture<?>> putFuts = new ArrayList<>();
-
-            for (int j = 0; j < PUT_THREADS; j++) {
-                final int key = j;
-
-                putFuts.add(GridTestUtils.runAsync(new Callable<Void>() {
-                    @Override public Void call() throws Exception {
-                        if (startTx) {
-                            try (IgniteTx tx = cache.txStart()) {
-                                cache.put(key, key);
-
-                                readyLatch.countDown();
-
-                                stopLatch.await();
-
-                                tx.commit();
-                            }
-                        }
-                        else {
-                            readyLatch.countDown();
-
-                            stopLatch.await();
-
-                            cache.put(key, key);
-                        }
-
-                        return null;
-                    }
-                }));
-            }
-
-            readyLatch.await();
-
-            stopLatch.countDown();
-
-            stopGrid(0);
-
-            for (IgniteInternalFuture<?> fut : putFuts) {
-                try {
-                    fut.get();
-                }
-                catch (IgniteCheckedException e) {
-                    if (!e.getMessage().startsWith(EXPECTED_MSG))
-                        e.printStackTrace();
-
-                    assertTrue("Unexpected error message: " + e.getMessage(), e.getMessage().startsWith(EXPECTED_MSG));
-                }
-            }
-
-            try {
-                cache.put(1, 1);
-            }
-            catch (IllegalStateException e) {
-                if (!e.getMessage().startsWith(EXPECTED_MSG))
-                    e.printStackTrace();
-
-                assertTrue("Unexpected error message: " + e.getMessage(), e.getMessage().startsWith(EXPECTED_MSG));
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStorePutxSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStorePutxSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStorePutxSelfTest.java
deleted file mode 100644
index 862ed65..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStorePutxSelfTest.java
+++ /dev/null
@@ -1,158 +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.store.*;
-import org.apache.ignite.configuration.*;
-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 org.apache.ignite.transactions.*;
-import org.jetbrains.annotations.*;
-
-import javax.cache.configuration.*;
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Tests for reproduce problem with GG-6895:
- * putx calls CacheStore.load() when null GridPredicate passed in to avoid IDE warnings
- */
-public class GridCacheStorePutxSelfTest extends GridCommonAbstractTest {
-    /** */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private static AtomicInteger loads;
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        ccfg.setCacheMode(PARTITIONED);
-        ccfg.setAtomicityMode(TRANSACTIONAL);
-        ccfg.setWriteSynchronizationMode(FULL_SYNC);
-        ccfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
-        ccfg.setReadThrough(true);
-        ccfg.setWriteThrough(true);
-        ccfg.setLoadPreviousValue(true);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        loads = new AtomicInteger();
-
-        startGrid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopGrid();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPutxShouldNotTriggerLoad() throws Exception {
-        assertTrue(cache().putx(1, 1));
-        assertTrue(cache().putx(2, 2, (IgnitePredicate)null));
-
-        assertEquals(0, loads.get());
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPutxShouldNotTriggerLoadWithTx() throws Exception {
-        GridCache<Integer, Integer> cache = cache();
-
-        try (IgniteTx tx = cache.txStart()) {
-            assertTrue(cache.putx(1, 1));
-            assertTrue(cache.putx(2, 2, (IgnitePredicate)null));
-
-            tx.commit();
-        }
-
-        assertEquals(0, loads.get());
-    }
-
-    /** */
-    private static class TestStore extends CacheStore<Integer, Integer> {
-        /** {@inheritDoc} */
-        @Nullable @Override public Integer load(Integer key) {
-            loads.incrementAndGet();
-
-            return null;
-        }
-
-        /** {@inheritDoc} */
-        @Override public void loadCache(IgniteBiInClosure<Integer, Integer> clo, @Nullable Object... args) {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public Map<Integer, Integer> loadAll(Iterable<? extends Integer> keys) {
-            return Collections.emptyMap();
-        }
-
-        /** {@inheritDoc} */
-        @Override public void write(javax.cache.Cache.Entry<? extends Integer, ? extends Integer> entry) {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeAll(Collection<javax.cache.Cache.Entry<? extends Integer, ? extends Integer>> entries) {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void delete(Object key) {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void deleteAll(Collection<?> keys) {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void txEnd(boolean commit) {
-            // No-op.
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
deleted file mode 100644
index 94fd587..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheStoreValueBytesSelfTest.java
+++ /dev/null
@@ -1,111 +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 static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- * Test for {@link org.apache.ignite.cache.CacheConfiguration#isStoreValueBytes()}.
- */
-public class GridCacheStoreValueBytesSelfTest extends GridCommonAbstractTest {
-    /** */
-    private boolean storeValBytes;
-
-    /** VM ip finder for TCP discovery. */
-    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        cfg.setDiscoverySpi(disco);
-
-        CacheConfiguration ccfg = defaultCacheConfiguration();
-
-        ccfg.setCacheMode(REPLICATED);
-        ccfg.setWriteSynchronizationMode(FULL_SYNC);
-        ccfg.setStoreValueBytes(storeValBytes);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        stopAllGrids();
-    }
-
-    /**
-     * JUnit.
-     *
-     * @throws Exception If failed.
-     */
-    public void testDisabled() throws Exception {
-        storeValBytes = false;
-
-        Ignite g0 = startGrid(0);
-        Ignite g1 = startGrid(1);
-
-        GridCache<Integer, String> c = g0.cache(null);
-
-        c.put(1, "Cached value");
-
-        GridCacheEntryEx<Object, Object> entry = ((IgniteKernal)g1).internalCache().peekEx(1);
-
-        assert entry != null;
-        assert entry.valueBytes().isNull();
-    }
-
-    /**
-     * JUnit.
-     *
-     * @throws Exception If failed.
-     */
-    public void testEnabled() throws Exception {
-        storeValBytes = true;
-
-        Ignite g0 = startGrid(0);
-        Ignite g1 = startGrid(1);
-
-        GridCache<Integer, String> c = g0.cache(null);
-
-        c.put(1, "Cached value");
-
-        GridCacheEntryEx<Object, Object> entry = ((IgniteKernal)g1).internalCache().peekEx(1);
-
-        assert entry != null;
-        assert entry.valueBytes() != null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
deleted file mode 100644
index ea04a12..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapPreloadSelfTest.java
+++ /dev/null
@@ -1,223 +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.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.jetbrains.annotations.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CachePreloadMode.*;
-
-/**
- * Test for cache swap preloading.
- */
-public class GridCacheSwapPreloadSelfTest extends GridCommonAbstractTest {
-    /** Entry count. */
-    private static final int ENTRY_CNT = 15000;
-
-    /** */
-    private final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private CacheMode cacheMode;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        cfg.setDiscoverySpi(disco);
-
-        cfg.setNetworkTimeout(2000);
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setSwapEnabled(true);
-        cacheCfg.setCacheMode(cacheMode);
-        cacheCfg.setPreloadMode(SYNC);
-        cacheCfg.setEvictSynchronized(false);
-        cacheCfg.setEvictNearSynchronized(false);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        if (cacheMode == PARTITIONED)
-            cacheCfg.setBackups(1);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        return cfg;
-    }
-
-    /** @throws Exception If failed. */
-    public void testSwapReplicated() throws Exception {
-        cacheMode = REPLICATED;
-
-        checkSwap();
-    }
-
-    /** @throws Exception If failed. */
-    public void testSwapPartitioned() throws Exception {
-        cacheMode = PARTITIONED;
-
-        checkSwap();
-    }
-
-    /** @throws Exception If failed. */
-    private void checkSwap() throws Exception {
-        try {
-            startGrid(0);
-
-            GridCache<Integer, Integer> cache = grid(0).cache(null);
-
-            // Populate.
-            for (int i = 0; i < ENTRY_CNT; i++)
-                cache.put(i, i);
-
-            info("Put finished.");
-
-            // Evict all.
-            cache.evictAll();
-
-            info("Evict finished.");
-
-            for (int i = 0; i < ENTRY_CNT; i++)
-                assertNull(cache.peek(i));
-
-            assert cache.isEmpty();
-
-            startGrid(1);
-
-            int size = grid(1).cache(null).size();
-
-            info("New node cache size: " + size);
-
-            assertEquals(ENTRY_CNT, size);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * TODO: GG-4804 Swap preloading test failed with NotNull assertion, TODO: GG-4804 while key should have been found
-     * either in swap or in cache
-     *
-     * @throws Exception If failed.
-     */
-    public void _testSwapReplicatedMultithreaded() throws Exception {
-        cacheMode = REPLICATED;
-
-        checkSwapMultithreaded();
-    }
-
-    /** @throws Exception If failed. */
-    public void testSwapPartitionedMultithreaded() throws Exception {
-        cacheMode = PARTITIONED;
-
-        checkSwapMultithreaded();
-    }
-
-    /** @throws Exception If failed. */
-    private void checkSwapMultithreaded() throws Exception {
-        final AtomicBoolean done = new AtomicBoolean();
-        IgniteInternalFuture<?> fut = null;
-
-        try {
-            startGrid(0);
-
-            final GridCache<Integer, Integer> cache = grid(0).cache(null);
-
-            assertNotNull(cache);
-
-            // Populate.
-            for (int i = 0; i < ENTRY_CNT; i++)
-                cache.put(i, i);
-
-            cache.evictAll();
-
-            fut = multithreadedAsync(new Callable<Object>() {
-                @Nullable @Override public Object call() throws Exception {
-                    Random rnd = new Random();
-
-                    while (!done.get()) {
-                        int key = rnd.nextInt(ENTRY_CNT);
-
-                        Integer i = cache.get(key);
-
-                        assertNotNull(i);
-                        assertEquals(Integer.valueOf(key), i);
-
-                        boolean b = cache.evict(rnd.nextInt(ENTRY_CNT));
-
-                        assert b;
-                    }
-
-                    return null;
-                }
-            }, 10);
-
-            startGrid(1);
-
-            done.set(true);
-
-            int size = grid(1).cache(null).size();
-
-            info("New node cache size: " + size);
-
-            if (size != ENTRY_CNT) {
-                Iterable<Integer> keySet = new TreeSet<>(grid(1).<Integer, Integer>cache(null).keySet());
-
-                int next = 0;
-
-                for (Integer i : keySet) {
-                    while (next < i)
-                        info("Missing key: " + next++);
-
-                    next++;
-                }
-            }
-
-            assertEquals(ENTRY_CNT, size);
-        }
-        finally {
-            done.set(true);
-
-            try {
-                if (fut != null)
-                    fut.get();
-            }
-            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/GridCacheSwapReloadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java
deleted file mode 100644
index c80a872d..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheSwapReloadSelfTest.java
+++ /dev/null
@@ -1,240 +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.store.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.events.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-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.spi.swapspace.*;
-import org.apache.ignite.spi.swapspace.file.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import javax.cache.*;
-import javax.cache.configuration.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-import static java.util.concurrent.TimeUnit.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-import static org.apache.ignite.events.IgniteEventType.*;
-
-/**
- * Test that swap is released after entry is reloaded.
- */
-public class GridCacheSwapReloadSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(disco);
-
-        FileSwapSpaceSpi swap = new FileSwapSpaceSpi();
-
-        swap.setWriteBufferSize(1);
-
-        cfg.setSwapSpaceSpi(swap);
-
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setCacheMode(REPLICATED);
-        cacheCfg.setSwapEnabled(true);
-        cacheCfg.setWriteSynchronizationMode(FULL_SYNC);
-        cacheCfg.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(new TestStore()));
-        cacheCfg.setReadThrough(true);
-        cacheCfg.setWriteThrough(true);
-        cacheCfg.setLoadPreviousValue(true);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        startGrid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopGrid();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testReload() throws Exception {
-        final CountDownLatch swapLatch = new CountDownLatch(1);
-        final CountDownLatch unswapLatch = new CountDownLatch(1);
-
-        grid().events().localListen(new IgnitePredicate<IgniteEvent>() {
-            @Override public boolean apply(IgniteEvent evt) {
-                switch (evt.type()) {
-                    case EVT_SWAP_SPACE_DATA_STORED:
-                        swapLatch.countDown();
-
-                        break;
-
-                    case EVT_SWAP_SPACE_DATA_REMOVED:
-                        unswapLatch.countDown();
-
-                        break;
-
-                    case EVT_SWAP_SPACE_DATA_EVICTED:
-                        assert false : "Data eviction happened.";
-
-                        break;
-
-                    default:
-                        assert false;
-                }
-
-                return true;
-            }
-        }, EVT_SWAP_SPACE_DATA_STORED, EVT_SWAP_SPACE_DATA_REMOVED, EVT_SWAP_SPACE_DATA_EVICTED);
-
-        assert swap() != null;
-
-        assert cache().putx("key", "val");
-
-        assert swap().size(spaceName()) == 0;
-
-        assert cache().evict("key");
-
-        assert swapLatch.await(1, SECONDS);
-        Thread.sleep(100);
-
-        assert swap().count(spaceName()) == 1;
-        assert swap().size(spaceName()) > 0;
-
-        assert "val".equals(cache().reload("key"));
-
-        assert unswapLatch.await(1, SECONDS);
-
-        assert swap().count(spaceName()) == 0;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testReloadAll() throws Exception {
-        final CountDownLatch swapLatch = new CountDownLatch(2);
-        final CountDownLatch unswapLatch = new CountDownLatch(2);
-
-        grid().events().localListen(new IgnitePredicate<IgniteEvent>() {
-            @Override public boolean apply(IgniteEvent evt) {
-                switch (evt.type()) {
-                    case EVT_SWAP_SPACE_DATA_STORED:
-                        swapLatch.countDown();
-
-                        break;
-
-                    case EVT_SWAP_SPACE_DATA_REMOVED:
-                        unswapLatch.countDown();
-
-                        break;
-
-                    default:
-                        assert false;
-                }
-
-                return true;
-            }
-        }, EVT_SWAP_SPACE_DATA_STORED, EVT_SWAP_SPACE_DATA_REMOVED);
-
-        assert swap() != null;
-
-        assert cache().putx("key1", "val1");
-        assert cache().putx("key2", "val2");
-
-        assert swap().size(spaceName()) == 0;
-
-        assert cache().evict("key1");
-        assert cache().evict("key2");
-
-        assert swapLatch.await(1, SECONDS);
-        Thread.sleep(100);
-
-        assert swap().count(spaceName()) == 2;
-        assert swap().size(spaceName()) > 0 : swap().size(spaceName());
-
-        cache().reloadAll(F.asList("key1", "key2"));
-
-        assert unswapLatch.await(1, SECONDS);
-
-        assert swap().count(spaceName()) == 0;
-    }
-
-    /**
-     * @return Swap space SPI.
-     */
-    private SwapSpaceSpi swap() {
-        return grid().configuration().getSwapSpaceSpi();
-    }
-
-    /**
-     * @return Swap space name.
-     */
-    private String spaceName() {
-        return CU.swapSpaceName(((IgniteKernal)grid()).internalCache().context());
-    }
-
-    /**
-     * Test store.
-     */
-    private static class TestStore extends CacheStoreAdapter<Object, Object> {
-        /** */
-        private Map<Object, Object> map = new ConcurrentHashMap<>();
-
-        /** */
-        void reset() {
-            map.clear();
-        }
-
-        /** {@inheritDoc} */
-        @Override public Object load(Object key) {
-            return map.get(key);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void write(Cache.Entry<? extends Object, ? extends Object> entry) {
-            map.put(entry.getKey(), entry.getValue());
-        }
-
-        /** {@inheritDoc} */
-        @Override public void delete(Object key) {
-            map.remove(key);
-        }
-    }
-}


Mime
View raw message