|
@@ -43,6 +43,7 @@ import org.apache.zookeeper.data.ACL;
|
|
|
import org.apache.zookeeper.data.Id;
|
|
|
import org.apache.zookeeper.data.Stat;
|
|
|
import org.apache.zookeeper.server.PrepRequestProcessor;
|
|
|
+import org.junit.Assert;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
import com.sun.management.UnixOperatingSystemMXBean;
|
|
@@ -50,12 +51,6 @@ import com.sun.management.UnixOperatingSystemMXBean;
|
|
|
public class ClientTest extends ClientBase {
|
|
|
protected static final Logger LOG = Logger.getLogger(ClientTest.class);
|
|
|
|
|
|
- @Override
|
|
|
- protected void tearDown() throws Exception {
|
|
|
- super.tearDown();
|
|
|
- LOG.info("FINISHED " + getName());
|
|
|
- }
|
|
|
-
|
|
|
/** Verify that pings are sent, keeping the "idle" client alive */
|
|
|
@Test
|
|
|
public void testPing() throws Exception {
|
|
@@ -128,7 +123,7 @@ public class ClientTest extends ClientBase {
|
|
|
zk = createClient();
|
|
|
try {
|
|
|
zk.create("/acltest", new byte[0], Ids.CREATOR_ALL_ACL, CreateMode.PERSISTENT);
|
|
|
- fail("Should have received an invalid acl error");
|
|
|
+ Assert.fail("Should have received an invalid acl error");
|
|
|
} catch(InvalidACLException e) {
|
|
|
LOG.info("Test successful, invalid acl received : "
|
|
|
+ e.getMessage());
|
|
@@ -138,7 +133,7 @@ public class ClientTest extends ClientBase {
|
|
|
testACL.add(new ACL(Perms.ALL | Perms.ADMIN, Ids.AUTH_IDS));
|
|
|
testACL.add(new ACL(Perms.ALL | Perms.ADMIN, new Id("ip", "127.0.0.1/8")));
|
|
|
zk.create("/acltest", new byte[0], testACL, CreateMode.PERSISTENT);
|
|
|
- fail("Should have received an invalid acl error");
|
|
|
+ Assert.fail("Should have received an invalid acl error");
|
|
|
} catch(InvalidACLException e) {
|
|
|
LOG.info("Test successful, invalid acl received : "
|
|
|
+ e.getMessage());
|
|
@@ -150,9 +145,9 @@ public class ClientTest extends ClientBase {
|
|
|
zk.addAuthInfo("digest", "ben:passwd2".getBytes());
|
|
|
try {
|
|
|
zk.getData("/acltest", false, new Stat());
|
|
|
- fail("Should have received a permission error");
|
|
|
+ Assert.fail("Should have received a permission error");
|
|
|
} catch (KeeperException e) {
|
|
|
- assertEquals(Code.NOAUTH, e.code());
|
|
|
+ Assert.assertEquals(Code.NOAUTH, e.code());
|
|
|
}
|
|
|
zk.addAuthInfo("digest", "ben:passwd".getBytes());
|
|
|
zk.getData("/acltest", false, new Stat());
|
|
@@ -161,8 +156,8 @@ public class ClientTest extends ClientBase {
|
|
|
zk = createClient();
|
|
|
zk.getData("/acltest", false, new Stat());
|
|
|
List<ACL> acls = zk.getACL("/acltest", new Stat());
|
|
|
- assertEquals(1, acls.size());
|
|
|
- assertEquals(Ids.OPEN_ACL_UNSAFE, acls);
|
|
|
+ Assert.assertEquals(1, acls.size());
|
|
|
+ Assert.assertEquals(Ids.OPEN_ACL_UNSAFE, acls);
|
|
|
zk.close();
|
|
|
} finally {
|
|
|
if (zk != null) {
|
|
@@ -212,10 +207,10 @@ public class ClientTest extends ClientBase {
|
|
|
// get all, then exists all
|
|
|
//
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
|
- assertNotNull(zk.getData("/foo-" + i, watchers[i], stat));
|
|
|
+ Assert.assertNotNull(zk.getData("/foo-" + i, watchers[i], stat));
|
|
|
}
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
|
- assertNotNull(zk.exists("/foo-" + i, watchers[i]));
|
|
|
+ Assert.assertNotNull(zk.exists("/foo-" + i, watchers[i]));
|
|
|
}
|
|
|
// trigger the watches
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
@@ -225,14 +220,14 @@ public class ClientTest extends ClientBase {
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
|
WatchedEvent event =
|
|
|
watchers[i].events.poll(10, TimeUnit.SECONDS);
|
|
|
- assertEquals("/foo-" + i, event.getPath());
|
|
|
- assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
+ Assert.assertEquals("/foo-" + i, event.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
|
|
|
// small chance that an unexpected message was delivered
|
|
|
// after this check, but we would catch that next time
|
|
|
// we check events
|
|
|
- assertEquals(0, watchers[i].events.size());
|
|
|
+ Assert.assertEquals(0, watchers[i].events.size());
|
|
|
}
|
|
|
|
|
|
//
|
|
@@ -240,8 +235,8 @@ public class ClientTest extends ClientBase {
|
|
|
// get/exists together
|
|
|
//
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
|
- assertNotNull(zk.getData("/foo-" + i, watchers[i], stat));
|
|
|
- assertNotNull(zk.exists("/foo-" + i, watchers[i]));
|
|
|
+ Assert.assertNotNull(zk.getData("/foo-" + i, watchers[i], stat));
|
|
|
+ Assert.assertNotNull(zk.exists("/foo-" + i, watchers[i]));
|
|
|
}
|
|
|
// trigger the watches
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
@@ -251,22 +246,22 @@ public class ClientTest extends ClientBase {
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
|
WatchedEvent event =
|
|
|
watchers[i].events.poll(10, TimeUnit.SECONDS);
|
|
|
- assertEquals("/foo-" + i, event.getPath());
|
|
|
- assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
+ Assert.assertEquals("/foo-" + i, event.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
|
|
|
// small chance that an unexpected message was delivered
|
|
|
// after this check, but we would catch that next time
|
|
|
// we check events
|
|
|
- assertEquals(0, watchers[i].events.size());
|
|
|
+ Assert.assertEquals(0, watchers[i].events.size());
|
|
|
}
|
|
|
|
|
|
//
|
|
|
// test get/exists with two sets of watchers
|
|
|
//
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
|
- assertNotNull(zk.getData("/foo-" + i, watchers[i], stat));
|
|
|
- assertNotNull(zk.exists("/foo-" + i, watchers2[i]));
|
|
|
+ Assert.assertNotNull(zk.getData("/foo-" + i, watchers[i], stat));
|
|
|
+ Assert.assertNotNull(zk.exists("/foo-" + i, watchers2[i]));
|
|
|
}
|
|
|
// trigger the watches
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
@@ -276,26 +271,26 @@ public class ClientTest extends ClientBase {
|
|
|
for (int i = 0; i < watchers.length; i++) {
|
|
|
WatchedEvent event =
|
|
|
watchers[i].events.poll(10, TimeUnit.SECONDS);
|
|
|
- assertEquals("/foo-" + i, event.getPath());
|
|
|
- assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
+ Assert.assertEquals("/foo-" + i, event.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
|
|
|
// small chance that an unexpected message was delivered
|
|
|
// after this check, but we would catch that next time
|
|
|
// we check events
|
|
|
- assertEquals(0, watchers[i].events.size());
|
|
|
+ Assert.assertEquals(0, watchers[i].events.size());
|
|
|
|
|
|
// watchers2
|
|
|
WatchedEvent event2 =
|
|
|
watchers2[i].events.poll(10, TimeUnit.SECONDS);
|
|
|
- assertEquals("/foo-" + i, event2.getPath());
|
|
|
- assertEquals(EventType.NodeDataChanged, event2.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event2.getState());
|
|
|
+ Assert.assertEquals("/foo-" + i, event2.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeDataChanged, event2.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event2.getState());
|
|
|
|
|
|
// small chance that an unexpected message was delivered
|
|
|
// after this check, but we would catch that next time
|
|
|
// we check events
|
|
|
- assertEquals(0, watchers2[i].events.size());
|
|
|
+ Assert.assertEquals(0, watchers2[i].events.size());
|
|
|
}
|
|
|
|
|
|
} finally {
|
|
@@ -318,11 +313,11 @@ public class ClientTest extends ClientBase {
|
|
|
LOG.info("After create /benwashere");
|
|
|
try {
|
|
|
zk.setData("/benwashere", "hi".getBytes(), 57);
|
|
|
- fail("Should have gotten BadVersion exception");
|
|
|
+ Assert.fail("Should have gotten BadVersion exception");
|
|
|
} catch(KeeperException.BadVersionException e) {
|
|
|
// expected that
|
|
|
} catch (KeeperException e) {
|
|
|
- fail("Should have gotten BadVersion exception");
|
|
|
+ Assert.fail("Should have gotten BadVersion exception");
|
|
|
}
|
|
|
LOG.info("Before delete /benwashere");
|
|
|
zk.delete("/benwashere", 0);
|
|
@@ -337,7 +332,7 @@ public class ClientTest extends ClientBase {
|
|
|
|
|
|
try {
|
|
|
zk.delete("/", -1);
|
|
|
- fail("deleted root!");
|
|
|
+ Assert.fail("deleted root!");
|
|
|
} catch(KeeperException.BadArgumentsException e) {
|
|
|
// good, expected that
|
|
|
}
|
|
@@ -350,19 +345,19 @@ public class ClientTest extends ClientBase {
|
|
|
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
|
|
|
LOG.info("Before getChildren /pat");
|
|
|
List<String> children = zk.getChildren("/pat", false);
|
|
|
- assertEquals(1, children.size());
|
|
|
- assertEquals("ben", children.get(0));
|
|
|
+ Assert.assertEquals(1, children.size());
|
|
|
+ Assert.assertEquals("ben", children.get(0));
|
|
|
List<String> children2 = zk.getChildren("/pat", false, null);
|
|
|
- assertEquals(children, children2);
|
|
|
+ Assert.assertEquals(children, children2);
|
|
|
String value = new String(zk.getData("/pat/ben", false, stat));
|
|
|
- assertEquals("Ben was here", value);
|
|
|
+ Assert.assertEquals("Ben was here", value);
|
|
|
// Test stat and watch of non existent node
|
|
|
|
|
|
try {
|
|
|
if (withWatcherObj) {
|
|
|
- assertEquals(null, zk.exists("/frog", watcher));
|
|
|
+ Assert.assertEquals(null, zk.exists("/frog", watcher));
|
|
|
} else {
|
|
|
- assertEquals(null, zk.exists("/frog", true));
|
|
|
+ Assert.assertEquals(null, zk.exists("/frog", true));
|
|
|
}
|
|
|
LOG.info("Comment: asseting passed for frog setting /");
|
|
|
} catch (KeeperException.NoNodeException e) {
|
|
@@ -374,9 +369,9 @@ public class ClientTest extends ClientBase {
|
|
|
LOG.info("Comment: checking for events length "
|
|
|
+ watcher.events.size());
|
|
|
WatchedEvent event = watcher.events.poll(10, TimeUnit.SECONDS);
|
|
|
- assertEquals("/frog", event.getPath());
|
|
|
- assertEquals(EventType.NodeCreated, event.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
+ Assert.assertEquals("/frog", event.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeCreated, event.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
// Test child watch and create with sequence
|
|
|
zk.getChildren("/pat/ben", true);
|
|
|
for (int i = 0; i < 10; i++) {
|
|
@@ -385,17 +380,17 @@ public class ClientTest extends ClientBase {
|
|
|
}
|
|
|
children = zk.getChildren("/pat/ben", false);
|
|
|
Collections.sort(children);
|
|
|
- assertEquals(10, children.size());
|
|
|
+ Assert.assertEquals(10, children.size());
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
final String name = children.get(i);
|
|
|
- assertTrue("starts with -", name.startsWith(i + "-"));
|
|
|
+ Assert.assertTrue("starts with -", name.startsWith(i + "-"));
|
|
|
byte b[];
|
|
|
if (withWatcherObj) {
|
|
|
b = zk.getData("/pat/ben/" + name, watcher, stat);
|
|
|
} else {
|
|
|
b = zk.getData("/pat/ben/" + name, true, stat);
|
|
|
}
|
|
|
- assertEquals(Integer.toString(i), new String(b));
|
|
|
+ Assert.assertEquals(Integer.toString(i), new String(b));
|
|
|
zk.setData("/pat/ben/" + name, "new".getBytes(),
|
|
|
stat.getVersion());
|
|
|
if (withWatcherObj) {
|
|
@@ -406,19 +401,19 @@ public class ClientTest extends ClientBase {
|
|
|
zk.delete("/pat/ben/" + name, stat.getVersion());
|
|
|
}
|
|
|
event = watcher.events.poll(10, TimeUnit.SECONDS);
|
|
|
- assertEquals("/pat/ben", event.getPath());
|
|
|
- assertEquals(EventType.NodeChildrenChanged, event.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
+ Assert.assertEquals("/pat/ben", event.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeChildrenChanged, event.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
event = watcher.events.poll(10, TimeUnit.SECONDS);
|
|
|
final String name = children.get(i);
|
|
|
- assertEquals("/pat/ben/" + name, event.getPath());
|
|
|
- assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
+ Assert.assertEquals("/pat/ben/" + name, event.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeDataChanged, event.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
event = watcher.events.poll(10, TimeUnit.SECONDS);
|
|
|
- assertEquals("/pat/ben/" + name, event.getPath());
|
|
|
- assertEquals(EventType.NodeDeleted, event.getType());
|
|
|
- assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
+ Assert.assertEquals("/pat/ben/" + name, event.getPath());
|
|
|
+ Assert.assertEquals(EventType.NodeDeleted, event.getType());
|
|
|
+ Assert.assertEquals(KeeperState.SyncConnected, event.getState());
|
|
|
}
|
|
|
zk.create("/good\u0040path", "".getBytes(), Ids.OPEN_ACL_UNSAFE,
|
|
|
CreateMode.PERSISTENT);
|
|
@@ -428,7 +423,7 @@ public class ClientTest extends ClientBase {
|
|
|
try {
|
|
|
zk.create("/duplicate", "".getBytes(), Ids.OPEN_ACL_UNSAFE,
|
|
|
CreateMode.PERSISTENT);
|
|
|
- fail("duplicate create allowed");
|
|
|
+ Assert.fail("duplicate create allowed");
|
|
|
} catch(KeeperException.NodeExistsException e) {
|
|
|
// OK, expected that
|
|
|
}
|
|
@@ -455,18 +450,18 @@ public class ClientTest extends ClientBase {
|
|
|
zk.create(path, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
|
|
|
zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
List<String> children = zk.getChildren(path, false);
|
|
|
- assertEquals(1, children.size());
|
|
|
- assertEquals(file + "0000000000", children.get(0));
|
|
|
+ Assert.assertEquals(1, children.size());
|
|
|
+ Assert.assertEquals(file + "0000000000", children.get(0));
|
|
|
|
|
|
zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
children = zk.getChildren(path, false);
|
|
|
- assertEquals(2, children.size());
|
|
|
- assertTrue("contains child 1", children.contains(file + "0000000001"));
|
|
|
+ Assert.assertEquals(2, children.size());
|
|
|
+ Assert.assertTrue("contains child 1", children.contains(file + "0000000001"));
|
|
|
|
|
|
zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
children = zk.getChildren(path, false);
|
|
|
- assertEquals(3, children.size());
|
|
|
- assertTrue("contains child 2",
|
|
|
+ Assert.assertEquals(3, children.size());
|
|
|
+ Assert.assertTrue("contains child 2",
|
|
|
children.contains(file + "0000000002"));
|
|
|
|
|
|
// The pattern is holding so far. Let's run the counter a bit
|
|
@@ -475,7 +470,7 @@ public class ClientTest extends ClientBase {
|
|
|
zk.create(filepath, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
|
|
|
children = zk.getChildren(path, false);
|
|
|
- assertTrue("contains child 104",
|
|
|
+ Assert.assertTrue("contains child 104",
|
|
|
children.contains(file + "0000000104"));
|
|
|
|
|
|
}
|
|
@@ -501,11 +496,11 @@ public class ClientTest extends ClientBase {
|
|
|
zk.create(queue_handle + "/element", "1".getBytes(),
|
|
|
Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
List<String> children = zk.getChildren(queue_handle, true);
|
|
|
- assertEquals(children.size(), 2);
|
|
|
+ Assert.assertEquals(children.size(), 2);
|
|
|
String child1 = children.get(0);
|
|
|
String child2 = children.get(1);
|
|
|
int compareResult = child1.compareTo(child2);
|
|
|
- assertNotSame(compareResult, 0);
|
|
|
+ Assert.assertNotSame(compareResult, 0);
|
|
|
if (compareResult < 0) {
|
|
|
} else {
|
|
|
String temp = child1;
|
|
@@ -516,8 +511,8 @@ public class ClientTest extends ClientBase {
|
|
|
+ "/" + child1, false, null));
|
|
|
String child2data = new String(zk.getData(queue_handle
|
|
|
+ "/" + child2, false, null));
|
|
|
- assertEquals(child1data, "0");
|
|
|
- assertEquals(child2data, "1");
|
|
|
+ Assert.assertEquals(child1data, "0");
|
|
|
+ Assert.assertEquals(child2data, "1");
|
|
|
} finally {
|
|
|
if (zk != null) {
|
|
|
zk.close();
|
|
@@ -534,7 +529,7 @@ public class ClientTest extends ClientBase {
|
|
|
// this is good
|
|
|
return;
|
|
|
}
|
|
|
- fail("bad path \"" + path + "\" not caught");
|
|
|
+ Assert.fail("bad path \"" + path + "\" not caught");
|
|
|
}
|
|
|
|
|
|
// Test that the path string is validated
|
|
@@ -568,11 +563,11 @@ public class ClientTest extends ClientBase {
|
|
|
zk.create("/createseqpar", null, Ids.OPEN_ACL_UNSAFE,
|
|
|
CreateMode.PERSISTENT);
|
|
|
// next two steps - related to sequential processing
|
|
|
- // 1) verify that empty child name fails if not sequential
|
|
|
+ // 1) verify that empty child name Assert.fails if not sequential
|
|
|
try {
|
|
|
zk.create("/createseqpar/", null, Ids.OPEN_ACL_UNSAFE,
|
|
|
CreateMode.PERSISTENT);
|
|
|
- assertTrue(false);
|
|
|
+ Assert.assertTrue(false);
|
|
|
} catch(IllegalArgumentException be) {
|
|
|
// catch this.
|
|
|
}
|
|
@@ -587,21 +582,21 @@ public class ClientTest extends ClientBase {
|
|
|
try {
|
|
|
zk.create("/createseqpar//", null, Ids.OPEN_ACL_UNSAFE,
|
|
|
CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
- assertTrue(false);
|
|
|
+ Assert.assertTrue(false);
|
|
|
} catch(IllegalArgumentException be) {
|
|
|
// catch this.
|
|
|
}
|
|
|
try {
|
|
|
zk.create("/createseqpar/./", null, Ids.OPEN_ACL_UNSAFE,
|
|
|
CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
- assertTrue(false);
|
|
|
+ Assert.assertTrue(false);
|
|
|
} catch(IllegalArgumentException be) {
|
|
|
// catch this.
|
|
|
}
|
|
|
try {
|
|
|
zk.create("/createseqpar/../", null, Ids.OPEN_ACL_UNSAFE,
|
|
|
CreateMode.PERSISTENT_SEQUENTIAL);
|
|
|
- assertTrue(false);
|
|
|
+ Assert.assertTrue(false);
|
|
|
} catch(IllegalArgumentException be) {
|
|
|
// catch this.
|
|
|
}
|
|
@@ -611,7 +606,7 @@ public class ClientTest extends ClientBase {
|
|
|
PrepRequestProcessor.setFailCreate(true);
|
|
|
try {
|
|
|
zk.create("/m", null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
|
|
|
- assertTrue(false);
|
|
|
+ Assert.assertTrue(false);
|
|
|
} catch(KeeperException.BadArgumentsException be) {
|
|
|
// catch this.
|
|
|
}
|
|
@@ -653,9 +648,9 @@ public class ClientTest extends ClientBase {
|
|
|
zk.create("/parent/child", new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
|
|
|
try {
|
|
|
zk.delete("/parent", -1);
|
|
|
- fail("Should have received a not equals message");
|
|
|
+ Assert.fail("Should have received a not equals message");
|
|
|
} catch (KeeperException e) {
|
|
|
- assertEquals(KeeperException.Code.NOTEMPTY, e.code());
|
|
|
+ Assert.assertEquals(KeeperException.Code.NOTEMPTY, e.code());
|
|
|
}
|
|
|
zk.delete("/parent/child", -1);
|
|
|
zk.delete("/parent", -1);
|
|
@@ -678,11 +673,11 @@ public class ClientTest extends ClientBase {
|
|
|
zk.close();
|
|
|
// we've asked to close, wait for it to finish closing
|
|
|
// all the sub-threads otw the selector may not be
|
|
|
- // closed when we check (false positive on test failure
|
|
|
+ // closed when we check (false positive on test Assert.failure
|
|
|
zk.testableWaitForShutdown(CONNECTION_TIMEOUT);
|
|
|
}
|
|
|
} catch (Throwable t) {
|
|
|
- LOG.error("test failed", t);
|
|
|
+ LOG.error("test Assert.failed", t);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -726,12 +721,12 @@ public class ClientTest extends ClientBase {
|
|
|
|
|
|
for (int i = 0; i < threads.length; i++) {
|
|
|
threads[i].join(CONNECTION_TIMEOUT);
|
|
|
- assertTrue(threads[i].current == threads[i].count);
|
|
|
+ Assert.assertTrue(threads[i].current == threads[i].count);
|
|
|
}
|
|
|
|
|
|
- // if this fails it means we are not cleaning up after the closed
|
|
|
+ // if this Assert.fails it means we are not cleaning up after the closed
|
|
|
// sessions.
|
|
|
- assertTrue("open fds after test are not significantly higher than before",
|
|
|
+ Assert.assertTrue("open fds after test are not significantly higher than before",
|
|
|
unixos.getOpenFileDescriptorCount() <= initialFdCount + 10);
|
|
|
}
|
|
|
}
|