ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [08/50] incubator-ignite git commit: # ignite-sprint-4 added test
Date Mon, 20 Apr 2015 15:14:34 GMT
# ignite-sprint-4 added 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/197885da
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/197885da
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/197885da

Branch: refs/heads/gg-10115
Commit: 197885dab22ebc160c2b5cce70e12a3d609a9277
Parents: b6efeab
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Apr 17 11:07:13 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Apr 17 11:07:13 2015 +0300

----------------------------------------------------------------------
 .../internal/GridLifecycleBeanSelfTest.java     | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/197885da/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
index 5821ef6..f0f890d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridLifecycleBeanSelfTest.java
@@ -21,6 +21,7 @@ import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lifecycle.*;
+import org.apache.ignite.resources.*;
 import org.apache.ignite.testframework.junits.common.*;
 
 import java.io.*;
@@ -49,6 +50,41 @@ public class GridLifecycleBeanSelfTest extends GridCommonAbstractTest {
     /**
      * @throws Exception If failed.
      */
+    public void testGetIgnite() throws Exception {
+        final AtomicBoolean done = new AtomicBoolean();
+
+        bean = new LifeCycleBaseBean() {
+            /** */
+            @IgniteInstanceResource
+            private Ignite ignite;
+
+            @Override public void onLifecycleEvent(LifecycleEventType evt) {
+                super.onLifecycleEvent(evt);
+
+                if (evt == LifecycleEventType.AFTER_NODE_START) {
+                    Ignite ignite0 = Ignition.ignite(ignite.name());
+
+                    assertNotNull(ignite0);
+                    assertNotNull(ignite0.cluster().localNode());
+
+                    done.set(true);
+                }
+            }
+        };
+
+        try {
+            startGrid();
+
+            assertTrue(done.get());
+        }
+        finally {
+            stopAllGrids();
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testNoErrors() throws Exception {
         bean = new LifeCycleBaseBean();
 


Mime
View raw message