Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BED3A17AE9 for ; Wed, 8 Apr 2015 06:23:28 +0000 (UTC) Received: (qmail 39211 invoked by uid 500); 8 Apr 2015 06:23:28 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 39133 invoked by uid 500); 8 Apr 2015 06:23:28 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 39115 invoked by uid 99); 8 Apr 2015 06:23:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 06:23:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 08 Apr 2015 06:23:26 +0000 Received: (qmail 38363 invoked by uid 99); 8 Apr 2015 06:23:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2015 06:23:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB3B4E18C7; Wed, 8 Apr 2015 06:23:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 08 Apr 2015 06:23:23 -0000 Message-Id: In-Reply-To: <6e1efef5da394c5c92a5df7c02ed1833@git.apache.org> References: <6e1efef5da394c5c92a5df7c02ed1833@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [18/22] incubator-ignite git commit: # ignite-sprint-3 fixed test X-Virus-Checked: Checked by ClamAV on apache.org # ignite-sprint-3 fixed test Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/beedb178 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/beedb178 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/beedb178 Branch: refs/heads/ignite-680 Commit: beedb1789c6636f5823b445cb219ffa9ae28d6d0 Parents: f11e357 Author: sboikov Authored: Tue Apr 7 22:23:23 2015 +0300 Committer: sboikov Committed: Tue Apr 7 22:23:23 2015 +0300 ---------------------------------------------------------------------- ...ePartitionedBasicStoreMultiNodeSelfTest.java | 110 ++----------------- 1 file changed, 10 insertions(+), 100 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/beedb178/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java index 05eab37..b362431 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedBasicStoreMultiNodeSelfTest.java @@ -126,22 +126,7 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA public void testPutFromPrimary() throws Exception { IgniteCache cache = jcache(0); - int key = 0; - - while (true) { - boolean found = false; - - for (ClusterNode n : grid(0).cluster().nodes()) { - if (grid(0).affinity(null).isPrimary(n, key)) { - found = true; - - break; - } - } - - if (found) - break; - } + int key = primaryKey(cache); assertNull(cache.getAndPut(key, "val")); @@ -154,26 +139,11 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA public void testPutFromBackup() throws Exception { IgniteCache cache = jcache(0); - int key = 0; - - while (true) { - boolean found = false; - - for (ClusterNode n : grid(0).cluster().nodes()) { - if (grid(0).affinity(null).isBackup(n, key)) { - found = true; - - break; - } - } - - if (found) - break; - } + int key = backupKey(cache); assertNull(cache.getAndPut(key, "val")); - checkStoreUsage(1, 1, 0, 1); + checkStoreUsage(1, 1, 0, nearCacheConfiguration() == null ? 2 : 1); } /** @@ -182,26 +152,11 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA public void testPutFromNear() throws Exception { IgniteCache cache = jcache(0); - int key = 0; - - while (true) { - boolean found = false; - - for (ClusterNode n : grid(0).cluster().nodes()) { - if (!grid(0).affinity(null).isPrimaryOrBackup(n, key)) { - found = true; - - break; - } - } - - if (found) - break; - } + int key = nearKey(cache); assertNull(cache.getAndPut(key, "val")); - checkStoreUsage(1, 1, 0, 1); + checkStoreUsage(1, 1, 0, nearCacheConfiguration() == null ? 2 : 1); } /** @@ -210,22 +165,7 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA public void testPutIfAbsentFromPrimary() throws Exception { IgniteCache cache = jcache(0); - int key = 0; - - while (true) { - boolean found = false; - - for (ClusterNode n : grid(0).cluster().nodes()) { - if (grid(0).affinity(null).isPrimary(n, key)) { - found = true; - - break; - } - } - - if (found) - break; - } + int key = primaryKey(cache); assertTrue(cache.putIfAbsent(key, "val")); @@ -238,26 +178,11 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA public void testPutIfAbsentFromBackup() throws Exception { IgniteCache cache = jcache(0); - int key = 0; - - while (true) { - boolean found = false; - - for (ClusterNode n : grid(0).cluster().nodes()) { - if (grid(0).affinity(null).isBackup(n, key)) { - found = true; - - break; - } - } - - if (found) - break; - } + int key = backupKey(cache); assertTrue(cache.putIfAbsent(key, "val")); - checkStoreUsage(1, 1, 0, 1); + checkStoreUsage(1, 1, 0, nearCacheConfiguration() == null ? 2 : 1); } /** @@ -266,26 +191,11 @@ public class GridCachePartitionedBasicStoreMultiNodeSelfTest extends GridCommonA public void testPutIfAbsentFromNear() throws Exception { IgniteCache cache = jcache(0); - int key = 0; - - while (true) { - boolean found = false; - - for (ClusterNode n : grid(0).cluster().nodes()) { - if (!grid(0).affinity(null).isPrimaryOrBackup(n, key)) { - found = true; - - break; - } - } - - if (found) - break; - } + int key = nearKey(cache); assertTrue(cache.putIfAbsent(key, "val")); - checkStoreUsage(1, 1, 0, 1); + checkStoreUsage(1, 1, 0, nearCacheConfiguration() == null ? 2 : 1); } /**