ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/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:48 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
deleted file mode 100644
index f0ccce4..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTransactionalAbstractMetricsSelfTest.java
+++ /dev/null
@@ -1,284 +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.transactions.*;
-
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-
-/**
- * Transactional cache metrics test.
- */
-public abstract class GridCacheTransactionalAbstractMetricsSelfTest extends GridCacheAbstractMetricsSelfTest {
-    /** */
-    private static final int TX_CNT = 3;
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticReadCommittedCommits() throws Exception {
-        testCommits(OPTIMISTIC, READ_COMMITTED, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticReadCommittedCommitsNoData() throws Exception {
-        testCommits(OPTIMISTIC, READ_COMMITTED, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticRepeatableReadCommits() throws Exception {
-        testCommits(OPTIMISTIC, REPEATABLE_READ, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticRepeatableReadCommitsNoData() throws Exception {
-        testCommits(OPTIMISTIC, REPEATABLE_READ, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticSerializableCommits() throws Exception {
-        testCommits(OPTIMISTIC, SERIALIZABLE, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticSerializableCommitsNoData() throws Exception {
-        testCommits(OPTIMISTIC, SERIALIZABLE, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticReadCommittedCommits() throws Exception {
-        testCommits(PESSIMISTIC, READ_COMMITTED, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticReadCommittedCommitsNoData() throws Exception {
-        testCommits(PESSIMISTIC, READ_COMMITTED, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticRepeatableReadCommits() throws Exception {
-        testCommits(PESSIMISTIC, REPEATABLE_READ, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticRepeatableReadCommitsNoData() throws Exception {
-        testCommits(PESSIMISTIC, REPEATABLE_READ, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticSerializableCommits() throws Exception {
-        testCommits(PESSIMISTIC, SERIALIZABLE, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticSerializableCommitsNoData() throws Exception {
-        testCommits(PESSIMISTIC, SERIALIZABLE, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticReadCommittedRollbacks() throws Exception {
-        testRollbacks(OPTIMISTIC, READ_COMMITTED, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticReadCommittedRollbacksNoData() throws Exception {
-        testRollbacks(OPTIMISTIC, READ_COMMITTED, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticRepeatableReadRollbacks() throws Exception {
-        testRollbacks(OPTIMISTIC, REPEATABLE_READ, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticRepeatableReadRollbacksNoData() throws Exception {
-        testRollbacks(OPTIMISTIC, REPEATABLE_READ, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticSerializableRollbacks() throws Exception {
-        testRollbacks(OPTIMISTIC, SERIALIZABLE, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOptimisticSerializableRollbacksNoData() throws Exception {
-        testRollbacks(OPTIMISTIC, SERIALIZABLE, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticReadCommittedRollbacks() throws Exception {
-        testRollbacks(PESSIMISTIC, READ_COMMITTED, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticReadCommittedRollbacksNoData() throws Exception {
-        testRollbacks(PESSIMISTIC, READ_COMMITTED, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticRepeatableReadRollbacks() throws Exception {
-        testRollbacks(PESSIMISTIC, REPEATABLE_READ, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticRepeatableReadRollbacksNoData() throws Exception {
-        testRollbacks(PESSIMISTIC, REPEATABLE_READ, false);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticSerializableRollbacks() throws Exception {
-        testRollbacks(PESSIMISTIC, SERIALIZABLE, true);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPessimisticSerializableRollbacksNoData() throws Exception {
-        testRollbacks(PESSIMISTIC, SERIALIZABLE, false);
-    }
-
-    /**
-     * @param concurrency Concurrency control.
-     * @param isolation Isolation level.
-     * @param put Put some data if {@code true}.
-     * @throws Exception If failed.
-     */
-    private void testCommits(IgniteTxConcurrency concurrency, IgniteTxIsolation isolation, boolean put)
-        throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
-
-        for (int i = 0; i < TX_CNT; i++) {
-            IgniteTx tx = cache.txStart(concurrency, isolation);
-
-            if (put)
-                for (int j = 0; j < keyCount(); j++)
-                    cache.put(j, j);
-
-            tx.commit();
-        }
-
-        for (int i = 0; i < gridCount(); i++) {
-            IgniteTxMetrics metrics = grid(i).transactions().metrics();
-            CacheMetrics cacheMetrics = grid(i).cache(null).metrics();
-
-            if (i == 0) {
-                assertEquals(TX_CNT, metrics.txCommits());
-
-                if (put) {
-                    assertEquals(TX_CNT, cacheMetrics.getCacheTxCommits());
-                    assert cacheMetrics.getAverageTxCommitTime() > 0;
-                }
-            }
-            else {
-                assertEquals(0, metrics.txCommits());
-                assertEquals(0, cacheMetrics.getCacheTxCommits());
-            }
-
-            assertEquals(0, metrics.txRollbacks());
-            assertEquals(0, cacheMetrics.getCacheTxRollbacks());
-        }
-    }
-
-    /**
-     * @param concurrency Concurrency control.
-     * @param isolation Isolation level.
-     * @param put Put some data if {@code true}.
-     * @throws Exception If failed.
-     */
-    private void testRollbacks(IgniteTxConcurrency concurrency, IgniteTxIsolation isolation,
-        boolean put) throws Exception {
-        GridCache<Integer, Integer> cache = grid(0).cache(null);
-
-        for (int i = 0; i < TX_CNT; i++) {
-            IgniteTx tx = cache.txStart(concurrency, isolation);
-
-            if (put)
-                for (int j = 0; j < keyCount(); j++)
-                    cache.put(j, j);
-
-            tx.rollback();
-        }
-
-        for (int i = 0; i < gridCount(); i++) {
-            IgniteTxMetrics metrics = grid(i).transactions().metrics();
-            CacheMetrics cacheMetrics = grid(i).cache(null).metrics();
-
-            assertEquals(0, metrics.txCommits());
-            assertEquals(0, cacheMetrics.getCacheTxCommits());
-
-            if (i == 0) {
-                assertEquals(TX_CNT, metrics.txRollbacks());
-
-                if (put) {
-                    assertEquals(TX_CNT, cacheMetrics.getCacheTxRollbacks());
-                    assert cacheMetrics.getAverageTxRollbackTime() > 0;
-                }
-            }
-            else {
-                assertEquals(0, metrics.txRollbacks());
-                assertEquals(0, cacheMetrics.getCacheTxRollbacks());
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerLoadTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerLoadTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerLoadTest.java
deleted file mode 100644
index 6b97f9a..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerLoadTest.java
+++ /dev/null
@@ -1,84 +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.internal.*;
-import org.apache.ignite.internal.util.typedef.internal.*;
-
-import javax.cache.expiry.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static java.util.concurrent.TimeUnit.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Check ttl manager for memory leak.
- */
-public class GridCacheTtlManagerLoadTest extends GridCacheTtlManagerSelfTest {
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLoad() throws Exception {
-        cacheMode = REPLICATED;
-
-        final IgniteKernal g = (IgniteKernal)startGrid(0);
-
-        try {
-            final AtomicBoolean stop = new AtomicBoolean();
-
-            IgniteInternalFuture<?> fut = multithreadedAsync(new Callable<Object>() {
-                @Override public Object call() throws Exception {
-                    IgniteCache<Object,Object> cache = g.jcache(null).
-                        withExpiryPolicy(new TouchedExpiryPolicy(new Duration(MILLISECONDS, 1000)));
-
-                    long key = 0;
-
-                    while (!stop.get()) {
-                        cache.put(key, key);
-
-                        key++;
-                    }
-
-                    return null;
-                }
-            }, 1);
-
-            GridCacheTtlManager<Object, Object> ttlMgr = g.internalCache().context().ttl();
-
-            for (int i = 0; i < 300; i++) {
-                U.sleep(1000);
-
-                ttlMgr.printMemoryStats();
-            }
-
-            stop.set(true);
-
-            fut.get();
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return Long.MAX_VALUE;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerSelfTest.java
deleted file mode 100644
index 0145559..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManagerSelfTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.cache.*;
-import org.apache.ignite.configuration.*;
-import org.apache.ignite.internal.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.internal.util.typedef.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.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import javax.cache.expiry.*;
-
-import static java.util.concurrent.TimeUnit.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * TTL manager self test.
- */
-public class GridCacheTtlManagerSelfTest extends GridCommonAbstractTest {
-    /** IP finder. */
-    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
-
-    /** Test cache mode. */
-    protected CacheMode cacheMode;
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
-
-        discoSpi.setIpFinder(IP_FINDER);
-
-        cfg.setDiscoverySpi(discoSpi);
-
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        ccfg.setCacheMode(cacheMode);
-        ccfg.setEagerTtl(true);
-
-        cfg.setCacheConfiguration(ccfg);
-
-        return cfg;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testLocalTtl() throws Exception {
-        checkTtl(LOCAL);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPartitionedTtl() throws Exception {
-        checkTtl(PARTITIONED);
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testReplicatedTtl() throws Exception {
-        checkTtl(REPLICATED);
-    }
-
-    /**
-     * @param mode Cache mode.
-     * @throws Exception If failed.
-     */
-    private void checkTtl(CacheMode mode) throws Exception {
-        cacheMode = mode;
-
-        final IgniteKernal g = (IgniteKernal)startGrid(0);
-
-        try {
-            final String key = "key";
-
-            g.jcache(null).withExpiryPolicy(
-                    new TouchedExpiryPolicy(new Duration(MILLISECONDS, 1000))).put(key, 1);
-
-            assertEquals(1, g.jcache(null).get(key));
-
-            U.sleep(1100);
-
-            GridTestUtils.retryAssert(log, 10, 100, new CAX() {
-                @Override public void applyx() {
-                    // Check that no more entries left in the map.
-                    assertNull(g.jcache(null).get(key));
-
-                    if (!g.internalCache().context().deferredDelete())
-                        assertNull(g.internalCache().map().getEntry(key));
-                }
-            });
-        }
-        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/GridCacheUtilsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheUtilsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheUtilsSelfTest.java
deleted file mode 100644
index 056081d..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheUtilsSelfTest.java
+++ /dev/null
@@ -1,261 +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.internal.util.typedef.internal.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.io.*;
-import java.util.concurrent.*;
-
-/**
- * Grid cache utils test.
- */
-public class GridCacheUtilsSelfTest extends GridCommonAbstractTest {
-    /** */
-    private static final String EXTERNALIZABLE_WARNING = "For best performance you should implement " +
-        "java.io.Externalizable";
-
-    /**
-     * Does not override equals and hashCode.
-     */
-    private static class NoEqualsAndHashCode {
-    }
-
-    /**
-     * Does not override equals.
-     */
-    private static class NoEquals {
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return 1;
-        }
-    }
-
-    /**
-     * Does not override hashCode.
-     */
-    private static class NoHashCode {
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object obj) {
-            return super.equals(obj);
-        }
-    }
-
-    /**
-     * Defines equals with different signature.
-     */
-    private static class WrongEquals {
-        /**
-         * @param obj Object.
-         * @return {@code False}.
-         */
-        @SuppressWarnings("CovariantEquals")
-        public boolean equals(String obj) {
-            return false;
-        }
-    }
-
-    /**
-     * Overrides equals and hashCode.
-     */
-    private static class EqualsAndHashCode {
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return super.hashCode();
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object obj) {
-            return super.equals(obj);
-        }
-    }
-
-    /**
-     * Overrides equals and hashCode and implements {@link Externalizable}.
-     */
-    private static class ExternalizableEqualsAndHashCode implements Externalizable {
-        /**
-         * Constructor required by {@link Externalizable}.
-         */
-        public ExternalizableEqualsAndHashCode() {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return super.hashCode();
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object obj) {
-            return super.equals(obj);
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeExternal(ObjectOutput out) throws IOException {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-            // No-op.
-        }
-    }
-
-    /**
-     * Extends class which overrides equals and hashCode.
-     */
-    private static class ExtendsClassWithEqualsAndHashCode extends EqualsAndHashCode {
-    }
-
-    /**
-     * Extends class which overrides equals and hashCode, overrides equals and hashCode.
-     */
-    private static class ExtendsClassWithEqualsAndHashCode2 extends EqualsAndHashCode {
-        /** {@inheritDoc} */
-        @Override public int hashCode() {
-            return super.hashCode();
-        }
-
-        /** {@inheritDoc} */
-        @Override public boolean equals(Object obj) {
-            return super.equals(obj);
-        }
-    }
-
-    /**
-     * Does not implement {@link Externalizable}.
-     */
-    private static class NoImplExternalizable {
-    }
-
-    /**
-     * Implements {@link Externalizable}.
-     */
-    private static class ImplExternalizable implements Externalizable  {
-        /**
-         * Constructor required by {@link Externalizable}.
-         */
-        public ImplExternalizable() {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void writeExternal(ObjectOutput out) throws IOException {
-            // No-op.
-        }
-
-        /** {@inheritDoc} */
-        @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-            // No-op.
-        }
-    }
-
-    /**
-     * Extends class which implements {@link Externalizable}.
-     */
-    private static class ExtendsImplExternalizable extends ImplExternalizable {
-        /**
-         * Constructor required by {@link Externalizable}.
-         */
-        public ExtendsImplExternalizable() {
-            // No-op.
-        }
-    }
-
-    /**
-     */
-    public void testCacheKeyValidation() {
-        CU.validateCacheKey(log, "key");
-
-        CU.validateCacheKey(log, 1);
-
-        CU.validateCacheKey(log, 1L);
-
-        CU.validateCacheKey(log, 1.0);
-
-        CU.validateCacheKey(log, new ExtendsClassWithEqualsAndHashCode());
-
-        CU.validateCacheKey(log, new ExtendsClassWithEqualsAndHashCode2());
-
-        assertThrowsForInvalidKey(new NoEqualsAndHashCode());
-
-        assertThrowsForInvalidKey(new NoEquals());
-
-        assertThrowsForInvalidKey(new NoHashCode());
-
-        assertThrowsForInvalidKey(new WrongEquals());
-
-        IgniteLogger log = new GridStringLogger(false);
-
-        CU.validateCacheKey(log, new ExternalizableEqualsAndHashCode());
-
-        assertFalse(log.toString().contains(EXTERNALIZABLE_WARNING));
-
-        CU.validateCacheKey(log, "key");
-
-        assertFalse(log.toString().contains(EXTERNALIZABLE_WARNING));
-
-        CU.validateCacheKey(log, new EqualsAndHashCode());
-
-        assertTrue(log.toString().contains(EXTERNALIZABLE_WARNING));
-    }
-
-    /**
-     */
-    public void testCacheValueValidation() {
-        IgniteLogger log = new GridStringLogger(false);
-
-        CU.validateCacheValue(log, new ImplExternalizable());
-
-        assertFalse(log.toString().contains(EXTERNALIZABLE_WARNING));
-
-        CU.validateCacheValue(log, new ExtendsImplExternalizable());
-
-        assertFalse(log.toString().contains(EXTERNALIZABLE_WARNING));
-
-        CU.validateCacheValue(log, "val");
-
-        assertFalse(log.toString().contains(EXTERNALIZABLE_WARNING));
-
-        CU.validateCacheValue(log, new byte[10]);
-
-        assertFalse(log.toString().contains(EXTERNALIZABLE_WARNING));
-
-        CU.validateCacheValue(log, new NoImplExternalizable());
-
-        assertTrue(log.toString().contains(EXTERNALIZABLE_WARNING));
-    }
-
-    /**
-     * @param key Cache key.
-     */
-    private void assertThrowsForInvalidKey(final Object key) {
-        GridTestUtils.assertThrows(log, new Callable<Void>() {
-            @Override public Void call() throws Exception {
-                CU.validateCacheKey(log, key);
-
-                return null;
-            }
-        }, IllegalArgumentException.class, null);
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java
deleted file mode 100644
index a25c317..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueBytesPreloadingSelfTest.java
+++ /dev/null
@@ -1,151 +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.testframework.junits.common.*;
-
-import java.util.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMemoryMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- *
- */
-public class GridCacheValueBytesPreloadingSelfTest extends GridCommonAbstractTest {
-    /** Memory mode. */
-    private CacheMemoryMode memMode;
-
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        cfg.setCacheConfiguration(cacheConfiguration(gridName));
-
-        return cfg;
-    }
-
-    /**
-     * @param gridName Grid name.
-     * @return Cache configuration.
-     * @throws Exception If failed.
-     */
-    protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
-        CacheConfiguration ccfg = new CacheConfiguration();
-
-        ccfg.setCacheMode(PARTITIONED);
-        ccfg.setBackups(1);
-        ccfg.setAtomicityMode(ATOMIC);
-        ccfg.setDistributionMode(PARTITIONED_ONLY);
-        ccfg.setStoreValueBytes(true);
-        ccfg.setWriteSynchronizationMode(FULL_SYNC);
-        ccfg.setMemoryMode(memMode);
-        ccfg.setOffHeapMaxMemory(1024 * 1024 * 1024);
-        ccfg.setPreloadMode(CachePreloadMode.SYNC);
-
-        return ccfg;
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOnHeapTiered() throws Exception {
-        memMode = ONHEAP_TIERED;
-
-        startGrids(1);
-
-        try {
-            checkByteArrays();
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOffHeapTiered() throws Exception {
-        memMode = OFFHEAP_TIERED;
-
-        startGrids(1);
-
-        try {
-            checkByteArrays();
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testOffHeapValuesOnly() throws Exception {
-        memMode = OFFHEAP_VALUES;
-
-        startGrids(1);
-
-        try {
-            checkByteArrays();
-        }
-        finally {
-            stopAllGrids();
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void checkByteArrays() throws Exception {
-        int keyCnt = 1000;
-
-        byte[] val = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
-
-        for (int i = 0; i < keyCnt; i++)
-            grid(0).cache(null).put(String.valueOf(i), val);
-
-        for (int i = 0; i < keyCnt; i++)
-            grid(0).cache(null).get(String.valueOf(i));
-
-        startGrid(1);
-
-        if (memMode == ONHEAP_TIERED) {
-            for (int i = 0; i < keyCnt; i++)
-                grid(0).cache(null).evict(String.valueOf(i));
-
-            for (int i = 0; i < keyCnt; i++)
-                grid(0).cache(null).promote(String.valueOf(i));
-        }
-
-        startGrid(2);
-
-        for (int g = 0; g < 3; g++) {
-            for (int i = 0; i < keyCnt; i++) {
-                byte[] o = (byte[])grid(g).cache(null).get(String.valueOf(i));
-
-                assertTrue("Got invalid value [val=" + Arrays.toString(val) + ", actual=" + Arrays.toString(o) + ']',
-                    Arrays.equals(val, o));
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
deleted file mode 100644
index 6ad3f32..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
+++ /dev/null
@@ -1,322 +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 java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.IgniteSystemProperties.*;
-import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-import static org.apache.ignite.cache.CachePreloadMode.*;
-import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
-
-/**
- *
- */
-public abstract class GridCacheValueConsistencyAbstractSelfTest extends GridCacheAbstractSelfTest {
-    /** Number of threads for test. */
-    private static final int THREAD_CNT = 16;
-
-    /** */
-    private String sizePropVal;
-
-    /** {@inheritDoc} */
-    @Override protected int gridCount() {
-        return 4;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected long getTestTimeout() {
-        return 60000;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected CacheConfiguration cacheConfiguration(String gridName) throws Exception {
-        CacheConfiguration cCfg = super.cacheConfiguration(gridName);
-
-        cCfg.setCacheMode(PARTITIONED);
-        cCfg.setAtomicityMode(atomicityMode());
-        cCfg.setAtomicWriteOrderMode(writeOrderMode());
-        cCfg.setDistributionMode(distributionMode());
-        cCfg.setPreloadMode(SYNC);
-        cCfg.setWriteSynchronizationMode(FULL_SYNC);
-        cCfg.setBackups(1);
-
-        return cCfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTestsStarted() throws Exception {
-        // Need to increase value set in GridAbstractTest
-        sizePropVal = System.getProperty(IGNITE_ATOMIC_CACHE_DELETE_HISTORY_SIZE);
-
-        System.setProperty(IGNITE_ATOMIC_CACHE_DELETE_HISTORY_SIZE, "100000");
-
-        super.beforeTestsStarted();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        super.afterTestsStopped();
-
-        System.setProperty(IGNITE_ATOMIC_CACHE_DELETE_HISTORY_SIZE, sizePropVal != null ? sizePropVal : "");
-    }
-
-    /**
-     * @return Distribution mode.
-     */
-    @Override protected CacheDistributionMode distributionMode() {
-        return PARTITIONED_ONLY;
-    }
-
-    /**
-     * @return Atomic write order mode.
-     */
-    protected CacheAtomicWriteOrderMode writeOrderMode() {
-        return CLOCK;
-    }
-
-    /**
-     * @return Consistency test iteration count.
-     */
-    protected abstract int iterationCount();
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPutRemove() throws Exception {
-        awaitPartitionMapExchange();
-
-        GridCache<String, Integer> cache = cache();
-
-        int keyCnt = 10;
-
-        for (int i = 0; i < keyCnt; i++)
-            cache.put("key" + i, i);
-
-        for (int g = 0; g < gridCount(); g++) {
-            GridCache<String, Integer> cache0 = cache(g);
-            ClusterNode locNode = grid(g).localNode();
-
-            for (int i = 0; i < keyCnt; i++) {
-                String key = "key" + i;
-
-                if (cache.affinity().mapKeyToPrimaryAndBackups(key).contains(locNode)) {
-                    info("Node is reported as affinity node for key [key=" + key + ", nodeId=" + locNode.id() + ']');
-
-                    assertEquals((Integer)i, cache0.peek(key));
-                }
-                else {
-                    info("Node is reported as NOT affinity node for key [key=" + key +
-                        ", nodeId=" + locNode.id() + ']');
-
-                    if (distributionMode() == NEAR_PARTITIONED && cache == cache0)
-                        assertEquals((Integer)i, cache0.peek(key));
-                    else
-                        assertNull(cache0.peek(key));
-                }
-
-                assertEquals((Integer)i, cache0.get(key));
-            }
-        }
-
-        info("Removing values from cache.");
-
-        for (int i = 0; i < keyCnt; i++)
-            assertEquals((Integer)i, cache.remove("key" + i));
-
-        for (int g = 0; g < gridCount(); g++) {
-            GridCache<String, Integer> cache0 = cache(g);
-
-            for (int i = 0; i < keyCnt; i++) {
-                String key = "key" + i;
-
-                assertNull(cache0.peek(key));
-
-                assertNull(cache0.get(key));
-            }
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPutRemoveAll() throws Exception {
-        awaitPartitionMapExchange();
-
-        GridCache<String, Integer> cache = cache();
-
-        int keyCnt = 10;
-
-        for (int i = 0; i < keyCnt; i++) {
-            info("Putting value to cache: " + i);
-
-            cache.put("key" + i, i);
-        }
-
-        for (int g = 0; g < gridCount(); g++) {
-            GridCache<String, Integer> cache0 = cache(g);
-            ClusterNode locNode = grid(g).localNode();
-
-            for (int i = 0; i < keyCnt; i++) {
-                String key = "key" + i;
-
-                if (cache.affinity().mapKeyToPrimaryAndBackups(key).contains(grid(g).localNode())) {
-                    info("Node is reported as affinity node for key [key=" + key + ", nodeId=" + locNode.id() + ']');
-
-                    assertEquals((Integer)i, cache0.peek(key));
-                }
-                else {
-                    info("Node is reported as NOT affinity node for key [key=" + key +
-                        ", nodeId=" + locNode.id() + ']');
-
-                    if (distributionMode() == NEAR_PARTITIONED && cache == cache0)
-                        assertEquals((Integer)i, cache0.peek(key));
-                    else
-                        assertNull(cache0.peek(key));
-                }
-
-                assertEquals((Integer)i, cache0.get(key));
-            }
-        }
-
-        for (int g = 0; g < gridCount(); g++) {
-            info(">>>> Removing all values form cache: " + g);
-
-            cache(g).removeAll();
-        }
-
-        info(">>>> Starting values check");
-
-        for (int g = 0; g < gridCount(); g++) {
-            GridCache<String, Integer> cache0 = cache(g);
-
-            for (int i = 0; i < keyCnt; i++) {
-                String key = "key" + i;
-
-                assertNull(cache0.peek(key));
-                assertNull(cache0.get(key));
-            }
-        }
-    }
-
-    /**
-     * @throws Exception If failed.
-     */
-    public void testPutRemoveConsistencyMultithreaded() throws Exception {
-        final int range = 10000;
-
-        final int iterCnt = iterationCount();
-
-        final AtomicInteger iters = new AtomicInteger();
-
-        multithreadedAsync(new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                Random rnd = new Random();
-
-                while (true) {
-                    int i = iters.getAndIncrement();
-
-                    if (i >= iterCnt)
-                        break;
-
-                    int g = rnd.nextInt(gridCount());
-
-                    Ignite ignite = grid(g);
-
-                    GridCache<Object, Object> cache = ignite.cache(null);
-
-                    int k = rnd.nextInt(range);
-
-                    boolean rmv = rnd.nextBoolean();
-
-                    if (!rmv)
-                        cache.put(k, Thread.currentThread().getId());
-                    else
-                        cache.remove(k);
-
-                    if (i > 0 && i % 5000 == 0)
-                        info("Completed: " + i);
-                }
-
-                return null;
-            }
-        }, THREAD_CNT).get();
-
-        int present = 0;
-        int absent = 0;
-
-        for (int i = 0; i < range; i++) {
-            Long firstVal = null;
-
-            for (int g = 0; g < gridCount(); g++) {
-                Long val = (Long)grid(g).cache(null).peek(i);
-
-                if (firstVal == null && val != null)
-                    firstVal = val;
-
-                assert val == null || firstVal.equals(val) : "Invalid value detected [val=" + val +
-                    ", firstVal=" + firstVal + ']';
-            }
-
-            if (firstVal == null)
-                absent++;
-            else
-                present++;
-        }
-
-        info("Finished check [present=" + present + ", absent=" + absent + ']');
-
-        info("Checking keySet consistency");
-
-        for (int g = 0; g < gridCount(); g++)
-            checkKeySet(grid(g));
-    }
-
-    /**
-     * @param g Grid to check.
-     */
-    private void checkKeySet(Ignite g) {
-        GridCache<Object, Object> cache = g.cache(null);
-
-        Set<Object> keys = cache.keySet();
-
-        int cacheSize = cache.size();
-        int keySetSize = keys.size();
-
-        int itSize = 0;
-
-        for (Object ignored : keys)
-            itSize++;
-
-        int valsSize = cache.values().size();
-
-        info("cacheSize=" + cacheSize + ", keysSize=" + keySetSize + ", valsSize=" + valsSize +
-            ", itSize=" + itSize + ']');
-
-        assertEquals("cacheSize vs itSize", cacheSize, itSize);
-        assertEquals("cacheSize vs keySeySize", cacheSize, keySetSize);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalNearEnabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalNearEnabledSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalNearEnabledSelfTest.java
deleted file mode 100644
index 09f1975..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalNearEnabledSelfTest.java
+++ /dev/null
@@ -1,31 +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.*;
-
-/**
- * Tests cache values consistency for transactional cache with near cache enabled.
- */
-public class GridCacheValueConsistencyTransactionalNearEnabledSelfTest
-    extends GridCacheValueConsistencyTransactionalSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheDistributionMode distributionMode() {
-        return CacheDistributionMode.NEAR_PARTITIONED;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
deleted file mode 100644
index bc9a4f0..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
+++ /dev/null
@@ -1,37 +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.CacheAtomicityMode.*;
-
-/**
- * Tests cache values consistency for transactional cache.
- */
-public class GridCacheValueConsistencyTransactionalSelfTest extends GridCacheValueConsistencyAbstractSelfTest {
-    /** {@inheritDoc} */
-    @Override protected CacheAtomicityMode atomicityMode() {
-        return TRANSACTIONAL;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected int iterationCount() {
-        return 100_000;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java
deleted file mode 100644
index 4fb357e..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVariableTopologySelfTest.java
+++ /dev/null
@@ -1,192 +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.transactions.*;
-import org.apache.ignite.internal.util.typedef.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.testframework.junits.common.*;
-import org.apache.ignite.transactions.*;
-
-import java.util.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheMode.*;
-
-/**
- * Affinity routing tests.
- */
-public class GridCacheVariableTopologySelfTest extends GridCommonAbstractTest {
-    /** */
-    private static final Random RAND = new Random();
-
-    /** */
-    private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** Constructs test. */
-    public GridCacheVariableTopologySelfTest() {
-        super(/* don't start grid */ false);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(gridName);
-
-        TcpDiscoverySpi spi = new TcpDiscoverySpi();
-
-        spi.setIpFinder(ipFinder);
-
-        cfg.setDiscoverySpi(spi);
-
-        // Default cache configuration.
-        CacheConfiguration cacheCfg = defaultCacheConfiguration();
-
-        cacheCfg.setCacheMode(PARTITIONED);
-        cacheCfg.setBackups(1);
-        cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cacheCfg.setAtomicityMode(TRANSACTIONAL);
-
-        cfg.setCacheConfiguration(cacheCfg);
-
-        return cfg;
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        stopAllGrids();
-
-        assert G.allGrids().isEmpty();
-    }
-
-    /**
-     * @param cnt Number of grids to starts.
-     * @param startIdx Start grid index.
-     * @throws Exception If failed to start grids.
-     */
-    private void startGrids(int cnt, int startIdx) throws Exception {
-        assert startIdx >= 0;
-        assert cnt >= 0;
-
-        for (int idx = startIdx; idx < startIdx + cnt; idx++)
-            startGrid(idx);
-    }
-
-    /**
-     * JUnit.
-     *
-     * @throws Exception If failed.
-     */
-    @SuppressWarnings({"TooBroadScope"})
-    public void testNodeStop() throws Exception {
-        // -- Test parameters. -- //
-        int nodeCnt = 3;
-        int threadCnt = 20;
-        final int txCnt = 1000;
-        final long txDelay = 0;
-        final int keyRange = 1000;
-        final int logMod = 20;
-
-        assert nodeCnt > 1 : "Node count for this test must be greater than 1.";
-
-        startGrids(nodeCnt, 0);
-
-        final AtomicBoolean done = new AtomicBoolean();
-
-        IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new CAX() {
-            /** */
-            private int cnt;
-
-            @SuppressWarnings({"BusyWait"})
-            @Override public void applyx() throws IgniteCheckedException {
-                while (cnt++ < txCnt && !done.get()) {
-                    GridCache<Object, Object> cache = grid(0).cache(null);
-
-                    if (cnt % logMod == 0)
-                        info("Starting transaction: " + cnt);
-
-                    try (IgniteTx tx = cache.txStart()) {
-                        int kv = RAND.nextInt(keyRange);
-
-                        cache.put(kv, kv);
-
-                        cache.get(kv);
-
-                        tx.commit();
-                    }
-                    catch (IgniteTxOptimisticCheckedException e) {
-                        info("Caught cache optimistic exception: " + e);
-                    }
-
-                    try {
-                        Thread.sleep(txDelay);
-                    }
-                    catch (InterruptedException ignored) {
-                        // No-op.
-                    }
-                }
-            }
-        }, threadCnt, "TEST-THREAD");
-
-        Thread.sleep(2000);
-
-        for (int idx = 1; idx < nodeCnt; idx++) {
-            info("Stopping node: " + idx);
-
-            stopGrid(idx);
-        }
-
-        // This is just for debugging.
-        /*
-        GridFuture<?> debugFut = GridTestUtils.runMultiThreadedAsync(new Runnable() {
-            @SuppressWarnings({"UnusedDeclaration"})
-            @Override public void run() {
-                Cache<Object, Object> cache = grid(0).cache(null);
-
-                try {
-                    Thread.sleep(15000);
-                }
-                catch (InterruptedException ignored) {
-                    return;
-                }
-
-                info("Set breakpoint here.");
-            }
-        }, 1, "TEST-THREAD");
-        */
-
-        done.set(true);
-
-        fut.get();
-
-        stopGrid(0);
-
-        info("Grid 0 stopped.");
-
-        //debugFut.get();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
deleted file mode 100644
index 45ad062..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionSelfTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache;
-
-import org.apache.ignite.internal.processors.cache.version.*;
-import org.apache.ignite.marshaller.optimized.*;
-import org.apache.ignite.testframework.*;
-import org.apache.ignite.testframework.junits.common.*;
-
-import java.util.concurrent.*;
-
-/**
- *
- */
-public class GridCacheVersionSelfTest extends GridCommonAbstractTest {
-    /**
-     * @throws Exception If failed.
-     */
-    public void testTopologyVersionDrId() throws Exception {
-        GridCacheVersion ver = version(10, 0);
-
-        assertEquals(10, ver.nodeOrder());
-        assertEquals(0, ver.dataCenterId());
-
-        // Check with max topology version and some dr IDs.
-        ver = version(0x7FFFFFF, 0);
-        assertEquals(0x7FFFFFF, ver.nodeOrder());
-        assertEquals(0, ver.dataCenterId());
-
-        ver = version(0x7FFFFFF, 15);
-        assertEquals(0x7FFFFFF, ver.nodeOrder());
-        assertEquals(15, ver.dataCenterId());
-
-        ver = version(0x7FFFFFF, 31);
-        assertEquals(0x7FFFFFF, ver.nodeOrder());
-        assertEquals(31, ver.dataCenterId());
-
-        // Check max dr ID with some topology versions.
-        ver = version(11, 31);
-        assertEquals(11, ver.nodeOrder());
-        assertEquals(31, ver.dataCenterId());
-
-        ver = version(256, 31);
-        assertEquals(256, ver.nodeOrder());
-        assertEquals(31, ver.dataCenterId());
-
-        ver = version(1025, 31);
-        assertEquals(1025, ver.nodeOrder());
-        assertEquals(31, ver.dataCenterId());
-
-        // Check overflow exception.
-        GridTestUtils.assertThrows(log, new Callable<Object>() {
-            @Override public Object call() throws Exception {
-                return version(0x7FFFFFF + 1, 1);
-            }
-        }, IllegalArgumentException.class, null);
-    }
-
-    /**
-     * Test versions marshalling.
-     *
-     * @throws Exception If failed.
-     */
-    public void testMarshalling() throws Exception {
-        GridCacheVersion ver = version(1, 1);
-        GridCacheVersionEx verEx = new GridCacheVersionEx(2, 2, 0, 0, ver);
-
-        IgniteOptimizedMarshaller marsh = new IgniteOptimizedMarshaller(false);
-
-        byte[] verBytes = marsh.marshal(ver);
-        byte[] verExBytes = marsh.marshal(verEx);
-
-        GridCacheVersion verNew = marsh.unmarshal(verBytes, Thread.currentThread().getContextClassLoader());
-        GridCacheVersionEx verExNew = marsh.unmarshal(verExBytes, Thread.currentThread().getContextClassLoader());
-
-        assert ver.equals(verNew);
-        assert verEx.equals(verExNew);
-    }
-
-    /**
-     * @param nodeOrder Node order.
-     * @param drId Data center ID.
-     * @return Cache version.
-     */
-    private GridCacheVersion version(int nodeOrder, int drId) {
-        return new GridCacheVersion(0, 0, 0, nodeOrder, drId);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
deleted file mode 100644
index e751b8f..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractSelfTest.java
+++ /dev/null
@@ -1,189 +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.internal.*;
-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.*;
-
-/**
- * Harness for {@link GridCacheWriteBehindStore} tests.
- */
-public abstract class GridCacheWriteBehindStoreAbstractSelfTest extends GridCommonAbstractTest {
-    /** Write cache size. */
-    public static final int CACHE_SIZE = 1024;
-
-    /** Value dump interval. */
-    public static final int FLUSH_FREQUENCY = 1000;
-
-    /** Underlying store. */
-    protected GridCacheTestStore delegate = new GridCacheTestStore();
-
-    /** Tested store. */
-    protected GridCacheWriteBehindStore<Integer, String> store;
-
-    /** {@inheritDoc} */
-    @Override protected void afterTestsStopped() throws Exception {
-        delegate = null;
-        store = null;
-
-        super.afterTestsStopped();
-    }
-
-    /**
-     * Initializes store.
-     *
-     * @param flushThreadCnt Count of flush threads
-     * @throws Exception If failed.
-     */
-    protected void initStore(int flushThreadCnt) throws Exception {
-        store = new GridCacheWriteBehindStore<>("", "", log, delegate);
-
-        store.setFlushFrequency(FLUSH_FREQUENCY);
-
-        store.setFlushSize(CACHE_SIZE);
-
-        store.setFlushThreadCount(flushThreadCnt);
-
-        delegate.reset();
-
-        store.start();
-    }
-
-    /**
-     * Shutdowns store.
-     *
-     * @throws Exception If failed.
-     */
-    protected void shutdownStore() throws Exception {
-        store.stop();
-
-        assertTrue("Store cache must be empty after shutdown", store.writeCache().isEmpty());
-    }
-
-    /**
-     * Performs multiple put, get and remove operations in several threads on a store. After
-     * all threads finished their operations, returns the total set of keys that should be
-     * in underlying store.
-     *
-     * @param threadCnt Count of threads that should update keys.
-     * @param keysPerThread Count of unique keys assigned to a thread.
-     * @return Set of keys that was totally put in store.
-     * @throws Exception If failed.
-     */
-    protected Set<Integer> runPutGetRemoveMultithreaded(int threadCnt, final int keysPerThread) throws Exception {
-        final ConcurrentMap<String, Set<Integer>> perThread = new ConcurrentHashMap<>();
-
-        final AtomicBoolean running = new AtomicBoolean(true);
-
-        final AtomicInteger cntr = new AtomicInteger();
-
-        final AtomicInteger operations = new AtomicInteger();
-
-        IgniteInternalFuture<?> fut = multithreadedAsync(new Runnable() {
-            @SuppressWarnings({"NullableProblems"})
-            @Override public void run() {
-                // Initialize key set for this thread.
-                Set<Integer> set = new HashSet<>();
-
-                Set<Integer> old = perThread.putIfAbsent(Thread.currentThread().getName(), set);
-
-                if (old != null)
-                    set = old;
-
-                List<Integer> original = new ArrayList<>();
-
-                Random rnd = new Random();
-
-                for (int i = 0; i < keysPerThread; i++)
-                    original.add(cntr.getAndIncrement());
-
-                try {
-                    while (running.get()) {
-                        int op = rnd.nextInt(3);
-                        int idx = rnd.nextInt(keysPerThread);
-
-                        int key = original.get(idx);
-
-                        switch (op) {
-                            case 0:
-                                store.write(new CacheEntryImpl<>(key, "val" + key));
-                                set.add(key);
-
-                                operations.incrementAndGet();
-
-                                break;
-
-                            case 1:
-                                store.delete(key);
-                                set.remove(key);
-
-                                operations.incrementAndGet();
-
-                                break;
-
-                            case 2:
-                            default:
-                                store.write(new CacheEntryImpl<>(key, "broken"));
-
-                                String val = store.load(key);
-
-                                assertEquals("Invalid intermediate value: " + val, "broken", val);
-
-                                store.write(new CacheEntryImpl<>(key, "val" + key));
-
-                                set.add(key);
-
-                                // 2 put operations performed here.
-                                operations.incrementAndGet();
-                                operations.incrementAndGet();
-                                operations.incrementAndGet();
-
-                                break;
-                        }
-                    }
-                }
-                catch (Exception e) {
-                    error("Unexpected exception in put thread", e);
-
-                    assert false;
-                }
-            }
-        }, threadCnt, "put");
-
-        U.sleep(10000);
-
-        running.set(false);
-
-        fut.get();
-
-        log().info(">>> " + operations + " operations performed totally");
-
-        Set<Integer> total = new HashSet<>();
-
-        for (Set<Integer> threadVals : perThread.values()) {
-            total.addAll(threadVals);
-        }
-
-        return total;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractTest.java
deleted file mode 100644
index 074b4d9..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreAbstractTest.java
+++ /dev/null
@@ -1,358 +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.internal.*;
-import org.apache.ignite.spi.discovery.tcp.*;
-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.*;
-import java.util.concurrent.atomic.*;
-
-import static org.apache.ignite.cache.CacheAtomicityMode.*;
-import static org.apache.ignite.cache.CacheDistributionMode.*;
-import static org.apache.ignite.transactions.IgniteTxConcurrency.*;
-import static org.apache.ignite.transactions.IgniteTxIsolation.*;
-
-/**
- * Basic store test.
- */
-public abstract class GridCacheWriteBehindStoreAbstractTest extends GridCommonAbstractTest {
-    /** Flush frequency. */
-    private static final int WRITE_FROM_BEHIND_FLUSH_FREQUENCY = 1000;
-
-    /** Cache store. */
-    private static final GridCacheTestStore store = new GridCacheTestStore();
-
-    /**
-     *
-     */
-    protected GridCacheWriteBehindStoreAbstractTest() {
-        super(true /*start grid. */);
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void beforeTest() throws Exception {
-        store.resetTimestamp();
-    }
-
-    /** {@inheritDoc} */
-    @Override protected void afterTest() throws Exception {
-        GridCache<?, ?> cache = cache();
-
-        if (cache != null)
-            cache.clearAll();
-
-        store.reset();
-    }
-
-    /** @return Caching mode. */
-    protected abstract CacheMode cacheMode();
-
-    /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
-    @Override protected final IgniteConfiguration getConfiguration() throws Exception {
-        IgniteConfiguration c = super.getConfiguration();
-
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
-
-        disco.setIpFinder(new TcpDiscoveryVmIpFinder(true));
-
-        c.setDiscoverySpi(disco);
-
-        CacheConfiguration cc = defaultCacheConfiguration();
-
-        cc.setCacheMode(cacheMode());
-        cc.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
-        cc.setSwapEnabled(false);
-        cc.setAtomicityMode(TRANSACTIONAL);
-        cc.setDistributionMode(NEAR_PARTITIONED);
-
-        cc.setCacheStoreFactory(new FactoryBuilder.SingletonFactory(store));
-        cc.setReadThrough(true);
-        cc.setWriteThrough(true);
-        cc.setLoadPreviousValue(true);
-
-        cc.setWriteBehindEnabled(true);
-        cc.setWriteBehindFlushFrequency(WRITE_FROM_BEHIND_FLUSH_FREQUENCY);
-
-        c.setCacheConfiguration(cc);
-
-        return c;
-    }
-
-    /** @throws Exception If test fails. */
-    public void testWriteThrough() throws Exception {
-        GridCache<Integer, String> cache = cache();
-
-        Map<Integer, String> map = store.getMap();
-
-        assert map.isEmpty();
-
-        IgniteTx tx = cache.txStart(OPTIMISTIC, REPEATABLE_READ);
-
-        try {
-            for (int i = 1; i <= 10; i++) {
-                cache.putx(i, Integer.toString(i));
-
-                checkLastMethod(null);
-            }
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        // Need to wait WFB flush timeout.
-        U.sleep(WRITE_FROM_BEHIND_FLUSH_FREQUENCY + 100);
-
-        checkLastMethod("putAll");
-
-        assert cache.size() == 10;
-
-        for (int i = 1; i <= 10; i++) {
-            String val = map.get(i);
-
-            assert val != null;
-            assert val.equals(Integer.toString(i));
-        }
-
-        store.resetLastMethod();
-
-        tx = cache.txStart();
-
-        try {
-            for (int i = 1; i <= 10; i++) {
-                String val = cache.remove(i);
-
-                checkLastMethod(null);
-
-                assert val != null;
-                assert val.equals(Integer.toString(i));
-            }
-
-            tx.commit();
-        }
-        finally {
-            tx.close();
-        }
-
-        // Need to wait WFB flush timeout.
-        U.sleep(WRITE_FROM_BEHIND_FLUSH_FREQUENCY + 100);
-
-        checkLastMethod("removeAll");
-
-        assert map.isEmpty();
-    }
-
-    /** @throws Exception If test failed. */
-    public void testReadThrough() throws Exception {
-        GridCache<Integer, String> cache = cache();
-
-        Map<Integer, String> map = store.getMap();
-
-        assert map.isEmpty();
-
-        try (IgniteTx tx = cache.txStart(OPTIMISTIC, REPEATABLE_READ)) {
-            for (int i = 1; i <= 10; i++)
-                cache.putx(i, Integer.toString(i));
-
-            checkLastMethod(null);
-
-            tx.commit();
-        }
-
-        // Need to wait WFB flush timeout.
-        U.sleep(WRITE_FROM_BEHIND_FLUSH_FREQUENCY + 100);
-
-        checkLastMethod("putAll");
-
-        for (int i = 1; i <= 10; i++) {
-            String val = map.get(i);
-
-            assert val != null;
-            assert val.equals(Integer.toString(i));
-        }
-
-        cache.clearAll();
-
-        assert cache.isEmpty();
-        assert cache.isEmpty();
-
-        // Need to wait WFB flush timeout.
-        U.sleep(WRITE_FROM_BEHIND_FLUSH_FREQUENCY + 100);
-
-        assert map.size() == 10;
-
-        for (int i = 1; i <= 10; i++) {
-            // Read through.
-            String val = cache.get(i);
-
-            checkLastMethod("load");
-
-            assert val != null;
-            assert val.equals(Integer.toString(i));
-        }
-
-        assert cache.size() == 10;
-
-        cache.clearAll();
-
-        assert cache.isEmpty();
-        assert cache.isEmpty();
-
-        assert map.size() == 10;
-
-        Collection<Integer> keys = new ArrayList<>();
-
-        for (int i = 1; i <= 10; i++)
-            keys.add(i);
-
-        // Read through.
-        Map<Integer, String> vals = cache.getAll(keys);
-
-        checkLastMethod("loadAll");
-
-        assert vals != null;
-        assert vals.size() == 10;
-
-        for (int i = 1; i <= 10; i++) {
-            String val = vals.get(i);
-
-            assert val != null;
-            assert val.equals(Integer.toString(i));
-        }
-
-        // Write through.
-        cache.removeAll(keys);
-
-        // Need to wait WFB flush timeout.
-        U.sleep(WRITE_FROM_BEHIND_FLUSH_FREQUENCY + 100);
-
-        checkLastMethod("removeAll");
-
-        assert cache.isEmpty();
-        assert cache.isEmpty();
-
-        assert map.isEmpty();
-    }
-
-    /** @throws Exception If failed. */
-    public void testMultithreaded() throws Exception {
-        final ConcurrentMap<String, Set<Integer>> perThread = new ConcurrentHashMap<>();
-
-        final AtomicBoolean running = new AtomicBoolean(true);
-
-        final GridCache<Integer, String> cache = cache();
-
-        IgniteInternalFuture<?> fut = multithreadedAsync(new Runnable() {
-            @SuppressWarnings({"NullableProblems"})
-            @Override public void run() {
-                // Initialize key set for this thread.
-                Set<Integer> set = new HashSet<>();
-
-                Set<Integer> old = perThread.putIfAbsent(Thread.currentThread().getName(), set);
-
-                if (old != null)
-                    set = old;
-
-                Random rnd = new Random();
-
-                try {
-                    int keyCnt = 20000;
-
-                    while (running.get()) {
-                        int op = rnd.nextInt(2);
-                        int key = rnd.nextInt(keyCnt);
-
-                        switch (op) {
-                            case 0:
-                                cache.put(key, "val" + key);
-                                set.add(key);
-
-                                break;
-
-                            case 1:
-                            default:
-                                cache.remove(key);
-                                set.remove(key);
-
-                                break;
-                        }
-                    }
-                }
-                catch (IgniteCheckedException e) {
-                    error("Unexpected exception in put thread", e);
-
-                    assert false;
-                }
-            }
-        }, 10, "put");
-
-        U.sleep(10000);
-
-        running.set(false);
-
-        fut.get();
-
-        U.sleep(5 * WRITE_FROM_BEHIND_FLUSH_FREQUENCY);
-
-        Map<Integer, String> stored = store.getMap();
-
-        for (Map.Entry<Integer, String> entry : stored.entrySet()) {
-            int key = entry.getKey();
-
-            assertEquals("Invalid value for key " + key, "val" + key, entry.getValue());
-
-            boolean found = false;
-
-            for (Set<Integer> threadPuts : perThread.values()) {
-                if (threadPuts.contains(key)) {
-                    found = true;
-
-                    break;
-                }
-            }
-
-            assert found : "No threads found that put key " + key;
-        }
-    }
-
-    /** @param mtd Expected last method value. */
-    private void checkLastMethod(@Nullable String mtd) {
-        String lastMtd = store.getLastMethod();
-
-        if (mtd == null)
-            assert lastMtd == null : "Last method must be null: " + lastMtd;
-        else {
-            assert lastMtd != null : "Last method must be not null";
-            assert lastMtd.equals(mtd) : "Last method does not match [expected=" + mtd + ", lastMtd=" + lastMtd + ']';
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreLocalTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreLocalTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreLocalTest.java
deleted file mode 100644
index 6c050ca..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreLocalTest.java
+++ /dev/null
@@ -1,30 +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.*;
-
-/**
- * Tests {@link GridCacheWriteBehindStore} in grid configuration.
- */
-public class GridCacheWriteBehindStoreLocalTest extends GridCacheWriteBehindStoreAbstractTest {
-    /** {@inheritDoc} */
-    @Override protected CacheMode cacheMode() {
-        return CacheMode.LOCAL;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6563e8a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreMultithreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreMultithreadedSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreMultithreadedSelfTest.java
deleted file mode 100644
index 9607784..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheWriteBehindStoreMultithreadedSelfTest.java
+++ /dev/null
@@ -1,163 +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.internal.util.typedef.internal.*;
-
-import java.util.*;
-
-/**
- * Multithreaded tests for {@link GridCacheWriteBehindStore}.
- */
-public class GridCacheWriteBehindStoreMultithreadedSelfTest extends GridCacheWriteBehindStoreAbstractSelfTest {
-    /**
-     * This test performs complex set of operations on store from multiple threads.
-     *
-     * @throws Exception If failed.
-     */
-    public void testPutGetRemove() throws Exception {
-        initStore(2);
-
-        Set<Integer> exp;
-
-        try {
-            exp = runPutGetRemoveMultithreaded(10, 10);
-        }
-        finally {
-            shutdownStore();
-        }
-
-        Map<Integer, String> map = delegate.getMap();
-
-        Collection<Integer> extra = new HashSet<>(map.keySet());
-
-        extra.removeAll(exp);
-
-        assertTrue("The underlying store contains extra keys: " + extra, extra.isEmpty());
-
-        Collection<Integer> missing = new HashSet<>(exp);
-
-        missing.removeAll(map.keySet());
-
-        assertTrue("Missing keys in the underlying store: " + missing, missing.isEmpty());
-
-        for (Integer key : exp)
-            assertEquals("Invalid value for key " + key, "val" + key, map.get(key));
-    }
-
-    /**
-     * Tests that cache would keep values if underlying store fails.
-     *
-     * @throws Exception If failed.
-     */
-    public void testStoreFailure() throws Exception {
-        delegate.setShouldFail(true);
-
-        initStore(2);
-
-        Set<Integer> exp;
-
-        try {
-            exp = runPutGetRemoveMultithreaded(10, 10);
-
-            U.sleep(FLUSH_FREQUENCY);
-
-            info(">>> There are " + store.getWriteBehindErrorRetryCount() + " entries in RETRY state");
-
-            delegate.setShouldFail(false);
-
-            // Despite that we set shouldFail flag to false, flush thread may just have caught an exception.
-            // If we move store to the stopping state right away, this value will be lost. That's why this sleep
-            // is inserted here to let all exception handlers in write-behind store exit.
-            U.sleep(1000);
-        }
-        finally {
-            shutdownStore();
-        }
-
-        Map<Integer, String> map = delegate.getMap();
-
-        Collection<Integer> extra = new HashSet<>(map.keySet());
-
-        extra.removeAll(exp);
-
-        assertTrue("The underlying store contains extra keys: " + extra, extra.isEmpty());
-
-        Collection<Integer> missing = new HashSet<>(exp);
-
-        missing.removeAll(map.keySet());
-
-        assertTrue("Missing keys in the underlying store: " + missing, missing.isEmpty());
-
-        for (Integer key : exp)
-            assertEquals("Invalid value for key " + key, "val" + key, map.get(key));
-    }
-
-    /**
-     * Tests store consistency in case of high put rate, when flush is performed from the same thread
-     * as put or remove operation.
-     *
-     * @throws Exception If failed.
-     */
-    public void testFlushFromTheSameThread() throws Exception {
-        // 50 milliseconds should be enough.
-        delegate.setOperationDelay(50);
-
-        initStore(2);
-
-        Set<Integer> exp;
-
-        int start = store.getWriteBehindTotalCriticalOverflowCount();
-
-        try {
-            //We will have in total 5 * CACHE_SIZE keys that should be enough to grow map size to critical value.
-            exp = runPutGetRemoveMultithreaded(5, CACHE_SIZE);
-        }
-        finally {
-            log.info(">>> Done inserting, shutting down the store");
-
-            shutdownStore();
-        }
-
-        // Restore delay.
-        delegate.setOperationDelay(0);
-
-        Map<Integer, String> map = delegate.getMap();
-
-        int end = store.getWriteBehindTotalCriticalOverflowCount();
-
-        log.info(">>> There are " + exp.size() + " keys in store, " + (end - start) + " overflows detected");
-
-        assertTrue("No cache overflows detected (a bug or too few keys or too few delay?)", end > start);
-
-        Collection<Integer> extra = new HashSet<>(map.keySet());
-
-        extra.removeAll(exp);
-
-        assertTrue("The underlying store contains extra keys: " + extra, extra.isEmpty());
-
-        Collection<Integer> missing = new HashSet<>(exp);
-
-        missing.removeAll(map.keySet());
-
-        assertTrue("Missing keys in the underlying store: " + missing, missing.isEmpty());
-
-        for (Integer key : exp)
-            assertEquals("Invalid value for key " + key, "val" + key, map.get(key));
-    }
-}


Mime
View raw message