You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2014/05/20 17:32:15 UTC
[13/13] git commit: Major refactoring. Moved all "BaseClassForTests"
versions into curator-test. Added checks for server binding errors to this as
occassionally getting a random port doesn't seem to work. Also,
added general retries of tests as, occasion
Major refactoring. Moved all "BaseClassForTests" versions into curator-test. Added checks for server binding errors to this as occassionally
getting a random port doesn't seem to work. Also, added general retries of tests as, occasionally, there are random problems.
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/351c67c9
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/351c67c9
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/351c67c9
Branch: refs/heads/CURATOR-96
Commit: 351c67c978d77f6f7241808b6b1b8824ffd8c52a
Parents: ab61896
Author: randgalt <ra...@apache.org>
Authored: Tue May 20 10:30:46 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Tue May 20 10:30:46 2014 -0500
----------------------------------------------------------------------
.../org/apache/curator/BaseClassForTests.java | 42 ---------
.../java/org/apache/curator/BasicTests.java | 1 +
.../java/org/apache/curator/TestRetryLoop.java | 1 +
.../curator/TestSessionFailRetryLoop.java | 1 +
.../TestExhibitorEnsembleProvider.java | 2 +-
.../framework/imps/BaseClassForTests.java | 49 ----------
.../curator/framework/imps/TestCompression.java | 1 +
.../framework/imps/TestFailedDeleteManager.java | 1 +
.../curator/framework/imps/TestFramework.java | 1 +
.../framework/imps/TestFrameworkBackground.java | 1 +
.../framework/imps/TestFrameworkEdges.java | 1 +
.../curator/framework/imps/TestMultiClient.java | 1 +
.../framework/imps/TestNamespaceFacade.java | 1 +
.../framework/imps/TestTempFramework.java | 1 +
.../framework/imps/TestTransactions.java | 1 +
.../framework/imps/TestWatcherIdentity.java | 1 +
.../framework/client/TestBackgroundStates.java | 2 +-
...estResetConnectionWithBackgroundFailure.java | 2 +-
.../framework/recipes/BaseClassForTests.java | 42 ---------
.../recipes/atomic/TestCachedAtomicCounter.java | 2 +-
.../atomic/TestDistributedAtomicLong.java | 2 +-
.../barriers/TestDistributedBarrier.java | 2 +-
.../barriers/TestDistributedDoubleBarrier.java | 2 +-
.../framework/recipes/cache/TestNodeCache.java | 2 +-
.../recipes/cache/TestPathChildrenCache.java | 2 +-
.../recipes/leader/TestLeaderLatch.java | 2 +-
.../recipes/leader/TestLeaderSelector.java | 2 +-
.../recipes/leader/TestLeaderSelectorEdges.java | 2 +-
.../leader/TestLeaderSelectorParticipants.java | 2 +-
.../leader/TestLeaderSelectorWithExecutor.java | 2 +-
.../recipes/locks/TestChildReaper.java | 2 +-
.../locks/TestInterProcessMutexBase.java | 2 +-
.../locks/TestInterProcessReadWriteLock.java | 2 +-
.../locks/TestInterProcessSemaphore.java | 2 +-
.../framework/recipes/locks/TestLockACLs.java | 2 +-
.../locks/TestLockCleanlinessWithFaults.java | 2 +-
.../framework/recipes/locks/TestReaper.java | 2 +-
.../nodes/TestPersistentEphemeralNode.java | 2 +-
.../TestPersistentEphemeralNodeListener.java | 2 +-
.../queue/TestBoundedDistributedQueue.java | 2 +-
.../queue/TestDistributedDelayQueue.java | 2 +-
.../recipes/queue/TestDistributedIdQueue.java | 2 +-
.../queue/TestDistributedPriorityQueue.java | 2 +-
.../recipes/queue/TestDistributedQueue.java | 2 +-
.../recipes/queue/TestQueueSharder.java | 2 +-
.../queue/TestSimpleDistributedQueue.java | 2 +-
.../recipes/shared/TestSharedCount.java | 2 +-
curator-test/pom.xml | 6 ++
.../apache/curator/test/BaseClassForTests.java | 98 ++++++++++++++++++++
.../curator/test/TestingZooKeeperMain.java | 51 ++++++----
.../curator/test/TestingZooKeeperServer.java | 2 +-
.../curator/x/discovery/TestServiceCache.java | 11 +--
.../x/discovery/TestServiceDiscovery.java | 13 +--
53 files changed, 188 insertions(+), 201 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-client/src/test/java/org/apache/curator/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-client/src/test/java/org/apache/curator/BaseClassForTests.java b/curator-client/src/test/java/org/apache/curator/BaseClassForTests.java
deleted file mode 100644
index 1356139..0000000
--- a/curator-client/src/test/java/org/apache/curator/BaseClassForTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator;
-
-import org.apache.curator.test.TestingServer;
-import org.apache.curator.utils.DebugUtils;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-
-public class BaseClassForTests
-{
- protected TestingServer server;
-
- @BeforeMethod
- public void setup() throws Exception
- {
- System.setProperty(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES, "true");
- server = new TestingServer();
- }
-
- @AfterMethod
- public void teardown() throws Exception
- {
- server.close();
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-client/src/test/java/org/apache/curator/BasicTests.java
----------------------------------------------------------------------
diff --git a/curator-client/src/test/java/org/apache/curator/BasicTests.java b/curator-client/src/test/java/org/apache/curator/BasicTests.java
index e9a9402..b886f3c 100644
--- a/curator-client/src/test/java/org/apache/curator/BasicTests.java
+++ b/curator-client/src/test/java/org/apache/curator/BasicTests.java
@@ -20,6 +20,7 @@ package org.apache.curator;
import org.apache.curator.ensemble.fixed.FixedEnsembleProvider;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.KillSession;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java
----------------------------------------------------------------------
diff --git a/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java b/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java
index 1549183..c839807 100644
--- a/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java
+++ b/curator-client/src/test/java/org/apache/curator/TestRetryLoop.java
@@ -20,6 +20,7 @@ package org.apache.curator;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.TestingServer;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.ZooDefs;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-client/src/test/java/org/apache/curator/TestSessionFailRetryLoop.java
----------------------------------------------------------------------
diff --git a/curator-client/src/test/java/org/apache/curator/TestSessionFailRetryLoop.java b/curator-client/src/test/java/org/apache/curator/TestSessionFailRetryLoop.java
index f3b2e4e..c17b5bf 100644
--- a/curator-client/src/test/java/org/apache/curator/TestSessionFailRetryLoop.java
+++ b/curator-client/src/test/java/org/apache/curator/TestSessionFailRetryLoop.java
@@ -18,6 +18,7 @@
*/
package org.apache.curator;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.KillSession;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-client/src/test/java/org/apache/curator/ensemble/exhibitor/TestExhibitorEnsembleProvider.java
----------------------------------------------------------------------
diff --git a/curator-client/src/test/java/org/apache/curator/ensemble/exhibitor/TestExhibitorEnsembleProvider.java b/curator-client/src/test/java/org/apache/curator/ensemble/exhibitor/TestExhibitorEnsembleProvider.java
index 7bc6cde..60c817a 100644
--- a/curator-client/src/test/java/org/apache/curator/ensemble/exhibitor/TestExhibitorEnsembleProvider.java
+++ b/curator-client/src/test/java/org/apache/curator/ensemble/exhibitor/TestExhibitorEnsembleProvider.java
@@ -19,8 +19,8 @@
package org.apache.curator.ensemble.exhibitor;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
-import org.apache.curator.BaseClassForTests;
import org.apache.curator.CuratorZookeeperClient;
import org.apache.curator.RetryLoop;
import org.apache.curator.retry.ExponentialBackoffRetry;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/BaseClassForTests.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/BaseClassForTests.java
deleted file mode 100644
index 13fd0b6..0000000
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/BaseClassForTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.framework.imps;
-
-import org.apache.curator.test.TestingServer;
-import org.apache.curator.utils.DebugUtils;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-
-public class BaseClassForTests
-{
- protected TestingServer server;
-
- @BeforeMethod
- public void setup() throws Exception
- {
- System.setProperty(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES, "true");
- server = new TestingServer();
- }
-
- @AfterMethod
- public void teardown()
- {
- try
- {
- server.close();
- }
- catch ( Throwable e )
- {
- e.printStackTrace();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCompression.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCompression.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCompression.java
index 2a8ec7c..520d0b6 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCompression.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCompression.java
@@ -18,6 +18,7 @@
*/
package org.apache.curator.framework.imps;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
index fa27285..fe74a72 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFailedDeleteManager.java
@@ -18,6 +18,7 @@
*/
package org.apache.curator.framework.imps;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
index 7a9a386..93d346b 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
@@ -19,6 +19,7 @@
package org.apache.curator.framework.imps;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
index 6e76931..44792d9 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkBackground.java
@@ -20,6 +20,7 @@
package org.apache.curator.framework.imps;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
index 3de1e56..52897b6 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
@@ -31,6 +31,7 @@ import org.apache.curator.framework.api.CuratorListener;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.KillSession;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java
index 69d688b..1d7634b 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestMultiClient.java
@@ -18,6 +18,7 @@
*/
package org.apache.curator.framework.imps;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java
index c99dc85..32b26dd 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestNamespaceFacade.java
@@ -18,6 +18,7 @@
*/
package org.apache.curator.framework.imps;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTempFramework.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTempFramework.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTempFramework.java
index a9e123e..d87e138 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTempFramework.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTempFramework.java
@@ -18,6 +18,7 @@
*/
package org.apache.curator.framework.imps;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.CuratorTempFramework;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java
index ba1104c..3b7e062 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactions.java
@@ -24,6 +24,7 @@ import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.transaction.CuratorTransactionResult;
import org.apache.curator.framework.api.transaction.OperationType;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.data.Stat;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java
index 84ef025..e950516 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java
@@ -18,6 +18,7 @@
*/
package org.apache.curator.framework.imps;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/client/TestBackgroundStates.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/client/TestBackgroundStates.java b/curator-recipes/src/test/java/org/apache/curator/framework/client/TestBackgroundStates.java
index 8cfa342..ac7c7a9 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/client/TestBackgroundStates.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/client/TestBackgroundStates.java
@@ -22,11 +22,11 @@ package org.apache.curator.framework.client;
import com.google.common.collect.Queues;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java b/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
index 5b6a5fa..83025af 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/client/TestResetConnectionWithBackgroundFailure.java
@@ -21,13 +21,13 @@ package org.apache.curator.framework.client;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.recipes.leader.LeaderSelector;
import org.apache.curator.framework.recipes.leader.LeaderSelectorListener;
import org.apache.curator.framework.recipes.leader.LeaderSelectorListenerAdapter;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/BaseClassForTests.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/BaseClassForTests.java
deleted file mode 100644
index 36e753c..0000000
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/BaseClassForTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.curator.framework.recipes;
-
-import org.apache.curator.test.TestingServer;
-import org.apache.curator.utils.DebugUtils;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-
-public class BaseClassForTests
-{
- protected TestingServer server;
-
- @BeforeMethod
- public void setup() throws Exception
- {
- System.setProperty(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES, "true");
- server = new TestingServer();
- }
-
- @AfterMethod
- public void teardown() throws Exception
- {
- server.close();
- }
-}
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestCachedAtomicCounter.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestCachedAtomicCounter.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestCachedAtomicCounter.java
index c0fe097..bdc03c2 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestCachedAtomicCounter.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestCachedAtomicCounter.java
@@ -20,8 +20,8 @@ package org.apache.curator.framework.recipes.atomic;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.concurrent.atomic.AtomicReference;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestDistributedAtomicLong.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestDistributedAtomicLong.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestDistributedAtomicLong.java
index cb7a839..c2e0888 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestDistributedAtomicLong.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/atomic/TestDistributedAtomicLong.java
@@ -21,11 +21,11 @@ package org.apache.curator.framework.recipes.atomic;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.curator.retry.RetryOneTime;
import org.apache.commons.math.stat.descriptive.SummaryStatistics;
import org.apache.commons.math.stat.descriptive.SynchronizedSummaryStatistics;
+import org.apache.curator.test.BaseClassForTests;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.testng.collections.Lists;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedBarrier.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedBarrier.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedBarrier.java
index 4926053..a870367 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedBarrier.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedBarrier.java
@@ -19,10 +19,10 @@
package org.apache.curator.framework.recipes.barriers;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
import org.apache.zookeeper.KeeperException;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedDoubleBarrier.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedDoubleBarrier.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedDoubleBarrier.java
index 53bfeda..24fd3cb 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedDoubleBarrier.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/barriers/TestDistributedDoubleBarrier.java
@@ -19,10 +19,10 @@
package org.apache.curator.framework.recipes.barriers;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.Timing;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
index c81619e..27af6ac 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
@@ -18,11 +18,11 @@
*/
package org.apache.curator.framework.recipes.cache;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.UnhandledErrorListener;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.KillSession;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/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 679d180..bf57ed8 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
@@ -22,8 +22,8 @@ import com.google.common.collect.Lists;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.UnhandledErrorListener;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.KillSession;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
index 1dcd352..b827e15 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
@@ -24,10 +24,10 @@ import com.google.common.collect.Lists;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
index a4ae2ba..87306a1 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelector.java
@@ -22,9 +22,9 @@ package org.apache.curator.framework.recipes.leader;
import com.google.common.collect.Lists;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.KillSession;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorEdges.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorEdges.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorEdges.java
index e89c958..d13fea7 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorEdges.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorEdges.java
@@ -23,9 +23,9 @@ import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.BackgroundCallback;
import org.apache.curator.framework.api.CuratorEvent;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryNTimes;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.server.ServerCnxnFactory;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
index 778a1b6..d7329ab 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorParticipants.java
@@ -19,10 +19,10 @@
package org.apache.curator.framework.recipes.leader;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryOneTime;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorWithExecutor.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorWithExecutor.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorWithExecutor.java
index c34a25f..214931b 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorWithExecutor.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderSelectorWithExecutor.java
@@ -18,10 +18,10 @@
*/
package org.apache.curator.framework.recipes.leader;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestChildReaper.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestChildReaper.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestChildReaper.java
index e9b91f7..309bd99 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestChildReaper.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestChildReaper.java
@@ -18,10 +18,10 @@
*/
package org.apache.curator.framework.recipes.locks;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.Timing;
import org.apache.zookeeper.data.Stat;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
index b1373fa..8b4ce46 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
@@ -20,10 +20,10 @@
package org.apache.curator.framework.recipes.locks;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.ExponentialBackoffRetry;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessReadWriteLock.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessReadWriteLock.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessReadWriteLock.java
index 5b44c7c..23c9eca 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessReadWriteLock.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessReadWriteLock.java
@@ -19,10 +19,10 @@
package org.apache.curator.framework.recipes.locks;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
import org.testng.Assert;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
index 798cb3e..dd3f98f 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
@@ -20,10 +20,10 @@
package org.apache.curator.framework.recipes.locks;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.recipes.shared.SharedCount;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockACLs.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockACLs.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockACLs.java
index e6e7418..2d9a9aa 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockACLs.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockACLs.java
@@ -19,12 +19,12 @@
package org.apache.curator.framework.recipes.locks;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.ACLProvider;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.ExponentialBackoffRetry;
import org.apache.curator.test.TestingServer;
import org.apache.zookeeper.ZooDefs;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockCleanlinessWithFaults.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockCleanlinessWithFaults.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockCleanlinessWithFaults.java
index 9843848..457be75 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockCleanlinessWithFaults.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestLockCleanlinessWithFaults.java
@@ -20,8 +20,8 @@ package org.apache.curator.framework.recipes.locks;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryNTimes;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.zookeeper.KeeperException;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestReaper.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestReaper.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestReaper.java
index 48868d5..83ec960 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestReaper.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestReaper.java
@@ -21,11 +21,11 @@ package org.apache.curator.framework.recipes.locks;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.recipes.leader.LeaderSelector;
import org.apache.curator.framework.recipes.leader.LeaderSelectorListener;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
import org.apache.zookeeper.CreateMode;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
index 35cb9e8..a07ee14 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNode.java
@@ -22,10 +22,10 @@ import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.KillSession;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNodeListener.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNodeListener.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNodeListener.java
index 82d5876..3a4eda8 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNodeListener.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/nodes/TestPersistentEphemeralNodeListener.java
@@ -21,10 +21,10 @@ package org.apache.curator.framework.recipes.nodes;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.TestingServer;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java
index 1acb051..edae618 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestBoundedDistributedQueue.java
@@ -20,9 +20,9 @@ package org.apache.curator.framework.recipes.queue;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
import org.apache.zookeeper.WatchedEvent;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedDelayQueue.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedDelayQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedDelayQueue.java
index ecce020..d6b592f 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedDelayQueue.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedDelayQueue.java
@@ -18,10 +18,10 @@
*/
package org.apache.curator.framework.recipes.queue;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
import org.apache.curator.test.Timing;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedIdQueue.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedIdQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedIdQueue.java
index 9b74199..30e552f 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedIdQueue.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedIdQueue.java
@@ -19,10 +19,10 @@
package org.apache.curator.framework.recipes.queue;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedPriorityQueue.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedPriorityQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedPriorityQueue.java
index e5c5e73..6c5ac7d 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedPriorityQueue.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedPriorityQueue.java
@@ -18,10 +18,10 @@
*/
package org.apache.curator.framework.recipes.queue;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedQueue.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedQueue.java
index 02fc5d6..80509bc 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedQueue.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestDistributedQueue.java
@@ -20,6 +20,7 @@ package org.apache.curator.framework.recipes.queue;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
@@ -27,7 +28,6 @@ import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.api.BackgroundCallback;
import org.apache.curator.framework.imps.CuratorFrameworkState;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.ExponentialBackoffRetry;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestQueueSharder.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestQueueSharder.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestQueueSharder.java
index e6f0d8e..7c4f298 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestQueueSharder.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestQueueSharder.java
@@ -22,10 +22,10 @@ import com.google.common.collect.Sets;
import org.apache.commons.math.stat.descriptive.SummaryStatistics;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.framework.state.ConnectionStateListener;
import org.apache.curator.retry.RetryOneTime;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestSimpleDistributedQueue.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestSimpleDistributedQueue.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestSimpleDistributedQueue.java
index 6d27340..dab1674 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestSimpleDistributedQueue.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/queue/TestSimpleDistributedQueue.java
@@ -18,10 +18,10 @@
*/
package org.apache.curator.framework.recipes.queue;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.retry.RetryOneTime;
import org.testng.Assert;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java
index 4ad8318..08f7263 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/shared/TestSharedCount.java
@@ -19,11 +19,11 @@
package org.apache.curator.framework.recipes.shared;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
-import org.apache.curator.framework.recipes.BaseClassForTests;
import org.apache.curator.framework.state.ConnectionState;
import org.apache.curator.retry.RetryOneTime;
import org.testng.Assert;
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-test/pom.xml
----------------------------------------------------------------------
diff --git a/curator-test/pom.xml b/curator-test/pom.xml
index 86ffd46..ca1f675 100644
--- a/curator-test/pom.xml
+++ b/curator-test/pom.xml
@@ -44,5 +44,11 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-math</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
new file mode 100644
index 0000000..767ae4e
--- /dev/null
+++ b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
@@ -0,0 +1,98 @@
+package org.apache.curator.test;
+
+import org.testng.IRetryAnalyzer;
+import org.testng.ITestContext;
+import org.testng.ITestNGMethod;
+import org.testng.ITestResult;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
+import java.net.BindException;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class BaseClassForTests
+{
+ protected TestingServer server;
+
+ private static final int RETRY_WAIT_MS = 5000;
+ private static final String INTERNAL_PROPERTY_DONT_LOG_CONNECTION_ISSUES;
+ static
+ {
+ String s = null;
+ try
+ {
+ // use reflection to avoid adding a circular dependency in the pom
+ s = (String)Class.forName("org.apache.curator.utils.DebugUtils").getField("PROPERTY_DONT_LOG_CONNECTION_ISSUES").get(null);
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace();
+ }
+ INTERNAL_PROPERTY_DONT_LOG_CONNECTION_ISSUES = s;
+ }
+
+ @BeforeSuite(alwaysRun = true)
+ public void beforeSuite(ITestContext context)
+ {
+ for ( ITestNGMethod method : context.getAllTestMethods() )
+ {
+ method.setRetryAnalyzer(new RetryTest());
+ }
+ }
+
+ @BeforeMethod
+ public void setup() throws Exception
+ {
+ if ( INTERNAL_PROPERTY_DONT_LOG_CONNECTION_ISSUES != null )
+ {
+ System.setProperty(INTERNAL_PROPERTY_DONT_LOG_CONNECTION_ISSUES, "true");
+ }
+
+ while ( server == null )
+ {
+ try
+ {
+ server = new TestingServer();
+ }
+ catch ( BindException e )
+ {
+ System.err.println("Getting bind exception - retrying to allocate server");
+ server = null;
+ }
+ }
+ }
+
+ @AfterMethod
+ public void teardown() throws Exception
+ {
+ server.close();
+ server = null;
+ }
+
+ private static class RetryTest implements IRetryAnalyzer
+ {
+ private final AtomicBoolean hasBeenRetried = new AtomicBoolean(false);
+
+ @Override
+ public boolean retry(ITestResult result)
+ {
+ boolean isRetrying = hasBeenRetried.compareAndSet(false, true);
+ if ( isRetrying )
+ {
+ System.err.println(String.format("Waiting " + RETRY_WAIT_MS + " ms and retrying test. Name: %s - TestName: %s ", result.getName(), result.getTestName()));
+ try
+ {
+ Thread.sleep(RETRY_WAIT_MS);
+ }
+ catch ( InterruptedException e )
+ {
+ System.err.println(String.format("Retry interrupted. Name: %s - TestName: %s ", result.getName(), result.getTestName()));
+ Thread.currentThread().interrupt();
+ isRetrying = false;
+ }
+ }
+ return isRetrying;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
index 2193acb..bb70da5 100644
--- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
+++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+
package org.apache.curator.test;
import org.apache.zookeeper.server.ServerCnxnFactory;
@@ -29,10 +30,12 @@ import java.io.IOException;
import java.lang.reflect.Field;
import java.nio.channels.ServerSocketChannel;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicReference;
public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeeperMainFace
{
- private final CountDownLatch latch = new CountDownLatch(1);
+ private final CountDownLatch latch = new CountDownLatch(1);
+ private final AtomicReference<Exception> startingException = new AtomicReference<Exception>(null);
private static final int MAX_WAIT_MS = 1000;
@@ -41,12 +44,12 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep
{
try
{
- Field cnxnFactoryField = ZooKeeperServerMain.class.getDeclaredField("cnxnFactory");
+ Field cnxnFactoryField = ZooKeeperServerMain.class.getDeclaredField("cnxnFactory");
cnxnFactoryField.setAccessible(true);
- ServerCnxnFactory cnxnFactory = (ServerCnxnFactory)cnxnFactoryField.get(this);
+ ServerCnxnFactory cnxnFactory = (ServerCnxnFactory)cnxnFactoryField.get(this);
cnxnFactory.closeAll();
- Field ssField = cnxnFactory.getClass().getDeclaredField("ss");
+ Field ssField = cnxnFactory.getClass().getDeclaredField("ss");
ssField.setAccessible(true);
ServerSocketChannel ss = (ServerSocketChannel)ssField.get(cnxnFactory);
ss.close();
@@ -62,10 +65,18 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep
@Override
public void runFromConfig(QuorumPeerConfig config) throws Exception
{
- ServerConfig serverConfig = new ServerConfig();
+ ServerConfig serverConfig = new ServerConfig();
serverConfig.readFrom(config);
latch.countDown();
- super.runFromConfig(serverConfig);
+ try
+ {
+ super.runFromConfig(serverConfig);
+ }
+ catch ( IOException e )
+ {
+ startingException.set(e);
+ throw e;
+ }
}
@Override
@@ -80,13 +91,13 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep
{
latch.await();
- ServerCnxnFactory cnxnFactory = getServerConnectionFactory();
+ ServerCnxnFactory cnxnFactory = getServerConnectionFactory();
if ( cnxnFactory != null )
{
- final ZooKeeperServer zkServer = getZooKeeperServer(cnxnFactory);
+ final ZooKeeperServer zkServer = getZooKeeperServer(cnxnFactory);
if ( zkServer != null )
{
- synchronized ( zkServer )
+ synchronized(zkServer)
{
if ( !zkServer.isRunning() )
{
@@ -95,6 +106,14 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep
}
}
}
+
+ Thread.sleep(1000);
+
+ Exception exception = startingException.get();
+ if ( exception != null )
+ {
+ throw exception;
+ }
}
@Override
@@ -104,13 +123,13 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep
try
{
- ServerCnxnFactory cnxnFactory = getServerConnectionFactory();
+ ServerCnxnFactory cnxnFactory = getServerConnectionFactory();
if ( cnxnFactory != null )
{
- ZooKeeperServer zkServer = getZooKeeperServer(cnxnFactory);
+ ZooKeeperServer zkServer = getZooKeeperServer(cnxnFactory);
if ( zkServer != null )
{
- ZKDatabase zkDb = zkServer.getZKDatabase();
+ ZKDatabase zkDb = zkServer.getZKDatabase();
if ( zkDb != null )
{
// make ZK server close its log files
@@ -127,9 +146,9 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep
private ServerCnxnFactory getServerConnectionFactory() throws Exception
{
- Field cnxnFactoryField = ZooKeeperServerMain.class.getDeclaredField("cnxnFactory");
+ Field cnxnFactoryField = ZooKeeperServerMain.class.getDeclaredField("cnxnFactory");
cnxnFactoryField.setAccessible(true);
- ServerCnxnFactory cnxnFactory;
+ ServerCnxnFactory cnxnFactory;
// Wait until the cnxnFactory field is non-null or up to 1s, whichever comes first.
long startTime = System.currentTimeMillis();
@@ -144,9 +163,9 @@ public class TestingZooKeeperMain extends ZooKeeperServerMain implements ZooKeep
private ZooKeeperServer getZooKeeperServer(ServerCnxnFactory cnxnFactory) throws Exception
{
- Field zkServerField = ServerCnxnFactory.class.getDeclaredField("zkServer");
+ Field zkServerField = ServerCnxnFactory.class.getDeclaredField("zkServer");
zkServerField.setAccessible(true);
- ZooKeeperServer zkServer;
+ ZooKeeperServer zkServer;
// Wait until the zkServer field is non-null or up to 1s, whichever comes first.
long startTime = System.currentTimeMillis();
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperServer.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperServer.java b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperServer.java
index be1a1b6..e706847 100644
--- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperServer.java
+++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperServer.java
@@ -135,7 +135,7 @@ public class TestingZooKeeperServer extends QuorumPeerMain implements Closeable
}
catch ( Exception e )
{
- logger.error(String.format("From testing server (random state: %s)", String.valueOf(configBuilder.isFromRandom())), e);
+ logger.error(String.format("From testing server (random state: %s) for instance: %s", String.valueOf(configBuilder.isFromRandom()), getInstanceSpec()), e);
}
}
}
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceCache.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceCache.java b/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceCache.java
index d1dc3bd..be114d4 100644
--- a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceCache.java
+++ b/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceCache.java
@@ -19,6 +19,7 @@
package org.apache.curator.x.discovery;
import com.google.common.collect.Lists;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.test.Timing;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
@@ -37,14 +38,12 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
-public class TestServiceCache
+public class TestServiceCache extends BaseClassForTests
{
@Test
public void testInitialLoad() throws Exception
{
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
@@ -106,8 +105,6 @@ public class TestServiceCache
Timing timing = new Timing();
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
@@ -155,8 +152,6 @@ public class TestServiceCache
public void testUpdate() throws Exception
{
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
@@ -209,8 +204,6 @@ public class TestServiceCache
public void testCache() throws Exception
{
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
http://git-wip-us.apache.org/repos/asf/curator/blob/351c67c9/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscovery.java
----------------------------------------------------------------------
diff --git a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscovery.java b/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscovery.java
index b615c74..354b88a 100644
--- a/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscovery.java
+++ b/curator-x-discovery/src/test/java/org/apache/curator/x/discovery/TestServiceDiscovery.java
@@ -20,6 +20,7 @@ package org.apache.curator.x.discovery;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
+import org.apache.curator.test.BaseClassForTests;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
@@ -38,7 +39,7 @@ import java.util.Comparator;
import java.util.List;
import java.util.concurrent.Semaphore;
-public class TestServiceDiscovery
+public class TestServiceDiscovery extends BaseClassForTests
{
private static final Comparator<ServiceInstance<Void>> comparator = new Comparator<ServiceInstance<Void>>()
{
@@ -53,8 +54,6 @@ public class TestServiceDiscovery
public void testCrashedServerMultiInstances() throws Exception
{
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
Timing timing = new Timing();
@@ -103,8 +102,6 @@ public class TestServiceDiscovery
public void testCrashedServer() throws Exception
{
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
Timing timing = new Timing();
@@ -151,8 +148,6 @@ public class TestServiceDiscovery
public void testCrashedInstance() throws Exception
{
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
Timing timing = new Timing();
@@ -190,8 +185,6 @@ public class TestServiceDiscovery
final String SERVICE_TWO = "two";
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
@@ -245,8 +238,6 @@ public class TestServiceDiscovery
public void testBasic() throws Exception
{
List<Closeable> closeables = Lists.newArrayList();
- TestingServer server = new TestingServer();
- closeables.add(server);
try
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));