/** {@inheritDoc} */ @Override public String getState() { return G.state().toString(); }
/** {@inheritDoc} */ @Override public String getState(String name) { if (F.isEmpty(name)) name = null; return G.state(name).toString(); }
igniteInstanceName = null; if (G.state(igniteInstanceName) != STARTED) throw new IgniteCheckedException("Grid is not locally started: " + igniteInstanceName);
igniteInstanceName = null; if (G.state(igniteInstanceName) != STARTED) throw new IgniteCheckedException("Grid is not locally started: " + igniteInstanceName);
igniteInstanceName = null; if (G.state(igniteInstanceName) != STARTED) throw new IgniteCheckedException("Grid is not locally started: " + igniteInstanceName);
igniteInstanceName = null; if (G.state(igniteInstanceName) != STARTED) throw new IgniteCheckedException("Grid is not locally started: " + igniteInstanceName);
igniteInstanceName = null; if (G.state(igniteInstanceName) != STARTED) throw new IgniteCheckedException("Grid is not locally started: " + igniteInstanceName);
igniteInstanceName = null; if (G.state(igniteInstanceName) != STARTED) throw new IgniteCheckedException("Grid is not locally started: " + igniteInstanceName);
if (G.state(getTestIgniteInstanceName()) != IgniteState.STOPPED) stopGrid(getTestIgniteInstanceName());
/** * @param evt Error event. * @param gridErr Grid error flag. * @throws Exception If failed. */ private void checkOnStop(LifecycleEventType evt, boolean gridErr) throws Exception { bean = new LifeCycleExceptionBean(evt, gridErr); try { startGrid(); assertEquals(IgniteState.STARTED, G.state(getTestIgniteInstanceName())); } catch (IgniteCheckedException ignore) { assertTrue(false); } finally { try { stopAllGrids(); assertEquals(IgniteState.STOPPED, G.state(getTestIgniteInstanceName())); } catch (Exception ignore) { assertTrue(false); } } }
/** * @throws Exception If failed. */ @Test public void testNoErrors() throws Exception { bean = new LifeCycleBaseBean(); startGrid(); try { assertEquals(IgniteState.STARTED, G.state(getTestIgniteInstanceName())); assertEquals(1, bean.count(BEFORE_NODE_START)); assertEquals(1, bean.count(AFTER_NODE_START)); assertEquals(0, bean.count(BEFORE_NODE_STOP)); assertEquals(0, bean.count(AFTER_NODE_STOP)); } finally { stopAllGrids(); } assertEquals(IgniteState.STOPPED, G.state(getTestIgniteInstanceName())); assertEquals(1, bean.count(BEFORE_NODE_START)); assertEquals(1, bean.count(AFTER_NODE_START)); assertEquals(1, bean.count(BEFORE_NODE_STOP)); assertEquals(1, bean.count(AFTER_NODE_STOP)); }
/** * @param gridErr Grid error flag. * @throws Exception If failed. */ private void checkBeforeStart(boolean gridErr) throws Exception { bean = new LifeCycleExceptionBean(BEFORE_NODE_START, gridErr); try { startGrid(); assertTrue(false); // Should never get here. } catch (IgniteCheckedException expected) { info("Got expected exception: " + expected); assertEquals(IgniteState.STOPPED, G.state(getTestIgniteInstanceName())); } finally { stopAllGrids(); } assertEquals(0, bean.count(BEFORE_NODE_START)); assertEquals(0, bean.count(AFTER_NODE_START)); assertEquals(0, bean.count(BEFORE_NODE_STOP)); assertEquals(1, bean.count(AFTER_NODE_STOP)); }
/** * @param gridErr Grid error flag. * @throws Exception If failed. */ private void checkAfterStart(boolean gridErr) throws Exception { bean = new LifeCycleExceptionBean(AFTER_NODE_START, gridErr); try { startGrid(); assertTrue(false); // Should never get here. } catch (IgniteCheckedException expected) { info("Got expected exception: " + expected); assertEquals(IgniteState.STOPPED, G.state(getTestIgniteInstanceName())); } finally { stopAllGrids(); } assertEquals(1, bean.count(BEFORE_NODE_START)); assertEquals(0, bean.count(AFTER_NODE_START)); assertEquals(1, bean.count(BEFORE_NODE_STOP)); assertEquals(1, bean.count(AFTER_NODE_STOP)); }
/** {@inheritDoc} */ @Override public String getState() { return G.state().toString(); }
/** {@inheritDoc} */ @Override public String getState(String name) { if (F.isEmpty(name)) name = null; return G.state(name).toString(); }