http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java
deleted file mode 100644
index d5b97c2..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheConcurrentEvictionsSelfTest.java
+++ /dev/null
@@ -1,183 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.eviction.*;
-import org.apache.ignite.cache.eviction.fifo.*;
-import org.apache.ignite.cache.eviction.lru.*;
-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 java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.GridCacheMode.*;
-import static org.apache.ignite.cache.GridCacheDistributionMode.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*;
-
-/**
- *
- */
-public class GridCacheConcurrentEvictionsSelfTest extends 
GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
-
-    /** Replicated cache. */
-    private GridCacheMode mode = REPLICATED;
-
-    /** */
-    private GridCacheEvictionPolicy<?, ?> plc;
-
-    /** */
-    private GridCacheEvictionPolicy<?, ?> nearPlc;
-
-    /** */
-    private int warmUpPutsCnt;
-
-    /** */
-    private int iterCnt;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        c.getTransactionsConfiguration().setDefaultTxConcurrency(PESSIMISTIC);
-        c.getTransactionsConfiguration().setDefaultTxIsolation(READ_COMMITTED);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(mode);
-
-        cc.setSwapEnabled(false);
-
-        cc.setWriteSynchronizationMode(FULL_SYNC);
-
-        cc.setDistributionMode(PARTITIONED_ONLY);
-
-        cc.setEvictionPolicy(plc);
-        cc.setNearEvictionPolicy(nearPlc);
-
-        c.setCacheConfiguration(cc);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        return c;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        plc = null;
-        nearPlc = null;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testConcurrentPutsFifoLocal() throws Exception {
-        mode = LOCAL;
-        plc = new GridCacheFifoEvictionPolicy<Object, Object>(1000);
-        nearPlc = null;
-        warmUpPutsCnt = 100000;
-        iterCnt = 100000;
-
-        checkConcurrentPuts();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testConcurrentPutsLruLocal() throws Exception {
-        mode = LOCAL;
-        plc = new GridCacheLruEvictionPolicy<Object, Object>(1000);
-        nearPlc = null;
-        warmUpPutsCnt = 100000;
-        iterCnt = 100000;
-
-        checkConcurrentPuts();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    private void checkConcurrentPuts() throws Exception {
-        try {
-            Ignite ignite = startGrid(1);
-
-            final GridCache<Integer, Integer> cache = ignite.cache(null);
-
-            // Warm up.
-            for (int i = 0; i < warmUpPutsCnt; i++) {
-                cache.putx(i, i);
-
-                if (i != 0 && i % 1000 == 0)
-                    info("Warm up puts count: " + i);
-            }
-
-            info("Cache size: " + cache.size());
-
-            cache.removeAll();
-
-            final AtomicInteger idx = new AtomicInteger();
-
-            int threadCnt = 30;
-
-            long start = System.currentTimeMillis();
-
-            IgniteFuture<?> fut = multithreadedAsync(
-                new Callable<Object>() {
-                    @Override public Object call() throws Exception {
-                        for (int i = 0; i < iterCnt; i++) {
-                            int j = idx.incrementAndGet();
-
-                            cache.putx(j, j);
-
-                            if (i != 0 && i % 10000 == 0)
-                                // info("Puts count: " + i);
-                                info("Stats [putsCnt=" + i + ", size=" + 
cache.size() + ']');
-                        }
-
-                        return null;
-                    }
-                },
-                threadCnt
-            );
-
-            fut.get();
-
-            info("Test results [threadCnt=" + threadCnt + ", iterCnt=" + 
iterCnt + ", cacheSize=" + cache.size() +
-                ", duration=" + (System.currentTimeMillis() - start) + ']');
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
deleted file mode 100644
index eef2a35..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheDistributedEvictionsSelfTest.java
+++ /dev/null
@@ -1,265 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.eviction.fifo.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.processors.cache.distributed.*;
-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.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheDistributionMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-
-/**
- *
- */
-public class GridCacheDistributedEvictionsSelfTest extends 
GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private int gridCnt = 2;
-
-    /** */
-    private GridCacheMode mode;
-
-    /** */
-    private boolean nearEnabled;
-
-    /** */
-    private boolean evictSync;
-
-    /** */
-    private boolean evictNearSync;
-
-    /** */
-    private final AtomicInteger idxGen = new AtomicInteger();
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        TransactionsConfiguration tCfg = new TransactionsConfiguration();
-
-        tCfg.setDefaultTxConcurrency(PESSIMISTIC);
-        tCfg.setDefaultTxIsolation(READ_COMMITTED);
-
-        c.setTransactionsConfiguration(tCfg);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(mode);
-        cc.setAtomicityMode(TRANSACTIONAL);
-
-        cc.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : 
PARTITIONED_ONLY);
-
-        cc.setSwapEnabled(false);
-
-        
cc.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-
-        // Set only DHT policy, leave default near policy.
-        cc.setEvictionPolicy(new GridCacheFifoEvictionPolicy<>(10));
-        cc.setEvictSynchronized(evictSync);
-        cc.setEvictNearSynchronized(evictNearSync);
-        cc.setEvictSynchronizedKeyBufferSize(1);
-
-        cc.setAffinity(new GridCacheModuloAffinityFunction(gridCnt, 1));
-
-        c.setCacheConfiguration(cc);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        c.setUserAttributes(F.asMap(GridCacheModuloAffinityFunction.IDX_ATTR, 
idxGen.getAndIncrement()));
-
-        return c;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        stopAllGrids();
-
-        super.afterTest();
-    }
-
-    /** @throws Throwable If failed. */
-    public void testNearSyncBackupUnsync() throws Throwable {
-        gridCnt = 3;
-        mode = PARTITIONED;
-        evictNearSync = true;
-        evictSync = false;
-        nearEnabled = true;
-
-        checkEvictions();
-    }
-
-    /** @throws Throwable If failed. */
-    public void testNearSyncBackupSync() throws Throwable {
-        gridCnt = 3;
-        mode = PARTITIONED;
-        evictNearSync = true;
-        evictSync = true;
-        nearEnabled = true;
-
-        checkEvictions();
-    }
-
-    /** @throws Throwable If failed. */
-    public void testNearUnsyncBackupSync() throws Throwable {
-        gridCnt = 1;
-        mode = PARTITIONED;
-        evictNearSync = false;
-        evictSync = true;
-        nearEnabled = true;
-
-        try {
-            startGrid(0);
-
-            assert false : "Grid was started with illegal configuration.";
-        }
-        catch (IgniteCheckedException e) {
-            info("Caught expected exception: " + e);
-        }
-    }
-
-    /**
-     * http://atlassian.gridgain.com/jira/browse/GG-9002
-     *
-     * @throws Throwable If failed.
-     */
-    public void testLocalSync() throws Throwable {
-        gridCnt = 1;
-        mode = LOCAL;
-        evictNearSync = true;
-        evictSync = true;
-        nearEnabled = true;
-
-        Ignite g = startGrid(0);
-
-        final GridCache<Integer, Integer> cache = g.cache(null);
-
-        for (int i = 1; i < 20; i++) {
-            cache.putx(i * gridCnt, i * gridCnt);
-
-            info("Put to cache: " + i * gridCnt);
-        }
-    }
-
-    /** @throws Throwable If failed. */
-    private void checkEvictions() throws Throwable {
-        try {
-            startGrids(gridCnt);
-
-            Ignite ignite = grid(0);
-
-            final GridCache<Integer, Integer> cache = ignite.cache(null);
-
-            // Put 1 entry to primary node.
-            cache.putx(0, 0);
-
-            Integer nearVal = this.<Integer, Integer>cache(2).get(0);
-
-            assert nearVal == 0 : "Unexpected near value: " + nearVal;
-
-            // Put several vals to primary node.
-            for (int i = 1; i < 20; i++) {
-                cache.putx(i * gridCnt, i * gridCnt);
-
-                info("Put to cache: " + i * gridCnt);
-            }
-
-            for (int i = 0; i < 3; i++) {
-                try {
-                    assert cache(2).get(0) == null : "Entry has not been 
evicted from near node for key: " + 0;
-                    assert cache(1).get(0) == null : "Entry has not been 
evicted from backup node for key: " + 0;
-                    assert cache.get(0) == null : "Entry has not been evicted 
from primary node for key: " + 0;
-                }
-                catch (Throwable e) {
-                    if (i == 2)
-                        // No attempts left.
-                        throw e;
-
-                    U.warn(log, "Check failed (will retry in 2000 ms): " + e);
-
-                    // Unwind evicts?
-                    cache.get(0);
-
-                    U.sleep(2000);
-                }
-            }
-
-            for (int i = 0; i < 3; i++) {
-                info("Primary key set: " + new TreeSet<>(this.<Integer, 
Integer>dht(0).keySet()));
-                info("Primary near key set: " + new TreeSet<>(this.<Integer, 
Integer>near(0).keySet()));
-
-                info("Backup key set: " + new TreeSet<>(this.<Integer, 
Integer>dht(1).keySet()));
-                info("Backup near key set: " + new TreeSet<>(this.<Integer, 
Integer>near(1).keySet()));
-
-                info("Near key set: " + new TreeSet<>(this.<Integer, 
Integer>dht(2).keySet()));
-                info("Near node near key set: " + new TreeSet<>(this.<Integer, 
Integer>near(2).keySet()));
-
-                try {
-                    assert cache.size() == 10 : "Invalid cache size [size=" + 
cache.size() +
-                        ", keys=" + new TreeSet<>(cache.keySet()) + ']';
-                    assert cache.size() == 10 : "Invalid key size [size=" + 
cache.size() +
-                        ", keys=" + new TreeSet<>(cache.keySet()) + ']';
-
-                    assert cache(2).isEmpty();
-
-                    break;
-                }
-                catch (Throwable e) {
-                    if (i == 2)
-                        // No attempts left.
-                        throw e;
-
-                    U.warn(log, "Check failed (will retry in 2000 ms): " + e);
-
-                    // Unwind evicts?
-                    cache.get(0);
-
-                    U.sleep(2000);
-                }
-            }
-        }
-        catch (Throwable t) {
-            error("Test failed.", t);
-
-            throw t;
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
deleted file mode 100644
index 900dd30..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesAbstractSelfTest.java
+++ /dev/null
@@ -1,304 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.store.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.transactions.*;
-import org.apache.ignite.cache.eviction.GridCacheEvictionPolicy;
-import org.apache.ignite.cache.eviction.fifo.GridCacheFifoEvictionPolicy;
-import org.apache.ignite.cache.store.CacheStore;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-
-import javax.cache.*;
-import javax.cache.configuration.*;
-
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-
-/**
- * Tests that cache handles {@code setAllowEmptyEntries} flag correctly.
- */
-public abstract class GridCacheEmptyEntriesAbstractSelfTest extends 
GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private GridCacheEvictionPolicy<?, ?> plc;
-
-    /** */
-    private GridCacheEvictionPolicy<?, ?> nearPlc;
-
-    /** Test store. */
-    private CacheStore<String, String> testStore;
-
-    /** Tx concurrency to use. */
-    private IgniteTxConcurrency txConcurrency;
-
-    /** Tx isolation to use. */
-    private IgniteTxIsolation txIsolation;
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        TransactionsConfiguration txCfg = c.getTransactionsConfiguration();
-
-        txCfg.setDefaultTxConcurrency(txConcurrency);
-        txCfg.setDefaultTxIsolation(txIsolation);
-        txCfg.setTxSerializableEnabled(true);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(cacheMode());
-        cc.setAtomicityMode(TRANSACTIONAL);
-
-        cc.setSwapEnabled(false);
-
-        
cc.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        cc.setDistributionMode(GridCacheDistributionMode.PARTITIONED_ONLY);
-
-        cc.setEvictionPolicy(plc);
-        cc.setNearEvictionPolicy(nearPlc);
-        cc.setEvictSynchronizedKeyBufferSize(1);
-
-        cc.setEvictNearSynchronized(true);
-        cc.setEvictSynchronized(true);
-
-        if (testStore != null) {
-            cc.setCacheStoreFactory(new 
FactoryBuilder.SingletonFactory(testStore));
-            cc.setReadThrough(true);
-            cc.setWriteThrough(true);
-            cc.setLoadPreviousValue(true);
-        }
-        else
-            cc.setCacheStoreFactory(null);
-
-        c.setCacheConfiguration(cc);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        return c;
-    }
-
-    /**
-     * Starts grids depending on testing cache.
-     *
-     * @return First grid node.
-     * @throws Exception If failed.
-     */
-    protected abstract Ignite startGrids() throws Exception;
-
-    /** @return Cache mode for particular test. */
-    protected abstract GridCacheMode cacheMode();
-
-    /**
-     * Tests FIFO eviction policy.
-     *
-     * @throws Exception If failed.
-     */
-    public void testFifo() throws Exception {
-        plc = new GridCacheFifoEvictionPolicy(50);
-        nearPlc = new GridCacheFifoEvictionPolicy(50);
-
-        checkPolicy();
-    }
-
-    /**
-     * Checks policy with and without store set.
-     *
-     * @throws Exception If failed.
-     */
-    private void checkPolicy() throws Exception {
-        testStore = null;
-
-        checkPolicy0();
-
-        testStore = new CacheStoreAdapter<String, String>() {
-            @Override public String load(String key) {
-                return null;
-            }
-
-            @Override public void write(Cache.Entry<? extends String, ? 
extends String> e) {
-                // No-op.
-            }
-
-            @Override public void delete(Object key) {
-                // No-op.
-            }
-        };
-
-        checkPolicy0();
-    }
-
-    /**
-     * Tests preset eviction policy.
-     *
-     * @throws Exception If failed.
-     */
-    private void checkPolicy0() throws Exception {
-        for (IgniteTxConcurrency concurrency : IgniteTxConcurrency.values()) {
-            txConcurrency = concurrency;
-
-            for (IgniteTxIsolation isolation : IgniteTxIsolation.values()) {
-                txIsolation = isolation;
-
-                Ignite g = startGrids();
-
-                GridCache<String, String> cache = g.cache(null);
-
-                try {
-                    info(">>> Checking policy [txConcurrency=" + txConcurrency 
+ ", txIsolation=" + txIsolation +
-                        ", plc=" + plc + ", nearPlc=" + nearPlc + ']');
-
-                    checkExplicitTx(cache);
-
-                    checkImplicitTx(cache);
-                }
-                finally {
-                    stopAllGrids();
-                }
-            }
-        }
-    }
-
-    /**
-     * Checks that gets work for implicit txs.
-     *
-     * @param cache Cache to test.
-     * @throws Exception If failed.
-     */
-    private void checkImplicitTx(GridCache<String, String> cache) throws 
Exception {
-        assertNull(cache.get("key1"));
-        assertNull(cache.getAsync("key2").get());
-
-        assertTrue(cache.getAll(F.asList("key3", "key4")).isEmpty());
-        assertTrue(cache.getAllAsync(F.asList("key5", 
"key6")).get().isEmpty());
-
-        cache.put("key7", "key7");
-        cache.remove("key7", "key7");
-        assertNull(cache.get("key7"));
-
-        checkEmpty(cache);
-    }
-
-    /**
-     * Checks that gets work for implicit txs.
-     *
-     * @param cache Cache to test.
-     * @throws Exception If failed.
-     */
-    private void checkExplicitTx(GridCache<String, String> cache) throws 
Exception {
-        IgniteTx tx = cache.txStart();
-
-        try {
-            assertNull(cache.get("key1"));
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        tx = cache.txStart();
-
-        try {
-            assertNull(cache.getAsync("key2").get());
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        tx = cache.txStart();
-
-        try {
-            assertTrue(cache.getAll(F.asList("key3", "key4")).isEmpty());
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        tx = cache.txStart();
-
-        try {
-            assertTrue(cache.getAllAsync(F.asList("key5", 
"key6")).get().isEmpty());
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        tx = cache.txStart();
-
-        try {
-            cache.put("key7", "key7");
-
-            cache.remove("key7");
-
-            assertNull(cache.get("key7"));
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        checkEmpty(cache);
-    }
-
-    /**
-     * Checks that cache is empty.
-     *
-     * @param cache Cache to check.
-     * @throws org.apache.ignite.IgniteInterruptedException If interrupted 
while sleeping.
-     */
-    @SuppressWarnings({"ErrorNotRethrown", "TypeMayBeWeakened"})
-    private void checkEmpty(GridCache<String, String> cache) throws 
IgniteInterruptedException {
-        for (int i = 0; i < 3; i++) {
-            try {
-                assertTrue(cache.entrySet().toString(), 
cache.entrySet().isEmpty());
-
-                break;
-            }
-            catch (AssertionError e) {
-                if (i == 2)
-                    throw e;
-
-                info(">>> Cache is not empty, flushing evictions.");
-
-                U.sleep(1000);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesLocalSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesLocalSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesLocalSelfTest.java
deleted file mode 100644
index eea6f23..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesLocalSelfTest.java
+++ /dev/null
@@ -1,41 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-
-/**
- *
- */
-public class GridCacheEmptyEntriesLocalSelfTest extends 
GridCacheEmptyEntriesAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected Ignite startGrids() throws Exception {
-        return startGrid();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected GridCacheMode cacheMode() {
-        return GridCacheMode.LOCAL;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void testFifo() throws Exception {
-        super.testFifo();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesPartitionedSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesPartitionedSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesPartitionedSelfTest.java
deleted file mode 100644
index c676c20..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEmptyEntriesPartitionedSelfTest.java
+++ /dev/null
@@ -1,41 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-
-/**
- * Test allow empty entries flag on partitioned cache.
- */
-public class GridCacheEmptyEntriesPartitionedSelfTest extends 
GridCacheEmptyEntriesAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected Ignite startGrids() throws Exception {
-        return startGridsMultiThreaded(3);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected GridCacheMode cacheMode() {
-        return GridCacheMode.PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void testFifo() throws Exception {
-        super.testFifo();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionAbstractTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionAbstractTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionAbstractTest.java
deleted file mode 100644
index 217b662..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionAbstractTest.java
+++ /dev/null
@@ -1,462 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.eviction.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.transactions.*;
-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.internal.util.typedef.*;
-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.events.IgniteEventType.*;
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-import static org.apache.ignite.cache.GridCacheDistributionMode.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*;
-
-/**
- * Base class for eviction tests.
- */
-public abstract class GridCacheEvictionAbstractTest<T extends 
GridCacheEvictionPolicy<?, ?>>
-    extends GridCommonAbstractTest {
-    /** IP finder. */
-    protected static final TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
-
-    /** Replicated cache. */
-    protected GridCacheMode mode = REPLICATED;
-
-    /** Near enabled flag. */
-    protected boolean nearEnabled;
-
-    /** Evict backup sync. */
-    protected boolean evictSync;
-
-    /** Evict near sync. */
-    protected boolean evictNearSync = true;
-
-    /** Policy max. */
-    protected int plcMax = 10;
-
-    /** Near policy max. */
-    protected int nearMax = 3;
-
-    /** Synchronous commit. */
-    protected boolean syncCommit;
-
-    /** */
-    protected int gridCnt = 2;
-
-    /** */
-    protected GridCacheEvictionFilter<?, ?> filter;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(mode);
-        cc.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : 
PARTITIONED_ONLY);
-        cc.setEvictionPolicy(createPolicy(plcMax));
-        cc.setNearEvictionPolicy(createNearPolicy(nearMax));
-        cc.setEvictSynchronized(evictSync);
-        cc.setEvictNearSynchronized(evictNearSync);
-        cc.setSwapEnabled(false);
-        cc.setWriteSynchronizationMode(syncCommit ? FULL_SYNC : FULL_ASYNC);
-        cc.setStartSize(plcMax);
-        cc.setAtomicityMode(TRANSACTIONAL);
-
-        if (mode == PARTITIONED)
-            cc.setBackups(1);
-
-        if (filter != null)
-            cc.setEvictionFilter(filter);
-
-        c.setCacheConfiguration(cc);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        c.setIncludeEventTypes(EVT_TASK_FAILED, EVT_TASK_FINISHED, 
EVT_JOB_MAPPED);
-
-        c.setIncludeProperties();
-
-        return c;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        filter = null;
-
-        super.afterTestsStopped();
-    }
-
-    /**
-     * @param arr Array.
-     * @param idx Index.
-     * @return Entry at the index.
-     */
-    protected MockEntry entry(MockEntry[] arr, int idx) {
-        MockEntry e = arr[idx];
-
-        if (e.isEvicted())
-            e = arr[idx] = new MockEntry(e.getKey());
-
-        return e;
-    }
-
-    /**
-     * @param prefix Prefix.
-     * @param p Policy.
-     */
-    protected void info(String prefix, GridCacheEvictionPolicy<?, ?> p) {
-        info(prefix + ": " + p.toString());
-    }
-
-    /** @param p Policy. */
-    protected void info(GridCacheEvictionPolicy<?, ?> p) {
-        info(p.toString());
-    }
-
-    /**
-     * @param c1 Policy collection.
-     * @param c2 Expected list.
-     */
-    protected void check(Collection<GridCacheEntry<String, String>> c1, 
MockEntry... c2) {
-        check(c1, F.asList(c2));
-    }
-
-    /** @return Policy. */
-    @SuppressWarnings({"unchecked"})
-    protected T policy() {
-        return (T)grid().cache(null).configuration().getEvictionPolicy();
-    }
-
-    /**
-     * @param i Grid index.
-     * @return Policy.
-     */
-    @SuppressWarnings({"unchecked"})
-    protected T policy(int i) {
-        return (T)grid(i).cache(null).configuration().getEvictionPolicy();
-    }
-
-    /**
-     * @param i Grid index.
-     * @return Policy.
-     */
-    @SuppressWarnings({"unchecked"})
-    protected T nearPolicy(int i) {
-        return (T)grid(i).cache(null).configuration().getNearEvictionPolicy();
-    }
-
-    /**
-     * @param c1 Policy collection.
-     * @param c2 Expected list.
-     */
-    protected void check(Collection<GridCacheEntry<String, String>> c1, 
List<MockEntry> c2) {
-        assert c1.size() == c2.size() : "Mismatch [actual=" + string(c1) + ", 
expected=" + string(c2) + ']';
-
-        assert c1.containsAll(c2) : "Mismatch [actual=" + string(c1) + ", 
expected=" + string(c2) + ']';
-
-        int i = 0;
-
-        // Check order.
-        for (GridCacheEntry<String, String> e : c1)
-            assertEquals(e, c2.get(i++));
-    }
-
-    /**
-     * @param c Collection.
-     * @return String.
-     */
-    protected String string(Iterable<? extends GridCacheEntry> c) {
-        return "[" + F.fold(c, "", new C2<GridCacheEntry, String, String>() {
-            @Override public String apply(GridCacheEntry e, String b) {
-                return b.isEmpty() ? e.getKey().toString() : b + ", " + 
e.getKey();
-            }
-        }) + "]]";
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearDisabled() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = false;
-        plcMax = 10;
-        syncCommit = true;
-
-        gridCnt = 2;
-
-        checkPartitioned(plcMax, plcMax, false);
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearEnabled() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = true;
-        nearMax = 3;
-        plcMax = 10;
-        evictNearSync = true;
-        syncCommit = true;
-
-        gridCnt = 2;
-
-        checkPartitioned(0, 0, true); // Near size is 0 because of backups 
present.
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearDisabledMultiThreaded() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = false;
-        plcMax = 100;
-        evictSync = false;
-
-        gridCnt = 2;
-
-        checkPartitionedMultiThreaded(gridCnt);
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearDisabledBackupSyncMultiThreaded() throws 
Exception {
-        mode = PARTITIONED;
-        nearEnabled = false;
-        plcMax = 100;
-        evictSync = true;
-
-        gridCnt = 2;
-
-        checkPartitionedMultiThreaded(gridCnt);
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearEnabledMultiThreaded() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = true;
-        plcMax = 10;
-        evictSync = false;
-
-        gridCnt = 2;
-
-        checkPartitionedMultiThreaded(gridCnt);
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearEnabledBackupSyncMultiThreaded() throws 
Exception {
-        mode = PARTITIONED;
-        nearEnabled = true;
-        plcMax = 10;
-        evictSync = true;
-
-        gridCnt = 2;
-
-        checkPartitionedMultiThreaded(gridCnt);
-    }
-
-    /**
-     * @param endSize Final near size.
-     * @param endPlcSize Final near policy size.
-     * @throws Exception If failed.
-     */
-    private void checkPartitioned(int endSize, int endPlcSize, boolean near) 
throws Exception {
-        startGridsMultiThreaded(gridCnt);
-
-        try {
-            Random rand = new Random();
-
-            int cnt = 500;
-
-            for (int i = 0; i < cnt; i++) {
-                GridCache<Integer, String> cache = 
grid(rand.nextInt(2)).cache(null);
-
-                int key = rand.nextInt(100);
-                String val = Integer.toString(key);
-
-                cache.put(key, val);
-
-                if (i % 100 == 0)
-                    info("Stored cache object for key [key=" + key + ", idx=" 
+ i + ']');
-            }
-
-            if (near) {
-                for (int i = 0; i < gridCnt; i++)
-                    assertEquals(endSize, near(i).nearSize());
-
-                if (endPlcSize >= 0)
-                    checkNearPolicies(endPlcSize);
-            }
-            else {
-                for (int i = 0; i < gridCnt; i++) {
-                    int actual = colocated(i).size();
-
-                    assertTrue("Cache size is greater then policy size 
[expected=" + endSize + ", actual=" + actual + ']',
-                        actual <= endSize);
-                }
-
-                checkPolicies(endPlcSize);
-            }
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @param gridCnt Grid count.
-     * @throws Exception If failed.
-     */
-    protected void checkPartitionedMultiThreaded(int gridCnt) throws Exception 
{
-        try {
-            startGridsMultiThreaded(gridCnt);
-
-            final Random rand = new Random();
-
-            final AtomicInteger cntr = new AtomicInteger();
-
-            multithreaded(new Callable() {
-                @Nullable @Override public Object call() throws Exception {
-                    int cnt = 100;
-
-                    for (int i = 0; i < cnt && 
!Thread.currentThread().isInterrupted(); i++) {
-                        GridCache<Integer, String> cache = 
grid(rand.nextInt(2)).cache(null);
-
-                        int key = rand.nextInt(1000);
-                        String val = Integer.toString(key);
-
-                        try (IgniteTx tx = cache.txStart(PESSIMISTIC, 
REPEATABLE_READ)) {
-                            String v = cache.get(key);
-
-                            assert v == null || 
v.equals(Integer.toString(key)) : "Invalid value for key [key=" + key +
-                                ", val=" + v + ']';
-
-                            cache.put(key, val);
-
-                            tx.commit();
-                        }
-
-                        if (cntr.incrementAndGet() % 100 == 0)
-                            info("Stored cache object for key [key=" + key + 
", idx=" + i + ']');
-                    }
-
-                    return null;
-                }
-            }, 10);
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @param plcMax Policy max.
-     * @return Policy.
-     */
-    protected abstract T createPolicy(int plcMax);
-
-    /**
-     * @param nearMax Near max.
-     * @return Policy.
-     */
-    protected abstract T createNearPolicy(int nearMax);
-
-    /**
-     * Performs after-test near policy check.
-     *
-     * @param nearMax Near max.
-     */
-    protected abstract void checkNearPolicies(int nearMax);
-
-    /**
-     * Performs after-test policy check.
-     *
-     * @param plcMax Maximum allowed size of ploicy.
-     */
-    protected abstract void checkPolicies(int plcMax);
-
-    /**
-     *
-     */
-    @SuppressWarnings({"PublicConstructorInNonPublicClass"})
-    protected static class MockEntry extends GridCacheMockEntry<String, 
String> {
-        /** */
-        private final GridCacheProjection<String, String> parent;
-
-        /** Entry value. */
-        private String val;
-
-        /** @param key Key. */
-        public MockEntry(String key) {
-            super(key);
-
-            parent = null;
-        }
-
-        /**
-         * @param key Key.
-         * @param val Value.
-         */
-        public MockEntry(String key, String val) {
-            super(key);
-
-            this.val = val;
-            parent = null;
-        }
-
-        /**
-         * @param key Key.
-         * @param parent Parent.
-         */
-        public MockEntry(String key, @Nullable GridCacheProjection<String, 
String> parent) {
-            super(key);
-
-            this.parent = parent;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String getValue() throws IllegalStateException {
-            return val;
-        }
-
-        /** {@inheritDoc} */
-        @Override public String setValue(String val) {
-            String old = this.val;
-
-            this.val = val;
-
-            return old;
-        }
-
-        /** {@inheritDoc} */
-        @Override public GridCacheProjection<String, String> projection() {
-            return parent;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
deleted file mode 100644
index bd12d0b..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionFilterSelfTest.java
+++ /dev/null
@@ -1,249 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.eviction.*;
-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.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-import static org.apache.ignite.cache.GridCacheDistributionMode.*;
-import static org.apache.ignite.cache.GridCachePreloadMode.*;
-
-/**
- * Base class for eviction tests.
- */
-public class GridCacheEvictionFilterSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
-
-    /** Replicated cache. */
-    private GridCacheMode mode = REPLICATED;
-
-    /** Near enabled flag. */
-    private boolean nearEnabled;
-
-    /** */
-    private EvictionFilter filter;
-
-    /** Policy. */
-    private GridCacheEvictionPolicy<Object, Object> plc = new 
GridCacheEvictionPolicy<Object, Object>() {
-        @Override public void onEntryAccessed(boolean rmv, GridCacheEntry 
entry) {
-            assert !(entry.peek() instanceof Integer);
-        }
-    };
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(mode);
-        cc.setDistributionMode(nearEnabled ? NEAR_PARTITIONED : 
PARTITIONED_ONLY);
-        cc.setEvictionPolicy(plc);
-        cc.setNearEvictionPolicy(plc);
-        cc.setEvictSynchronized(false);
-        cc.setEvictNearSynchronized(false);
-        cc.setSwapEnabled(false);
-        
cc.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        cc.setEvictionFilter(filter);
-        cc.setPreloadMode(SYNC);
-        cc.setAtomicityMode(TRANSACTIONAL);
-
-        if (mode == PARTITIONED)
-            cc.setBackups(1);
-
-        c.setCacheConfiguration(cc);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        return c;
-    }
-
-    /** @throws Exception If failed. */
-    public void testLocal() throws Exception {
-        mode = LOCAL;
-
-        checkEvictionFilter();
-    }
-
-    /** @throws Exception If failed. */
-    public void testReplicated() throws Exception {
-        mode = REPLICATED;
-
-        checkEvictionFilter();
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitioned() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = true;
-
-        checkEvictionFilter();
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitionedNearDisabled() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = false;
-
-        checkEvictionFilter();
-    }
-
-    /** @throws Exception If failed. */
-    @SuppressWarnings("BusyWait")
-    private void checkEvictionFilter() throws Exception {
-        filter = new EvictionFilter();
-
-        startGridsMultiThreaded(2);
-
-        try {
-            Ignite g = grid(0);
-
-            GridCache<Object, Object> c = g.cache(null);
-
-            int cnt = 1;
-
-            for (int i = 0; i < cnt; i++)
-                c.putx(i, i);
-
-            Map<Object, AtomicInteger> cnts = filter.counts();
-
-            int exp = mode == LOCAL ? 1 : mode == REPLICATED ? 2 : nearEnabled 
? 3 : 2;
-
-            for (int j = 0; j < 3; j++) {
-                boolean success = true;
-
-                for (int i = 0; i < cnt; i++) {
-                    int cnt0 = cnts.get(i).get();
-
-                    success = cnt0 == exp;
-
-                    if (!success) {
-                        U.warn(log, "Invalid count for key [key=" + i + ", 
cnt=" + cnt0 + ", expected=" + exp + ']');
-
-                        break;
-                    }
-                    else
-                        info("Correct count for key [key=" + i + ", cnt=" + 
cnt0 + ']');
-                }
-
-                if (success)
-                    break;
-
-                if (j < 2)
-                    Thread.sleep(1000);
-                else
-                    assert false : "Test has not succeeded (see log for 
details).";
-            }
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * This test case is just to visualize a support issue from client. It 
does not fail.
-     *
-     * @throws Exception If failed.
-     */
-    public void _testPartitionedMixed() throws Exception {
-        mode = PARTITIONED;
-        nearEnabled = false;
-
-        filter = new EvictionFilter();
-
-        Ignite g = startGrid();
-
-        GridCache<Object, Object> cache = g.cache(null);
-
-        try {
-            int id = 1;
-
-            cache.putx(id++, 1);
-            cache.putx(id++, 2);
-
-            for (int i = id + 1; i < 10; i++) {
-                cache.putx(id, id);
-
-                cache.putx(i, String.valueOf(i));
-            }
-
-            info(">>>> " + cache.get(1));
-            info(">>>> " + cache.get(2));
-            info(">>>> " + cache.get(3));
-        }
-        finally {
-            stopGrid();
-        }
-    }
-
-    /**
-     *
-     */
-    private final class EvictionFilter implements 
GridCacheEvictionFilter<Object, Object> {
-        /** */
-        private final ConcurrentMap<Object, AtomicInteger> cnts = new 
ConcurrentHashMap<>();
-
-        /** {@inheritDoc} */
-        @Override public boolean evictAllowed(GridCacheEntry<Object, Object> 
entry) {
-            AtomicInteger i = cnts.get(entry.getKey());
-
-            if (i == null) {
-                AtomicInteger old = cnts.putIfAbsent(entry.getKey(), i = new 
AtomicInteger());
-
-                if (old != null)
-                    i = old;
-            }
-
-            i.incrementAndGet();
-
-            String grid = entry.projection().gridProjection().ignite().name();
-
-            boolean ret = !(entry.peek() instanceof Integer);
-
-            if (!ret)
-                info(">>> Not evicting key [grid=" + grid + ", key=" + 
entry.getKey() + ", cnt=" + i.get() + ']');
-            else
-                info(">>> Evicting key [grid=" + grid + ", key=" + 
entry.getKey() + ", cnt=" + i.get() + ']');
-
-            return ret;
-        }
-
-        /** @return Counts. */
-        ConcurrentMap<Object, AtomicInteger> counts() {
-            return cnts;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java
deleted file mode 100644
index 6890358..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionLockUnlockSelfTest.java
+++ /dev/null
@@ -1,175 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.*;
-import org.apache.ignite.cache.eviction.*;
-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 java.util.concurrent.TimeUnit.*;
-import static org.apache.ignite.cache.GridCacheAtomicityMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-import static org.apache.ignite.cache.GridCacheDistributionMode.*;
-import static org.apache.ignite.events.IgniteEventType.*;
-
-/**
- *
- */
-public class GridCacheEvictionLockUnlockSelfTest extends 
GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
-
-    /** Evict latch. */
-    private static CountDownLatch evictLatch;
-
-    /** Evict counter. */
-    private static final AtomicInteger evictCnt = new AtomicInteger();
-
-    /** Touch counter. */
-    private static final AtomicInteger touchCnt = new AtomicInteger();
-
-    /** Cache mode. */
-    private GridCacheMode mode;
-
-    /** Number of grids to start. */
-    private int gridCnt;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(mode);
-        
cc.setWriteSynchronizationMode(GridCacheWriteSynchronizationMode.FULL_SYNC);
-        cc.setEvictionPolicy(new EvictionPolicy());
-        cc.setNearEvictionPolicy(new EvictionPolicy());
-        cc.setEvictNearSynchronized(false);
-        cc.setAtomicityMode(TRANSACTIONAL);
-        cc.setDistributionMode(NEAR_PARTITIONED);
-
-        if (mode == PARTITIONED)
-            cc.setBackups(1);
-
-        c.setCacheConfiguration(cc);
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(discoSpi);
-
-        return c;
-    }
-
-    /** @throws Exception If failed. */
-    public void testLocal() throws Exception {
-        mode = LOCAL;
-        gridCnt = 1;
-
-        doTest();
-    }
-
-    /** @throws Exception If failed. */
-    public void testReplicated() throws Exception {
-        mode = REPLICATED;
-        gridCnt = 3;
-
-        doTest();
-    }
-
-    /** @throws Exception If failed. */
-    public void testPartitioned() throws Exception {
-        mode = PARTITIONED;
-        gridCnt = 3;
-
-        doTest();
-    }
-
-    /** @throws Exception If failed. */
-    private void doTest() throws Exception {
-        try {
-            startGridsMultiThreaded(gridCnt);
-
-            for (int i = 0; i < gridCnt; i++)
-                grid(i).events().localListen(new EvictListener(), 
EVT_CACHE_ENTRY_EVICTED);
-
-            for (int i = 0; i < gridCnt; i++) {
-                reset();
-
-                IgniteCache<Object, Object> cache = jcache(i);
-
-                cache.lock("key").lock();
-                cache.lock("key").unlock();
-
-                assertTrue(evictLatch.await(3, SECONDS));
-
-                assertEquals(gridCnt, evictCnt.get());
-                assertEquals(gridCnt, touchCnt.get());
-
-                for (int j = 0; j < gridCnt; j++)
-                    assertFalse(cache(j).containsKey("key"));
-            }
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** @throws Exception If failed. */
-    private void reset() throws Exception {
-        evictLatch = new CountDownLatch(gridCnt);
-
-        evictCnt.set(0);
-        touchCnt.set(0);
-    }
-
-    /** Eviction event listener. */
-    private static class EvictListener implements IgnitePredicate<IgniteEvent> 
{
-        /** {@inheritDoc} */
-        @Override public boolean apply(IgniteEvent evt) {
-            assert evt.type() == EVT_CACHE_ENTRY_EVICTED;
-
-            evictCnt.incrementAndGet();
-
-            evictLatch.countDown();
-
-            return true;
-        }
-    }
-
-    /** Eviction policy. */
-    private static class EvictionPolicy implements 
GridCacheEvictionPolicy<Object, Object> {
-        /** {@inheritDoc} */
-        @Override public void onEntryAccessed(boolean rmv, 
GridCacheEntry<Object, Object> entry) {
-            touchCnt.incrementAndGet();
-
-            entry.evict();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
deleted file mode 100644
index 7eab6f7..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheEvictionTouchSelfTest.java
+++ /dev/null
@@ -1,347 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.eviction.*;
-import org.apache.ignite.cache.eviction.fifo.*;
-import org.apache.ignite.cache.store.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.transactions.*;
-import org.gridgain.grid.kernal.processors.cache.*;
-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.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import javax.cache.configuration.*;
-import java.util.*;
-
-import static org.apache.ignite.cache.GridCacheMode.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-import static org.apache.ignite.cache.GridCacheWriteSynchronizationMode.*;
-
-/**
- *
- */
-public class GridCacheEvictionTouchSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
-
-    /** */
-    private GridCacheEvictionPolicy<?, ?> plc;
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected IgniteConfiguration getConfiguration(String gridName) 
throws Exception {
-        IgniteConfiguration c = super.getConfiguration(gridName);
-
-        TransactionsConfiguration txCfg = c.getTransactionsConfiguration();
-
-        txCfg.setDefaultTxConcurrency(PESSIMISTIC);
-        txCfg.setDefaultTxIsolation(REPEATABLE_READ);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(REPLICATED);
-
-        cc.setSwapEnabled(false);
-
-        cc.setWriteSynchronizationMode(FULL_SYNC);
-
-        cc.setEvictionPolicy(plc);
-
-        CacheStore store = new GridCacheGenericTestStore<Object, Object>() {
-            @Override public Object load(Object key) {
-                return key;
-            }
-
-            @Override public Map<Object, Object> loadAll(Iterable<?> keys) {
-                Map<Object, Object> loaded = new HashMap<>();
-
-                for (Object key : keys)
-                    loaded.put(key, key);
-
-                return loaded;
-            }
-        };
-
-        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
-        cc.setReadThrough(true);
-        cc.setWriteThrough(true);
-        cc.setLoadPreviousValue(true);
-
-        c.setCacheConfiguration(cc);
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(ipFinder);
-
-        c.setDiscoverySpi(disco);
-
-        return c;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        plc = null;
-
-        super.afterTest();
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPolicyConsistency() throws Exception {
-        plc = new GridCacheFifoEvictionPolicy<Object, Object>(500);
-
-        try {
-            Ignite ignite = startGrid(1);
-
-            final GridCache<Integer, Integer> cache = ignite.cache(null);
-
-            final Random rnd = new Random();
-
-            try (IgniteTx tx = cache.txStart()) {
-                int iterCnt = 20;
-                int keyCnt = 5000;
-
-                for (int i = 0; i < iterCnt; i++) {
-                    int j = rnd.nextInt(keyCnt);
-
-                    // Put or remove?
-                    if (rnd.nextBoolean())
-                        cache.putx(j, j);
-                    else
-                        cache.remove(j);
-
-                    if (i != 0 && i % 1000 == 0)
-                        info("Stats [iterCnt=" + i + ", size=" + cache.size() 
+ ']');
-                }
-
-                GridCacheFifoEvictionPolicy<Integer, Integer> plc0 = 
(GridCacheFifoEvictionPolicy<Integer, Integer>) plc;
-
-                if (!plc0.queue().isEmpty()) {
-                    for (GridCacheEntry<Integer, Integer> e : plc0.queue())
-                        U.warn(log, "Policy queue item: " + e);
-
-                    fail("Test failed, see logs for details.");
-                }
-
-                tx.commit();
-            }
-        }
-        catch (Throwable t) {
-            error("Test failed.", t);
-
-            fail("Test failed, see logs for details.");
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testEvictSingle() throws Exception {
-        plc = new GridCacheFifoEvictionPolicy<Object, Object>(500);
-
-        try {
-            Ignite ignite = startGrid(1);
-
-            final GridCache<Integer, Integer> cache = ignite.cache(null);
-
-            for (int i = 0; i < 100; i++)
-                cache.put(i, i);
-
-            assertEquals(100, 
((GridCacheFifoEvictionPolicy)plc).queue().size());
-
-            for (int i = 0; i < 100; i++)
-                cache.evict(i);
-
-            assertEquals(0, ((GridCacheFifoEvictionPolicy)plc).queue().size());
-            assertEquals(0, cache.size());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testEvictAll() throws Exception {
-        plc = new GridCacheFifoEvictionPolicy<Object, Object>(500);
-
-        try {
-            Ignite ignite = startGrid(1);
-
-            final GridCache<Integer, Integer> cache = ignite.cache(null);
-
-            Collection<Integer> keys = new ArrayList<>(100);
-
-            for (int i = 0; i < 100; i++) {
-                cache.put(i, i);
-
-                keys.add(i);
-            }
-
-            assertEquals(100, 
((GridCacheFifoEvictionPolicy)plc).queue().size());
-
-            cache.evictAll(keys);
-
-            assertEquals(0, ((GridCacheFifoEvictionPolicy)plc).queue().size());
-            assertEquals(0, cache.size());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testGroupLock() throws Exception {
-        plc = new GridCacheFifoEvictionPolicy<>(100);
-
-        try {
-            Ignite g = startGrid(1);
-
-            Integer affKey = 1;
-
-            GridCache<GridCacheAffinityKey<Object>, Integer> cache = 
g.cache(null);
-
-            IgniteTx tx = cache.txStartAffinity(affKey, PESSIMISTIC, 
REPEATABLE_READ, 0, 5);
-
-            try {
-                for (int i = 0; i < 5; i++)
-                    cache.put(new GridCacheAffinityKey<Object>(i, affKey), i);
-
-                tx.commit();
-            }
-            finally {
-                tx.close();
-            }
-
-            assertEquals(5, ((GridCacheFifoEvictionPolicy)plc).queue().size());
-
-            tx = cache.txStartAffinity(affKey, PESSIMISTIC, REPEATABLE_READ, 
0, 5);
-
-            try {
-                for (int i = 0; i < 5; i++)
-                    cache.remove(new GridCacheAffinityKey<Object>(i, affKey));
-
-                tx.commit();
-            }
-            finally {
-                tx.close();
-            }
-
-            assertEquals(0, ((GridCacheFifoEvictionPolicy)plc).queue().size());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPartitionGroupLock() throws Exception {
-        plc = new GridCacheFifoEvictionPolicy<>(100);
-
-        try {
-            Ignite g = startGrid(1);
-
-            Integer affKey = 1;
-
-            GridCache<Object, Integer> cache = g.cache(null);
-
-            IgniteTx tx = 
cache.txStartPartition(cache.affinity().partition(affKey), PESSIMISTIC, 
REPEATABLE_READ,
-                0, 5);
-
-            try {
-                for (int i = 0; i < 5; i++)
-                    cache.put(new GridCacheAffinityKey<Object>(i, affKey), i);
-
-                tx.commit();
-            }
-            finally {
-                tx.close();
-            }
-
-            assertEquals(5, ((GridCacheFifoEvictionPolicy)plc).queue().size());
-
-            tx = cache.txStartPartition(cache.affinity().partition(affKey), 
PESSIMISTIC, REPEATABLE_READ, 0, 5);
-
-            try {
-                for (int i = 0; i < 5; i++)
-                    cache.remove(new GridCacheAffinityKey<Object>(i, affKey));
-
-                tx.commit();
-            }
-            finally {
-                tx.close();
-            }
-
-            assertEquals(0, ((GridCacheFifoEvictionPolicy)plc).queue().size());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testReload() throws Exception {
-        plc = new GridCacheFifoEvictionPolicy<Object, Object>(100);
-
-        try {
-            Ignite ignite = startGrid(1);
-
-            final GridCache<Integer, Integer> cache = ignite.cache(null);
-
-            for (int i = 0; i < 10000; i++)
-                cache.reload(i);
-
-            assertEquals(100, cache.size());
-            assertEquals(100, cache.size());
-            assertEquals(100, 
((GridCacheFifoEvictionPolicy)plc).queue().size());
-
-            Collection<Integer> keys = new ArrayList<>(10000);
-
-            for (int i = 0; i < 10000; i++)
-                keys.add(i);
-
-            cache.reloadAll(keys);
-
-            assertEquals(100, cache.size());
-            assertEquals(100, cache.size());
-            assertEquals(100, 
((GridCacheFifoEvictionPolicy)plc).queue().size());
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheMockEntry.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheMockEntry.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheMockEntry.java
deleted file mode 100644
index 485caf7..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheMockEntry.java
+++ /dev/null
@@ -1,365 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.lang.*;
-import org.apache.ignite.internal.util.future.*;
-import org.apache.ignite.internal.util.lang.*;
-import org.apache.ignite.internal.util.tostring.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.jetbrains.annotations.*;
-
-import java.util.*;
-
-/**
- * Mock cache entry.
- */
-public class GridCacheMockEntry<K, V> extends GridMetadataAwareAdapter 
implements GridCacheEntry<K, V> {
-    /** */
-    @GridToStringInclude
-    private K key;
-
-    /** */
-    @GridToStringInclude
-    private boolean evicted;
-
-    /** */
-    @GridToStringInclude
-    private boolean canEvict = true;
-
-    /**
-     * Constructor.
-     *
-     * @param key Key.
-     */
-    public GridCacheMockEntry(K key) {
-        this.key = key;
-    }
-
-    /**
-     * Constructor.
-     *
-     * @param key Key.
-     * @param canEvict Evict or not.
-     */
-    public GridCacheMockEntry(K key, boolean canEvict) {
-        this.key = key;
-        this.canEvict = canEvict;
-    }
-
-    /** {@inheritDoc} */
-    @Override public K getKey() throws IllegalStateException {
-        return key;
-    }
-
-    /** {@inheritDoc} */
-    @Override public V getValue() throws IllegalStateException {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public V setValue(V val) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean evict() {
-        evicted = true;
-
-        onEvicted();
-
-        return canEvict;
-    }
-
-    /**
-     * Eviction callback.
-     */
-    public void onEvicted() {
-        for (String key : allMeta().keySet())
-            removeMeta(key);
-    }
-
-    /**
-     *
-     * @return Evicted or not.
-     */
-    public boolean isEvicted() {
-        return evicted;
-    }
-
-    /** {@inheritDoc} */
-    @Override public V peek() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public V peek(@Nullable Collection<GridCachePeekMode> modes) {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isLocked() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isLockedByThread() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public Object version() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long expirationTime() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public long timeToLive() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean primary() {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean backup() {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int partition() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V set(V val,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) throws 
IgniteCheckedException {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<V> setAsync(V val,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V setIfAbsent(V val) throws 
IgniteCheckedException {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<V> setIfAbsentAsync(V val) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean setx(V val,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) throws 
IgniteCheckedException {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<Boolean> setxAsync(V val,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean setxIfAbsent(@Nullable V val) throws 
IgniteCheckedException {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<Boolean> setxIfAbsentAsync(V val) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V replace(V val) throws IgniteCheckedException {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<V> replaceAsync(V val) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean replacex(V val) throws IgniteCheckedException {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<Boolean> replacexAsync(V val) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean replace(V oldVal, V newVal) throws 
IgniteCheckedException {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<Boolean> replaceAsync(V oldVal, V 
newVal) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V remove(
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) throws 
IgniteCheckedException {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<V> removeAsync(
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean removex(@Nullable 
IgnitePredicate<GridCacheEntry<K, V>>... filter) throws IgniteCheckedException {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<Boolean> removexAsync(
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean remove(V val) throws IgniteCheckedException {
-        // No-op.
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public IgniteFuture<Boolean> removeAsync(V val) {
-        // No-op.
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public void timeToLive(long ttl) {
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean lock(long timeout,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) throws 
IgniteCheckedException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteFuture<Boolean> lockAsync(long timeout,
-        @Nullable IgnitePredicate<GridCacheEntry<K, V>>... filter) {
-        return new GridFinishedFuture<>(null, false);
-    }
-
-    /** {@inheritDoc} */
-    @Override public void unlock(IgnitePredicate<GridCacheEntry<K, V>>... 
filter) throws IgniteCheckedException {
-        // No-op.
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean isCached() {
-        return !evicted;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int memorySize() {
-        return 1024;
-    }
-
-    /** {@inheritDoc} */
-    @Override public GridCacheProjection<K, V> projection() {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V reload() throws IgniteCheckedException {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteFuture<V> reloadAsync() {
-        return new GridFinishedFuture<>();
-    }
-
-    /** {@inheritDoc} */
-    @Nullable @Override public V get() throws IgniteCheckedException {
-        return null;
-    }
-
-    /** {@inheritDoc} */
-    @Override public IgniteFuture<V> getAsync() {
-        return new GridFinishedFuture<>();
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean clear() {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public boolean compact() throws IgniteCheckedException {
-        return false;
-    }
-
-    /** {@inheritDoc} */
-    @Override public <T> T unwrap(Class<T> clazz) {
-        if(clazz.isAssignableFrom(getClass()))
-            return clazz.cast(this);
-
-        throw new IllegalArgumentException();
-    }
-
-    /** {@inheritDoc} */
-    @Override public String toString() {
-        return S.toString(GridCacheMockEntry.class, this);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a916db69/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
 
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
deleted file mode 100644
index 4114aaf..0000000
--- 
a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/eviction/GridCacheSynchronousEvictionsFailoverSelfTest.java
+++ /dev/null
@@ -1,160 +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.gridgain.grid.kernal.processors.cache.eviction;
-
-import org.apache.ignite.*;
-import org.apache.ignite.cache.*;
-import org.apache.ignite.cache.affinity.*;
-import org.apache.ignite.cache.affinity.consistenthash.*;
-import org.apache.ignite.cluster.*;
-import org.apache.ignite.lang.*;
-import org.gridgain.grid.kernal.processors.cache.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.*;
-
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.GridCacheDistributionMode.*;
-import static org.apache.ignite.cache.GridCacheMode.*;
-
-/**
- *
- */
-public class GridCacheSynchronousEvictionsFailoverSelfTest extends 
GridCacheAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 3;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected GridCacheMode cacheMode() {
-        return PARTITIONED;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected GridCacheDistributionMode distributionMode() {
-        return PARTITIONED_ONLY;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheConfiguration cacheConfiguration(String gridName) 
throws Exception {
-        CacheConfiguration ccfg = super.cacheConfiguration(gridName);
-
-        ccfg.setSwapEnabled(false);
-        ccfg.setEvictSynchronized(true);
-        ccfg.setEvictSynchronizedKeyBufferSize(10);
-
-        ccfg.setBackups(2);
-
-        ccfg.setAffinity(new GridCacheConsistentHashAffinityFunction(false, 
500));
-
-        return ccfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return 60_000;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testSynchronousEvictions() throws Exception {
-        GridCache<String, Integer> cache = cache(0);
-
-        final AtomicBoolean stop = new AtomicBoolean();
-
-        IgniteFuture<?> fut = null;
-
-        try {
-            Map<String, Integer> data = new HashMap<>();
-
-            addKeysForNode(cache.affinity(), grid(0).localNode(), data);
-            addKeysForNode(cache.affinity(), grid(1).localNode(), data);
-            addKeysForNode(cache.affinity(), grid(2).localNode(), data);
-
-            fut = GridTestUtils.runAsync(new Callable<Void>() {
-                @Override public Void call() throws Exception {
-                    Random rnd = new Random();
-
-                    while (!stop.get()) {
-                        int idx = rnd.nextBoolean() ? 1 : 2;
-
-                        log.info("Stopping grid: " + idx);
-
-                        stopGrid(idx);
-
-                        U.sleep(100);
-
-                        log.info("Starting grid: " + idx);
-
-                        startGrid(idx);
-                    }
-
-                    return null;
-                }
-            });
-
-            for (int i = 0 ; i < 100; i++) {
-                log.info("Iteration: " + i);
-
-                try {
-                    cache.putAll(data);
-                }
-                catch (IgniteCheckedException ignore) {
-                    continue;
-                }
-
-                for (String key : data.keySet())
-                    cache.evict(key);
-            }
-        }
-        finally {
-            stop.set(true);
-
-            if (fut != null)
-                fut.get();
-        }
-    }
-
-    /**
-     * @param aff Cache affinity.
-     * @param node Primary node for keys.
-     * @param data Map where keys/values should be put to.
-     */
-    private void addKeysForNode(GridCacheAffinity<String> aff, ClusterNode 
node, Map<String, Integer> data) {
-        int cntr = 0;
-
-        for (int i = 0; i < 100_000; i++) {
-            String key = String.valueOf(i);
-
-            if (aff.isPrimary(node, key)) {
-                data.put(key, i);
-
-                cntr++;
-
-                if (cntr == 500)
-                    break;
-            }
-        }
-
-        assertEquals(500, cntr);
-    }
-}

Reply via email to