@Test public void testWithOnlyMinSessionTimeout() throws Exception { ClientBase.setupTestEnv(); final int CLIENT_PORT = PortAssignment.unique(); final int tickTime = 2000; final int minSessionTimeout = tickTime * 2 - 100; int maxSessionTimeout = 20 * tickTime; final String configs = "minSessionTimeout=" + minSessionTimeout + "\n"; MainThread main = new MainThread(CLIENT_PORT, false, configs); main.start(); String HOSTPORT = "127.0.0.1:" + CLIENT_PORT; Assert.assertTrue("waiting for server being up", ClientBase.waitForServerUp(HOSTPORT, CONNECTION_TIMEOUT)); verifySessionTimeOut(minSessionTimeout, minSessionTimeout, HOSTPORT); verifySessionTimeOut(minSessionTimeout - 2000, minSessionTimeout, HOSTPORT); verifySessionTimeOut(maxSessionTimeout, maxSessionTimeout, HOSTPORT); verifySessionTimeOut(maxSessionTimeout + 2000, maxSessionTimeout, HOSTPORT); main.shutdown(); Assert.assertTrue("waiting for server down", ClientBase .waitForServerDown(HOSTPORT, ClientBase.CONNECTION_TIMEOUT)); }
protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } } }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }  }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }  static void main(String[] args); void runFromConfig(ServerConfig config); }
ZooKeeperServerMain { protected void shutdown() { if (containerManager != null) { containerManager.stop(); } if (cnxnFactory != null) { cnxnFactory.shutdown(); } if (secureCnxnFactory != null) { secureCnxnFactory.shutdown(); } try { if (adminServer != null) { adminServer.shutdown(); } } catch (AdminServerException e) { LOG.warn("Problem stopping AdminServer", e); } }  static void main(String[] args); void runFromConfig(ServerConfig config);  }