Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BCD4410A6C for ; Fri, 17 Apr 2015 09:59:58 +0000 (UTC) Received: (qmail 41837 invoked by uid 500); 17 Apr 2015 09:59:00 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 41807 invoked by uid 500); 17 Apr 2015 09:59:00 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 41798 invoked by uid 99); 17 Apr 2015 09:59:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2015 09:59:00 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [54.164.171.186] (HELO mx1-us-east.apache.org) (54.164.171.186) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2015 09:58:55 +0000 Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id F29704551F for ; Fri, 17 Apr 2015 09:38:23 +0000 (UTC) Received: (qmail 80323 invoked by uid 99); 17 Apr 2015 09:38:23 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2015 09:38:23 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 53148E0F99; Fri, 17 Apr 2015 09:38:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.incubator.apache.org Date: Fri, 17 Apr 2015 09:38:28 -0000 Message-Id: In-Reply-To: <4ce5308aa60b453a89cdac630e0ea34c@git.apache.org> References: <4ce5308aa60b453a89cdac630e0ea34c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/10] incubator-ignite git commit: # ignite-sprint-4 added test X-Virus-Checked: Checked by ClamAV on apache.org # 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/ignite-218 Commit: 197885dab22ebc160c2b5cce70e12a3d609a9277 Parents: b6efeab Author: sboikov Authored: Fri Apr 17 11:07:13 2015 +0300 Committer: sboikov 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();