250251252253254255256257258259260
assertEquals(100, q.size()); transactionContext.commitTransaction(); assertEquals(100, h.getQueue("default").size()); assertFalse(result); h.shutdown(); } @Test public void testListenerLifecycle() throws Exception { final HazelcastInstance instance = createHazelcastInstance();
96979899100101102103104105106
} }; new Thread(runnable).start(); try { Thread.sleep(1000); h2.shutdown(); assertTrue(latch.await(30, TimeUnit.SECONDS)); for (int i = 0; i < size; i++) { assertFalse(map1.isLocked(i)); } } catch (InterruptedException e) {
136137138139140141142143144145146
} protected void shutdownHazelcastInstance() { final HazelcastInstance localInstanceRef = hazelcastInstance; if (localInstanceRef != null) { localInstanceRef.shutdown(); } hazelcastInstance = null; } @Override
106107108109110111112113114115116
String[] cities = {"NEW YORK", "ISTANBULL", "TOKYO", "LONDON", "PARIS", "CAIRO", "HONG KONG"}; putAll(map1, cities); //Now terminate one node i2.shutdown(); assertGet(map1, "-foo", cities); //Now adding the node back in i2 = startNode(nodeFactory);
207208209210211212213214215216217
latch.countDown(); } }; new Thread(runnable).start(); assertTrue(latch2.await(20, TimeUnit.SECONDS)); h2.shutdown(); assertTrue(latch.await(60, TimeUnit.SECONDS)); for (int i = 0; i < size; i++) { assertNull(map1.get(i)); }
149150151152153154155156157158159
assertEquals(200, instance3.getList(name).size()); instance1 = factory.newHazelcastInstance(config); assertEquals(200, instance1.getList(name).size()); instance3.shutdown(); assertEquals(200, instance1.getList(name).size()); } @Test
849850851852853854855856857858859
txnMap.remove(i.toString()); context.commitTransaction(); } assertEquals(0, map.size()); inst.shutdown(); } @Test // TODO: @mm - Review following case...
979980981982983984985986987988989
throw new RuntimeException(e); } } assertEquals(2, map.keySet().size()); h1.shutdown(); h2.shutdown(); } @Test public void testIssue615KeysetWithPredicate() throws TransactionException { Config config = new Config();
10341035103610371038103910401041104210431044
assertEquals(1, map.size()); assertEquals(1, map.keySet().size()); assertEquals(0, map.keySet(new SqlPredicate("age <= 10")).size()); h1.shutdown(); h2.shutdown(); } @Test public void testIssue615KeysetPredicates() throws TransactionException { final String MAP_NAME = "defaultMap";
10691070107110721073107410751076107710781079
assertEquals(2, map.size()); h1.shutdown(); h2.shutdown(); } @Test public void testPortableKeysetAndValuesWithPredicates() throws Exception { final String mapName = randomString();