@Test public void testRMNonRf() throws Throwable { mkPath("/rm", CreateMode.PERSISTENT); mkPath("/rm/child", CreateMode.PERSISTENT); try { curatorService.zkDelete("/rm", false, null); fail("expected a failure"); } catch (PathIsNotEmptyDirectoryException expected) { } }
@Test public void testRMNonRf() throws Throwable { mkPath("/rm", CreateMode.PERSISTENT); mkPath("/rm/child", CreateMode.PERSISTENT); try { curatorService.zkDelete("/rm", false, null); fail("expected a failure"); } catch (PathIsNotEmptyDirectoryException expected) { } }
@Test public void testBackgroundDelete() throws Throwable { mkPath("/rm", CreateMode.PERSISTENT); mkPath("/rm/child", CreateMode.PERSISTENT); CuratorEventCatcher events = new CuratorEventCatcher(); curatorService.zkDelete("/rm", true, events); CuratorEvent taken = events.take(); LOG.info("took {}", taken); assertEquals(1, events.getCount()); }
@Test public void testBackgroundDelete() throws Throwable { mkPath("/rm", CreateMode.PERSISTENT); mkPath("/rm/child", CreateMode.PERSISTENT); CuratorEventCatcher events = new CuratorEventCatcher(); curatorService.zkDelete("/rm", true, events); CuratorEvent taken = events.take(); LOG.info("took {}", taken); assertEquals(1, events.getCount()); }