IGNITE-45 - Fixing tests.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/99151c20 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/99151c20 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/99151c20 Branch: refs/heads/ignite-45 Commit: 99151c208c39486e640e36bbc8d6e6c99fe0ee19 Parents: 61c7a49 Author: Alexey Goncharuk <agoncha...@gridgain.com> Authored: Mon Mar 16 19:04:12 2015 -0700 Committer: Alexey Goncharuk <agoncha...@gridgain.com> Committed: Mon Mar 16 19:04:12 2015 -0700 ---------------------------------------------------------------------- .../GridCacheAtomicMessageCountSelfTest.java | 30 +++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/99151c20/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java index 7612e27..8e8e7be 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAtomicMessageCountSelfTest.java @@ -35,7 +35,6 @@ import java.util.*; import java.util.concurrent.atomic.*; 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.CacheWriteSynchronizationMode.*; @@ -49,8 +48,8 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest /** Starting grid index. */ private int idx; - /** Partition distribution mode. */ - private CacheDistributionMode partDistMode; + /** Client mode flag. */ + private boolean client; /** Write sync mode. */ private CacheAtomicWriteOrderMode writeOrderMode; @@ -70,14 +69,11 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest cCfg.setCacheMode(PARTITIONED); cCfg.setBackups(1); cCfg.setWriteSynchronizationMode(FULL_SYNC); - // TODO IGNITE-45 -// cCfg.setDistributionMode(partDistMode); cCfg.setAtomicWriteOrderMode(writeOrderMode); -// if (idx == 0) -// cCfg.setDistributionMode(partDistMode); -// else -// cCfg.setDistributionMode(PARTITIONED_ONLY); + // TODO IGNITE-45 test hangs. (client node started first) + if (idx == 0 && client) + cfg.setClientMode(true); idx++; @@ -92,43 +88,45 @@ public class GridCacheAtomicMessageCountSelfTest extends GridCommonAbstractTest * @throws Exception If failed. */ public void testPartitionedClock() throws Exception { - checkMessages(PARTITIONED_ONLY, CLOCK); + checkMessages(false, CLOCK); } /** * @throws Exception If failed. */ public void testPartitionedPrimary() throws Exception { - checkMessages(PARTITIONED_ONLY, PRIMARY); + checkMessages(false, PRIMARY); } /** * @throws Exception If failed. */ public void testClientClock() throws Exception { - checkMessages(CLIENT_ONLY, CLOCK); + checkMessages(true, CLOCK); } /** * @throws Exception If failed. */ public void testClientPrimary() throws Exception { - checkMessages(CLIENT_ONLY, PRIMARY); + checkMessages(true, PRIMARY); } /** - * @param distMode Distribution mode. + * @param clientMode Client mode flag. * @param orderMode Write ordering mode. * @throws Exception If failed. */ - protected void checkMessages(CacheDistributionMode distMode, + protected void checkMessages(boolean clientMode, CacheAtomicWriteOrderMode orderMode) throws Exception { - partDistMode = distMode; + client = clientMode; writeOrderMode = orderMode; startGrids(4); + ignite(0).jcache(null); + try { awaitPartitionMapExchange();