/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { ctx = null; Ignition.stopAll(true); }
/** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { Ignition.stopAll(true); }
/** {@inheritDoc} */ @Override protected void afterTestsStopped() throws Exception { Ignition.stopAll(true); }
/** * Entry point. */ public static void main(String[] args) throws Exception { List<Thread> threads = new ArrayList<>(THREAD_CNT + 1); try (Ignite ignite = start()) { IgniteCache<Integer, Person> cache = ignite.cache(CACHE_NAME); loadData(ignite, cache); System.out.println("Loaded data: " + cache.size()); for (int i = 0; i < THREAD_CNT; i++) threads.add(startDaemon("qry-exec-" + i, new QueryExecutor(cache, "Select * from Person"))); threads.add(startDaemon("printer", new ThroughputPrinter())); Thread.sleep(TIMEOUT); for (Thread t : threads) t.join(); if(error.get()!=null) throw error.get(); } finally { Ignition.stopAll(false); } }
Ignition.stopAll(true);
timer.interrupt(); Ignition.stopAll(true);
Ignition.stopAll(true);
/** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { assert testsCfg != null; if (Ignition.allGrids().size() != testsCfg.gridCount()) { info("All nodes will be stopped, new " + testsCfg.gridCount() + " nodes will be started."); Ignition.stopAll(true); FileUtils.deleteDirectory(workDir); info("Ignite's 'work' directory has been cleaned."); startGrids(testsCfg.gridCount()); for (int i = 0; i < testsCfg.gridCount(); i++) info("Grid " + i + ": " + grid(i).localNode().id()); } assert testsCfg.testedNodeIndex() >= 0 : "testedNodeIdx: " + testedNodeIdx; testedNodeIdx = testsCfg.testedNodeIndex(); if (testsCfg.withClients()) { for (int i = 0; i < gridCount(); i++) assertEquals("i: " + i, expectedClient(getTestIgniteInstanceName(i)), (boolean)grid(i).configuration().isClientMode()); } }
Ignition.stopAll(true);
/** * @throws Exception If failed. */ @Test public void testConfigurations() throws Exception { try { checkStartWithInvalidConfiguration(getConfiguration("node0") .setExecutorConfiguration(new ExecutorConfiguration())); checkStartWithInvalidConfiguration(getConfiguration("node0") .setExecutorConfiguration(new ExecutorConfiguration(""))); checkStartWithInvalidConfiguration(getConfiguration("node0") .setExecutorConfiguration(new ExecutorConfiguration("exec").setSize(-1))); checkStartWithInvalidConfiguration(getConfiguration("node0") .setExecutorConfiguration(new ExecutorConfiguration("exec").setSize(0))); } finally { Ignition.stopAll(true); } }
info("All nodes will be stopped, new " + cnt + " nodes will be started."); Ignition.stopAll(true);