Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-837 5c372b34f -> 08660fe8f


ignite-786: evnt


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/08660fe8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/08660fe8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/08660fe8

Branch: refs/heads/ignite-837
Commit: 08660fe8f741ebd23266fd8bb4912682de46d6fc
Parents: 5c372b3
Author: Artem Shutak <ashu...@gridgain.com>
Authored: Tue Apr 28 19:52:58 2015 +0300
Committer: Artem Shutak <ashu...@gridgain.com>
Committed: Tue Apr 28 19:52:58 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/ignite/StopNodesTest.java   | 49 ++++++++++++++++++++
 ...gniteProjectionStartStopRestartSelfTest.java |  6 ++-
 2 files changed, 53 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/08660fe8/modules/core/src/test/java/org/apache/ignite/StopNodesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/StopNodesTest.java 
b/modules/core/src/test/java/org/apache/ignite/StopNodesTest.java
new file mode 100644
index 0000000..0afe2d6
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/StopNodesTest.java
@@ -0,0 +1,49 @@
+/* @java.file.header */
+
+/*  _________        _____ __________________        _____
+ *  __  ____/___________(_)______  /__  ____/______ ____(_)_______
+ *  _  / __  __  ___/__  / _  __  / _  / __  _  __ `/__  / __  __ \
+ *  / /_/ /  _  /    _  /  / /_/ /  / /_/ /  / /_/ / _  /  _  / / /
+ *  \____/   /_/     /_/   \_,__/   \____/   \__,_/  /_/   /_/ /_/
+ */
+
+package org.apache.ignite;
+
+import org.apache.ignite.configuration.*;
+import org.apache.ignite.events.*;
+import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.lang.*;
+
+import java.util.concurrent.*;
+
+import static java.util.concurrent.TimeUnit.*;
+import static org.apache.ignite.events.EventType.*;
+
+/**
+ * TODO: Add class description.
+ *
+ * @author @java.author
+ * @version @java.version
+ */
+public class StopNodesTest {
+    public static void main(String[] args) throws Exception{
+        Ignite ignite = Ignition.start(new IgniteConfiguration());
+
+        U.sleep(10000);
+
+        final CountDownLatch leftLatch = new CountDownLatch(1);
+
+        ignite.events().localListen(new IgnitePredicate<Event>() {
+            @Override public boolean apply(Event evt) {
+                leftLatch.countDown();
+
+                return true;
+            }
+        }, EVT_NODE_LEFT);
+
+
+        ignite.cluster().stopNodes();
+
+        assert leftLatch.await(40, SECONDS);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/08660fe8/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java
 
b/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java
index e364383..8250fbb 100644
--- 
a/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java
+++ 
b/modules/ssh/src/test/java/org/apache/ignite/internal/IgniteProjectionStartStopRestartSelfTest.java
@@ -131,7 +131,7 @@ public class IgniteProjectionStartStopRestartSelfTest 
extends GridCommonAbstract
 
                     if (joinedLatch != null)
                         joinedLatch.countDown();
-                } else if (evt.type() == EVT_NODE_LEFT) {
+                } else if (evt.type() == EVT_NODE_LEFT || evt.type() == 
EVT_NODE_FAILED) {
                     leftCnt.incrementAndGet();
 
                     if (leftLatch != null)
@@ -140,7 +140,7 @@ public class IgniteProjectionStartStopRestartSelfTest 
extends GridCommonAbstract
 
                 return true;
             }
-        }, EVT_NODE_JOINED, EVT_NODE_LEFT);
+        }, EVT_NODE_JOINED, EVT_NODE_LEFT, EVT_NODE_FAILED);
     }
 
     /** {@inheritDoc} */
@@ -590,6 +590,8 @@ public class IgniteProjectionStartStopRestartSelfTest 
extends GridCommonAbstract
         assert ignite.cluster().nodes().size() == 1;
     }
 
+
+
     /**
      * @throws Exception If failed.
      */

Reply via email to