final String HOSTPORT = "127.0.0.1:" + CLIENT_PORT;
File tmpDir = ClientBase.createTmpDir();
ZooKeeperServer zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
ServerCnxnFactory f = ServerCnxnFactory.createFactory(CLIENT_PORT, -1);
f.startup(zks);
Assert.assertTrue("waiting for server being up ", ClientBase
.waitForServerUp(HOSTPORT, CONNECTION_TIMEOUT));
CountdownWatcher watcher = new CountdownWatcher();
ZooKeeper zk = new ZooKeeper(HOSTPORT, CONNECTION_TIMEOUT, watcher);
watcher.waitForConnected(CONNECTION_TIMEOUT);
List<String> joiners = new ArrayList<String>();
joiners.add("server.2=localhost:1234:1235;1236");
// generate some transactions that will get logged
try {
zk.reconfig(joiners, null, null, -1, new Stat());
Assert.fail("Reconfiguration in standalone should trigger " +
"UnimplementedException");
} catch (KeeperException.UnimplementedException ex) {
// expected
}
zk.close();
zks.shutdown();
f.shutdown();
Assert.assertTrue("waiting for server being down ", ClientBase
.waitForServerDown(HOSTPORT, CONNECTION_TIMEOUT));
}