/** {@inheritDoc} */ @Test @Override public void testReconnectClient() throws Exception { super.testReconnectClient(); }
/** {@inheritDoc} */ @Test @Override public void testReconnectClientAndLeftRouter() throws Exception { super.testReconnectClientAndLeftRouter(); } }
if (!tcpDiscovery()) return; Ignite client = grid(serverCount()); final Ignite srv = clientRouter(client); assertTrue(client.cluster().localNode().isClient()); clnCache.put(key, key); assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS)); reconnectClientNode(client, srv, new Runnable() { @Override public void run() { stopGrid(clnRouterName); assertFalse("Client connected to the same server node.", clnRouterName.equals(clientRouter(client).name())); clnCache.put(key, key); assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS));
/** * @throws Exception If failed. */ @Test public void testReconnectClient() throws Exception { Ignite client = grid(serverCount()); Ignite srv = clientRouter(client); assertTrue(client.cluster().localNode().isClient()); final CacheEventListener lsnr = new CacheEventListener(); ContinuousQuery<Object, Object> qry = new ContinuousQuery<>(); qry.setLocalListener(lsnr); IgniteCache<Object, Object> clnCache = client.cache(DEFAULT_CACHE_NAME); QueryCursor<?> cur = clnCache.query(qry); int keyCnt = 100; for (int i = 0; i < 10; i++) { lsnr.latch = new CountDownLatch(keyCnt); for (int key = 0; key < keyCnt; key++) clnCache.put(key, key); assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS)); reconnectClientNode(client, srv, null); lsnr.latch = new CountDownLatch(keyCnt); for (int key = 0; key < keyCnt; key++) clnCache.put(key, key); assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS)); } cur.close(); }
/** {@inheritDoc} */ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME); ccfg.setCacheMode(PARTITIONED); ccfg.setAtomicityMode(atomicMode()); ccfg.setWriteSynchronizationMode(FULL_SYNC); cfg.setCacheConfiguration(ccfg); return cfg; }