ZooKeeperServer zks = new ZooKeeperServer(tmpDir, tmpDir, 3000); int oldSnapCount = SyncRequestProcessor.getSnapCount(); SyncRequestProcessor.setSnapCount(1000); try {
/** * Verify the ability to start a standalone server instance. */ @Test public void testInvalidSnapCount() throws Exception { final int CLIENT_PORT = 3181; MainThread main = new MainThread(CLIENT_PORT); main.start(); Assert.assertTrue("waiting for server being up", ClientBase.waitForServerUp("127.0.0.1:" + CLIENT_PORT, CONNECTION_TIMEOUT)); Assert.assertEquals(SyncRequestProcessor.getSnapCount(), 2); main.shutdown(); }