diff --git a/bookkeeper-benchmark/pom.xml b/bookkeeper-benchmark/pom.xml
index d910ee04a8b..2161747b8db 100644
--- a/bookkeeper-benchmark/pom.xml
+++ b/bookkeeper-benchmark/pom.xml
@@ -43,6 +43,17 @@
+
+ org.apache.bookkeeper
+ bookkeeper-server
+ ${project.version}
+
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.apache.zookeeper
zookeeper
@@ -61,12 +72,6 @@
metrics-core
test
-
- org.apache.bookkeeper
- bookkeeper-server
- ${project.version}
- compile
-
org.apache.bookkeeper
bookkeeper-common
diff --git a/bookkeeper-benchmark/src/test/resources/log4j.properties b/bookkeeper-benchmark/src/test/resources/log4j.properties
deleted file mode 100644
index c0d9a42134e..00000000000
--- a/bookkeeper-benchmark/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,72 +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.
-#
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only
-log4j.rootLogger=INFO, CONSOLE
-
-# Example with rolling log file
-#log4j.rootLogger=DEBUG, CONSOLE, ROLLINGFILE
-
-# Example with rolling log file and tracing
-#log4j.rootLogger=TRACE, CONSOLE, ROLLINGFILE, TRACEFILE
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.ROLLINGFILE.Threshold=DEBUG
-log4j.appender.ROLLINGFILE.File=bookkeeper-benchmark.log
-log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Max log file size of 10MB
-log4j.appender.ROLLINGFILE.MaxFileSize=10MB
-# uncomment the next line to limit number of backup files
-#log4j.appender.ROLLINGFILE.MaxBackupIndex=10
-
-log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n
-
-
-#
-# Add TRACEFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-log4j.appender.TRACEFILE=org.apache.log4j.FileAppender
-log4j.appender.TRACEFILE.Threshold=TRACE
-log4j.appender.TRACEFILE.File=bookkeeper_trace.log
-
-log4j.appender.TRACEFILE.layout=org.apache.log4j.PatternLayout
-### Notice we are including log4j's NDC here (%x)
-log4j.appender.TRACEFILE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L][%x] - %m%n
diff --git a/bookkeeper-common/build.gradle b/bookkeeper-common/build.gradle
index 9699d0937e2..c133ac7769b 100644
--- a/bookkeeper-common/build.gradle
+++ b/bookkeeper-common/build.gradle
@@ -45,7 +45,6 @@ dependencies {
testImplementation depLibs.hamcrest
testImplementation depLibs.junit
testImplementation depLibs.log4jSlf4jImpl
- testImplementation depLibs.log4j12api
testImplementation depLibs.log4jCore
testImplementation depLibs.mockito
diff --git a/bookkeeper-common/pom.xml b/bookkeeper-common/pom.xml
index 01826f57080..c88a002f807 100644
--- a/bookkeeper-common/pom.xml
+++ b/bookkeeper-common/pom.xml
@@ -75,20 +75,15 @@
rxjava
- org.apache.commons
- commons-lang3
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
test
- org.slf4j
- slf4j-api
- ${slf4j.version}
-
-
- org.apache.logging.log4j
- log4j-1.2-api
- ${log4j.version}
- test
+ org.apache.commons
+ commons-lang3
+ test
org.apache.logging.log4j
diff --git a/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestOrderedExecutorDecorators.java b/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestOrderedExecutorDecorators.java
index f8d53b496d8..d12c19ee20a 100644
--- a/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestOrderedExecutorDecorators.java
+++ b/bookkeeper-common/src/test/java/org/apache/bookkeeper/common/util/TestOrderedExecutorDecorators.java
@@ -34,8 +34,8 @@
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;
-import org.apache.log4j.MDC;
import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.ThreadContext;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.appender.NullAppender;
@@ -62,7 +62,7 @@ public static String mdcFormat(Object mdc, String message) {
@Before
public void setUp() throws Exception {
- MDC.clear();
+ ThreadContext.clearMap();
LoggerContext lc = (LoggerContext) org.apache.logging.log4j.LogManager.getContext(false);
mockAppender = spy(NullAppender.createAppender(UUID.randomUUID().toString()));
mockAppender.start();
@@ -83,7 +83,7 @@ public void tearDown() throws Exception {
lc.getRootLogger().removeAppender(lc.getConfiguration().getAppender(mockAppender.getName()));
lc.updateLoggers();
capturedEvents.clear();
- MDC.clear();
+ ThreadContext.clearMap();
}
@Test
@@ -92,7 +92,7 @@ public void testMDCInvokeOrdered() throws Exception {
.name("test").numThreads(20).preserveMdcForTaskExecution(true).build();
try {
- MDC.put(MDC_KEY, "testMDCInvokeOrdered");
+ ThreadContext.put(MDC_KEY, "testMDCInvokeOrdered");
executor.submitOrdered(10, () -> {
log.info("foobar");
return 10;
@@ -110,7 +110,7 @@ public void testMDCInvokeDirectOnChosen() throws Exception {
.name("test").numThreads(20).preserveMdcForTaskExecution(true).build();
try {
- MDC.put(MDC_KEY, "testMDCInvokeOrdered");
+ ThreadContext.put(MDC_KEY, "testMDCInvokeOrdered");
executor.chooseThread(10).submit(() -> {
log.info("foobar");
return 10;
@@ -130,7 +130,7 @@ public void testMDCScheduleOrdered() throws Exception {
.name("test").numThreads(20).preserveMdcForTaskExecution(true).build();
try {
- MDC.put(MDC_KEY, "testMDCInvokeOrdered");
+ ThreadContext.put(MDC_KEY, "testMDCInvokeOrdered");
scheduler.scheduleOrdered(10, safeRun(() -> {
log.info("foobar");
}), 0, TimeUnit.DAYS).get();
@@ -147,7 +147,7 @@ public void testMDCScheduleDirectOnChosen() throws Exception {
.name("test").numThreads(20).preserveMdcForTaskExecution(true).build();
try {
- MDC.put(MDC_KEY, "testMDCInvokeOrdered");
+ ThreadContext.put(MDC_KEY, "testMDCInvokeOrdered");
scheduler.chooseThread(10).schedule(safeRun(() -> {
log.info("foobar");
}), 0, TimeUnit.DAYS).get();
diff --git a/bookkeeper-common/src/test/resources/log4j.properties b/bookkeeper-common/src/test/resources/log4j.properties
deleted file mode 100644
index 10ae6bfcbba..00000000000
--- a/bookkeeper-common/src/test/resources/log4j.properties
+++ /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.
-#
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-bookkeeper.root.logger=INFO,CONSOLE
-log4j.rootLogger=${bookkeeper.root.logger}
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
index b2223d510d3..1ff2c942f56 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-all.bin.txt
@@ -311,7 +311,7 @@ Apache Software License, Version 2.
- lib/io.dropwizard.metrics-metrics-jvm-3.2.5.jar [47]
- lib/io.perfmark-perfmark-api-0.23.0.jar [48]
- lib/org.conscrypt-conscrypt-openjdk-uber-2.5.1.jar [49]
-- lib/org.xerial.snappy-snappy-java-1.1.7.jar [50]
+- lib/org.xerial.snappy-snappy-java-1.1.7.7.jar [50]
- lib/io.reactivex.rxjava3-rxjava-3.0.1.jar [51]
[1] Source available at https://github.com/FasterXML/jackson-annotations/tree/jackson-annotations-2.11.0
@@ -360,7 +360,7 @@ Apache Software License, Version 2.
[47] Source available at https://github.com/dropwizard/metrics/releases/tag/v3.2.5
[48] Source available at https://github.com/perfmark/perfmark/releases/tag/v0.23.0
[49] Source available at https://github.com/google/conscrypt/releases/tag/2.5.1
-[50] Source available at https://github.com/google/snappy/releases/tag/1.1.7
+[50] Source available at https://github.com/google/snappy/releases/tag/1.1.7.7
[51] Source available at https://github.com/ReactiveX/RxJava/tree/v3.0.1
------------------------------------------------------------------------------------
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
index 1e9c2b56ec2..19eaf8af3d9 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-bkctl.bin.txt
@@ -288,7 +288,7 @@ Apache Software License, Version 2.
- lib/io.dropwizard.metrics-metrics-core-3.2.5.jar [46]
- lib/io.perfmark-perfmark-api-0.23.0.jar [47]
- lib/org.conscrypt-conscrypt-openjdk-uber-2.5.1.jar [49]
-- lib/org.xerial.snappy-snappy-java-1.1.7.jar [50]
+- lib/org.xerial.snappy-snappy-java-1.1.7.7.jar [50]
- lib/io.reactivex.rxjava3-rxjava-3.0.1.jar [51]
[1] Source available at https://github.com/FasterXML/jackson-annotations/tree/jackson-annotations-2.11.0
@@ -329,7 +329,7 @@ Apache Software License, Version 2.
[46] Source available at https://github.com/dropwizard/metrics/releases/tag/v3.1.0
[47] Source available at https://github.com/perfmark/perfmark/releases/tag/v0.23.0
[49] Source available at https://github.com/google/conscrypt/releases/tag/2.5.1
-[50] Source available at https://github.com/google/snappy/releases/tag/1.1.7
+[50] Source available at https://github.com/google/snappy/releases/tag/1.1.7.7
[51] Source available at https://github.com/ReactiveX/RxJava/tree/v3.0.1
------------------------------------------------------------------------------------
diff --git a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
index a01249ff4e7..73cb344fa29 100644
--- a/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
+++ b/bookkeeper-dist/src/main/resources/LICENSE-server.bin.txt
@@ -309,7 +309,7 @@ Apache Software License, Version 2.
- lib/io.dropwizard.metrics-metrics-core-3.2.5.jar [47]
- lib/io.perfmark-perfmark-api-0.23.0.jar [48]
- lib/org.conscrypt-conscrypt-openjdk-uber-2.5.1.jar [49]
-- lib/org.xerial.snappy-snappy-java-1.1.7.jar [50]
+- lib/org.xerial.snappy-snappy-java-1.1.7.7.jar [50]
- lib/io.reactivex.rxjava3-rxjava-3.0.1.jar [51]
[1] Source available at https://github.com/FasterXML/jackson-annotations/tree/jackson-annotations-2.11.0
@@ -358,7 +358,7 @@ Apache Software License, Version 2.
[47] Source available at https://github.com/dropwizard/metrics/releases/tag/v3.2.5
[48] Source available at https://github.com/perfmark/perfmark/releases/tag/v0.23.0
[49] Source available at https://github.com/google/conscrypt/releases/tag/2.5.1
-[50] Source available at https://github.com/google/snappy/releases/tag/1.1.7
+[50] Source available at https://github.com/google/snappy/releases/tag/1.1.7.7
[51] Source available at https://github.com/ReactiveX/RxJava/tree/v3.0.1
------------------------------------------------------------------------------------
diff --git a/bookkeeper-http/http-server/pom.xml b/bookkeeper-http/http-server/pom.xml
index b05d651bcb4..b14ad46a91e 100644
--- a/bookkeeper-http/http-server/pom.xml
+++ b/bookkeeper-http/http-server/pom.xml
@@ -28,10 +28,6 @@
Apache BookKeeper :: Http :: Http Server
http://maven.apache.org
-
- commons-configuration
- commons-configuration
-
com.fasterxml.jackson.core
jackson-core
diff --git a/bookkeeper-server/build.gradle b/bookkeeper-server/build.gradle
index 2d48d6b2779..cef8e64e1e0 100644
--- a/bookkeeper-server/build.gradle
+++ b/bookkeeper-server/build.gradle
@@ -57,6 +57,7 @@ dependencies {
runtimeOnly depLibs.metricsCore
runtimeOnly depLibs.snappy
+ testImplementation project(':testtools')
testImplementation project(':bookkeeper-stats-providers:prometheus-metrics-provider')
testImplementation project(':bookkeeper-http:vertx-http-server')
testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts')
@@ -76,7 +77,6 @@ dependencies {
annotationProcessor depLibs.lombok
testAnnotationProcessor depLibs.lombok
testImplementation depLibs.log4jSlf4jImpl
- testImplementation depLibs.log4j12api
testImplementation depLibs.log4jCore
}
diff --git a/bookkeeper-server/pom.xml b/bookkeeper-server/pom.xml
index c21a2d69d00..b51615c5844 100644
--- a/bookkeeper-server/pom.xml
+++ b/bookkeeper-server/pom.xml
@@ -50,10 +50,10 @@
rocksdbjni
- org.apache.logging.log4j
- log4j-1.2-api
- ${log4j.version}
- test
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
org.apache.logging.log4j
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java
index d62c8697c2b..222e268078d 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerStorageCheckpointTest.java
@@ -79,7 +79,7 @@
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest(SyncThread.class)
-@PowerMockIgnore("javax.*")
+@PowerMockIgnore({"java.*", "javax.*", "org.slf4j.*"})
public class LedgerStorageCheckpointTest {
private static final Logger LOG = LoggerFactory
.getLogger(LedgerStorageCheckpointTest.class);
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MdcContextTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MdcContextTest.java
index 51d66d84059..055ac0d9289 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MdcContextTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/MdcContextTest.java
@@ -43,7 +43,7 @@
import org.apache.bookkeeper.bookie.LedgerDirsManager;
import org.apache.bookkeeper.conf.ClientConfiguration;
import org.apache.bookkeeper.test.BookKeeperClusterTestCase;
-import org.apache.log4j.MDC;
+import org.apache.logging.log4j.ThreadContext;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.appender.NullAppender;
@@ -87,7 +87,7 @@ public MdcContextTest() {
public static String mdcFormat(Object mdc, String message) {
return mdc == null
? "[" + MDC_REQUEST_ID + ":] - " + message
- : "[" + MDC_REQUEST_ID + ":" + mdc.toString()
+ : "[" + MDC_REQUEST_ID + ":" + mdc
+ "] - " + message;
}
@@ -107,13 +107,13 @@ public void setUp() throws Exception {
.setMetadataServiceUri(zkUtil.getMetadataServiceUri())
.setPreserveMdcForTaskExecution(true);
- MDC.clear();
+ ThreadContext.clearMap();
bkc = new BookKeeper(conf);
- MDC.put(MDC_REQUEST_ID, "ledger_create");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_create");
log.info("creating ledger");
lh = bkc.createLedgerAdv(3, 3, 3, BookKeeper.DigestType.CRC32, new byte[] {});
- MDC.clear();
+ ThreadContext.clearMap();
LoggerContext lc = (LoggerContext) org.apache.logging.log4j.LogManager.getContext(false);
mockAppender = spy(NullAppender.createAppender(UUID.randomUUID().toString()));
@@ -138,13 +138,13 @@ public void tearDown() throws Exception {
lc.getRootLogger().removeAppender(lc.getConfiguration().getAppender(mockAppender.getName()));
lc.updateLoggers();
capturedEvents = null;
- MDC.clear();
+ ThreadContext.clearMap();
super.tearDown();
}
@Test
public void testLedgerCreateFails() throws Exception {
- MDC.put(MDC_REQUEST_ID, "ledger_create_fail");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_create_fail");
try {
bkc.createLedgerAdv(99, 3, 2, BookKeeper.DigestType.CRC32, new byte[]{});
Assert.fail("should not get here");
@@ -156,7 +156,7 @@ public void testLedgerCreateFails() throws Exception {
@Test
public void testSimpleAdd() throws Exception {
- MDC.put(MDC_REQUEST_ID, "ledger_add_entry");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_add_entry");
lh.addEntry(0, entry);
// client msg
@@ -171,7 +171,7 @@ public void testAddWithEnsembleChange() throws Exception {
startNewBookie();
killBookie(0);
- MDC.put(MDC_REQUEST_ID, "ledger_add_entry");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_add_entry");
lh.addEntry(1, entry);
assertLogWithMdc("ledger_add_entry", "Could not connect to bookie");
assertLogWithMdc("ledger_add_entry", "Failed to write entry");
@@ -189,7 +189,7 @@ public void testAddFailsWithReadOnlyBookie() throws Exception {
ledgerDirsManager.addToFilledDirs(new File(ledgerDirs[0], "current"));
}
- MDC.put(MDC_REQUEST_ID, "ledger_add_entry");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_add_entry");
try {
lh.addEntry(0, entry);
Assert.fail("should not get here");
@@ -209,7 +209,7 @@ public void testAddFailsWithReadOnlyBookie() throws Exception {
public void testAddFailsDuplicateEntry() throws Exception {
lh.addEntry(0, entry);
- MDC.put(MDC_REQUEST_ID, "ledger_add_duplicate_entry");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_add_duplicate_entry");
try {
lh.addEntry(0, entry);
Assert.fail("should not get here");
@@ -223,7 +223,7 @@ public void testAddFailsDuplicateEntry() throws Exception {
@Test
public void testReadEntryBeyondLac() throws Exception {
- MDC.put(MDC_REQUEST_ID, "ledger_read_entry");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_read_entry");
try {
lh.readEntries(100, 100);
@@ -240,7 +240,7 @@ public void testReadFromDeletedLedger() throws Exception {
lh.close();
bkc.deleteLedger(lh.ledgerId);
- MDC.put(MDC_REQUEST_ID, "ledger_read_entry");
+ ThreadContext.put(MDC_REQUEST_ID, "ledger_read_entry");
try {
lh.readEntries(100, 100);
diff --git a/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/AbstractZkLedgerManagerTest.java b/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/AbstractZkLedgerManagerTest.java
index f9de13d855a..5c6a514a7e1 100644
--- a/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/AbstractZkLedgerManagerTest.java
+++ b/bookkeeper-server/src/test/java/org/apache/bookkeeper/meta/AbstractZkLedgerManagerTest.java
@@ -78,6 +78,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
@@ -85,6 +86,7 @@
* Unit test of {@link AbstractZkLedgerManager}.
*/
@RunWith(PowerMockRunner.class)
+@PowerMockIgnore("javax.management.*")
@PrepareForTest({ AbstractZkLedgerManager.class, ZkUtils.class })
public class AbstractZkLedgerManagerTest extends MockZooKeeperTestCase {
diff --git a/bookkeeper-server/src/test/resources/log4j.properties b/bookkeeper-server/src/test/resources/log4j.properties
deleted file mode 100644
index 10ae6bfcbba..00000000000
--- a/bookkeeper-server/src/test/resources/log4j.properties
+++ /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.
-#
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-bookkeeper.root.logger=INFO,CONSOLE
-log4j.rootLogger=${bookkeeper.root.logger}
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO
diff --git a/bookkeeper-slogger/slf4j/pom.xml b/bookkeeper-slogger/slf4j/pom.xml
index b442035175b..0f3c98ef3f1 100644
--- a/bookkeeper-slogger/slf4j/pom.xml
+++ b/bookkeeper-slogger/slf4j/pom.xml
@@ -30,9 +30,5 @@
bookkeeper-slogger-api
${project.parent.version}
-
- org.slf4j
- slf4j-api
-
diff --git a/bookkeeper-stats/pom.xml b/bookkeeper-stats/pom.xml
index 41736c43527..76a6cf21ceb 100644
--- a/bookkeeper-stats/pom.xml
+++ b/bookkeeper-stats/pom.xml
@@ -55,9 +55,5 @@
-
- commons-configuration
- commons-configuration
-
diff --git a/circe-checksum/build.gradle b/circe-checksum/build.gradle
index dca984be77a..12d9f5f730c 100644
--- a/circe-checksum/build.gradle
+++ b/circe-checksum/build.gradle
@@ -25,6 +25,9 @@ dependencies {
implementation depLibs.guava
implementation depLibs.nettyBuffer
implementation depLibs.slf4j
+
+ testImplementation project(':testtools')
+
testImplementation depLibs.junit
testImplementation depLibs.mockito
}
diff --git a/circe-checksum/pom.xml b/circe-checksum/pom.xml
index 6f986e1fe8f..dd76177f527 100644
--- a/circe-checksum/pom.xml
+++ b/circe-checksum/pom.xml
@@ -50,6 +50,12 @@
netty-buffer
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
diff --git a/circe-checksum/src/test/resources/log4j.properties b/circe-checksum/src/test/resources/log4j.properties
deleted file mode 100644
index 10ae6bfcbba..00000000000
--- a/circe-checksum/src/test/resources/log4j.properties
+++ /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.
-#
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-bookkeeper.root.logger=INFO,CONSOLE
-log4j.rootLogger=${bookkeeper.root.logger}
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO
diff --git a/dependencies.gradle b/dependencies.gradle
index c68c0ed6168..e96c42909ae 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -82,7 +82,7 @@ depVersions = [
spotbugsAnnotations: "3.1.8",
protocGenGrpcJava: "1.12.0",
shrinkwrap:"3.1.4",
- snappy: "1.1.7",
+ snappy: "1.1.7.7",
thrift: "0.14.2",
testcontainers: "1.16.3",
vertx: "3.9.8",
diff --git a/metadata-drivers/etcd/build.gradle b/metadata-drivers/etcd/build.gradle
index 7ab75594865..0004b783cd4 100644
--- a/metadata-drivers/etcd/build.gradle
+++ b/metadata-drivers/etcd/build.gradle
@@ -36,6 +36,7 @@ dependencies {
testImplementation depLibs.arquillianCubeDocker
testImplementation depLibs.arquillianJunitStandalone
testImplementation depLibs.testcontainers
+ testImplementation project(':testtools')
testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts')
testImplementation project(path: ':bookkeeper-server', configuration: 'testArtifacts')
testImplementation depLibs.dockerJava
diff --git a/metadata-drivers/etcd/pom.xml b/metadata-drivers/etcd/pom.xml
index c907200600c..1a769c1ed4e 100644
--- a/metadata-drivers/etcd/pom.xml
+++ b/metadata-drivers/etcd/pom.xml
@@ -90,6 +90,12 @@
testcontainers
test
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.apache.bookkeeper
bookkeeper-common
diff --git a/metadata-drivers/etcd/src/test/resources/log4j.properties b/metadata-drivers/etcd/src/test/resources/log4j.properties
deleted file mode 100644
index e6e9f783730..00000000000
--- a/metadata-drivers/etcd/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,39 +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.
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-bookkeeper.root.logger=INFO,CONSOLE
-log4j.rootLogger=${bookkeeper.root.logger}
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO
diff --git a/microbenchmarks/pom.xml b/microbenchmarks/pom.xml
index 297f37aab23..746421cfc8f 100644
--- a/microbenchmarks/pom.xml
+++ b/microbenchmarks/pom.xml
@@ -38,10 +38,6 @@
jmh-generator-annprocess
provided
-
- org.slf4j
- slf4j-api
-
org.apache.logging.log4j
log4j-1.2-api
diff --git a/pom.xml b/pom.xml
index b2e6f96067d..dfcbaf29c64 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,7 @@
bookkeeper-slogger
tests
native-io
+ testtools
@@ -176,7 +177,7 @@
1.15.1
3.9.8
3.8.0
- 1.1.7
+ 1.1.7.7
2.1.2
0.12
@@ -1219,9 +1220,19 @@
- --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
- --add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
+ --add-opens java.base/java.lang=ALL-UNNAMED
+ --add-opens java.base/java.nio=ALL-UNNAMED
+ --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED
+ --add-opens java.base/java.util=ALL-UNNAMED
+ --add-opens java.base/java.util.concurrent=ALL-UNNAMED
+ --add-opens java.base/java.util.stream=ALL-UNNAMED
+ --add-opens java.base/java.time=ALL-UNNAMED
+ --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
+ --add-opens java.base/sun.net.dns=ALL-UNNAMED
+ --add-opens java.base/sun.nio.ch=ALL-UNNAMED
+ --add-opens java.base/sun.security.jca=ALL-UNNAMED
+ --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED
diff --git a/settings.gradle b/settings.gradle
index 550476e3f3b..1483afef51f 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -99,7 +99,9 @@ include(':bookkeeper-benchmark',
'tests:scripts',
'tests:shaded:bookkeeper-server-shaded-test',
'tests:shaded:bookkeeper-server-tests-shaded-test',
- 'tests:shaded:distributedlog-core-shaded-test')
+ 'tests:shaded:distributedlog-core-shaded-test',
+ 'testtools',
+)
project(':bookkeeper-tools').projectDir = file('tools/all')
project(':bookkeeper-tools-framework').projectDir = file('tools/framework')
diff --git a/stream/clients/java/all/build.gradle b/stream/clients/java/all/build.gradle
index a3a2ea3e500..84ff33ad546 100644
--- a/stream/clients/java/all/build.gradle
+++ b/stream/clients/java/all/build.gradle
@@ -30,6 +30,7 @@ dependencies {
compileOnly depLibs.lombok
implementation depLibs.slf4j
+ testImplementation project(':testtools')
testImplementation project(path: ':stream:clients:java:base', configuration: 'testArtifacts')
testImplementation depLibs.mockito
testImplementation depLibs.powermockJunit
diff --git a/stream/clients/java/all/pom.xml b/stream/clients/java/all/pom.xml
index 4892885826d..0130d73bd01 100644
--- a/stream/clients/java/all/pom.xml
+++ b/stream/clients/java/all/pom.xml
@@ -31,6 +31,12 @@
stream-storage-java-kv-client
${project.parent.version}
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.apache.bookkeeper
stream-storage-java-client-base
diff --git a/stream/clients/java/all/src/test/resources/log4j.properties b/stream/clients/java/all/src/test/resources/log4j.properties
deleted file mode 100644
index e651cb4b6e5..00000000000
--- a/stream/clients/java/all/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,53 +0,0 @@
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=zstream.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/clients/java/base/build.gradle b/stream/clients/java/base/build.gradle
index a855902b73e..0659084676c 100644
--- a/stream/clients/java/base/build.gradle
+++ b/stream/clients/java/base/build.gradle
@@ -31,6 +31,8 @@ dependencies {
compileOnly depLibs.lombok
implementation depLibs.slf4j
+ testImplementation project(':testtools')
+
testImplementation depLibs.mockito
testImplementation depLibs.freebuilder
diff --git a/stream/clients/java/base/pom.xml b/stream/clients/java/base/pom.xml
index ac4c9e4ed53..e7b2eefed87 100644
--- a/stream/clients/java/base/pom.xml
+++ b/stream/clients/java/base/pom.xml
@@ -36,6 +36,12 @@
stream-storage-proto
${project.parent.version}
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
diff --git a/stream/clients/java/base/src/test/resources/log4j.properties b/stream/clients/java/base/src/test/resources/log4j.properties
deleted file mode 100644
index 9405038b2b8..00000000000
--- a/stream/clients/java/base/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,51 +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.
-#
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=stream.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/clients/java/kv/build.gradle b/stream/clients/java/kv/build.gradle
index 3df6167cd14..de85b5ba71b 100644
--- a/stream/clients/java/kv/build.gradle
+++ b/stream/clients/java/kv/build.gradle
@@ -30,6 +30,7 @@ dependencies {
implementation depLibs.protobuf
implementation depLibs.slf4j
compileOnly depLibs.jsr305
+ testImplementation project(':testtools')
testImplementation project(path: ':stream:clients:java:base', configuration: 'testArtifacts')
testImplementation depLibs.mockito
testImplementation depLibs.junit
diff --git a/stream/clients/java/kv/pom.xml b/stream/clients/java/kv/pom.xml
index 7c2ebbb750f..16aa9463ac0 100644
--- a/stream/clients/java/kv/pom.xml
+++ b/stream/clients/java/kv/pom.xml
@@ -31,6 +31,12 @@
stream-storage-java-client-base
${project.parent.version}
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.apache.bookkeeper
stream-storage-java-client-base
diff --git a/stream/clients/java/kv/src/test/resources/log4j.properties b/stream/clients/java/kv/src/test/resources/log4j.properties
deleted file mode 100644
index 9405038b2b8..00000000000
--- a/stream/clients/java/kv/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,51 +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.
-#
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=stream.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/distributedlog/core/build.gradle b/stream/distributedlog/core/build.gradle
index ee9a79fc10a..2af471ac7aa 100644
--- a/stream/distributedlog/core/build.gradle
+++ b/stream/distributedlog/core/build.gradle
@@ -46,6 +46,7 @@ dependencies {
testRuntimeOnly depLibs.metricsCore
testRuntimeOnly depLibs.snappy
+ testImplementation project(':testtools')
testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts')
testImplementation project(path: ':bookkeeper-server', configuration: 'testArtifacts')
testImplementation project(path: ':stream:distributedlog:common', configuration: 'testArtifacts')
diff --git a/stream/distributedlog/core/pom.xml b/stream/distributedlog/core/pom.xml
index 67ef4b42279..67caafa1430 100644
--- a/stream/distributedlog/core/pom.xml
+++ b/stream/distributedlog/core/pom.xml
@@ -49,6 +49,12 @@
true
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.jmock
jmock
diff --git a/stream/distributedlog/core/src/test/resources/log4j.properties b/stream/distributedlog/core/src/test/resources/log4j.properties
deleted file mode 100644
index 3e51059366d..00000000000
--- a/stream/distributedlog/core/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,51 +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.
-# */
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=distributedlog.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/distributedlog/protocol/build.gradle b/stream/distributedlog/protocol/build.gradle
index 532d41fb8af..869a4e6115a 100644
--- a/stream/distributedlog/protocol/build.gradle
+++ b/stream/distributedlog/protocol/build.gradle
@@ -32,6 +32,7 @@ dependencies {
implementation depLibs.slf4j
testImplementation project(':bookkeeper-common')
+ testImplementation project(':testtools')
testImplementation depLibs.junit
testImplementation depLibs.lombok
annotationProcessor depLibs.lombok
diff --git a/stream/distributedlog/protocol/pom.xml b/stream/distributedlog/protocol/pom.xml
index 7a1748ab7b0..cd29b40f628 100644
--- a/stream/distributedlog/protocol/pom.xml
+++ b/stream/distributedlog/protocol/pom.xml
@@ -34,6 +34,12 @@
io.netty
netty-buffer
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
diff --git a/stream/distributedlog/protocol/src/test/resources/log4j.properties b/stream/distributedlog/protocol/src/test/resources/log4j.properties
deleted file mode 100644
index 3e51059366d..00000000000
--- a/stream/distributedlog/protocol/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,51 +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.
-# */
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=distributedlog.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/proto/build.gradle b/stream/proto/build.gradle
index 8a16bf5247e..0bb88331bf9 100644
--- a/stream/proto/build.gradle
+++ b/stream/proto/build.gradle
@@ -33,6 +33,8 @@ dependencies {
testImplementation depLibs.junit
compileOnly depLibs.javaAnnotations
annotationProcessor depLibs.lombok
+
+ testImplementation project(':testtools')
}
protobuf {
diff --git a/stream/proto/pom.xml b/stream/proto/pom.xml
index 570407359f8..bd60d3de1e8 100644
--- a/stream/proto/pom.xml
+++ b/stream/proto/pom.xml
@@ -47,6 +47,12 @@
true
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.apache.bookkeeper.tests
stream-storage-tests-common
diff --git a/stream/proto/src/test/resources/log4j.properties b/stream/proto/src/test/resources/log4j.properties
deleted file mode 100644
index e651cb4b6e5..00000000000
--- a/stream/proto/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,53 +0,0 @@
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=zstream.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/server/build.gradle b/stream/server/build.gradle
index 19faa189683..edf93434747 100644
--- a/stream/server/build.gradle
+++ b/stream/server/build.gradle
@@ -68,6 +68,8 @@ dependencies {
compileOnly depLibs.javaAnnotations
annotationProcessor depLibs.lombok
+
+ testImplementation project(':testtools')
}
application {
diff --git a/stream/server/pom.xml b/stream/server/pom.xml
index 8889856cbce..3fc2255ee57 100644
--- a/stream/server/pom.xml
+++ b/stream/server/pom.xml
@@ -58,6 +58,12 @@
metrics-core
runtime
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
diff --git a/stream/server/src/test/resources/log4j.properties b/stream/server/src/test/resources/log4j.properties
deleted file mode 100644
index 453e6e0e0b4..00000000000
--- a/stream/server/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,53 +0,0 @@
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=stream.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/statelib/build.gradle b/stream/statelib/build.gradle
index 754f53e03b2..0ecf8e7cf10 100644
--- a/stream/statelib/build.gradle
+++ b/stream/statelib/build.gradle
@@ -43,6 +43,7 @@ dependencies {
implementation depLibs.rocksDb
implementation depLibs.slf4j
+ testImplementation project(':testtools')
testImplementation depLibs.commonsConfiguration
testImplementation depLibs.commonsIO
testImplementation depLibs.junit
diff --git a/stream/statelib/pom.xml b/stream/statelib/pom.xml
index 871ab65c148..23996e66e70 100644
--- a/stream/statelib/pom.xml
+++ b/stream/statelib/pom.xml
@@ -97,6 +97,12 @@
${dropwizard.version}
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
diff --git a/stream/statelib/src/test/resources/log4j.properties b/stream/statelib/src/test/resources/log4j.properties
deleted file mode 100644
index 9f4666a2fc0..00000000000
--- a/stream/statelib/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,33 +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.
-# */
-
-#
-# DisributedLog Logging Configuration
-#
-
-dlog.test.logger=INFO, CONSOLE
-log4j.rootLogger=${dlog.test.logger}
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/stream/storage/impl/build.gradle b/stream/storage/impl/build.gradle
index 0e00a3e5b80..05fee0b4bad 100644
--- a/stream/storage/impl/build.gradle
+++ b/stream/storage/impl/build.gradle
@@ -47,6 +47,7 @@ dependencies {
compileOnly depLibs.jsr305
testImplementation project(':stream:distributedlog:common')
testImplementation project(':stream:distributedlog:protocol')
+ testImplementation project(':testtools')
testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts')
testImplementation project(path: ':stream:clients:java:base', configuration: 'testArtifacts')
testImplementation project(path: ':stream:distributedlog:core', configuration: 'testArtifacts')
diff --git a/stream/storage/impl/pom.xml b/stream/storage/impl/pom.xml
index 961f5b1a1cb..c683eecf2ed 100644
--- a/stream/storage/impl/pom.xml
+++ b/stream/storage/impl/pom.xml
@@ -46,6 +46,12 @@
org.apache.curator
curator-recipes
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.apache.distributedlog
distributedlog-core
diff --git a/stream/storage/impl/src/test/resources/log4j.properties b/stream/storage/impl/src/test/resources/log4j.properties
deleted file mode 100644
index e651cb4b6e5..00000000000
--- a/stream/storage/impl/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,53 +0,0 @@
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * 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.
-# */
-
-#
-# DisributedLog Logging Configuration
-#
-
-# Example with rolling log file
-log4j.rootLogger=INFO, CONSOLE
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-#Set the bookkeeper level to warning
-log4j.logger.org.apache.bookkeeper=INFO
-
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=INFO
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-# Add ROLLINGFILE to rootLogger to get log file output
-# Log DEBUG level and above messages to a log file
-#log4j.appender.ROLLINGFILE=org.apache.log4j.DailyRollingFileAppender
-#log4j.appender.ROLLINGFILE.Threshold=INFO
-#log4j.appender.ROLLINGFILE.File=zstream.log
-#log4j.appender.ROLLINGFILE.layout=org.apache.log4j.PatternLayout
-#log4j.appender.ROLLINGFILE.DatePattern='.'yyyy-MM-dd-HH-mm
-#log4j.appender.ROLLINGFILE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.Threshold=TRACE
-log4j.appender.R.File=target/error.log
-log4j.appender.R.MaxFileSize=200MB
-log4j.appender.R.MaxBackupIndex=7
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
diff --git a/tests/integration-tests-base/pom.xml b/tests/integration-tests-base/pom.xml
index 733bc3f6964..bb41e64cc68 100644
--- a/tests/integration-tests-base/pom.xml
+++ b/tests/integration-tests-base/pom.xml
@@ -49,12 +49,6 @@
test
-
- junit
- junit
- test
-
-
diff --git a/tests/integration-tests-utils/src/main/resources/log4j.properties b/tests/integration-tests-utils/src/main/resources/log4j.properties
deleted file mode 100644
index 09ac2e75d13..00000000000
--- a/tests/integration-tests-utils/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,37 +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.
-#
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-log4j.rootLogger=INFO,CONSOLE
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO
diff --git a/metadata-drivers/etcd/src/test/resources/log4j2.xml b/tests/integration-tests-utils/src/main/resources/log4j2.xml
similarity index 81%
rename from metadata-drivers/etcd/src/test/resources/log4j2.xml
rename to tests/integration-tests-utils/src/main/resources/log4j2.xml
index 184f58487ea..12f713a7b59 100644
--- a/metadata-drivers/etcd/src/test/resources/log4j2.xml
+++ b/tests/integration-tests-utils/src/main/resources/log4j2.xml
@@ -1,6 +1,5 @@
-
+
-
-
-
-
diff --git a/tests/integration/cluster/build.gradle b/tests/integration/cluster/build.gradle
index 71a01ac3881..a8acf526144 100644
--- a/tests/integration/cluster/build.gradle
+++ b/tests/integration/cluster/build.gradle
@@ -36,6 +36,7 @@ dependencies {
testImplementation project(':bookkeeper-stats')
testImplementation project(':tests:integration-tests-topologies')
testImplementation project(':stream:clients:java:kv')
+ testImplementation project(':testtools')
testCompileOnly depLibs.lombok
testImplementation depLibs.log4j12api
diff --git a/tests/integration/cluster/pom.xml b/tests/integration/cluster/pom.xml
index 97e7a9ce228..af558658834 100644
--- a/tests/integration/cluster/pom.xml
+++ b/tests/integration/cluster/pom.xml
@@ -31,6 +31,13 @@
Apache BookKeeper :: Tests :: Integration :: Cluster test
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
+
org.apache.bookkeeper
bookkeeper-server
diff --git a/tests/integration/cluster/src/test/resources/log4j.properties b/tests/integration/cluster/src/test/resources/log4j.properties
deleted file mode 100644
index 10ae6bfcbba..00000000000
--- a/tests/integration/cluster/src/test/resources/log4j.properties
+++ /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.
-#
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-bookkeeper.root.logger=INFO,CONSOLE
-log4j.rootLogger=${bookkeeper.root.logger}
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO
diff --git a/tests/integration/standalone/build.gradle b/tests/integration/standalone/build.gradle
index fe63dd3b52c..771dfe44889 100644
--- a/tests/integration/standalone/build.gradle
+++ b/tests/integration/standalone/build.gradle
@@ -26,6 +26,7 @@ dependencies {
testImplementation project(':bookkeeper-server')
testImplementation project(':tests:integration-tests-utils')
testImplementation project(':tests:integration-tests-topologies')
+ testImplementation project(':testtools')
testCompileOnly depLibs.lombok
testImplementation depLibs.arquillianJunitContainer
testImplementation depLibs.testcontainers
diff --git a/tests/integration/standalone/pom.xml b/tests/integration/standalone/pom.xml
index 874c07cd899..fd859cae43f 100644
--- a/tests/integration/standalone/pom.xml
+++ b/tests/integration/standalone/pom.xml
@@ -31,6 +31,13 @@
Apache BookKeeper :: Tests :: Integration :: Standalone test
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
+
org.apache.bookkeeper
bookkeeper-server
diff --git a/tests/integration/standalone/src/test/resources/log4j.properties b/tests/integration/standalone/src/test/resources/log4j.properties
deleted file mode 100644
index 10ae6bfcbba..00000000000
--- a/tests/integration/standalone/src/test/resources/log4j.properties
+++ /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.
-#
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-bookkeeper.root.logger=INFO,CONSOLE
-log4j.rootLogger=${bookkeeper.root.logger}
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO
diff --git a/testtools/build.gradle b/testtools/build.gradle
new file mode 100644
index 00000000000..c606cf6ab24
--- /dev/null
+++ b/testtools/build.gradle
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+plugins {
+ id 'java'
+ id 'maven-publish'
+}
+
+description = 'Apache BookKeeper :: Test Tools'
+
+dependencies {
+
+
+ compileOnly depLibs.lombok
+ compileOnly depLibs.spotbugsAnnotations
+
+
+
+ testCompileOnly depLibs.lombok
+
+
+ annotationProcessor depLibs.lombok
+ testAnnotationProcessor depLibs.lombok
+}
+
+jar {
+ archiveBaseName = 'testtools'
+}
diff --git a/testtools/pom.xml b/testtools/pom.xml
new file mode 100644
index 00000000000..600a4830e4e
--- /dev/null
+++ b/testtools/pom.xml
@@ -0,0 +1,28 @@
+
+
+
+ 4.0.0
+
+ org.apache.bookkeeper
+ bookkeeper
+ 4.16.0-SNAPSHOT
+
+ testtools
+ Apache BookKeeper :: Test Tools
+ 4.16.0-SNAPSHOT
+
diff --git a/testtools/src/main/resources/log4j2.xml b/testtools/src/main/resources/log4j2.xml
new file mode 100644
index 00000000000..12f713a7b59
--- /dev/null
+++ b/testtools/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/ledger/build.gradle b/tools/ledger/build.gradle
index ea355fe3aad..fdf60f7b367 100644
--- a/tools/ledger/build.gradle
+++ b/tools/ledger/build.gradle
@@ -38,6 +38,7 @@ dependencies {
implementation depLibs.nettyCodecHTTP
implementation depLibs.nettyProxy
testImplementation project(":bookkeeper-stats")
+ testImplementation project(':testtools')
testCompileOnly depLibs.lombok
testImplementation depLibs.junit
testImplementation depLibs.commonsConfiguration
diff --git a/tools/ledger/pom.xml b/tools/ledger/pom.xml
index a3d26be1ac7..0ba321a3402 100644
--- a/tools/ledger/pom.xml
+++ b/tools/ledger/pom.xml
@@ -56,6 +56,12 @@
${project.parent.version}
test
+
+ org.apache.bookkeeper
+ testtools
+ ${project.parent.version}
+ test
+
org.apache.bookkeeper
bookkeeper-server
diff --git a/tools/ledger/src/test/resources/log4j.properties b/tools/ledger/src/test/resources/log4j.properties
deleted file mode 100644
index 10ae6bfcbba..00000000000
--- a/tools/ledger/src/test/resources/log4j.properties
+++ /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.
-#
-#
-
-#
-# Bookkeeper Logging Configuration
-#
-
-# Format is " (, )+
-
-# DEFAULT: console appender only, level INFO
-bookkeeper.root.logger=INFO,CONSOLE
-log4j.rootLogger=${bookkeeper.root.logger}
-
-#
-# Log INFO level and above messages to the console
-#
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p - [%t:%C{1}@%L] - %m%n
-
-#disable zookeeper logging
-log4j.logger.org.apache.zookeeper=OFF
-log4j.logger.org.apache.bookkeeper.bookie=INFO
-log4j.logger.org.apache.bookkeeper.meta=INFO