PathChildrenCache implements Closeable { public void start() throws Exception { start(StartMode.NORMAL); } @Deprecated @SuppressWarnings("deprecation")  PathChildrenCache(CuratorFramework client, String path, PathChildrenCacheMode mode); @Deprecated @SuppressWarnings("deprecation")  PathChildrenCache(CuratorFramework client, String path, PathChildrenCacheMode mode, ThreadFactory threadFactory);  PathChildrenCache(CuratorFramework client, String path, boolean cacheData);  PathChildrenCache(CuratorFramework client, String path, boolean cacheData, ThreadFactory threadFactory);  PathChildrenCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, ThreadFactory threadFactory);  PathChildrenCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, final ExecutorService executorService);  PathChildrenCache(CuratorFramework client, String path, boolean cacheData, boolean dataIsCompressed, final CloseableExecutorService executorService); void start(); @Deprecated void start(boolean buildInitial); void start(StartMode mode); void rebuild(); void rebuildNode(String fullPath); @Override void close(); ListenerContainer<PathChildrenCacheListener> getListenable(); List<ChildData> getCurrentData(); ChildData getCurrentData(String fullPath); void clearDataBytes(String fullPath); boolean clearDataBytes(String fullPath, int ifVersion); void clearAndRefresh(); void clear(); static final ThreadFactory defaultThreadFactory; }
@Test public void testModes() throws Exception { Timing timing = new Timing(); CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1)); client.start(); try { client.create().forPath("/test"); for ( boolean cacheData : new boolean[]{false, true} ) { internalTestMode(client, cacheData); client.delete().forPath("/test/one"); client.delete().forPath("/test/two"); } } finally { TestCleanState.closeAndTestClean(client); } }