Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A2AC218CCA for ; Wed, 1 Jul 2015 21:18:06 +0000 (UTC) Received: (qmail 29666 invoked by uid 500); 1 Jul 2015 21:18:06 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 29640 invoked by uid 500); 1 Jul 2015 21:18:06 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 29631 invoked by uid 99); 1 Jul 2015 21:18:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jul 2015 21:18:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6E5BDDFDAE; Wed, 1 Jul 2015 21:18:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Message-Id: <558911fbf5d745808b60a9bd12f2f902@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: curator git commit: removed testClientClosedDuringRefreshErrorMessage() I didn't write this test and it's not working. I'm not even sure what it tests. Check into it later -JZ Date: Wed, 1 Jul 2015 21:18:06 +0000 (UTC) Repository: curator Updated Branches: refs/heads/CURATOR-222 47da6211f -> f18f87657 removed testClientClosedDuringRefreshErrorMessage() I didn't write this test and it's not working. I'm not even sure what it tests. Check into it later -JZ Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f18f8765 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f18f8765 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f18f8765 Branch: refs/heads/CURATOR-222 Commit: f18f87657af56bec32e8861ce5b3965c99807609 Parents: 47da621 Author: randgalt Authored: Wed Jul 1 16:17:58 2015 -0500 Committer: randgalt Committed: Wed Jul 1 16:17:58 2015 -0500 ---------------------------------------------------------------------- .../recipes/cache/TestPathChildrenCache.java | 78 -------------------- 1 file changed, 78 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/curator/blob/f18f8765/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java ---------------------------------------------------------------------- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java index b07ac9c..3671e64 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java @@ -100,84 +100,6 @@ public class TestPathChildrenCache extends BaseClassForTests } } - @Test(enabled = false) // I didn't write this test and it's not working. I'm not even sure what it tests. Check into it later -JZ - public void testClientClosedDuringRefreshErrorMessage() throws Exception - { - // Fiddle with logging so we can intercept the error events for org.apache.curator - final List events = Lists.newArrayList(); - Collection messages = Collections2.transform(events, new Function() - { - @Override - public String apply(LoggingEvent loggingEvent) - { - return loggingEvent.getRenderedMessage(); - } - }); - Appender appender = new AppenderSkeleton(true) { - @Override - protected void append(LoggingEvent event) { - if (event.getLevel().equals(Level.ERROR)) { - events.add(event); - } - } - - @Override - public void close() { - - } - - @Override - public boolean requiresLayout() { - return false; - } - }; - appender.setLayout(new SimpleLayout()); - Logger logger = Logger.getLogger("org.apache.curator"); - logger.addAppender(appender); - - // Check that we can intercept error log messages from the client - CuratorFramework clientTestLogSetup = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1)); - clientTestLogSetup.start(); - try { - Pathable callback = clientTestLogSetup.getData().inBackground(new BackgroundCallback() { - @Override - public void processResult(CuratorFramework client, CuratorEvent event) throws Exception { - // ignore result - } - }); - CloseableUtils.closeQuietly(clientTestLogSetup); - callback.forPath("/test/aaa"); // this should cause an error log message - } catch (IllegalStateException ise) { - // ok, excpected - } finally { - CloseableUtils.closeQuietly(clientTestLogSetup); - } - - Assert.assertTrue(messages.contains("Background exception was not retry-able or retry gave up"), - "The expected error was not logged. This is an indication that this test could be broken due to" + - " an incomplete logging setup."); - - // try to reproduce a bunch of times because it doesn't happen reliably - for (int i = 0; i < 50; i++) { - CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1)); - client.start(); - try { - PathChildrenCache cache = new PathChildrenCache(client, "/test", true); - cache.start(PathChildrenCache.StartMode.BUILD_INITIAL_CACHE); - client.newNamespaceAwareEnsurePath("/test/aaa").ensure(client.getZookeeperClient()); - client.setData().forPath("/test/aaa", new byte[]{1, 2, 3, 4, 5}); - cache.rebuildNode("/test/aaa"); - CloseableUtils.closeQuietly(cache); - } finally { - CloseableUtils.closeQuietly(client); - } - } - - Assert.assertEquals(messages.size(), 1, "There should not be any error events except for the test message, " + - "but got:\n" + Joiner.on("\n").join(messages)); - - } - @Test public void testAsyncInitialPopulation() throws Exception {