/** * Starts an empty local Zk instance on the default port */ public static void startLocalZkServer() { // DEFAULT_ZK_TEST_PORT = new Random().nextInt(10000) + 10000; // DEFAULT_ZK_STR = "localhost:" + DEFAULT_ZK_TEST_PORT; try { startLocalZkServer(DEFAULT_ZK_TEST_PORT); } catch (Exception e) { LOGGER.error("Failed to start ZK: " + e); } }
/** * Stops a local Zk instance, deleting its data directory */ public static void stopLocalZkServer() { try { stopLocalZkServer(true); } catch (Exception e) { LOGGER.error("Failed to stop ZK: " + e); } }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
/** * Starts a local Zk instance with a generated empty data directory * @param port The port to listen on */ public static void startLocalZkServer(final int port) { startLocalZkServer(port, org.apache.commons.io.FileUtils.getTempDirectoryPath() + File.separator + "test-" + System.currentTimeMillis()); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); ZkStarter.stopLocalZkServer(); }
@BeforeTest public void setup() { LOGGER.info("Trying to setup"); ZkStarter.startLocalZkServer(); }
@AfterTest public void shutdown() { LOGGER.info("Trying to shutdown"); kafkaBrokerTopicObserver.stop(); KafkaStarterUtils.stopServer(kafkaStarter); ZkStarter.stopLocalZkServer(); }