public void testGetRingState() throws Exception { Ring ring = ZkRing.create(getZk(), coordinator, getRoot(), 1, null, 1); assertEquals(RingState.CLOSED, ring.getState()); ring.setState(RingState.OPEN); assertEquals(RingState.OPEN, ring.getState()); ring = new ZkRing(getZk(), ZkPath.append(getRoot(), "ring-1"), null, coordinator); assertEquals(RingState.OPEN, ring.getState()); }
public void testGetRingState() throws Exception { Ring rc = ZkRing.create(getZk(), getRoot(), 1, null, 1); assertEquals(RingState.DOWN, rc.getState()); rc.setState(RingState.UP); assertEquals(RingState.UP, rc.getState()); rc = new ZkRing(getZk(), getRoot() + "/ring-1", null); assertEquals(RingState.UP, rc.getState()); }