You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/03/02 16:12:35 UTC
[13/50] incubator-ignite git commit: IGNITE-136 Fixed tests.
IGNITE-136 Fixed 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/96e449a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/96e449a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/96e449a7
Branch: refs/heads/ignite-334
Commit: 96e449a7dfce4385100058a99e0fecd30aeb9a4e
Parents: 8899128
Author: nikolay_tikhonov <nt...@gridgain.com>
Authored: Wed Feb 25 15:02:16 2015 +0300
Committer: nikolay_tikhonov <nt...@gridgain.com>
Committed: Wed Feb 25 15:02:16 2015 +0300
----------------------------------------------------------------------
.../GridCacheAbstractLocalStoreSelfTest.java | 48 ++++++++------------
1 file changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/96e449a7/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
index bf11c5f..781c6a6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractLocalStoreSelfTest.java
@@ -181,8 +181,6 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
checkLocalStore(ignite1, LOCAL_STORE_1);
- final CountDownLatch partExchanged = new CountDownLatch(1);
-
final AtomicInteger evtCnt = new AtomicInteger(0);
if (getCacheMode() != REPLICATED) {
@@ -197,23 +195,21 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
final Ignite ignite2 = startGrid(2);
- boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
- @Override public boolean apply() {
- // Partition count which must be transferred to 2'nd node.
- int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+ if (getCacheMode() != REPLICATED) {
+ boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ // Partition count which must be transferred to 2'nd node.
+ int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
- return evtCnt.get() >= parts;
- }
- }, 5000);
+ return evtCnt.get() >= parts;
+ }
+ }, 5000);
- assertTrue(wait);
+ assertTrue(wait);
+ }
assertEquals(Ignition.allGrids().size(), 2);
- // Wait when partition unloaded.
- if (getCacheMode() != REPLICATED)
- assert partExchanged.await(2, TimeUnit.SECONDS);
-
checkLocalStore(ignite1, LOCAL_STORE_1);
checkLocalStore(ignite2, LOCAL_STORE_2);
}
@@ -279,8 +275,6 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
for (int i = 0; i < KEYS; i++)
assertNull(cache.localPeek(i, CachePeekMode.ONHEAP));
- final CountDownLatch partExchanged = new CountDownLatch(1);
-
final AtomicInteger evtCnt = new AtomicInteger(0);
if (getCacheMode() != REPLICATED) {
@@ -295,23 +289,21 @@ public abstract class GridCacheAbstractLocalStoreSelfTest extends GridCommonAbst
final Ignite ignite2 = startGrid(2);
- boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
- @Override public boolean apply() {
- // Partition count which must be transferred to 2'nd node.
- int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
+ if (getCacheMode() != REPLICATED) {
+ boolean wait = GridTestUtils.waitForCondition(new GridAbsPredicate() {
+ @Override public boolean apply() {
+ // Partition count which must be transferred to 2'nd node.
+ int parts = ignite2.affinity(null).allPartitions(ignite2.cluster().localNode()).length;
- return evtCnt.get() >= parts;
- }
- }, 5000);
+ return evtCnt.get() >= parts;
+ }
+ }, 5000);
- assertTrue(wait);
+ assertTrue(wait);
+ }
assertEquals(Ignition.allGrids().size(), 2);
- // Wait when partition unloaded.
- if (getCacheMode() != REPLICATED)
- assert partExchanged.await(2, TimeUnit.SECONDS);
-
checkLocalStore(ignite1, LOCAL_STORE_1);
checkLocalStore(ignite2, LOCAL_STORE_2);
}