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/06/22 11:05:11 UTC
[14/38] incubator-ignite git commit: Fixed test.
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/4f3292d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4f3292d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4f3292d5
Branch: refs/heads/ignite-yardstick-client
Commit: 4f3292d5d8b29c04fcc1bf1fa9b88e5f19ceddfe
Parents: d874b00
Author: nikolay tikhonov <nt...@gridgain.com>
Authored: Thu Jun 18 15:19:03 2015 +0300
Committer: nikolay tikhonov <nt...@gridgain.com>
Committed: Thu Jun 18 15:19:03 2015 +0300
----------------------------------------------------------------------
.../apache/ignite/internal/GridSelfTest.java | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4f3292d5/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
index eccae34..2de04b0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridSelfTest.java
@@ -112,7 +112,9 @@ public class GridSelfTest extends GridProjectionAbstractTest {
*/
@SuppressWarnings({"TooBroadScope"})
public void testAsyncListen() throws Exception {
- final String msg = "HELLO!";
+ final String hello = "HELLO!";
+
+ final String bye = "BYE!";
final Ignite g = grid(0);
@@ -120,10 +122,12 @@ public class GridSelfTest extends GridProjectionAbstractTest {
g.message().remoteListen(null, new MessagingListenActor<String>() {
@Override protected void receive(UUID nodeId, String rcvMsg) throws Throwable {
- assertEquals(locNodeId, nodeId);
- assertEquals(msg, rcvMsg);
+ if (hello.equals(rcvMsg)) {
+ assertEquals(locNodeId, nodeId);
+ assertEquals(hello, rcvMsg);
- stop(rcvMsg);
+ stop(bye);
+ }
}
});
@@ -131,22 +135,22 @@ public class GridSelfTest extends GridProjectionAbstractTest {
g.message().localListen(null, new P2<UUID, String>() {
@Override public boolean apply(UUID nodeId, String msg) {
- if (!locNodeId.equals(nodeId))
+ if (msg.equals(bye))
cnt.incrementAndGet();
return true;
}
});
- g.message().send(null, msg);
+ g.message().send(null, hello);
GridTestUtils.waitForCondition(new GridAbsPredicate() {
@Override public boolean apply() {
- return cnt.get() == g.cluster().forRemotes().nodes().size();
+ return cnt.get() == g.cluster().nodes().size();
}
}, 5000);
- assertEquals(cnt.get(), g.cluster().forRemotes().nodes().size());
+ assertEquals(cnt.get(), g.cluster().nodes().size());
}
/**