Source:
<code>public void setup() throws Exception { File rootDir = temp.newFolder("zk-test"); zkport = Net.getFreePort(); ezk = new EmbeddedZooKeeper(rootDir, zkport); ezk.init(); final CountDownLatch connectedLatch = new CountDownLatch(1); zk = new ZooKeeper("localhost:" + zkport, 1000, new Watcher() { public void process(WatchedEvent event) { if (event.getState() == Event.KeeperState.SyncConnected) { connectedLatch.countDown(); } } }); connectedLatch.await(); coordinateRunning = Coordinate.parse("1.service.user.cell"); cn = new ZkCloudname.Builder().setConnectString("localhost:" + zkport).build().connect(); cn.createCoordinate(coordinateRunning); ServiceHandle handleRunning = cn.claim(coordinateRunning); handleRunning.putEndpoint(new Endpoint(coordinateRunning, "foo", "localhost", 1234, "http", "data")); handleRunning.putEndpoint(new Endpoint(coordinateRunning, "bar", "localhost", 1235, "http", null)); ServiceStatus statusRunning = new ServiceStatus(ServiceState.RUNNING, "Running message"); handleRunning.setStatus(statusRunning); coordinateDraining = Coordinate.parse("0.service.user.cell"); cn.createCoordinate(coordinateDraining); handleDraining = cn.claim(coordinateDraining); handleDraining.putEndpoint(new Endpoint(coordinateDraining, "foo", "localhost", 5555, "http", "data")); handleDraining.putEndpoint(new Endpoint(coordinateDraining, "bar", "localhost", 5556, "http", null)); <START> ServiceStatus statusDraining = new ServiceStatus(ServiceState.DRAIN, "Draining message"); <END> handleDraining.setStatus(statusDraining); }</code><technical_language>ServiceState.DRAIN named 'DRAINING' for conformance RUNNING STARTING</technical_language>

Target:
public void setup() throws Exception { File rootDir = temp.newFolder("zk-test"); zkport = Net.getFreePort(); ezk = new EmbeddedZooKeeper(rootDir, zkport); ezk.init(); final CountDownLatch connectedLatch = new CountDownLatch(1); zk = new ZooKeeper("localhost:" + zkport, 1000, new Watcher() { public void process(WatchedEvent event) { if (event.getState() == Event.KeeperState.SyncConnected) { connectedLatch.countDown(); } } }); connectedLatch.await(); coordinateRunning = Coordinate.parse("1.service.user.cell"); cn = new ZkCloudname.Builder().setConnectString("localhost:" + zkport).build().connect(); cn.createCoordinate(coordinateRunning); ServiceHandle handleRunning = cn.claim(coordinateRunning); assertTrue(handleRunning.waitForCoordinateOkSeconds(30)); handleRunning.putEndpoint(new Endpoint(coordinateRunning, "foo", "localhost", 1234, "http", "data")); handleRunning.putEndpoint(new Endpoint(coordinateRunning, "bar", "localhost", 1235, "http", null)); ServiceStatus statusRunning = new ServiceStatus(ServiceState.RUNNING, "Running message"); handleRunning.setStatus(statusRunning); coordinateDraining = Coordinate.parse("0.service.user.cell"); cn.createCoordinate(coordinateDraining); handleDraining = cn.claim(coordinateDraining); assertTrue(handleDraining.waitForCoordinateOkSeconds(10)); handleDraining.putEndpoint(new Endpoint(coordinateDraining, "foo", "localhost", 5555, "http", "data")); handleDraining.putEndpoint(new Endpoint(coordinateDraining, "bar", "localhost", 5556, "http", null)); ServiceStatus statusDraining = new ServiceStatus(ServiceState.DRAINING, "Draining message"); handleDraining.setStatus(statusDraining); }