ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [18/50] incubator-ignite git commit: Fixed test.
Date Wed, 24 Jun 2015 11:06:17 GMT
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/master
Commit: 4f3292d5d8b29c04fcc1bf1fa9b88e5f19ceddfe
Parents: d874b00
Author: nikolay tikhonov <ntikhonov@gridgain.com>
Authored: Thu Jun 18 15:19:03 2015 +0300
Committer: nikolay tikhonov <ntikhonov@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());
     }
 
     /**


Mime
View raw message