From 972fffac7cf76fd5e6aadf586e6d2959b3750c76 Mon Sep 17 00:00:00 2001 From: tison Date: Thu, 15 Feb 2024 10:30:30 +0800 Subject: [PATCH] CURATOR-699. Upgrade ZooKeeper version to 3.9 (#496) Signed-off-by: tison --- .github/workflows/ci.yml | 2 +- .../transaction/CuratorTransactionResult.java | 9 +- .../framework/imps/TestTransactionsNew.java | 49 ++-- .../framework/imps/TestTransactionsOld.java | 22 +- .../framework/imps/TransactionsHelper.java | 30 +++ .../leader/ChaosMonkeyCnxnFactory.java | 11 +- .../leader/TestLeaderSelectorEdges.java | 8 +- curator-test-zk35/pom.xml | 2 +- curator-test-zk36/pom.xml | 1 - curator-test-zk37/pom.xml | 232 +++++++++++++++++ .../org/apache/curator/zk37}/TestIs37.java | 4 +- .../src/test/resources/log4j.properties | 25 ++ curator-test-zk38/pom.xml | 237 ++++++++++++++++++ .../org/apache/curator/zk38/TestIs38.java | 37 +++ .../src/test/resources/log4j.properties | 25 ++ .../test/compatibility/CuratorTestBase.java | 1 - pom.xml | 8 +- 17 files changed, 633 insertions(+), 70 deletions(-) create mode 100644 curator-framework/src/test/java/org/apache/curator/framework/imps/TransactionsHelper.java create mode 100644 curator-test-zk37/pom.xml rename {curator-client/src/test/java/org/apache/curator => curator-test-zk37/src/test/java/org/apache/curator/zk37}/TestIs37.java (94%) create mode 100644 curator-test-zk37/src/test/resources/log4j.properties create mode 100644 curator-test-zk38/pom.xml create mode 100644 curator-test-zk38/src/test/java/org/apache/curator/zk38/TestIs38.java create mode 100644 curator-test-zk38/src/test/resources/log4j.properties diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b532a93178..db9cba2e67 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 d0e5be84bb..bc710f72f4 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 ofTypeAndPath(final OperationType type, final String forPath) { - return new Predicate() { - @Override - public boolean apply(CuratorTransactionResult result) { - return (result.getType() == type) && result.getForPath().equals(forPath); - } - }; + public static Predicate 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 c10e0f46ea..8595dd06b2 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 void testErrors() throws Exception { CuratorOp createOp1 = client.transactionOp().create().forPath("/bar"); CuratorOp createOp2 = client.transactionOp().create().forPath("/z/blue"); final BlockingQueue 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 void testWithNamespace() throws Exception { Collection 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 void testBasic() throws Exception { Collection 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 void testBackground() throws Exception { CuratorOp createOp2 = client.transactionOp().create().forPath("/foo/bar", "snafu".getBytes()); final BlockingQueue> 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 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 void testBackgroundWithNamespace() throws Exception { CuratorOp deleteOp = client.transactionOp().delete().forPath("/foo/bar"); final BlockingQueue> 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 void processResult(CuratorFramework client, CuratorEvent event) throws Ex Collection 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 9d2a7fa538..961dcf8c0c 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 void testWithNamespace() throws Exception { .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 void testWithCompression() throws Exception { .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 void testBasic() throws Exception { .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-framework/src/test/java/org/apache/curator/framework/imps/TransactionsHelper.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TransactionsHelper.java new file mode 100644 index 0000000000..8b385e32a7 --- /dev/null +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TransactionsHelper.java @@ -0,0 +1,30 @@ +/* + * 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 com.google.common.base.Predicate; +import org.apache.curator.framework.api.transaction.CuratorTransactionResult; +import org.apache.curator.framework.api.transaction.OperationType; + +public class TransactionsHelper { + public static Predicate 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 e6109f87ce..f6c01c4ec2 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 void submitRequest(Request si) { && 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 0ca650c87d..6e8fcbbbab 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.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 static void resetCNXFactory() { /** * 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 void flappingTest() throws Exception { // 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 d9bfaf906a..cfb4599012 100644 --- a/curator-test-zk35/pom.xml +++ b/curator-test-zk35/pom.xml @@ -211,7 +211,7 @@ org.apache.curator:curator-recipes zk35TestCompatibility - zk36,zk37 + zk36 diff --git a/curator-test-zk36/pom.xml b/curator-test-zk36/pom.xml index 32261524de..5afd4733c0 100644 --- a/curator-test-zk36/pom.xml +++ b/curator-test-zk36/pom.xml @@ -225,7 +225,6 @@ org.apache.curator:curator-client zk36,zk35TestCompatibility - zk37 diff --git a/curator-test-zk37/pom.xml b/curator-test-zk37/pom.xml new file mode 100644 index 0000000000..ad8548a2ef --- /dev/null +++ b/curator-test-zk37/pom.xml @@ -0,0 +1,232 @@ + + + + + + org.apache.curator + apache-curator + 5.6.1-SNAPSHOT + + 4.0.0 + + curator-test-zk37 + + + 3.7.2 + + + + + org.apache.curator + curator-framework + + + org.apache.zookeeper + zookeeper + + + + + + org.apache.curator + curator-x-async + + + org.apache.zookeeper + zookeeper + + + + + + org.apache.curator + curator-recipes + + + org.apache.zookeeper + zookeeper + + + + + + org.apache.zookeeper + zookeeper + ${zookeeper-37-version} + + + com.sun.jmx + jmxri + + + com.sun.jdmk + jmxtools + + + javax.jms + jms + + + junit + junit + + + org.slf4j + slf4j-log4j12 + + + + + + org.apache.curator + curator-test + + + org.apache.zookeeper + zookeeper + + + test + + + + org.apache.curator + curator-recipes + + + org.apache.zookeeper + zookeeper + + + test-jar + test + + + + org.apache.curator + curator-framework + + + org.apache.zookeeper + zookeeper + + + test-jar + test + + + + org.apache.curator + curator-client + + + org.apache.zookeeper + zookeeper + + + test-jar + test + + + + org.apache.commons + commons-math + test + + + + org.assertj + assertj-core + test + + + + com.fasterxml.jackson.core + jackson-core + test + + + + com.fasterxml.jackson.core + jackson-databind + test + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + ${jackson-version} + test + + + + org.junit.jupiter + junit-jupiter-api + test + + + + org.awaitility + awaitility + test + + + + org.slf4j + slf4j-log4j12 + test + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + deploy + + true + + + deploy + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.curator:curator-framework + org.apache.curator:curator-recipes + org.apache.curator:curator-client + + master + + + + + 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 87217875d0..328092aa3e 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 ZOOKEEPER-3969 */ @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 0000000000..706484ce59 --- /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-zk38/pom.xml b/curator-test-zk38/pom.xml new file mode 100644 index 0000000000..678206e91a --- /dev/null +++ b/curator-test-zk38/pom.xml @@ -0,0 +1,237 @@ + + + + + + org.apache.curator + apache-curator + 5.6.1-SNAPSHOT + + 4.0.0 + + curator-test-zk38 + + + 3.8.3 + + + + + org.apache.curator + curator-framework + + + org.apache.zookeeper + zookeeper + + + + + + org.apache.curator + curator-x-async + + + org.apache.zookeeper + zookeeper + + + + + + org.apache.curator + curator-recipes + + + org.apache.zookeeper + zookeeper + + + + + + org.apache.zookeeper + zookeeper + ${zookeeper-38-version} + + + com.sun.jmx + jmxri + + + com.sun.jdmk + jmxtools + + + javax.jms + jms + + + junit + junit + + + org.slf4j + slf4j-log4j12 + + + ch.qos.logback + logback-classic + + + + + + org.apache.curator + curator-test + + + org.apache.zookeeper + zookeeper + + + test + + + + org.apache.curator + curator-recipes + + + org.apache.zookeeper + zookeeper + + + test-jar + test + + + + org.apache.curator + curator-framework + + + org.apache.zookeeper + zookeeper + + + test-jar + test + + + + org.apache.curator + curator-client + + + org.apache.zookeeper + zookeeper + + + test-jar + test + + + + org.apache.commons + commons-math + test + + + + org.assertj + assertj-core + test + + + + com.fasterxml.jackson.core + jackson-core + test + + + + com.fasterxml.jackson.core + jackson-databind + test + + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + ${jackson-version} + test + + + + org.junit.jupiter + junit-jupiter-api + test + + + + org.awaitility + awaitility + test + + + + org.slf4j + slf4j-log4j12 + test + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + deploy + + true + + + deploy + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.curator:curator-framework + org.apache.curator:curator-recipes + org.apache.curator:curator-client + + master + + + + + diff --git a/curator-test-zk38/src/test/java/org/apache/curator/zk38/TestIs38.java b/curator-test-zk38/src/test/java/org/apache/curator/zk38/TestIs38.java new file mode 100644 index 0000000000..2d35f88c7c --- /dev/null +++ b/curator-test-zk38/src/test/java/org/apache/curator/zk38/TestIs38.java @@ -0,0 +1,37 @@ +/* + * 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.zk38; + +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 TestIs38 extends CuratorTestBase { + @Test + public void testIsZk38() { + assertThat(Version.getVersion()).startsWith("3.8"); + } + + @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 0000000000..706484ce59 --- /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 47ff1e2747..8c2800b696 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 @@ 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 34dccdcb91..ceaddf3874 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ true - 3.7.2 + 3.9.1 5.1.4 3.10.0 3.2.0 @@ -352,6 +352,8 @@ curator-x-async curator-test-zk35 curator-test-zk36 + curator-test-zk37 + curator-test-zk38 @@ -558,6 +560,10 @@ org.slf4j slf4j-log4j12 + + ch.qos.logback + logback-classic +