You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ti...@apache.org on 2024/02/15 02:30:36 UTC
(curator) branch master updated: CURATOR-699. Upgrade ZooKeeper version to 3.9 (#496)
This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/curator.git
The following commit(s) were added to refs/heads/master by this push:
new 972fffac CURATOR-699. Upgrade ZooKeeper version to 3.9 (#496)
972fffac is described below
commit 972fffac7cf76fd5e6aadf586e6d2959b3750c76
Author: tison <wa...@gmail.com>
AuthorDate: Thu Feb 15 10:30:30 2024 +0800
CURATOR-699. Upgrade ZooKeeper version to 3.9 (#496)
Signed-off-by: tison <wa...@gmail.com>
---
.github/workflows/ci.yml | 2 +-
.../api/transaction/CuratorTransactionResult.java | 9 +---
.../framework/imps/TestTransactionsNew.java | 49 ++++++++--------------
.../framework/imps/TestTransactionsOld.java | 22 +++++-----
.../curator/framework/imps/TransactionsHelper.java | 16 +++----
.../recipes/leader/ChaosMonkeyCnxnFactory.java | 11 ++---
.../recipes/leader/TestLeaderSelectorEdges.java | 8 ++--
curator-test-zk35/pom.xml | 2 +-
curator-test-zk36/pom.xml | 1 -
{curator-test-zk36 => curator-test-zk37}/pom.xml | 9 ++--
.../java/org/apache/curator/zk37}/TestIs37.java | 4 +-
.../src/test/resources/log4j.properties | 25 +++++++++++
{curator-test-zk36 => curator-test-zk38}/pom.xml | 16 ++++---
.../java/org/apache/curator/zk38/TestIs38.java | 21 ++++++----
.../src/test/resources/log4j.properties | 25 +++++++++++
.../test/compatibility/CuratorTestBase.java | 1 -
pom.xml | 8 +++-
17 files changed, 133 insertions(+), 96 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b532a931..db9cba2e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -52,7 +52,7 @@ jobs:
unittest:
name: Unit tests
runs-on: ubuntu-latest
- timeout-minutes: 120
+ timeout-minutes: 180
strategy:
fail-fast: false
matrix:
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java b/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java
index d0e5be84..bc710f72 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/api/transaction/CuratorTransactionResult.java
@@ -43,13 +43,8 @@ public class CuratorTransactionResult {
* @param forPath path
* @return predicate
*/
- public static Predicate<CuratorTransactionResult> ofTypeAndPath(final OperationType type, final String forPath) {
- return new Predicate<CuratorTransactionResult>() {
- @Override
- public boolean apply(CuratorTransactionResult result) {
- return (result.getType() == type) && result.getForPath().equals(forPath);
- }
- };
+ public static Predicate<CuratorTransactionResult> ofTypeAndPath(OperationType type, String forPath) {
+ return result -> (result.getType() == type) && result.getForPath().equals(forPath);
}
public CuratorTransactionResult(OperationType type, String forPath, String resultPath, Stat resultStat) {
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsNew.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsNew.java
index c10e0f46..8595dd06 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsNew.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsNew.java
@@ -59,12 +59,7 @@ public class TestTransactionsNew extends BaseClassForTests {
CuratorOp createOp1 = client.transactionOp().create().forPath("/bar");
CuratorOp createOp2 = client.transactionOp().create().forPath("/z/blue");
final BlockingQueue<CuratorEvent> callbackQueue = new LinkedBlockingQueue<>();
- BackgroundCallback callback = new BackgroundCallback() {
- @Override
- public void processResult(CuratorFramework client, CuratorEvent event) throws Exception {
- callbackQueue.add(event);
- }
- };
+ BackgroundCallback callback = (client1, event) -> callbackQueue.add(event);
client.transaction().inBackground(callback).forOperations(createOp1, createOp2);
CuratorEvent event = callbackQueue.poll(new Timing().milliseconds(), TimeUnit.MILLISECONDS);
assertNotNull(event);
@@ -124,13 +119,13 @@ public class TestTransactionsNew extends BaseClassForTests {
Collection<CuratorTransactionResult> results =
client.transaction().forOperations(createOp1, createOp2, setDataOp, createOp3, deleteOp);
- assertTrue(client.checkExists().forPath("/foo") != null);
- assertTrue(client.usingNamespace(null).checkExists().forPath("/galt/foo") != null);
+ assertNotNull(client.checkExists().forPath("/foo"));
+ assertNotNull(client.usingNamespace(null).checkExists().forPath("/galt/foo"));
assertArrayEquals(client.getData().forPath("/foo"), "two".getBytes());
- assertTrue(client.checkExists().forPath("/foo/bar") == null);
+ assertNull(client.checkExists().forPath("/foo/bar"));
CuratorTransactionResult ephemeralResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/test-"));
assertNotNull(ephemeralResult);
assertNotEquals(ephemeralResult.getResultPath(), "/test-");
assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
@@ -149,13 +144,13 @@ public class TestTransactionsNew extends BaseClassForTests {
Collection<CuratorTransactionResult> results = client.transaction().forOperations(createOp1, createOp2);
- assertTrue(client.checkExists().forPath("/foo/bar") != null);
+ assertNotNull(client.checkExists().forPath("/foo/bar"));
assertArrayEquals(client.getData().forPath("/foo/bar"), "snafu".getBytes());
CuratorTransactionResult fooResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/foo"));
CuratorTransactionResult fooBarResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
assertNotNull(fooResult);
assertNotNull(fooBarResult);
assertNotSame(fooResult, fooBarResult);
@@ -175,23 +170,18 @@ public class TestTransactionsNew extends BaseClassForTests {
CuratorOp createOp2 = client.transactionOp().create().forPath("/foo/bar", "snafu".getBytes());
final BlockingQueue<List<CuratorTransactionResult>> queue = Queues.newLinkedBlockingQueue();
- BackgroundCallback callback = new BackgroundCallback() {
- @Override
- public void processResult(CuratorFramework client, CuratorEvent event) throws Exception {
- queue.add(event.getOpResults());
- }
- };
+ BackgroundCallback callback = (client1, event) -> queue.add(event.getOpResults());
client.transaction().inBackground(callback).forOperations(createOp1, createOp2);
Collection<CuratorTransactionResult> results = queue.poll(5, TimeUnit.SECONDS);
assertNotNull(results);
- assertTrue(client.checkExists().forPath("/foo/bar") != null);
+ assertNotNull(client.checkExists().forPath("/foo/bar"));
assertArrayEquals(client.getData().forPath("/foo/bar"), "snafu".getBytes());
CuratorTransactionResult fooResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/foo"));
CuratorTransactionResult fooBarResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
assertNotNull(fooResult);
assertNotNull(fooBarResult);
assertNotSame(fooResult, fooBarResult);
@@ -221,12 +211,7 @@ public class TestTransactionsNew extends BaseClassForTests {
CuratorOp deleteOp = client.transactionOp().delete().forPath("/foo/bar");
final BlockingQueue<List<CuratorTransactionResult>> queue = Queues.newLinkedBlockingQueue();
- BackgroundCallback callback = new BackgroundCallback() {
- @Override
- public void processResult(CuratorFramework client, CuratorEvent event) throws Exception {
- queue.add(event.getOpResults());
- }
- };
+ BackgroundCallback callback = (client1, event) -> queue.add(event.getOpResults());
client.transaction()
.inBackground(callback)
.forOperations(createOp1, createOp2, setDataOp, createOp3, deleteOp);
@@ -234,13 +219,13 @@ public class TestTransactionsNew extends BaseClassForTests {
Collection<CuratorTransactionResult> results = queue.poll(5, TimeUnit.SECONDS);
assertNotNull(results);
- assertTrue(client.checkExists().forPath("/foo") != null);
- assertTrue(client.usingNamespace(null).checkExists().forPath("/galt/foo") != null);
+ assertNotNull(client.checkExists().forPath("/foo"));
+ assertNotNull(client.usingNamespace(null).checkExists().forPath("/galt/foo"));
assertArrayEquals(client.getData().forPath("/foo"), "two".getBytes());
- assertTrue(client.checkExists().forPath("/foo/bar") == null);
+ assertNull(client.checkExists().forPath("/foo/bar"));
CuratorTransactionResult ephemeralResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/test-"));
assertNotNull(ephemeralResult);
assertNotEquals(ephemeralResult.getResultPath(), "/test-");
assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsOld.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsOld.java
index 9d2a7fa5..961dcf8c 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsOld.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestTransactionsOld.java
@@ -102,13 +102,13 @@ public class TestTransactionsOld extends BaseClassForTests {
.and()
.commit();
- assertTrue(client.checkExists().forPath("/foo") != null);
- assertTrue(client.usingNamespace(null).checkExists().forPath("/galt/foo") != null);
+ assertNotNull(client.checkExists().forPath("/foo"));
+ assertNotNull(client.usingNamespace(null).checkExists().forPath("/galt/foo"));
assertArrayEquals(client.getData().forPath("/foo"), "two".getBytes());
- assertTrue(client.checkExists().forPath("/foo/bar") == null);
+ assertNull(client.checkExists().forPath("/foo/bar"));
CuratorTransactionResult ephemeralResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/test-"));
assertNotNull(ephemeralResult);
assertNotEquals(ephemeralResult.getResultPath(), "/test-");
assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
@@ -154,20 +154,20 @@ public class TestTransactionsOld extends BaseClassForTests {
.and()
.commit();
- assertTrue(client.checkExists().forPath("/foo") != null);
+ assertNotNull(client.checkExists().forPath("/foo"));
assertArrayEquals(client.getData().decompressed().forPath("/foo"), "five".getBytes());
- assertTrue(client.checkExists().forPath("/bar") != null);
+ assertNotNull(client.checkExists().forPath("/bar"));
assertArrayEquals(client.getData().decompressed().forPath("/bar"), "two".getBytes());
assertEquals(client.getACL().forPath("/bar"), ZooDefs.Ids.READ_ACL_UNSAFE);
CuratorTransactionResult ephemeralResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/test-"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/test-"));
assertNotNull(ephemeralResult);
assertNotEquals(ephemeralResult.getResultPath(), "/test-");
assertTrue(ephemeralResult.getResultPath().startsWith("/test-"));
- assertTrue(client.checkExists().forPath("/baz") != null);
+ assertNotNull(client.checkExists().forPath("/baz"));
assertArrayEquals(client.getData().decompressed().forPath("/baz"), "four".getBytes());
assertEquals(client.getACL().forPath("/baz"), ZooDefs.Ids.READ_ACL_UNSAFE);
} finally {
@@ -189,13 +189,13 @@ public class TestTransactionsOld extends BaseClassForTests {
.and()
.commit();
- assertTrue(client.checkExists().forPath("/foo/bar") != null);
+ assertNotNull(client.checkExists().forPath("/foo/bar"));
assertArrayEquals(client.getData().forPath("/foo/bar"), "snafu".getBytes());
CuratorTransactionResult fooResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/foo"));
CuratorTransactionResult fooBarResult =
- Iterables.find(results, CuratorTransactionResult.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
+ Iterables.find(results, TransactionsHelper.ofTypeAndPath(OperationType.CREATE, "/foo/bar"));
assertNotNull(fooResult);
assertNotNull(fooBarResult);
assertNotSame(fooResult, fooBarResult);
diff --git a/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TransactionsHelper.java
similarity index 63%
copy from curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java
copy to curator-framework/src/test/java/org/apache/curator/framework/imps/TransactionsHelper.java
index 47ff1e27..8b385e32 100644
--- a/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TransactionsHelper.java
@@ -17,14 +17,14 @@
* under the License.
*/
-package org.apache.curator.test.compatibility;
+package org.apache.curator.framework.imps;
-import org.apache.curator.test.BaseClassForTests;
+import com.google.common.base.Predicate;
+import org.apache.curator.framework.api.transaction.CuratorTransactionResult;
+import org.apache.curator.framework.api.transaction.OperationType;
-public class CuratorTestBase extends BaseClassForTests {
- public static final String zk36Group = "zk36";
- public static final String zk37Group = "zk37";
- public static final String zk35TestCompatibilityGroup = "zk35TestCompatibility";
-
- protected final Timing2 timing = new Timing2();
+public class TransactionsHelper {
+ public static Predicate<CuratorTransactionResult> ofTypeAndPath(OperationType type, String forPath) {
+ return result -> (result.getType() == type) && result.getForPath().equals(forPath);
+ }
}
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
index e6109f87..f6c01c4e 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java
@@ -20,12 +20,10 @@
package org.apache.curator.framework.recipes.leader;
import java.io.IOException;
-import java.nio.ByteBuffer;
import org.apache.curator.test.Compatibility;
import org.apache.curator.test.TestingZooKeeperMain;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.proto.CreateRequest;
-import org.apache.zookeeper.server.ByteBufferInputStream;
import org.apache.zookeeper.server.NIOServerCnxnFactory;
import org.apache.zookeeper.server.Request;
import org.apache.zookeeper.server.ZooKeeperServer;
@@ -81,22 +79,19 @@ public class ChaosMonkeyCnxnFactory extends NIOServerCnxnFactory {
&& si.type != ZooDefs.OpCode.ping
&& firstError != 0
&& remaining > 0) {
- log.debug("Rejected : " + si.toString());
+ log.debug("Rejected : {}", si);
// Still reject request
log.debug("Still not ready for " + remaining + "ms");
Compatibility.serverCnxnClose(si.cnxn);
return;
}
// Submit the request to the legacy Zookeeper server
- log.debug("Applied : " + si.toString());
+ log.debug("Applied : {}", si);
super.submitRequest(si);
// Raise an error if a lock is created
if ((si.type == ZooDefs.OpCode.create) || (si.type == ZooDefs.OpCode.create2)) {
- CreateRequest createRequest = new CreateRequest();
try {
- ByteBuffer duplicate = si.request.duplicate();
- duplicate.rewind();
- ByteBufferInputStream.byteBuffer2Record(duplicate, createRequest);
+ CreateRequest createRequest = si.readRequestRecord(CreateRequest::new);
if (createRequest.getPath().startsWith(CHAOS_ZNODE_PREFIX) && firstError == 0) {
firstError = System.currentTimeMillis();
// The znode has been created, close the connection and don't tell it to client
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 0ca650c8..6e8fcbbb 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
@@ -36,13 +36,15 @@ import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.server.ServerCnxnFactory;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Test cases designed after CURATOR-45
+ * Test cases designed after CURATOR-45.
*/
+@Tag("master")
public class TestLeaderSelectorEdges extends BaseClassForTests {
private final Logger log = LoggerFactory.getLogger(getClass());
@@ -59,8 +61,6 @@ public class TestLeaderSelectorEdges extends BaseClassForTests {
/**
* Create a LeaderSelector but close the connection right after the "lock" znode
* has been created.
- *
- * @throws Exception
*/
@Test
public void flappingTest() throws Exception {
@@ -81,7 +81,7 @@ public class TestLeaderSelectorEdges extends BaseClassForTests {
// At this point the ChaosMonkeyZookeeperServer must close the connection
// right after the lock znode is created.
assertTrue(listener.reconnected.await(10, TimeUnit.SECONDS), "Connection has not been lost");
- // Check that leader ship has failed
+ // Check that leadership has failed
assertEquals(listener.takeLeadership.getCount(), 1);
// Wait FailedDelete
Thread.sleep(ChaosMonkeyCnxnFactory.LOCKOUT_DURATION_MS * 2);
diff --git a/curator-test-zk35/pom.xml b/curator-test-zk35/pom.xml
index d9bfaf90..cfb45990 100644
--- a/curator-test-zk35/pom.xml
+++ b/curator-test-zk35/pom.xml
@@ -211,7 +211,7 @@
<dependency>org.apache.curator:curator-recipes</dependency>
</dependenciesToScan>
<groups>zk35TestCompatibility</groups>
- <excludedGroups>zk36,zk37</excludedGroups>
+ <excludedGroups>zk36</excludedGroups>
</configuration>
</plugin>
</plugins>
diff --git a/curator-test-zk36/pom.xml b/curator-test-zk36/pom.xml
index 32261524..5afd4733 100644
--- a/curator-test-zk36/pom.xml
+++ b/curator-test-zk36/pom.xml
@@ -225,7 +225,6 @@
<dependency>org.apache.curator:curator-client</dependency>
</dependenciesToScan>
<groups>zk36,zk35TestCompatibility</groups>
- <excludedGroups>zk37</excludedGroups>
</configuration>
</plugin>
</plugins>
diff --git a/curator-test-zk36/pom.xml b/curator-test-zk37/pom.xml
similarity index 96%
copy from curator-test-zk36/pom.xml
copy to curator-test-zk37/pom.xml
index 32261524..ad8548a2 100644
--- a/curator-test-zk36/pom.xml
+++ b/curator-test-zk37/pom.xml
@@ -28,10 +28,10 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>curator-test-zk36</artifactId>
+ <artifactId>curator-test-zk37</artifactId>
<properties>
- <zookeeper-36-version>3.6.3</zookeeper-36-version>
+ <zookeeper-37-version>3.7.2</zookeeper-37-version>
</properties>
<dependencies>
@@ -71,7 +71,7 @@
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
- <version>${zookeeper-36-version}</version>
+ <version>${zookeeper-37-version}</version>
<exclusions>
<exclusion>
<groupId>com.sun.jmx</groupId>
@@ -224,8 +224,7 @@
<dependency>org.apache.curator:curator-recipes</dependency>
<dependency>org.apache.curator:curator-client</dependency>
</dependenciesToScan>
- <groups>zk36,zk35TestCompatibility</groups>
- <excludedGroups>zk37</excludedGroups>
+ <excludedGroups>master</excludedGroups>
</configuration>
</plugin>
</plugins>
diff --git a/curator-client/src/test/java/org/apache/curator/TestIs37.java b/curator-test-zk37/src/test/java/org/apache/curator/zk37/TestIs37.java
similarity index 94%
rename from curator-client/src/test/java/org/apache/curator/TestIs37.java
rename to curator-test-zk37/src/test/java/org/apache/curator/zk37/TestIs37.java
index 87217875..328092aa 100644
--- a/curator-client/src/test/java/org/apache/curator/TestIs37.java
+++ b/curator-test-zk37/src/test/java/org/apache/curator/zk37/TestIs37.java
@@ -17,12 +17,11 @@
* under the License.
*/
-package org.apache.curator;
+package org.apache.curator.zk37;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.apache.curator.test.compatibility.CuratorTestBase;
import org.apache.zookeeper.proto.WhoAmIResponse;
-import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
public class TestIs37 extends CuratorTestBase {
@@ -34,7 +33,6 @@ public class TestIs37 extends CuratorTestBase {
* @see <a href="https://issues.apache.org/jira/browse/ZOOKEEPER-3969">ZOOKEEPER-3969</a>
*/
@Test
- @Tag(zk37Group)
public void testIsZk37() throws Exception {
assertNotNull(Class.forName("org.apache.zookeeper.proto.WhoAmIResponse"));
}
diff --git a/curator-test-zk37/src/test/resources/log4j.properties b/curator-test-zk37/src/test/resources/log4j.properties
new file mode 100644
index 00000000..706484ce
--- /dev/null
+++ b/curator-test-zk37/src/test/resources/log4j.properties
@@ -0,0 +1,25 @@
+# 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.
+
+log4j.rootLogger=ERROR, console
+
+log4j.logger.org.apache.curator=DEBUG, console
+log4j.additivity.org.apache.curator=false
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%-5p %c %x %m [%t]%n
diff --git a/curator-test-zk36/pom.xml b/curator-test-zk38/pom.xml
similarity index 93%
copy from curator-test-zk36/pom.xml
copy to curator-test-zk38/pom.xml
index 32261524..678206e9 100644
--- a/curator-test-zk36/pom.xml
+++ b/curator-test-zk38/pom.xml
@@ -20,7 +20,8 @@
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.apache.curator</groupId>
<artifactId>apache-curator</artifactId>
@@ -28,10 +29,10 @@
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>curator-test-zk36</artifactId>
+ <artifactId>curator-test-zk38</artifactId>
<properties>
- <zookeeper-36-version>3.6.3</zookeeper-36-version>
+ <zookeeper-38-version>3.8.3</zookeeper-38-version>
</properties>
<dependencies>
@@ -71,7 +72,7 @@
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
- <version>${zookeeper-36-version}</version>
+ <version>${zookeeper-38-version}</version>
<exclusions>
<exclusion>
<groupId>com.sun.jmx</groupId>
@@ -93,6 +94,10 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
</exclusions>
</dependency>
@@ -224,8 +229,7 @@
<dependency>org.apache.curator:curator-recipes</dependency>
<dependency>org.apache.curator:curator-client</dependency>
</dependenciesToScan>
- <groups>zk36,zk35TestCompatibility</groups>
- <excludedGroups>zk37</excludedGroups>
+ <excludedGroups>master</excludedGroups>
</configuration>
</plugin>
</plugins>
diff --git a/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java b/curator-test-zk38/src/test/java/org/apache/curator/zk38/TestIs38.java
similarity index 64%
copy from curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java
copy to curator-test-zk38/src/test/java/org/apache/curator/zk38/TestIs38.java
index 47ff1e27..2d35f88c 100644
--- a/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java
+++ b/curator-test-zk38/src/test/java/org/apache/curator/zk38/TestIs38.java
@@ -17,14 +17,21 @@
* under the License.
*/
-package org.apache.curator.test.compatibility;
+package org.apache.curator.zk38;
-import org.apache.curator.test.BaseClassForTests;
+import static org.assertj.core.api.Assertions.assertThat;
+import org.apache.curator.test.compatibility.CuratorTestBase;
+import org.apache.zookeeper.Version;
+import org.junit.jupiter.api.Test;
-public class CuratorTestBase extends BaseClassForTests {
- public static final String zk36Group = "zk36";
- public static final String zk37Group = "zk37";
- public static final String zk35TestCompatibilityGroup = "zk35TestCompatibility";
+public class TestIs38 extends CuratorTestBase {
+ @Test
+ public void testIsZk38() {
+ assertThat(Version.getVersion()).startsWith("3.8");
+ }
- protected final Timing2 timing = new Timing2();
+ @Override
+ protected void createServer() {
+ // NOP
+ }
}
diff --git a/curator-test-zk38/src/test/resources/log4j.properties b/curator-test-zk38/src/test/resources/log4j.properties
new file mode 100644
index 00000000..706484ce
--- /dev/null
+++ b/curator-test-zk38/src/test/resources/log4j.properties
@@ -0,0 +1,25 @@
+# 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.
+
+log4j.rootLogger=ERROR, console
+
+log4j.logger.org.apache.curator=DEBUG, console
+log4j.additivity.org.apache.curator=false
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%-5p %c %x %m [%t]%n
diff --git a/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java b/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java
index 47ff1e27..8c2800b6 100644
--- a/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java
+++ b/curator-test/src/main/java/org/apache/curator/test/compatibility/CuratorTestBase.java
@@ -23,7 +23,6 @@ import org.apache.curator.test.BaseClassForTests;
public class CuratorTestBase extends BaseClassForTests {
public static final String zk36Group = "zk36";
- public static final String zk37Group = "zk37";
public static final String zk35TestCompatibilityGroup = "zk35TestCompatibility";
protected final Timing2 timing = new Timing2();
diff --git a/pom.xml b/pom.xml
index 34dccdcb..ceaddf38 100644
--- a/pom.xml
+++ b/pom.xml
@@ -72,7 +72,7 @@
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<!-- versions -->
- <zookeeper-version>3.7.2</zookeeper-version>
+ <zookeeper-version>3.9.1</zookeeper-version>
<maven-bundle-plugin-version>5.1.4</maven-bundle-plugin-version>
<maven-compiler-plugin-version>3.10.0</maven-compiler-plugin-version>
<maven-dependency-plugin-version>3.2.0</maven-dependency-plugin-version>
@@ -352,6 +352,8 @@
<module>curator-x-async</module>
<module>curator-test-zk35</module>
<module>curator-test-zk36</module>
+ <module>curator-test-zk37</module>
+ <module>curator-test-zk38</module>
</modules>
<dependencyManagement>
@@ -558,6 +560,10 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
</exclusions>
</dependency>