ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [12/31] incubator-ignite git commit: ignite-471-2: huge merge from sprint-6
Date Wed, 10 Jun 2015 16:27:35 GMT
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTcpClientDiscoveryMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTcpClientDiscoveryMultiThreadedTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTcpClientDiscoveryMultiThreadedTest.java
new file mode 100644
index 0000000..b817f4c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTcpClientDiscoveryMultiThreadedTest.java
@@ -0,0 +1,190 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+
+import java.net.*;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Tests {@link TcpDiscoverySpi} in client mode with multiple client nodes that interact with a cache concurrently.
+ */
+public class GridCacheTcpClientDiscoveryMultiThreadedTest extends GridCacheAbstractSelfTest {
+    /** Server nodes count. */
+    private static int srvNodesCnt;
+
+    /** Client nodes count. */
+    private static int clientNodesCnt;
+
+    /** Client node or not. */
+    private static boolean client;
+
+    /** {@inheritDoc} */
+    @Override protected int gridCount() {
+        return srvNodesCnt + clientNodesCnt;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        // No-op.
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTestsStopped();
+    }
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        // Filling configuration for client nodes
+        if (client) {
+            TcpDiscoveryVmIpFinder clientFinder = new TcpDiscoveryVmIpFinder();
+            Collection<String> addrs = new ArrayList<>(ipFinder.getRegisteredAddresses().size());
+
+            for (InetSocketAddress sockAddr : ipFinder.getRegisteredAddresses())
+                addrs.add(sockAddr.getHostString() + ":" + sockAddr.getPort());
+
+            clientFinder.setAddresses(addrs);
+
+            cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(clientFinder));
+
+            cfg.setClientMode(true);
+        }
+
+        cfg.setLocalHost("127.0.0.1");
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected CacheMode cacheMode() {
+        return PARTITIONED;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected long getTestTimeout() {
+        return 2 * 60 * 1000;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testCacheConcurrentlyWithMultipleClientNodes() throws Exception {
+        srvNodesCnt = 2;
+        clientNodesCnt = 3;
+
+        startServerNodes();
+
+        client = true;
+
+        for (int n = 0; n < 2; n++) {
+            startGridsMultiThreaded(srvNodesCnt, clientNodesCnt);
+
+            checkTopology(gridCount());
+
+            awaitPartitionMapExchange();
+
+            // Explicitly create near cache for even client nodes
+            for (int i = srvNodesCnt; i < gridCount(); i++)
+                grid(i).createNearCache(null, new NearCacheConfiguration<>());
+
+            final AtomicInteger threadsCnt = new AtomicInteger();
+
+            IgniteInternalFuture<?> f = multithreadedAsync(
+                    new Callable<Object>() {
+                        @Override public Object call() throws Exception {
+                            int clientIdx = srvNodesCnt + threadsCnt.getAndIncrement();
+
+                            Ignite node = grid(clientIdx);
+
+                            assert node.configuration().isClientMode();
+
+                            IgniteCache<Integer, Integer> cache = node.cache(null);
+
+                            boolean isNearCacheNode = clientIdx % 2 == 0;
+
+                            for (int i = 100 * clientIdx; i < 100 * (clientIdx + 1); i++)
+                                cache.put(i, i);
+
+                            for (int i = 100 * clientIdx; i < 100 * (clientIdx + 1); i++) {
+                                assertEquals(i, (int) cache.get(i));
+
+                                if (isNearCacheNode)
+                                    assertEquals(i, (int) cache.localPeek(i, CachePeekMode.ONHEAP));
+                            }
+
+                            stopGrid(clientIdx);
+
+                            return null;
+                        }
+                    },
+                    clientNodesCnt
+            );
+
+            f.get();
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void startServerNodes() throws Exception {
+        client = false;
+
+        for (int i = 0; i < srvNodesCnt; i++)
+            startGrid(i);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void stopServerNodes() throws Exception {
+        for (int i = 0; i < srvNodesCnt; i++)
+            stopGrid(i);
+    }
+
+    /**
+     * Executes simple operation on the cache.
+     *
+     * @param cache Cache instance to use.
+     */
+    private void performSimpleOperationsOnCache(IgniteCache<Integer, Integer> cache) {
+        for (int i = 100; i < 200; i++)
+            cache.put(i, i);
+
+        for (int i = 100; i < 200; i++)
+            assertEquals(i, (int) cache.get(i));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
index 9a24109..eaa6e13 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheTestEntryEx.java
@@ -843,4 +843,8 @@ public class GridCacheTestEntryEx extends GridMetadataAwareAdapter implements Gr
         return null;
     }
 
+    /** {@inheritDoc} */
+    @Override public void onUnlock() {
+        // No-op.
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/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
index ce0a55c..dc50ee6 100644
--- 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
@@ -19,8 +19,10 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.cluster.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -137,8 +139,14 @@ public class GridCacheVariableTopologySelfTest extends GridCommonAbstractTest {
 
                         tx.commit();
                     }
-                    catch (TransactionOptimisticException e) {
-                        info("Caught cache optimistic exception: " + e);
+                    catch (ClusterTopologyException e) {
+                        info("Caught topology exception: " + e);
+                    }
+                    catch (IgniteException e) {
+                        if (X.hasCause(e, ClusterTopologyCheckedException.class))
+                            info("Caught cache exception: " + e);
+                        else
+                            throw e;
                     }
 
                     try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
index 3c3c5db..cecb4a9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheVersionMultinodeTest.java
@@ -81,7 +81,7 @@ public class GridCacheVersionMultinodeTest extends GridCacheAbstractSelfTest {
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
-        // No-op.
+        fail("https://issues.apache.org/jira/browse/IGNITE-114");
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
index aa8e2f7..10b14cc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractStopBusySelfTest.java
@@ -101,11 +101,7 @@ public abstract class IgniteCacheAbstractStopBusySelfTest extends GridCommonAbst
 
         cfg.setCommunicationSpi(commSpi);
 
-        TcpDiscoverySpi spi = new TcpDiscoverySpi();
-
-        spi.setIpFinder(finder);
-
-        cfg.setDiscoverySpi(spi);
+        cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(finder).setForceServerMode(true));
 
         cfg.setCacheConfiguration(cacheCfg);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
index 8d86319..62a5b20 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractTest.java
@@ -81,7 +81,7 @@ public abstract class IgniteCacheAbstractTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        TcpDiscoverySpi disco = new TcpDiscoverySpi();
+        TcpDiscoverySpi disco = new TcpDiscoverySpi().setForceServerMode(true);
 
         disco.setMaxMissedHeartbeats(Integer.MAX_VALUE);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
index a030039..937a3b4 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheConfigurationTemplateTest.java
@@ -59,7 +59,7 @@ public class IgniteCacheConfigurationTemplateTest extends GridCommonAbstractTest
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder).setForceServerMode(true);
 
         if (addTemplate) {
             CacheConfiguration dfltCfg = new CacheConfiguration();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
index ee4d64b..a5c4a99 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInterceptorSelfTestSuite.java
@@ -47,7 +47,7 @@ public class IgniteCacheInterceptorSelfTestSuite extends TestSuite {
 
         suite.addTestSuite(GridCacheInterceptorSelfTest.class);
         suite.addTestSuite(GridCacheInterceptorNearEnabledSelfTest.class);
-//        suite.addTestSuite(GridCacheInterceptorWithStoreSelfTest.class); TODO GG-9141
+        suite.addTestSuite(GridCacheInterceptorWithStoreSelfTest.class);
         suite.addTestSuite(GridCacheInterceptorReplicatedSelfTest.class);
         suite.addTestSuite(GridCacheInterceptorReplicatedWithStoreSelfTest.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
index 673bbaf..10ab1ab 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheInvokeReadThroughTest.java
@@ -32,6 +32,11 @@ import static org.apache.ignite.cache.CacheMode.*;
  *
  */
 public class IgniteCacheInvokeReadThroughTest extends IgniteCacheAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-114");
+    }
+
     /** */
     private static volatile boolean failed;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
index 5cc9d04..cd04433 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheNearLockValueSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.internal.processors.cache.distributed.near.*;
 import org.apache.ignite.plugin.extensions.communication.*;
 import org.apache.ignite.spi.*;
 import org.apache.ignite.spi.communication.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.testframework.junits.common.*;
 import org.apache.ignite.transactions.*;
 
@@ -54,6 +55,8 @@ public class IgniteCacheNearLockValueSelfTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
+        cfg.setDiscoverySpi(new TcpDiscoverySpi().setForceServerMode(true));
+
         if (getTestGridName(0).equals(gridName))
             cfg.setClientMode(true);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
index 5aa0ac8..ce68b17 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingErrorTest.java
@@ -65,27 +65,33 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        if (gridName.endsWith("0"))
+        if (getTestGridName(0).equals(gridName)) {
             cfg.setClientMode(true);
 
+            cfg.setCacheConfiguration();
+        }
+
         return cfg;
     }
 
     /** Test key 1. */
     public static class TestKey implements Externalizable {
-        /** Test key 1. */
+        /** Field. */
+        @QuerySqlField(index = true)
+        private String field;
+
+        /**
+         * @param field Test key 1.
+         */
         public TestKey(String field) {
             this.field = field;
         }
 
         /** Test key 1. */
         public TestKey() {
+            // No-op.
         }
 
-        /** Field. */
-        @QuerySqlField(index = true)
-        private String field;
-
         /** {@inheritDoc} */
         @Override public boolean equals(Object o) {
             if (this == o)
@@ -112,14 +118,15 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
         @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
             field = (String)in.readObject();
 
-            if (readCnt.decrementAndGet() <= 0) {
-                throw new IOException("Class can not be unmarshalled");
-            }
+            if (readCnt.decrementAndGet() <= 0)
+                throw new IOException("Class can not be unmarshalled.");
         }
     }
 
     /**
      * Sends put atomically and handles fail.
+     *
+     * @param k Key.
      */
     protected void failAtomicPut(int k) {
         try {
@@ -136,6 +143,8 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
 
     /**
      * Sends get atomically and handles fail.
+     *
+     * @param k Key.
      */
     protected void failAtomicGet(int k) {
         try {
@@ -150,6 +159,8 @@ public class IgniteCacheP2pUnmarshallingErrorTest extends IgniteCacheAbstractTes
 
     /**
      * Tests that correct response will be sent to client node in case of unmarshalling failed.
+     *
+     * @throws Exception If failed.
      */
     public void testResponseMessageOnUnmarshallingFailed() throws Exception {
         //GridNearAtomicUpdateRequest unmarshalling failed test

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
index 732d12d..3462d71 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingNearErrorTest.java
@@ -33,10 +33,12 @@ public class IgniteCacheP2pUnmarshallingNearErrorTest extends IgniteCacheP2pUnma
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(gridName);
 
-        cfg.getCacheConfiguration()[0].setEvictMaxOverflowRatio(0);
-        cfg.getCacheConfiguration()[0].setEvictSynchronized(true);
-        cfg.getCacheConfiguration()[0].setEvictSynchronizedKeyBufferSize(1);
-        cfg.getCacheConfiguration()[0].setEvictionPolicy(new FifoEvictionPolicy(1));
+        if (cfg.isClientMode() == null || !cfg.isClientMode()) {
+            cfg.getCacheConfiguration()[0].setEvictMaxOverflowRatio(0);
+            cfg.getCacheConfiguration()[0].setEvictSynchronized(true);
+            cfg.getCacheConfiguration()[0].setEvictSynchronizedKeyBufferSize(1);
+            cfg.getCacheConfiguration()[0].setEvictionPolicy(new FifoEvictionPolicy(1));
+        }
 
         return cfg;
     }
@@ -51,6 +53,7 @@ public class IgniteCacheP2pUnmarshallingNearErrorTest extends IgniteCacheP2pUnma
 
         //Eviction request unmarshalling failed but ioManager does not hangs up.
 
-        Thread.sleep(1000); //todo: wait for eviction complete
+        // Wait for eviction complete.
+        Thread.sleep(1000);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionMapUpdateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionMapUpdateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionMapUpdateTest.java
new file mode 100644
index 0000000..5b45701
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePartitionMapUpdateTest.java
@@ -0,0 +1,226 @@
+/*
+ * 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.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.util.typedef.*;
+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.*;
+import java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ *
+ */
+public class IgniteCachePartitionMapUpdateTest extends GridCommonAbstractTest {
+    /** */
+    protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private static final String CACHE1_ATTR = "cache1";
+
+    /** */
+    private static final String CACHE2_ATTR = "cache2";
+
+    /** */
+    private static final String CACHE1 = "cache1";
+
+    /** */
+    private static final String CACHE2 = "cache2";
+
+    /** */
+    private boolean startClientCache;
+
+    /** */
+    private boolean cache1;
+
+    /** */
+    private boolean cache2;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        CacheConfiguration ccfg1 = new CacheConfiguration();
+
+        ccfg1.setName(CACHE1);
+        ccfg1.setCacheMode(PARTITIONED);
+        ccfg1.setBackups(1);
+        ccfg1.setNodeFilter(new AttributeFilter(CACHE1_ATTR));
+
+        CacheConfiguration ccfg2 = new CacheConfiguration();
+
+        ccfg2.setName(CACHE2);
+        ccfg2.setCacheMode(PARTITIONED);
+        ccfg2.setNodeFilter(new AttributeFilter(CACHE2_ATTR));
+
+        List<CacheConfiguration> ccfgs = new ArrayList<>();
+
+        Map<String, String> attrs = new HashMap<>();
+
+        if (cache1)
+            attrs.put(CACHE1_ATTR, "true");
+
+        if (cache1 || startClientCache)
+            ccfgs.add(ccfg1);
+
+        if (cache2)
+            attrs.put(CACHE2_ATTR, "true");
+
+        if (cache2 || startClientCache)
+            ccfgs.add(ccfg2);
+
+        cfg.setUserAttributes(attrs);
+
+        cfg.setCacheConfiguration(ccfgs.toArray(new CacheConfiguration[ccfgs.size()]));
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPartitionMapUpdate1() throws Exception {
+        cache1 = false;
+        cache2 = false;
+
+        startGrid(0);
+
+        cache1 = true;
+        cache2 = false;
+
+        startGrid(1);
+
+        awaitPartitionMapExchange();
+
+        cache1 = false;
+        cache2 = true;
+
+        startGrid(2);
+
+        cache1 = true;
+        cache2 = true;
+
+        startGrid(3);
+
+        awaitPartitionMapExchange();
+
+        stopGrid(0);
+
+        awaitPartitionMapExchange();
+
+        stopGrid(1);
+
+        awaitPartitionMapExchange();
+
+        stopGrid(2);
+
+        awaitPartitionMapExchange();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testPartitionMapUpdate2() throws Exception {
+        startClientCache = true;
+
+        testPartitionMapUpdate1();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testRandom() throws Exception {
+        ThreadLocalRandom rnd = ThreadLocalRandom.current();
+
+        final int NODE_CNT = 10;
+
+        for (int iter = 0; iter < 1; iter++) {
+            log.info("Iteration: " + iter);
+
+            for (int i = 0; i < NODE_CNT; i++) {
+                cache1 = rnd.nextBoolean();
+                cache2 = rnd.nextBoolean();
+
+                log.info("Start node [idx=" + i + ", cache1=" + cache1 + ", cache2=" + cache2 + ']');
+
+                startGrid(i);
+
+                awaitPartitionMapExchange();
+            }
+
+            LinkedHashSet<Integer> stopSeq = new LinkedHashSet<>();
+
+            while (stopSeq.size() != NODE_CNT)
+                stopSeq.add(rnd.nextInt(0, NODE_CNT));
+
+            for (Integer idx : stopSeq) {
+                log.info("Stop node: " + idx);
+
+                stopGrid(idx);
+
+                awaitPartitionMapExchange();
+            }
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testRandom2() throws Exception {
+        startClientCache = true;
+
+        testRandom();
+    }
+
+    /**
+     *
+     */
+    static class AttributeFilter implements IgnitePredicate<ClusterNode> {
+        /** */
+        private String attrName;
+
+        /**
+         * @param attrName Attribute name.
+         */
+        public AttributeFilter(String attrName) {
+            this.attrName = attrName;
+        }
+
+        /** {@inheritDoc} */
+        @Override public boolean apply(ClusterNode node) {
+            return F.eq(node.attribute(attrName), "true");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
index 7cd8414..448f171 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCachePeekModesAbstractTest.java
@@ -93,7 +93,10 @@ public abstract class IgniteCachePeekModesAbstractTest extends IgniteCacheAbstra
         if (hasNearCache())
             ccfg.setNearConfiguration(new NearCacheConfiguration());
 
-        ccfg.setEvictionPolicy(new FifoEvictionPolicy(HEAP_ENTRIES));
+        FifoEvictionPolicy plc = new FifoEvictionPolicy();
+        plc.setMaxSize(HEAP_ENTRIES);
+
+        ccfg.setEvictionPolicy(plc);
 
         return ccfg;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
index 07b7c13..fe1b266 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheTransactionalStopBusySelfTest.java
@@ -24,6 +24,11 @@ import org.apache.ignite.internal.processors.cache.distributed.near.*;
  */
 public class IgniteCacheTransactionalStopBusySelfTest extends IgniteCacheAbstractStopBusySelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-257");
+    }
+
+    /** {@inheritDoc} */
     @Override public void testPut() throws Exception {
         bannedMessage.set(GridNearTxPrepareRequest.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
index 095221e..db9e6a8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
@@ -25,6 +25,7 @@ import org.apache.ignite.events.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.discovery.*;
 import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
@@ -68,6 +69,9 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
     private boolean testAttribute = true;
 
     /** */
+    private boolean client;
+
+    /** */
     private boolean daemon;
 
     /**
@@ -85,6 +89,12 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
 
         ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
 
+        if (client) {
+            cfg.setClientMode(true);
+
+            ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
+        }
+
         cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE_NAME, testAttribute));
 
         CacheConfiguration cacheCfg = new CacheConfiguration();
@@ -1024,4 +1034,56 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
             stopGrid(nodeCount());
         }
     }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStartStopWithClientJoin() throws Exception {
+        Ignite ignite1 = ignite(1);
+
+        final AtomicBoolean stop = new AtomicBoolean();
+
+        IgniteInternalFuture<?> fut = GridTestUtils.runMultiThreadedAsync(new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                client = true;
+
+                int iter = 0;
+
+                while (!stop.get()) {
+                    if (iter % 10 == 0)
+                        log.info("Client start/stop iteration: " + iter);
+
+                    iter++;
+
+                    try (Ignite ignite = startGrid(nodeCount())) {
+                        assertTrue(ignite.configuration().isClientMode());
+                    }
+                }
+
+                return null;
+            }
+        }, 1, "client-start-stop");
+
+        try {
+            long stopTime = U.currentTimeMillis() + 30_000;
+
+            int iter = 0;
+
+            while (System.currentTimeMillis() < stopTime) {
+                if (iter % 10 == 0)
+                    log.info("Cache start/stop iteration: " + iter);
+
+                try (IgniteCache<Object, Object> cache = ignite1.getOrCreateCache("cache-" + iter)) {
+                    assertNotNull(cache);
+                }
+
+                iter++;
+            }
+        }
+        finally {
+            stop.set(true);
+        }
+
+        fut.get();
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheWithConfigStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheWithConfigStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheWithConfigStartSelfTest.java
new file mode 100644
index 0000000..6386f8c
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheWithConfigStartSelfTest.java
@@ -0,0 +1,97 @@
+/*
+ * 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.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+/**
+ *
+ */
+public class IgniteDynamicCacheWithConfigStartSelfTest extends GridCommonAbstractTest {
+    /** */
+    private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private static final String CACHE_NAME = "partitioned";
+
+    /** */
+    private boolean client;
+
+    /** {@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);
+
+        if (client)
+            cfg.setCacheConfiguration(cacheConfiguration());
+
+        cfg.setClientMode(client);
+
+        return cfg;
+    }
+
+    /**
+     * @return Cache configuration.
+     */
+    private CacheConfiguration cacheConfiguration() {
+        CacheConfiguration<Object, Object> ccfg = new CacheConfiguration<>(CACHE_NAME);
+
+        ccfg.setIndexedTypes(String.class, String.class);
+
+        return ccfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testStartCacheOnClient() throws Exception {
+        int srvCnt = 3;
+
+        startGrids(srvCnt);
+
+        try {
+            client = true;
+
+            IgniteEx client = startGrid(srvCnt);
+
+            for (int i = 0; i < 100; i++)
+                client.cache(CACHE_NAME).put(i, i);
+
+            for (int i = 0; i < 100; i++)
+                assertEquals(i, grid(0).cache(CACHE_NAME).get(i));
+
+            client.cache(CACHE_NAME).removeAll();
+
+            for (int i = 0; i < 100; i++)
+                assertNull(grid(0).cache(CACHE_NAME).get(i));
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
new file mode 100644
index 0000000..24935c7
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicClientCacheStartSelfTest.java
@@ -0,0 +1,283 @@
+/*
+ * 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.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.managers.discovery.*;
+import org.apache.ignite.internal.processors.cache.distributed.dht.*;
+import org.apache.ignite.internal.processors.cache.distributed.near.*;
+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 java.util.concurrent.*;
+
+import static org.apache.ignite.cache.CacheMode.*;
+
+/**
+ * Tests that cache specified in configuration start on client nodes.
+ */
+public class IgniteDynamicClientCacheStartSelfTest extends GridCommonAbstractTest {
+    /** */
+    protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private CacheConfiguration ccfg;
+
+    /** */
+    private boolean client;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        cfg.setClientMode(client);
+
+        if (ccfg != null)
+            cfg.setCacheConfiguration(ccfg);
+
+        return cfg;
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    @Override protected void afterTest() throws Exception {
+        super.afterTest();
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testConfiguredCacheOnClientNode() throws Exception {
+        ccfg = new CacheConfiguration();
+
+        final String cacheName = null;
+
+        Ignite ignite0 = startGrid(0);
+
+        checkCache(ignite0, cacheName, true, false);
+
+        client = true;
+
+        Ignite ignite1 = startGrid(1);
+
+        checkCache(ignite1, cacheName, false, false);
+
+        ccfg = new CacheConfiguration();
+
+        ccfg.setNearConfiguration(new NearCacheConfiguration());
+
+        Ignite ignite2 = startGrid(2);
+
+        checkCache(ignite2, cacheName, false, true);
+
+        ccfg = null;
+
+        Ignite ignite3 = startGrid(3);
+
+        checkNoCache(ignite3, cacheName);
+
+        assertNotNull(ignite3.cache(cacheName));
+
+        checkCache(ignite3, cacheName, false, false);
+
+        Ignite ignite4 = startGrid(4);
+
+        checkNoCache(ignite4, cacheName);
+
+        assertNotNull(ignite4.createNearCache(cacheName, new NearCacheConfiguration<>()));
+
+        checkCache(ignite4, cacheName, false, true);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testNearCacheStartError() throws Exception {
+        ccfg = new CacheConfiguration();
+
+        final String cacheName = null;
+
+        Ignite ignite0 = startGrid(0);
+
+        checkCache(ignite0, cacheName, true, false);
+
+        client = true;
+
+        final Ignite ignite1 = startGrid(1);
+
+        checkCache(ignite1, cacheName, false, false);
+
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                ignite1.getOrCreateNearCache(cacheName, new NearCacheConfiguration<>());
+
+                return null;
+            }
+        }, IgniteException.class, null);
+
+        checkCache(ignite1, cacheName, false, false);
+
+        GridTestUtils.assertThrows(log, new Callable<Object>() {
+            @Override public Object call() throws Exception {
+                ignite1.createNearCache(cacheName, new NearCacheConfiguration<>());
+
+                return null;
+            }
+        }, IgniteException.class, null);
+
+        checkCache(ignite1, cacheName, false, false);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testReplicatedCacheClient() throws Exception {
+        ccfg = new CacheConfiguration();
+
+        ccfg.setCacheMode(REPLICATED);
+
+        final String cacheName = null;
+
+        Ignite ignite0 = startGrid(0);
+
+        checkCache(ignite0, cacheName, true, false);
+
+        client = true;
+
+        final Ignite ignite1 = startGrid(1);
+
+        checkCache(ignite1, cacheName, false, false);
+
+        ccfg.setNearConfiguration(new NearCacheConfiguration());
+
+        Ignite ignite2 = startGrid(2);
+
+        checkCache(ignite2, cacheName, false, true);
+
+        ccfg = null;
+
+        Ignite ignite3 = startGrid(3);
+
+        checkNoCache(ignite3, cacheName);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testReplicatedWithNearCacheClient() throws Exception {
+        ccfg = new CacheConfiguration();
+
+        ccfg.setNearConfiguration(new NearCacheConfiguration());
+
+        ccfg.setCacheMode(REPLICATED);
+
+        final String cacheName = null;
+
+        Ignite ignite0 = startGrid(0);
+
+        checkCache(ignite0, cacheName, true, false);
+
+        client = true;
+
+        final Ignite ignite1 = startGrid(1);
+
+        checkCache(ignite1, cacheName, false, true);
+
+        ccfg.setNearConfiguration(null);
+
+        Ignite ignite2 = startGrid(2);
+
+        checkCache(ignite2, cacheName, false, false);
+
+        ccfg = null;
+
+        Ignite ignite3 = startGrid(3);
+
+        checkNoCache(ignite3, cacheName);
+    }
+
+    /**
+     * @param ignite Node.
+     * @param cacheName Cache name
+     * @param srv {@code True} if server cache is expected.
+     * @param near {@code True} if near cache is expected.
+     */
+    private void checkCache(Ignite ignite, String cacheName, boolean srv, boolean near) {
+        GridCacheAdapter<Object, Object> cache = ((IgniteKernal)ignite).context().cache().internalCache(cacheName);
+
+        assertNotNull("No cache on node " + ignite.name(), cache);
+
+        assertEquals(near, cache.context().isNear());
+
+        if (near)
+            cache = ((GridNearCacheAdapter)cache).dht();
+
+        if (srv)
+            assertSame(GridCacheConcurrentMap.class, cache.map().getClass());
+        else
+            assertSame(GridNoStorageCacheMap.class, cache.map().getClass());
+
+        ClusterNode node = ((IgniteKernal)ignite).localNode();
+
+        for (Ignite ignite0 : Ignition.allGrids()) {
+            GridDiscoveryManager disco = ((IgniteKernal)ignite0).context().discovery();
+
+            assertTrue(disco.cacheNode(node, cacheName));
+            assertEquals(srv, disco.cacheAffinityNode(node, cacheName));
+            assertEquals(near, disco.cacheNearNode(node, cacheName));
+
+            if (srv)
+                assertTrue(ignite0.affinity(null).primaryPartitions(node).length > 0);
+            else
+                assertEquals(0, ignite0.affinity(null).primaryPartitions(node).length);
+        }
+
+        assertNotNull(ignite.cache(cacheName));
+    }
+
+    /**
+     * @param ignite Node.
+     * @param cacheName Cache name.
+     */
+    private void checkNoCache(Ignite ignite, String cacheName) {
+        GridCacheAdapter<Object, Object> cache = ((IgniteKernal)ignite).context().cache().internalCache(cacheName);
+
+        assertNull("Unexpected cache on node " + ignite.name(), cache);
+
+        ClusterNode node = ((IgniteKernal)ignite).localNode();
+
+        for (Ignite ignite0 : Ignition.allGrids()) {
+            GridDiscoveryManager disco = ((IgniteKernal)ignite0).context().discovery();
+
+            assertFalse(disco.cacheNode(node, cacheName));
+            assertFalse(disco.cacheAffinityNode(node, cacheName));
+            assertFalse(disco.cacheNearNode(node, cacheName));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteSystemCacheOnClientTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteSystemCacheOnClientTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteSystemCacheOnClientTest.java
new file mode 100644
index 0000000..a7b2df6
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteSystemCacheOnClientTest.java
@@ -0,0 +1,97 @@
+/*
+ * 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.cluster.*;
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.internal.*;
+import org.apache.ignite.internal.util.lang.*;
+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 java.util.*;
+
+/**
+ *
+ */
+public class IgniteSystemCacheOnClientTest extends GridCommonAbstractTest {
+    /** */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        if (gridName.equals(getTestGridName(1)))
+            cfg.setClientMode(true);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        super.afterTestsStopped();
+
+        stopAllGrids();
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSystemCacheOnClientNode() throws Exception {
+        startGrids(2);
+
+        final IgniteKernal ignite = (IgniteKernal)ignite(1);
+
+        assertTrue(ignite.configuration().isClientMode());
+
+        GridTestUtils.waitForCondition(new GridAbsPredicate() {
+            @Override public boolean apply() {
+                return ignite.internalCache(CU.MARSH_CACHE_NAME) != null;
+            }
+        }, 5000);
+
+        GridCacheAdapter marshCache = ignite.internalCache(CU.MARSH_CACHE_NAME);
+
+        assertNotNull(marshCache);
+
+        assertFalse(marshCache.context().isNear());
+
+        marshCache = ((IgniteKernal)ignite(0)).internalCache(CU.MARSH_CACHE_NAME);
+
+        assertFalse(marshCache.context().isNear());
+
+        Collection<ClusterNode> affNodes = marshCache.affinity().mapKeyToPrimaryAndBackups(1);
+
+        assertEquals(1, affNodes.size());
+        assertTrue(affNodes.contains(ignite(0).cluster().localNode()));
+
+        GridCacheAdapter utilityCache = ((IgniteKernal)ignite(0)).internalCache(CU.UTILITY_CACHE_NAME);
+
+        affNodes = utilityCache.affinity().mapKeyToPrimaryAndBackups(1);
+
+        assertEquals(1, affNodes.size());
+        assertTrue(affNodes.contains(ignite(0).cluster().localNode()));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
index 09090a4..b1d29e0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteTxMultiThreadedAbstractTest.java
@@ -204,11 +204,11 @@ public abstract class IgniteTxMultiThreadedAbstractTest extends IgniteTxAbstract
     }
 
     /**
-     * TODO: IGNITE-582.
-     *
      * @throws Exception If failed.
      */
     public void testOptimisticSerializableConsistency() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-582");
+
         final IgniteCache<Integer, Long> cache = grid(0).cache(null);
 
         final int THREADS = 2;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueApiSelfAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueApiSelfAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueApiSelfAbstractTest.java
index 12397b2..7af0490 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueApiSelfAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueApiSelfAbstractTest.java
@@ -549,7 +549,7 @@ public abstract class GridCacheQueueApiSelfAbstractTest extends IgniteCollection
 
         CollectionConfiguration colCfg2 = collectionConfiguration();
 
-        colCfg2.setNodeFilter(CacheConfiguration.SERVER_NODES);
+        colCfg2.setNodeFilter(CacheConfiguration.ALL_NODES);
 
         IgniteQueue queue1 = grid(0).queue("Queue1", 0, colCfg1);
 
@@ -557,7 +557,7 @@ public abstract class GridCacheQueueApiSelfAbstractTest extends IgniteCollection
 
         assertNotSame(getQueueCache(queue1), getQueueCache(queue2));
 
-        colCfg1.setNodeFilter(CacheConfiguration.SERVER_NODES);
+        colCfg1.setNodeFilter(CacheConfiguration.ALL_NODES);
 
         IgniteQueue queue3 = grid(0).queue("Queue3", 0, colCfg1);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
index 2232493..782ba97 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/GridCacheQueueMultiNodeConsistencySelfTest.java
@@ -54,6 +54,11 @@ public class GridCacheQueueMultiNodeConsistencySelfTest extends IgniteCollection
     private int backups;
 
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-583");
+    }
+
+    /** {@inheritDoc} */
     @Override protected void beforeTestsStarted() throws Exception {
         // No-op.
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresAbstractTest.java
new file mode 100644
index 0000000..5a6be8e
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresAbstractTest.java
@@ -0,0 +1,283 @@
+/*
+ * 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.datastructures;
+
+import org.apache.ignite.*;
+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.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
+import org.apache.ignite.testframework.*;
+import org.apache.ignite.testframework.junits.common.*;
+
+import java.util.concurrent.*;
+
+/**
+ *
+ */
+public abstract class IgniteClientDataStructuresAbstractTest extends GridCommonAbstractTest {
+    /** */
+    protected static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+    /** */
+    private static final int NODE_CNT = 4;
+
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        if (gridName.equals(getTestGridName(NODE_CNT - 1))) {
+            cfg.setClientMode(true);
+
+            if (!clientDiscovery())
+                ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);
+        }
+
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
+        return cfg;
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void beforeTestsStarted() throws Exception {
+        super.beforeTestsStarted();
+
+        startGrids(NODE_CNT);
+    }
+
+    /** {@inheritDoc} */
+    @Override protected void afterTestsStopped() throws Exception {
+        stopAllGrids();
+    }
+
+    /**
+     * @return {@code True} if use client discovery.
+     */
+    protected abstract boolean clientDiscovery();
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSequence() throws Exception {
+        Ignite clientNode = clientIgnite();
+
+        Ignite srvNode = serverNode();
+
+        assertNull(clientNode.atomicSequence("seq1", 1L, false));
+
+        try (IgniteAtomicSequence seq = clientNode.atomicSequence("seq1", 1L, true)) {
+            assertNotNull(seq);
+
+            assertEquals(1L, seq.get());
+
+            assertEquals(1L, seq.getAndAdd(1));
+
+            assertEquals(2L, seq.get());
+
+            IgniteAtomicSequence seq0 = srvNode.atomicSequence("seq1", 1L, false);
+
+            assertNotNull(seq0);
+        }
+
+        assertNull(clientNode.atomicSequence("seq1", 1L, false));
+        assertNull(srvNode.atomicSequence("seq1", 1L, false));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testAtomicLong() throws Exception {
+        Ignite clientNode = clientIgnite();
+
+        Ignite srvNode = serverNode();
+
+        assertNull(clientNode.atomicLong("long1", 1L, false));
+
+        try (IgniteAtomicLong cntr = clientNode.atomicLong("long1", 1L, true)) {
+            assertNotNull(cntr);
+
+            assertEquals(1L, cntr.get());
+
+            assertEquals(1L, cntr.getAndAdd(1));
+
+            assertEquals(2L, cntr.get());
+
+            IgniteAtomicLong cntr0 = srvNode.atomicLong("long1", 1L, false);
+
+            assertNotNull(cntr0);
+
+            assertEquals(2L, cntr0.get());
+
+            assertEquals(3L, cntr0.incrementAndGet());
+
+            assertEquals(3L, cntr.get());
+        }
+
+        assertNull(clientNode.atomicLong("long1", 1L, false));
+        assertNull(srvNode.atomicLong("long1", 1L, false));
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testSet() throws Exception {
+        Ignite clientNode = clientIgnite();
+
+        Ignite srvNode = serverNode();
+
+        assertNull(clientNode.set("set1", null));
+
+        CollectionConfiguration colCfg = new CollectionConfiguration();
+
+        try (IgniteSet<Integer> set = clientNode.set("set1", colCfg)) {
+            assertNotNull(set);
+
+            assertEquals(0, set.size());
+
+            assertFalse(set.contains(1));
+
+            assertTrue(set.add(1));
+
+            assertTrue(set.contains(1));
+
+            IgniteSet<Integer> set0 = srvNode.set("set1", null);
+
+            assertTrue(set0.contains(1));
+
+            assertEquals(1, set0.size());
+
+            assertTrue(set0.remove(1));
+
+            assertFalse(set.contains(1));
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLatch() throws Exception {
+        Ignite clientNode = clientIgnite();
+
+        final Ignite srvNode = serverNode();
+
+        assertNull(clientNode.countDownLatch("latch1", 1, true, false));
+
+        try (IgniteCountDownLatch latch = clientNode.countDownLatch("latch1", 1, true, true)) {
+            assertNotNull(latch);
+
+            assertEquals(1, latch.count());
+
+            IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Object>() {
+                @Override public Object call() throws Exception {
+                    U.sleep(1000);
+
+                    IgniteCountDownLatch latch0 = srvNode.countDownLatch("latch1", 1, true, false);
+
+                    assertEquals(1, latch0.count());
+
+                    log.info("Count down latch.");
+
+                    latch0.countDown();
+
+                    assertEquals(0, latch0.count());
+
+                    return null;
+                }
+            });
+
+            log.info("Await latch.");
+
+            assertTrue(latch.await(5000, TimeUnit.MILLISECONDS));
+
+            log.info("Finished wait.");
+
+            fut.get();
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testQueue() throws Exception {
+        Ignite clientNode = clientIgnite();
+
+        final Ignite srvNode = serverNode();
+
+        CollectionConfiguration colCfg = new CollectionConfiguration();
+
+        assertNull(clientNode.queue("q1", 0, null));
+
+        try (IgniteQueue<Integer> queue = clientNode.queue("q1", 0, colCfg)) {
+            assertNotNull(queue);
+
+            queue.add(1);
+
+            assertEquals(1, queue.poll().intValue());
+
+            IgniteInternalFuture<?> fut = GridTestUtils.runAsync(new Callable<Object>() {
+                @Override public Object call() throws Exception {
+                    U.sleep(1000);
+
+                    IgniteQueue<Integer> queue0 = srvNode.queue("q1", 0, null);
+
+                    assertEquals(0, queue0.size());
+
+                    log.info("Add in queue.");
+
+                    queue0.add(2);
+
+                    return null;
+                }
+            });
+
+            log.info("Try take.");
+
+            assertEquals(2, queue.take().intValue());
+
+            log.info("Finished take.");
+
+            fut.get();
+        }
+    }
+
+    /**
+     * @return Client node.
+     */
+    private Ignite clientIgnite() {
+        Ignite ignite = ignite(NODE_CNT - 1);
+
+        assertTrue(ignite.configuration().isClientMode());
+
+        assertEquals(clientDiscovery(), ignite.configuration().getDiscoverySpi().isClientMode());
+
+        return ignite;
+    }
+
+    /**
+     * @return Server node.
+     */
+    private Ignite serverNode() {
+        Ignite ignite = ignite(0);
+
+        assertFalse(ignite.configuration().isClientMode());
+
+        return ignite;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresTest.java
new file mode 100644
index 0000000..a228cc2
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDataStructuresTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.datastructures;
+
+/**
+ *
+ */
+public class IgniteClientDataStructuresTest extends IgniteClientDataStructuresAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected boolean clientDiscovery() {
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDiscoveryDataStructuresTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDiscoveryDataStructuresTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDiscoveryDataStructuresTest.java
new file mode 100644
index 0000000..bd5cce8
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteClientDiscoveryDataStructuresTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.datastructures;
+
+/**
+ *
+ */
+public class IgniteClientDiscoveryDataStructuresTest extends IgniteClientDataStructuresAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected boolean clientDiscovery() {
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCountDownLatchAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCountDownLatchAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCountDownLatchAbstractSelfTest.java
index 0f2a898..80e6123 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCountDownLatchAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/IgniteCountDownLatchAbstractSelfTest.java
@@ -28,6 +28,7 @@ import org.jetbrains.annotations.*;
 import java.io.*;
 import java.util.*;
 import java.util.concurrent.*;
+import java.util.concurrent.atomic.*;
 
 import static java.util.concurrent.TimeUnit.*;
 
@@ -258,6 +259,107 @@ public abstract class IgniteCountDownLatchAbstractSelfTest extends IgniteAtomics
         checkRemovedLatch(latch);
     }
 
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLatchMultinode1() throws Exception {
+        if (gridCount() == 1)
+            return;
+
+        IgniteCountDownLatch latch = grid(0).countDownLatch("l1", 10,
+            true,
+            true);
+
+        List<IgniteInternalFuture<?>> futs = new ArrayList<>();
+
+        final AtomicBoolean countedDown = new AtomicBoolean();
+
+        for (int i = 0; i < gridCount(); i++) {
+            final Ignite ignite = grid(i);
+
+            futs.add(GridTestUtils.runAsync(new Callable<Void>() {
+                @Override public Void call() throws Exception {
+                    IgniteCountDownLatch latch = ignite.countDownLatch("l1", 10,
+                        true,
+                        false);
+
+                    assertNotNull(latch);
+
+                    boolean wait = latch.await(30_000);
+
+                    assertTrue(countedDown.get());
+
+                    assertEquals(0, latch.count());
+
+                    assertTrue(wait);
+
+                    return null;
+                }
+            }));
+        }
+
+        for (int i = 0; i < 10; i++) {
+            if (i == 9)
+                countedDown.set(true);
+
+            latch.countDown();
+        }
+
+        for (IgniteInternalFuture<?> fut : futs)
+            fut.get(30_000);
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    public void testLatchMultinode2() throws Exception {
+        if (gridCount() == 1)
+            return;
+
+        IgniteCountDownLatch latch = grid(0).countDownLatch("l2", gridCount() * 3,
+            true,
+            true);
+
+        assertNotNull(latch);
+
+        List<IgniteInternalFuture<?>> futs = new ArrayList<>();
+
+        final AtomicInteger cnt = new AtomicInteger();
+
+        for (int i = 0; i < gridCount(); i++) {
+            final Ignite ignite = grid(i);
+
+            futs.add(GridTestUtils.runAsync(new Callable<Void>() {
+                @Override public Void call() throws Exception {
+                    IgniteCountDownLatch latch = ignite.countDownLatch("l2", 10,
+                        true,
+                        false);
+
+                    assertNotNull(latch);
+
+                    for (int i = 0; i < 3; i++) {
+                        cnt.incrementAndGet();
+
+                        latch.countDown();
+                    }
+
+                    boolean wait = latch.await(30_000);
+
+                    assertEquals(gridCount() * 3, cnt.get());
+
+                    assertEquals(0, latch.count());
+
+                    assertTrue(wait);
+
+                    return null;
+                }
+            }));
+        }
+
+        for (IgniteInternalFuture<?> fut : futs)
+            fut.get(30_000);
+    }
+
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         // No-op.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
index f29a752..317904e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest.java
@@ -26,6 +26,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
 public class GridCachePartitionedAtomicOffheapQueueCreateMultiNodeSelfTest
     extends GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-80");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheMemoryMode collectionMemoryMode() {
         return OFFHEAP_TIERED;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
index e2cebec..8a6db83 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest.java
@@ -28,6 +28,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
 public class GridCachePartitionedAtomicQueueCreateMultiNodeSelfTest
     extends GridCachePartitionedQueueCreateMultiNodeSelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-80");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheMemoryMode collectionMemoryMode() {
         return ONHEAP_TIERED;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
index 519148e..8d5a483 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedDataStructuresFailoverSelfTest.java
@@ -30,6 +30,11 @@ import static org.apache.ignite.cache.CacheMode.*;
 public class GridCachePartitionedDataStructuresFailoverSelfTest
     extends GridCacheAbstractDataStructuresFailoverSelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-803");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheMode collectionCacheMode() {
         return PARTITIONED;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
index 9878693..b38798e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedOffheapDataStructuresFailoverSelfTest.java
@@ -26,6 +26,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
  */
 public class GridCachePartitionedOffheapDataStructuresFailoverSelfTest extends GridCachePartitionedDataStructuresFailoverSelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-803");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheMemoryMode collectionMemoryMode() {
         return OFFHEAP_TIERED;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
index 5b6627e..592479c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueCreateMultiNodeSelfTest.java
@@ -42,6 +42,11 @@ import static org.apache.ignite.transactions.TransactionIsolation.*;
  */
 public class GridCachePartitionedQueueCreateMultiNodeSelfTest extends IgniteCollectionAbstractTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-80");
+    }
+
+    /** {@inheritDoc} */
     @Override protected int gridCount() {
         return 1;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
index 13363cd..05e47ec 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueEntryMoveSelfTest.java
@@ -40,6 +40,11 @@ import static org.apache.ignite.cache.CacheMode.*;
  * Cache queue test with changing topology.
  */
 public class GridCachePartitionedQueueEntryMoveSelfTest extends IgniteCollectionAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-802");
+    }
+
     /** Queue capacity. */
     private static final int QUEUE_CAP = 5;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
index 4b809e2..92db5d8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/partitioned/GridCachePartitionedQueueFailoverDataConsistencySelfTest.java
@@ -29,6 +29,11 @@ import static org.apache.ignite.cache.CacheMemoryMode.*;
 public class GridCachePartitionedQueueFailoverDataConsistencySelfTest extends
     GridCacheAbstractQueueFailoverDataConsistencySelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-264");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheMemoryMode collectionMemoryMode() {
         return ONHEAP_TIERED;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
index 46e458b..869f2b6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/datastructures/replicated/GridCacheReplicatedDataStructuresFailoverSelfTest.java
@@ -30,6 +30,11 @@ import static org.apache.ignite.cache.CacheMode.*;
 public class GridCacheReplicatedDataStructuresFailoverSelfTest
     extends GridCacheAbstractDataStructuresFailoverSelfTest {
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-801");
+    }
+
+    /** {@inheritDoc} */
     @Override protected CacheMode collectionCacheMode() {
         return REPLICATED;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3d78aa15/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
index 798494f..0fc1d41 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
@@ -39,6 +39,11 @@ import static org.apache.ignite.cache.CacheMode.*;
  * Tests for cache data loading during simultaneous grids start.
  */
 public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractTest {
+    /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        fail("https://issues.apache.org/jira/browse/IGNITE-500");
+    }
+
     /** Grids count */
     private static int GRIDS_CNT = 5;
 


Mime
View raw message