@Test public void testWithRetryInBackground() throws Exception { server.stop(); CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1)); try { client.start(); WatcherRemovalFacade removerClient = (WatcherRemovalFacade)client.newWatcherRemoveCuratorFramework(); Watcher w = new Watcher() { @Override public void process(WatchedEvent event) { } }; final CountDownLatch latch = new CountDownLatch(1); BackgroundCallback callback = new BackgroundCallback() { @Override public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { latch.countDown(); } }; removerClient.checkExists().usingWatcher(w).inBackground(callback).forPath("/one/two/three"); Assert.assertTrue(new Timing().awaitLatch(latch)); Assert.assertEquals(removerClient.getWatcherRemovalManager().getEntries().size(), 0); } finally { TestCleanState.closeAndTestClean(client); } }
@VisibleForTesting Set<? extends Watcher> getEntries() { return Sets.newHashSet(entries); }
WatcherRemovalManager { @VisibleForTesting Set<? extends Watcher> getEntries() { return Sets.newHashSet(entries); } }
WatcherRemovalManager { @VisibleForTesting Set<? extends Watcher> getEntries() { return Sets.newHashSet(entries); } WatcherRemovalManager(CuratorFrameworkImpl client); }
WatcherRemovalManager { @VisibleForTesting Set<? extends Watcher> getEntries() { return Sets.newHashSet(entries); } WatcherRemovalManager(CuratorFrameworkImpl client);  }
WatcherRemovalManager { @VisibleForTesting Set<? extends Watcher> getEntries() { return Sets.newHashSet(entries); } WatcherRemovalManager(CuratorFrameworkImpl client);   }