@Override public void close() { clientFactory.close(); } }
/** * shutdown dictionary client */ @Override public void shutDown() { clientFactory.close(); } }
@Override public void close() { checkInit(); if (clientFactory != null) { clientFactory.close(); clientFactory = null; } } }
@Override public void close() { checkInit(); if (clientFactory != null) { clientFactory.close(); clientFactory = null; } } }
@After public void afterEach() { if (clientFactory != null) { clientFactory.close(); clientFactory = null; } }
@After public void afterEach() { if (clientFactory != null) { clientFactory.close(); clientFactory = null; } }
@After public void afterEach() { if (clientFactory != null) { clientFactory.close(); clientFactory = null; } }
@AfterClass public static void tearDown() { server.close(); clientFactory.close(); if (tempDir != null) { for (File f : tempDir.listFiles()) { f.delete(); } tempDir.delete(); } }
@After public void tearDown() { if (server != null) { server.close(); } if (clientFactory != null) { clientFactory.close(); } }
@AfterClass public static void tearDown() { server.close(); clientFactory.close(); }
@After public void tearDown() { if (server != null) { server.close(); } if (clientFactory != null) { clientFactory.close(); } }
@AfterClass public static void tearDown() { bufferChunk.release(); server.close(); clientFactory.close(); testFile.delete(); }
@AfterClass public static void tearDown() { bufferChunk.release(); server.close(); clientFactory.close(); testFile.delete(); }
@AfterClass public static void tearDown() { server.close(); clientFactory.close(); testData.cleanup(); }
@AfterClass public static void tearDown() { server.close(); clientFactory.close(); testData.cleanup(); }
@Test public void neverReturnInactiveClients() throws IOException, InterruptedException { TransportClientFactory factory = context.createClientFactory(); TransportClient c1 = factory.createClient(TestUtils.getLocalHost(), server1.getPort()); c1.close(); long start = System.currentTimeMillis(); while (c1.isActive() && (System.currentTimeMillis() - start) < 3000) { Thread.sleep(10); } assertFalse(c1.isActive()); TransportClient c2 = factory.createClient(TestUtils.getLocalHost(), server1.getPort()); assertNotSame(c1, c2); assertTrue(c2.isActive()); factory.close(); }
@Test public void returnDifferentClientsForDifferentServers() throws IOException, InterruptedException { TransportClientFactory factory = context.createClientFactory(); TransportClient c1 = factory.createClient(TestUtils.getLocalHost(), server1.getPort()); TransportClient c2 = factory.createClient(TestUtils.getLocalHost(), server2.getPort()); assertTrue(c1.isActive()); assertTrue(c2.isActive()); assertNotSame(c1, c2); factory.close(); }
@Test public void returnDifferentClientsForDifferentServers() throws IOException, InterruptedException { TransportClientFactory factory = context.createClientFactory(); TransportClient c1 = factory.createClient(TestUtils.getLocalHost(), server1.getPort()); TransportClient c2 = factory.createClient(TestUtils.getLocalHost(), server2.getPort()); assertTrue(c1.isActive()); assertTrue(c2.isActive()); assertNotSame(c1, c2); factory.close(); }
@Test public void closeBlockClientsWithFactory() throws IOException, InterruptedException { TransportClientFactory factory = context.createClientFactory(); TransportClient c1 = factory.createClient(TestUtils.getLocalHost(), server1.getPort()); TransportClient c2 = factory.createClient(TestUtils.getLocalHost(), server2.getPort()); assertTrue(c1.isActive()); assertTrue(c2.isActive()); factory.close(); assertFalse(c1.isActive()); assertFalse(c2.isActive()); }
@Test public void closeBlockClientsWithFactory() throws IOException, InterruptedException { TransportClientFactory factory = context.createClientFactory(); TransportClient c1 = factory.createClient(TestUtils.getLocalHost(), server1.getPort()); TransportClient c2 = factory.createClient(TestUtils.getLocalHost(), server2.getPort()); assertTrue(c1.isActive()); assertTrue(c2.isActive()); factory.close(); assertFalse(c1.isActive()); assertFalse(c2.isActive()); }