This is an automated email from the ASF dual-hosted git repository. sijie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push: new 6bfad08 Issue #1434: Checkstyle is not executed at some modules 6bfad08 is described below commit 6bfad08b4851406c219c1b5dc445c33453e7ecc4 Author: Sijie Guo <si...@apache.org> AuthorDate: Fri May 25 00:58:26 2018 -0700 Issue #1434: Checkstyle is not executed at some modules Descriptions of the changes in this PR: *Motivation* Checkstyle was supposed to run at `validate` phase for every modules. However checkstyle is not running at some modules. This introduces inconsistency between modules. *Changes* - Fix Checkstyle warnings. - Remove `checkstyle` plugins from modules, only leave it at root pom file or modules that have overrides. This improves default build time. - Add `checkstyle:check` to CI jobs. *NOTES* `microbenchmarks` has too many checkstyle volations. so skip checkstyle for this PR. Master Issue: #1434 Author: Sijie Guo <si...@apache.org> Reviewers: Enrico Olivelli <eolive...@gmail.com>, Jia Zhai <None> This closes #1435 from sijie/checkstyle_tests, closes #1434 --- .../job_bookkeeper_postcommit_master_java8.groovy | 2 +- .../job_bookkeeper_postcommit_master_java9.groovy | 2 +- .../jenkins/job_bookkeeper_precommit_java8.groovy | 2 +- .../jenkins/job_bookkeeper_precommit_java9.groovy | 2 +- .../job_bookkeeper_release_nightly_snapshot.groovy | 2 +- bookkeeper-benchmark/pom.xml | 4 --- bookkeeper-common/pom.xml | 4 --- bookkeeper-http/http-server/pom.xml | 8 ----- bookkeeper-http/twitter-http-server/pom.xml | 8 ----- bookkeeper-http/vertx-http-server/pom.xml | 8 ----- bookkeeper-server/pom.xml | 4 --- .../codahale-metrics-provider/pom.xml | 8 ----- .../prometheus-metrics-provider/pom.xml | 9 ----- .../twitter-finagle-provider/pom.xml | 8 ----- .../twitter-ostrich-provider/pom.xml | 8 ----- .../twitter-science-provider/pom.xml | 8 ----- bookkeeper-stats/pom.xml | 4 --- .../tools/cli/commands/package-info.java | 15 ++------- .../apache/bookkeeper/tools/cli/package-info.java | 15 ++------- .../bookkeeper/tools/cli/BookKeeperCLITest.java | 2 +- .../cli/commands/bookie/LastMarkCommandTest.java | 1 - .../commands/cluster/ListBookiesCommandTest.java | 12 +++---- .../tools/cli/helpers/CommandTestBase.java | 3 ++ .../cli/helpers/DiscoveryCommandTestBase.java | 4 --- circe-checksum/pom.xml | 4 --- microbenchmarks/pom.xml | 7 ++++ pom.xml | 14 -------- .../clients/impl/kv/TableRequestProcessor.java | 1 - stream/distributedlog/common/pom.xml | 4 --- stream/distributedlog/io/dlfs/pom.xml | 4 --- stream/distributedlog/protocol/pom.xml | 4 --- .../util/StorageContainerPlacementPolicy.java | 31 +++++++++--------- stream/server/pom.xml | 4 --- .../stream/storage/conf/StorageConfiguration.java | 1 - .../stream/storage/StorageConstants.java | 2 +- .../impl/cluster/ClusterControllerLeaderImpl.java | 9 +++-- .../storage/impl/grpc/GrpcMetaRangeService.java | 2 +- .../storage/impl/grpc/GrpcRootRangeService.java | 2 +- .../stream/storage/impl/grpc/GrpcTableService.java | 2 +- .../impl/sc/DefaultStorageContainerController.java | 7 ++-- .../storage/impl/sc/ZkStorageContainerManager.java | 2 +- .../cluster/ClusterControllerLeaderImplTest.java | 4 +-- .../impl/cluster/ZkClusterMetadataStoreTest.java | 2 +- .../backwardcompat/TestCompatOldClients.groovy | 6 ++-- .../TestCompatHierarchicalLedgerManager.groovy | 4 +-- .../TestCompatUpgradeWithHostnameBookieId.groovy | 4 +-- ...mpatUpgradeOldServerInClusterWithCookies.groovy | 4 +-- .../TestCompatRecoveryNoPassword.groovy | 9 +++-- .../backwardcompat/TestCompatUpgradeDirect.groovy | 7 ++-- .../tests/backwardcompat/TestCompatUpgrade.groovy | 4 +-- .../TestCompatUpgradeYahooCustom.groovy | 5 ++- .../tests/containers/BKStandaloneContainer.java | 2 +- .../tests/containers/BookieContainer.java | 4 +-- .../tests/containers/ChaosContainer.java | 4 +-- .../tests/containers/MetadataStoreContainer.java | 3 +- .../bookkeeper/tests/containers/ZKContainer.java | 5 ++- ...tadataStoreContainer.java => package-info.java} | 15 ++------- .../tests/containers/wait/HttpWaitStrategy.java | 5 +-- .../tests/containers/wait/ZKWaitStrategy.java | 2 +- .../package-info.java} | 15 ++------- .../3-node-all-version-unstarted.yaml | 16 ++++----- .../utils}/BookKeeperClusterUtils.java | 26 ++++++++------- .../BookKeeperLogsToTargetDirStopAction.java | 20 +++++++----- .../tests/{ => integration/utils}/DockerUtils.java | 38 ++++++++++++---------- .../utils}/LogToTargetDirStopAction.java | 20 +++++++----- .../{ => integration/utils}/MavenClassLoader.java | 27 +++++++-------- .../{ => integration/utils}/NoopAwaitStrategy.java | 22 ++++++------- .../{ => integration/utils}/ThreadReaper.java | 22 ++++++------- .../utils}/ZooKeeperAwaitStrategy.java | 28 ++++++++-------- .../tests/integration/utils/package-info.java} | 15 ++------- .../utils}/MavenClassLoaderTest.java | 24 +++++++------- .../integration/stream/LocationClientTest.java | 1 - .../integration/stream/StorageAdminClientTest.java | 4 --- .../tests/integration/BookieShellTestBase.java | 3 ++ .../tests/integration/TestBookieShellCluster.java | 7 ++-- .../bookkeeper/tests/integration/TestCLI.java | 7 ++-- .../bookkeeper/tests/integration/TestDlogCLI.java | 7 ++-- .../bookkeeper/tests/integration/TestSmoke.java | 7 ++-- tests/shaded/bookkeeper-server-shaded-test/pom.xml | 4 --- .../bookkeeper-server-tests-shaded-test/pom.xml | 4 --- .../shaded/distributedlog-core-shaded-test/pom.xml | 7 ---- 81 files changed, 248 insertions(+), 408 deletions(-) diff --git a/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy index 599f4ed..ed13b8c 100644 --- a/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy +++ b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java8.groovy @@ -42,5 +42,5 @@ mavenJob('bookkeeper_postcommit_master_java8') { common_job_properties.setMavenConfig(delegate) // Maven build project. - goals('clean apache-rat:check package spotbugs:check -Ddistributedlog -Dstream -DstreamTests') + goals('clean apache-rat:check checkstyle:check package spotbugs:check -Ddistributedlog -Dstream -DstreamTests') } diff --git a/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy index 68c4bde..006255f 100644 --- a/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy +++ b/.test-infra/jenkins/job_bookkeeper_postcommit_master_java9.groovy @@ -42,5 +42,5 @@ mavenJob('bookkeeper_postcommit_master_java9') { common_job_properties.setMavenConfig(delegate) // Maven build project. - goals('clean apache-rat:check package spotbugs:check -Ddistributedlog -Dstream -DstreamTests') + goals('clean apache-rat:check checkstyle:check package spotbugs:check -Ddistributedlog -Dstream -DstreamTests') } diff --git a/.test-infra/jenkins/job_bookkeeper_precommit_java8.groovy b/.test-infra/jenkins/job_bookkeeper_precommit_java8.groovy index 58b0a0f..3586b35 100644 --- a/.test-infra/jenkins/job_bookkeeper_precommit_java8.groovy +++ b/.test-infra/jenkins/job_bookkeeper_precommit_java8.groovy @@ -48,5 +48,5 @@ mavenJob('bookkeeper_precommit_pullrequest_java8') { common_job_properties.setMavenConfig(delegate) // Maven build project - goals('clean apache-rat:check package spotbugs:check -Dstream') + goals('clean apache-rat:check checkstyle:check package spotbugs:check -Dstream') } diff --git a/.test-infra/jenkins/job_bookkeeper_precommit_java9.groovy b/.test-infra/jenkins/job_bookkeeper_precommit_java9.groovy index b7e6217..16a8449 100644 --- a/.test-infra/jenkins/job_bookkeeper_precommit_java9.groovy +++ b/.test-infra/jenkins/job_bookkeeper_precommit_java9.groovy @@ -48,5 +48,5 @@ mavenJob('bookkeeper_precommit_pullrequest_java9') { common_job_properties.setMavenConfig(delegate) // Maven build project - goals('clean apache-rat:check package spotbugs:check -Dstream') + goals('clean apache-rat:check checkstyle:check package spotbugs:check -Dstream') } diff --git a/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy b/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy index 5938e06..1a045d4 100644 --- a/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy +++ b/.test-infra/jenkins/job_bookkeeper_release_nightly_snapshot.groovy @@ -43,7 +43,7 @@ freeStyleJob('bookkeeper_release_nightly_snapshot') { common_job_properties.setMavenConfig(delegate) // Maven build project. - goals('clean apache-rat:check package spotbugs:check -Dmaven.test.failure.ignore=true deploy -Ddistributedlog -Dstream -DstreamTests -Pdocker') + goals('clean apache-rat:check checkstyle:check package spotbugs:check -Dmaven.test.failure.ignore=true deploy -Ddistributedlog -Dstream -DstreamTests -Pdocker') } // publish the docker images diff --git a/bookkeeper-benchmark/pom.xml b/bookkeeper-benchmark/pom.xml index 40a937d..5a76126 100644 --- a/bookkeeper-benchmark/pom.xml +++ b/bookkeeper-benchmark/pom.xml @@ -40,10 +40,6 @@ </systemPropertyVariables> </configuration> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> <dependencies> diff --git a/bookkeeper-common/pom.xml b/bookkeeper-common/pom.xml index 0f09440..740f16a 100644 --- a/bookkeeper-common/pom.xml +++ b/bookkeeper-common/pom.xml @@ -80,10 +80,6 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> </project> diff --git a/bookkeeper-http/http-server/pom.xml b/bookkeeper-http/http-server/pom.xml index e465a8f..fd37334 100644 --- a/bookkeeper-http/http-server/pom.xml +++ b/bookkeeper-http/http-server/pom.xml @@ -27,14 +27,6 @@ <artifactId>http-server</artifactId> <name>Apache BookKeeper :: Http :: Http Server</name> <url>http://maven.apache.org</url> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> <dependencies> <dependency> <groupId>commons-configuration</groupId> diff --git a/bookkeeper-http/twitter-http-server/pom.xml b/bookkeeper-http/twitter-http-server/pom.xml index ae87239..19a20aa 100644 --- a/bookkeeper-http/twitter-http-server/pom.xml +++ b/bookkeeper-http/twitter-http-server/pom.xml @@ -27,14 +27,6 @@ <artifactId>twitter-http-server</artifactId> <name>Apache BookKeeper :: Bookkeeper Http :: Twitter Http Server</name> <url>http://maven.apache.org</url> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> <dependencies> <dependency> <groupId>com.twitter</groupId> diff --git a/bookkeeper-http/vertx-http-server/pom.xml b/bookkeeper-http/vertx-http-server/pom.xml index ea39307..7957bff 100644 --- a/bookkeeper-http/vertx-http-server/pom.xml +++ b/bookkeeper-http/vertx-http-server/pom.xml @@ -27,14 +27,6 @@ <artifactId>vertx-http-server</artifactId> <name>Apache BookKeeper :: Bookkeeper Http :: Vertx Http Server</name> <url>http://maven.apache.org</url> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> <dependencies> <dependency> <groupId>io.vertx</groupId> diff --git a/bookkeeper-server/pom.xml b/bookkeeper-server/pom.xml index 61d8770..d90f6bb 100644 --- a/bookkeeper-server/pom.xml +++ b/bookkeeper-server/pom.xml @@ -202,10 +202,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> <profiles> diff --git a/bookkeeper-stats-providers/codahale-metrics-provider/pom.xml b/bookkeeper-stats-providers/codahale-metrics-provider/pom.xml index 02c6742..7d668e9 100644 --- a/bookkeeper-stats-providers/codahale-metrics-provider/pom.xml +++ b/bookkeeper-stats-providers/codahale-metrics-provider/pom.xml @@ -27,14 +27,6 @@ <artifactId>codahale-metrics-provider</artifactId> <name>Apache BookKeeper :: Stats Providers :: Codahale Metrics</name> <url>http://maven.apache.org</url> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> <dependencies> <dependency> <groupId>org.apache.bookkeeper.stats</groupId> diff --git a/bookkeeper-stats-providers/prometheus-metrics-provider/pom.xml b/bookkeeper-stats-providers/prometheus-metrics-provider/pom.xml index 6754c08..b6dce53 100644 --- a/bookkeeper-stats-providers/prometheus-metrics-provider/pom.xml +++ b/bookkeeper-stats-providers/prometheus-metrics-provider/pom.xml @@ -26,15 +26,6 @@ <groupId>org.apache.bookkeeper.stats</groupId> <artifactId>prometheus-metrics-provider</artifactId> <name>Apache BookKeeper :: Stats Providers :: Prometheus</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> - <dependencies> <dependency> <groupId>org.apache.bookkeeper.stats</groupId> diff --git a/bookkeeper-stats-providers/twitter-finagle-provider/pom.xml b/bookkeeper-stats-providers/twitter-finagle-provider/pom.xml index 18d7ba5..58c9a1d 100644 --- a/bookkeeper-stats-providers/twitter-finagle-provider/pom.xml +++ b/bookkeeper-stats-providers/twitter-finagle-provider/pom.xml @@ -27,14 +27,6 @@ <artifactId>twitter-finagle-provider</artifactId> <name>Apache BookKeeper :: Stats Providers :: Twitter Finagle Stats</name> <url>http://maven.apache.org</url> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> <dependencies> <dependency> <groupId>org.apache.bookkeeper.stats</groupId> diff --git a/bookkeeper-stats-providers/twitter-ostrich-provider/pom.xml b/bookkeeper-stats-providers/twitter-ostrich-provider/pom.xml index 3c81dd8..19b4ccd 100644 --- a/bookkeeper-stats-providers/twitter-ostrich-provider/pom.xml +++ b/bookkeeper-stats-providers/twitter-ostrich-provider/pom.xml @@ -27,14 +27,6 @@ <artifactId>twitter-ostrich-provider</artifactId> <name>Apache BookKeeper :: Stats Providers :: Twitter Ostrich Stats</name> <url>http://maven.apache.org</url> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> <dependencies> <dependency> <groupId>org.apache.bookkeeper.stats</groupId> diff --git a/bookkeeper-stats-providers/twitter-science-provider/pom.xml b/bookkeeper-stats-providers/twitter-science-provider/pom.xml index bbcc7ec..f18daa0 100644 --- a/bookkeeper-stats-providers/twitter-science-provider/pom.xml +++ b/bookkeeper-stats-providers/twitter-science-provider/pom.xml @@ -26,14 +26,6 @@ <groupId>org.apache.bookkeeper.stats</groupId> <artifactId>twitter-science-provider</artifactId> <name>Apache BookKeeper :: Stats Providers :: Twitter Science Stats</name> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - </plugins> - </build> <!-- keep twitter specific dependencies defined in this profile only. --> diff --git a/bookkeeper-stats/pom.xml b/bookkeeper-stats/pom.xml index 24ff65b..2fde4b3 100644 --- a/bookkeeper-stats/pom.xml +++ b/bookkeeper-stats/pom.xml @@ -30,10 +30,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>${maven-javadoc-plugin.version}</version> <configuration> diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java b/bookkeeper-tools/src/main/java/org/apache/bookkeeper/tools/cli/commands/package-info.java similarity index 64% copy from tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java copy to bookkeeper-tools/src/main/java/org/apache/bookkeeper/tools/cli/commands/package-info.java index ec8d914..5e1aed5 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java +++ b/bookkeeper-tools/src/main/java/org/apache/bookkeeper/tools/cli/commands/package-info.java @@ -16,18 +16,7 @@ * limitations under the License. */ -package org.apache.bookkeeper.tests.containers; - /** - * An abstract class for metadata store container. + * BookKeeper CLI commands. */ -public abstract class MetadataStoreContainer<SELF extends MetadataStoreContainer<SELF>> extends ChaosContainer<SELF> { - protected MetadataStoreContainer(String clusterName, String image) { - super(clusterName, image); - } - - public abstract String getExternalServiceUri(); - - public abstract String getInternalServiceUri(); - -} +package org.apache.bookkeeper.tools.cli.commands; \ No newline at end of file diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java b/bookkeeper-tools/src/main/java/org/apache/bookkeeper/tools/cli/package-info.java similarity index 64% copy from tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java copy to bookkeeper-tools/src/main/java/org/apache/bookkeeper/tools/cli/package-info.java index ec8d914..be470e1 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java +++ b/bookkeeper-tools/src/main/java/org/apache/bookkeeper/tools/cli/package-info.java @@ -16,18 +16,7 @@ * limitations under the License. */ -package org.apache.bookkeeper.tests.containers; - /** - * An abstract class for metadata store container. + * BookKeeper CLI. */ -public abstract class MetadataStoreContainer<SELF extends MetadataStoreContainer<SELF>> extends ChaosContainer<SELF> { - protected MetadataStoreContainer(String clusterName, String image) { - super(clusterName, image); - } - - public abstract String getExternalServiceUri(); - - public abstract String getInternalServiceUri(); - -} +package org.apache.bookkeeper.tools.cli; \ No newline at end of file diff --git a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/BookKeeperCLITest.java b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/BookKeeperCLITest.java index 7a0affe..22dad59 100644 --- a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/BookKeeperCLITest.java +++ b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/BookKeeperCLITest.java @@ -56,7 +56,7 @@ import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; /** - * Unit test of {@link BookKeeperCLI} + * Unit test of {@link BookKeeperCLI}. */ @RunWith(PowerMockRunner.class) @PrepareForTest({ BookKeeperCLI.class, CmdBase.class }) diff --git a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/LastMarkCommandTest.java b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/LastMarkCommandTest.java index 20899b7..b2c1d8b 100644 --- a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/LastMarkCommandTest.java +++ b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/bookie/LastMarkCommandTest.java @@ -19,7 +19,6 @@ package org.apache.bookkeeper.tools.cli.commands.bookie; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyObject; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/cluster/ListBookiesCommandTest.java b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/cluster/ListBookiesCommandTest.java index 2574c63..5e7de7d 100644 --- a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/cluster/ListBookiesCommandTest.java +++ b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/commands/cluster/ListBookiesCommandTest.java @@ -155,14 +155,14 @@ public class ListBookiesCommandTest extends DiscoveryCommandTestBase { assertTrue(runner.runArgs(args)); if (readwrite && !readonly) { - verifyPrintBookies(3181, 10,1); - verifyPrintBookies(4181, 10,0); + verifyPrintBookies(3181, 10, 1); + verifyPrintBookies(4181, 10, 0); } else if (readonly && !readwrite) { - verifyPrintBookies(3181, 10,0); - verifyPrintBookies(4181, 10,1); + verifyPrintBookies(3181, 10, 0); + verifyPrintBookies(4181, 10, 1); } else { - verifyPrintBookies(3181, 10,1); - verifyPrintBookies(4181, 10,1); + verifyPrintBookies(3181, 10, 1); + verifyPrintBookies(4181, 10, 1); } } diff --git a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CommandTestBase.java b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CommandTestBase.java index b93cf38..162d244 100644 --- a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CommandTestBase.java +++ b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CommandTestBase.java @@ -28,6 +28,9 @@ import org.apache.bookkeeper.tools.cli.commands.CmdBase; @Slf4j public class CommandTestBase { + /** + * Command Runner to run commands inherited from {@link CmdBase}. + */ protected static class CommandRunner extends CmdBase { public CommandRunner(ServerConfiguration conf, Command command) { diff --git a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/DiscoveryCommandTestBase.java b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/DiscoveryCommandTestBase.java index a3dfb9d..faa8b28 100644 --- a/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/DiscoveryCommandTestBase.java +++ b/bookkeeper-tools/src/test/java/org/apache/bookkeeper/tools/cli/helpers/DiscoveryCommandTestBase.java @@ -18,16 +18,12 @@ */ package org.apache.bookkeeper.tools.cli.helpers; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; -import org.apache.bookkeeper.conf.ClientConfiguration; import org.apache.bookkeeper.discover.RegistrationClient; -import org.apache.bookkeeper.util.ReflectionUtils; import org.junit.Before; -import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; diff --git a/circe-checksum/pom.xml b/circe-checksum/pom.xml index eab4820..78733f5 100644 --- a/circe-checksum/pom.xml +++ b/circe-checksum/pom.xml @@ -56,10 +56,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${maven-compiler-plugin.version}</version> <configuration> diff --git a/microbenchmarks/pom.xml b/microbenchmarks/pom.xml index f6ff8dc..9a81297 100644 --- a/microbenchmarks/pom.xml +++ b/microbenchmarks/pom.xml @@ -123,6 +123,13 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <configuration> + <skip>true</skip> + </configuration> + </plugin> </plugins> </build> </project> diff --git a/pom.xml b/pom.xml index 80651c1..f567d3b 100644 --- a/pom.xml +++ b/pom.xml @@ -924,13 +924,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> <configuration> @@ -951,13 +944,6 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <skip>true</skip> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${maven-surefire-plugin.version}</version> <configuration> diff --git a/stream/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/TableRequestProcessor.java b/stream/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/TableRequestProcessor.java index f5e0bc5..e697d3d 100644 --- a/stream/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/TableRequestProcessor.java +++ b/stream/clients/java/kv/src/main/java/org/apache/bookkeeper/clients/impl/kv/TableRequestProcessor.java @@ -18,7 +18,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import java.util.concurrent.ScheduledExecutorService; import java.util.function.Function; -import java.util.stream.Stream; import org.apache.bookkeeper.clients.exceptions.InternalServerException; import org.apache.bookkeeper.clients.impl.channel.StorageServerChannel; import org.apache.bookkeeper.clients.impl.container.StorageContainerChannel; diff --git a/stream/distributedlog/common/pom.xml b/stream/distributedlog/common/pom.xml index f935c77..e8d0b58 100644 --- a/stream/distributedlog/common/pom.xml +++ b/stream/distributedlog/common/pom.xml @@ -104,10 +104,6 @@ <forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds> </configuration> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> </project> diff --git a/stream/distributedlog/io/dlfs/pom.xml b/stream/distributedlog/io/dlfs/pom.xml index 1273da3..fee4f17 100644 --- a/stream/distributedlog/io/dlfs/pom.xml +++ b/stream/distributedlog/io/dlfs/pom.xml @@ -66,10 +66,6 @@ <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> </project> diff --git a/stream/distributedlog/protocol/pom.xml b/stream/distributedlog/protocol/pom.xml index 39600f6..3f97d89 100644 --- a/stream/distributedlog/protocol/pom.xml +++ b/stream/distributedlog/protocol/pom.xml @@ -53,10 +53,6 @@ <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> </project> diff --git a/stream/proto/src/main/java/org/apache/bookkeeper/stream/protocol/util/StorageContainerPlacementPolicy.java b/stream/proto/src/main/java/org/apache/bookkeeper/stream/protocol/util/StorageContainerPlacementPolicy.java index 340a731..8ab93a8 100644 --- a/stream/proto/src/main/java/org/apache/bookkeeper/stream/protocol/util/StorageContainerPlacementPolicy.java +++ b/stream/proto/src/main/java/org/apache/bookkeeper/stream/protocol/util/StorageContainerPlacementPolicy.java @@ -11,21 +11,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/* - * Licensed 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.bookkeeper.stream.protocol.util; /** @@ -34,13 +19,29 @@ package org.apache.bookkeeper.stream.protocol.util; @FunctionalInterface public interface StorageContainerPlacementPolicy { + /** + * Factory to create placement policy. + */ @FunctionalInterface interface Factory { + /** + * Create a placement policy to place ranges to storage containers. + * + * @return a new placement policy instance. + */ StorageContainerPlacementPolicy newPlacementPolicy(); } + /** + * Placement a stream range (<tt>streamId</tt>/<tt>rangeId</tt>) to + * a storage container. + * + * @param streamId stream id + * @param rangeId range id + * @return storage container id + */ long placeStreamRange(long streamId, long rangeId); } diff --git a/stream/server/pom.xml b/stream/server/pom.xml index e0bdf09..cb52fd9 100644 --- a/stream/server/pom.xml +++ b/stream/server/pom.xml @@ -57,10 +57,6 @@ </execution> </executions> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> </project> diff --git a/stream/storage/api/src/main/java/org/apache/bookkeeper/stream/storage/conf/StorageConfiguration.java b/stream/storage/api/src/main/java/org/apache/bookkeeper/stream/storage/conf/StorageConfiguration.java index 0699a13..e6e109e 100644 --- a/stream/storage/api/src/main/java/org/apache/bookkeeper/stream/storage/conf/StorageConfiguration.java +++ b/stream/storage/api/src/main/java/org/apache/bookkeeper/stream/storage/conf/StorageConfiguration.java @@ -14,7 +14,6 @@ package org.apache.bookkeeper.stream.storage.conf; import java.io.File; -import java.time.Duration; import java.util.concurrent.TimeUnit; import org.apache.bookkeeper.common.conf.ComponentConfiguration; import org.apache.commons.configuration.CompositeConfiguration; diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/StorageConstants.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/StorageConstants.java index d6ec8a3..5b1e36a 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/StorageConstants.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/StorageConstants.java @@ -21,7 +21,7 @@ package org.apache.bookkeeper.stream.storage; import static org.apache.bookkeeper.util.BookKeeperConstants.AVAILABLE_NODE; /** - * Defines the storage constants + * Defines the storage constants. */ public final class StorageConstants { diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java index 807bf69..f117b8b 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImpl.java @@ -35,6 +35,9 @@ import org.apache.bookkeeper.stream.storage.api.cluster.ClusterMetadataStore; import org.apache.bookkeeper.stream.storage.impl.sc.StorageContainerController; import org.apache.bookkeeper.versioning.Versioned; +/** + * A default implementation of {@link ClusterControllerLeader}. + */ @Slf4j public class ClusterControllerLeaderImpl implements ClusterControllerLeader, RegistrationListener { @@ -79,7 +82,7 @@ public class ClusterControllerLeaderImpl implements ClusterControllerLeader, Reg } /** - * Suspend the controller if the leader disconnects from zookeeper + * Suspend the controller if the leader disconnects from zookeeper. */ @Override public void suspend() { @@ -134,8 +137,8 @@ public class ClusterControllerLeaderImpl implements ClusterControllerLeader, Reg // if the leader is suspended due to losing connection to zookeeper // we don't give leadership until it becomes leader again or being interrupted by curator if (!suspended) { - log.warn("Controller leader encountered exceptions on processing server changes," + - " giving up leadership"); + log.warn("Controller leader encountered exceptions on processing server changes," + + " giving up leadership"); // stop monitoring the servers this.regClient.unwatchWritableBookies(this); diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcMetaRangeService.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcMetaRangeService.java index 1e4f681..8510ec3 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcMetaRangeService.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcMetaRangeService.java @@ -22,9 +22,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.bookkeeper.stream.proto.storage.MetaRangeServiceGrpc.MetaRangeServiceImplBase; import org.apache.bookkeeper.stream.proto.storage.StorageContainerRequest; import org.apache.bookkeeper.stream.proto.storage.StorageContainerResponse; -import org.apache.bookkeeper.stream.storage.impl.grpc.handler.StorageContainerResponseHandler; import org.apache.bookkeeper.stream.storage.api.RangeStore; import org.apache.bookkeeper.stream.storage.api.metadata.RangeStoreService; +import org.apache.bookkeeper.stream.storage.impl.grpc.handler.StorageContainerResponseHandler; /** * The gRPC protocol based range service. diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcRootRangeService.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcRootRangeService.java index 763a221..035ba4b 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcRootRangeService.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcRootRangeService.java @@ -32,8 +32,8 @@ import org.apache.bookkeeper.stream.proto.storage.GetStreamRequest; import org.apache.bookkeeper.stream.proto.storage.GetStreamResponse; import org.apache.bookkeeper.stream.proto.storage.RootRangeServiceGrpc.RootRangeServiceImplBase; import org.apache.bookkeeper.stream.proto.storage.StatusCode; -import org.apache.bookkeeper.stream.storage.impl.grpc.handler.ResponseHandler; import org.apache.bookkeeper.stream.storage.api.metadata.RangeStoreService; +import org.apache.bookkeeper.stream.storage.impl.grpc.handler.ResponseHandler; /** * Grpc based root range service. diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcTableService.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcTableService.java index e86759d..39c30cb 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcTableService.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/grpc/GrpcTableService.java @@ -22,8 +22,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.bookkeeper.stream.proto.storage.StorageContainerRequest; import org.apache.bookkeeper.stream.proto.storage.StorageContainerResponse; import org.apache.bookkeeper.stream.proto.storage.TableServiceGrpc.TableServiceImplBase; -import org.apache.bookkeeper.stream.storage.impl.grpc.handler.StorageContainerResponseHandler; import org.apache.bookkeeper.stream.storage.api.metadata.RangeStoreService; +import org.apache.bookkeeper.stream.storage.impl.grpc.handler.StorageContainerResponseHandler; /** * The gRPC protocol based k/v service. diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/DefaultStorageContainerController.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/DefaultStorageContainerController.java index 2a3d704..c68f4bb 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/DefaultStorageContainerController.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/DefaultStorageContainerController.java @@ -54,7 +54,8 @@ public class DefaultStorageContainerController implements StorageContainerContro implements Comparator<Pair<BookieSocketAddress, LinkedList<Long>>> { @Override - public int compare(Pair<BookieSocketAddress, LinkedList<Long>> o1, Pair<BookieSocketAddress, LinkedList<Long>> o2) { + public int compare(Pair<BookieSocketAddress, LinkedList<Long>> o1, + Pair<BookieSocketAddress, LinkedList<Long>> o2) { int res = Integer.compare(o1.getValue().size(), o2.getValue().size()); if (0 == res) { // two servers have same number of container @@ -131,8 +132,8 @@ public class DefaultStorageContainerController implements StorageContainerContro .collect(Collectors.toSet()); // 5. use an ordered set as priority deque to sort the servers by the number of assigned containers - TreeSet<Pair<BookieSocketAddress, LinkedList<Long>>> assignmentQueue - = new TreeSet<>(new ServerAssignmentDataComparator()); + TreeSet<Pair<BookieSocketAddress, LinkedList<Long>>> assignmentQueue = + new TreeSet<>(new ServerAssignmentDataComparator()); for (Map.Entry<BookieSocketAddress, Set<Long>> entry : currentServerAssignments.entrySet()) { BookieSocketAddress host = entry.getKey(); diff --git a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/ZkStorageContainerManager.java b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/ZkStorageContainerManager.java index f77244c..b6350fe 100644 --- a/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/ZkStorageContainerManager.java +++ b/stream/storage/impl/src/main/java/org/apache/bookkeeper/stream/storage/impl/sc/ZkStorageContainerManager.java @@ -265,7 +265,7 @@ public class ZkStorageContainerManager pendingStartStopContainers.add(scId); return registry .startStorageContainer(scId) - .whenComplete((container, cause ) -> { + .whenComplete((container, cause) -> { try { if (null != cause) { log.warn("Failed to start storage container ({})", scId, cause); diff --git a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java index 73d6e17..7d1aa31 100644 --- a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java +++ b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ClusterControllerLeaderImplTest.java @@ -71,8 +71,8 @@ public class ClusterControllerLeaderImplTest { private ExecutorService leaderExecutor; private final Semaphore coordSem = new Semaphore(0); - private final AtomicReference<RegistrationListener> regListenerRef - = new AtomicReference<>(null); + private final AtomicReference<RegistrationListener> regListenerRef = + new AtomicReference<>(null); private final CompletableFuture<Void> watchFuture = new CompletableFuture<>(); @Before diff --git a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java index 1c224db..e6ca0ba 100644 --- a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java +++ b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java @@ -66,7 +66,7 @@ public class ZkClusterMetadataStoreTest extends ZooKeeperClusterTestCase { zkServers, new ExponentialBackoffRetry(200, 10, 5000)); curatorClient.start(); - store = new ZkClusterMetadataStore(curatorClient, zkServers,"/" + runtime.getMethodName()); + store = new ZkClusterMetadataStore(curatorClient, zkServers, "/" + runtime.getMethodName()); store.initializeCluster(NUM_STORAGE_CONTAINERS); } diff --git a/tests/backward-compat/current-server-old-clients/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatOldClients.groovy b/tests/backward-compat/current-server-old-clients/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatOldClients.groovy index 84f48aa..a7ab4e3 100644 --- a/tests/backward-compat/current-server-old-clients/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatOldClients.groovy +++ b/tests/backward-compat/current-server-old-clients/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatOldClients.groovy @@ -19,9 +19,9 @@ package org.apache.bookkeeper.tests.backwardcompat import com.github.dockerjava.api.DockerClient -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.MavenClassLoader -import org.apache.bookkeeper.tests.ThreadReaper +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.ThreadReaper import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource diff --git a/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy b/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy index f376144..6394ff0 100644 --- a/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy +++ b/tests/backward-compat/hierarchical-ledger-manager/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatHierarchicalLedgerManager.groovy @@ -19,8 +19,8 @@ package org.apache.bookkeeper.tests.backwardcompat import com.github.dockerjava.api.DockerClient -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource diff --git a/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy b/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy index b9b2a9e..e82cbd8 100644 --- a/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy +++ b/tests/backward-compat/hostname-bookieid/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeWithHostnameBookieId.groovy @@ -19,8 +19,8 @@ package org.apache.bookkeeper.tests.backwardcompat import com.github.dockerjava.api.DockerClient -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource diff --git a/tests/backward-compat/old-cookie-new-cluster/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeOldServerInClusterWithCookies.groovy b/tests/backward-compat/old-cookie-new-cluster/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeOldServerInClusterWithCookies.groovy index c2d7263..dff7d4d 100644 --- a/tests/backward-compat/old-cookie-new-cluster/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeOldServerInClusterWithCookies.groovy +++ b/tests/backward-compat/old-cookie-new-cluster/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeOldServerInClusterWithCookies.groovy @@ -19,8 +19,8 @@ package org.apache.bookkeeper.tests.backwardcompat import com.github.dockerjava.api.DockerClient -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource diff --git a/tests/backward-compat/recovery-no-password/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatRecoveryNoPassword.groovy b/tests/backward-compat/recovery-no-password/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatRecoveryNoPassword.groovy index 87d9458..14243b9 100644 --- a/tests/backward-compat/recovery-no-password/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatRecoveryNoPassword.groovy +++ b/tests/backward-compat/recovery-no-password/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatRecoveryNoPassword.groovy @@ -20,8 +20,7 @@ package org.apache.bookkeeper.tests.backwardcompat import com.github.dockerjava.api.DockerClient import io.netty.buffer.ByteBuf -import java.util.ArrayList -import java.util.HashMap + import java.util.concurrent.CompletableFuture import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit @@ -36,9 +35,9 @@ import org.apache.bookkeeper.conf.ClientConfiguration import org.apache.bookkeeper.net.BookieSocketAddress import org.apache.bookkeeper.proto.BookieProtocol import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.ReadEntryCallback -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.DockerUtils -import org.apache.bookkeeper.tests.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.DockerUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource diff --git a/tests/backward-compat/upgrade-direct/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeDirect.groovy b/tests/backward-compat/upgrade-direct/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeDirect.groovy index 2fe675e..4a8a95c 100644 --- a/tests/backward-compat/upgrade-direct/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeDirect.groovy +++ b/tests/backward-compat/upgrade-direct/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeDirect.groovy @@ -19,18 +19,15 @@ package org.apache.bookkeeper.tests.backwardcompat import com.github.dockerjava.api.DockerClient -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource import org.junit.Assert -import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith -import org.junit.runners.MethodSorters - import org.slf4j.Logger import org.slf4j.LoggerFactory diff --git a/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy b/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy index 940501d..1a3f296 100644 --- a/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy +++ b/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy @@ -19,8 +19,8 @@ package org.apache.bookkeeper.tests.backwardcompat import com.github.dockerjava.api.DockerClient -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource diff --git a/tests/backward-compat/yahoo-custom-version/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeYahooCustom.groovy b/tests/backward-compat/yahoo-custom-version/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeYahooCustom.groovy index 2a6b91b..18cdec8 100644 --- a/tests/backward-compat/yahoo-custom-version/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeYahooCustom.groovy +++ b/tests/backward-compat/yahoo-custom-version/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgradeYahooCustom.groovy @@ -21,12 +21,11 @@ import static java.nio.charset.StandardCharsets.UTF_8 import com.github.dockerjava.api.DockerClient -import java.util.List import java.util.concurrent.CompletableFuture import java.util.concurrent.ExecutionException import java.util.concurrent.TimeUnit -import org.apache.bookkeeper.tests.BookKeeperClusterUtils -import org.apache.bookkeeper.tests.MavenClassLoader +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils +import org.apache.bookkeeper.tests.integration.utils.MavenClassLoader import org.jboss.arquillian.junit.Arquillian import org.jboss.arquillian.test.api.ArquillianResource diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BKStandaloneContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BKStandaloneContainer.java index 1288695..5f1e438 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BKStandaloneContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BKStandaloneContainer.java @@ -29,7 +29,7 @@ import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; * Test Container for Bookies. */ @Slf4j -public class BKStandaloneContainer<SELF extends BKStandaloneContainer<SELF>> extends ChaosContainer<SELF> { +public class BKStandaloneContainer<SelfT extends BKStandaloneContainer<SelfT>> extends ChaosContainer<SelfT> { private static final int ZK_PORT = 2181; private static final int BOOKIE_BASE_PORT = 3181; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java index d70b4f2..1082977 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/BookieContainer.java @@ -25,15 +25,15 @@ import java.net.URI; import java.time.Duration; import java.util.Objects; import lombok.extern.slf4j.Slf4j; -import org.apache.bookkeeper.tests.DockerUtils; import org.apache.bookkeeper.tests.containers.wait.HttpWaitStrategy; +import org.apache.bookkeeper.tests.integration.utils.DockerUtils; import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy; /** * Test Container for Bookies. */ @Slf4j -public class BookieContainer<SELF extends BookieContainer<SELF>> extends ChaosContainer<SELF> { +public class BookieContainer<SelfT extends BookieContainer<SelfT>> extends ChaosContainer<SelfT> { private static final int BOOKIE_PORT = 3181; private static final int BOOKIE_GRPC_PORT = 4181; // stream storage grpc port diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ChaosContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ChaosContainer.java index 33530f1..adc3e27 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ChaosContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ChaosContainer.java @@ -34,7 +34,7 @@ import org.testcontainers.containers.GenericContainer; * A base container provides chaos capability. */ @Slf4j -public class ChaosContainer<SELF extends ChaosContainer<SELF>> extends GenericContainer<SELF> { +public class ChaosContainer<SelfT extends ChaosContainer<SelfT>> extends GenericContainer<SelfT> { protected final String clusterName; @@ -45,7 +45,7 @@ public class ChaosContainer<SELF extends ChaosContainer<SELF>> extends GenericCo public void tailContainerLog() { CompletableFuture.runAsync(() -> { - while(null == containerId) { + while (null == containerId) { try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException e) { diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java index ec8d914..32303c7 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java @@ -21,7 +21,8 @@ package org.apache.bookkeeper.tests.containers; /** * An abstract class for metadata store container. */ -public abstract class MetadataStoreContainer<SELF extends MetadataStoreContainer<SELF>> extends ChaosContainer<SELF> { +public abstract class MetadataStoreContainer<SelfT extends MetadataStoreContainer<SelfT>> + extends ChaosContainer<SelfT> { protected MetadataStoreContainer(String clusterName, String image) { super(clusterName, image); } diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java index 8f5fb8a..4ef6a78 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/ZKContainer.java @@ -24,8 +24,11 @@ import java.time.Duration; import lombok.extern.slf4j.Slf4j; import org.apache.bookkeeper.tests.containers.wait.HttpWaitStrategy; +/** + * Test container that runs zookeeper. + */ @Slf4j -public class ZKContainer<SELF extends ZKContainer<SELF>> extends MetadataStoreContainer<SELF> { +public class ZKContainer<SelfT extends ZKContainer<SelfT>> extends MetadataStoreContainer<SelfT> { private static final int ZK_PORT = 2181; private static final int ZK_HTTP_PORT = 8080; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/package-info.java similarity index 64% copy from tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java copy to tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/package-info.java index ec8d914..f817134 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/package-info.java @@ -16,18 +16,7 @@ * limitations under the License. */ -package org.apache.bookkeeper.tests.containers; - /** - * An abstract class for metadata store container. + * Test containers used for running integration tests. */ -public abstract class MetadataStoreContainer<SELF extends MetadataStoreContainer<SELF>> extends ChaosContainer<SELF> { - protected MetadataStoreContainer(String clusterName, String image) { - super(clusterName, image); - } - - public abstract String getExternalServiceUri(); - - public abstract String getInternalServiceUri(); - -} +package org.apache.bookkeeper.tests.containers; \ No newline at end of file diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java index e70140a..0304c20 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/HttpWaitStrategy.java @@ -36,7 +36,7 @@ import org.testcontainers.containers.ContainerLaunchException; import org.testcontainers.containers.wait.strategy.AbstractWaitStrategy; /** - * Http Strategy + * An wait strategy to wait for http ports. */ public class HttpWaitStrategy extends AbstractWaitStrategy { @java.lang.SuppressWarnings("all") @@ -114,7 +114,8 @@ public class HttpWaitStrategy extends AbstractWaitStrategy { } /** - * Waits for the response to pass the given predicate + * Waits for the response to pass the given predicate. + * * @param responsePredicate The predicate to test the response against * @return this */ diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/ZKWaitStrategy.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/ZKWaitStrategy.java index bd3d916..5b41041 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/ZKWaitStrategy.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/ZKWaitStrategy.java @@ -20,7 +20,7 @@ package org.apache.bookkeeper.tests.containers.wait; import java.util.concurrent.TimeUnit; import lombok.extern.slf4j.Slf4j; -import org.apache.bookkeeper.tests.BookKeeperClusterUtils; +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils; import org.rnorth.ducttape.TimeoutException; import org.rnorth.ducttape.unreliables.Unreliables; import org.testcontainers.containers.ContainerLaunchException; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/package-info.java similarity index 64% copy from tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java copy to tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/package-info.java index ec8d914..59628b4 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java +++ b/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/wait/package-info.java @@ -16,18 +16,7 @@ * limitations under the License. */ -package org.apache.bookkeeper.tests.containers; - /** - * An abstract class for metadata store container. + * Wait strategies for running test containers. */ -public abstract class MetadataStoreContainer<SELF extends MetadataStoreContainer<SELF>> extends ChaosContainer<SELF> { - protected MetadataStoreContainer(String clusterName, String image) { - super(clusterName, image); - } - - public abstract String getExternalServiceUri(); - - public abstract String getInternalServiceUri(); - -} +package org.apache.bookkeeper.tests.containers.wait; \ No newline at end of file diff --git a/tests/integration-tests-topologies/src/main/resources/cube-definitions/3-node-all-version-unstarted.yaml b/tests/integration-tests-topologies/src/main/resources/cube-definitions/3-node-all-version-unstarted.yaml index a98a322..c0a2938 100644 --- a/tests/integration-tests-topologies/src/main/resources/cube-definitions/3-node-all-version-unstarted.yaml +++ b/tests/integration-tests-topologies/src/main/resources/cube-definitions/3-node-all-version-unstarted.yaml @@ -24,41 +24,41 @@ networks: zookeeper*: image: zookeeper:3.4.11 await: - strategy: org.apache.bookkeeper.tests.ZooKeeperAwaitStrategy + strategy: org.apache.bookkeeper.tests.integration.utils.ZooKeeperAwaitStrategy aliases: - zookeeper beforeStop: - customBeforeStopAction: - strategy: org.apache.bookkeeper.tests.LogToTargetDirStopAction + strategy: org.apache.bookkeeper.tests.integration.utils.LogToTargetDirStopAction networkMode: testnetwork* bookkeeper1*: image: apachebookkeeper/bookkeeper-all-versions await: - strategy: org.apache.bookkeeper.tests.NoopAwaitStrategy + strategy: org.apache.bookkeeper.tests.integration.utils.NoopAwaitStrategy env: [BK_ZKCONNECTSTRING=zookeeper] beforeStop: - customBeforeStopAction: - strategy: org.apache.bookkeeper.tests.BookKeeperLogsToTargetDirStopAction + strategy: org.apache.bookkeeper.tests.integration.utils.BookKeeperLogsToTargetDirStopAction networkMode: testnetwork* bookkeeper2*: image: apachebookkeeper/bookkeeper-all-versions await: - strategy: org.apache.bookkeeper.tests.NoopAwaitStrategy + strategy: org.apache.bookkeeper.tests.integration.utils.NoopAwaitStrategy env: [BK_ZKCONNECTSTRING=zookeeper] beforeStop: - customBeforeStopAction: - strategy: org.apache.bookkeeper.tests.BookKeeperLogsToTargetDirStopAction + strategy: org.apache.bookkeeper.tests.integration.utils.BookKeeperLogsToTargetDirStopAction networkMode: testnetwork* bookkeeper3*: image: apachebookkeeper/bookkeeper-all-versions await: - strategy: org.apache.bookkeeper.tests.NoopAwaitStrategy + strategy: org.apache.bookkeeper.tests.integration.utils.NoopAwaitStrategy env: [BK_ZKCONNECTSTRING=zookeeper] beforeStop: - customBeforeStopAction: - strategy: org.apache.bookkeeper.tests.BookKeeperLogsToTargetDirStopAction + strategy: org.apache.bookkeeper.tests.integration.utils.BookKeeperLogsToTargetDirStopAction networkMode: testnetwork* diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperClusterUtils.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/BookKeeperClusterUtils.java similarity index 95% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperClusterUtils.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/BookKeeperClusterUtils.java index 7020fff..b0f4e00 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperClusterUtils.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/BookKeeperClusterUtils.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,36 +7,38 @@ * "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 + * 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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import static java.nio.charset.StandardCharsets.UTF_8; import com.github.dockerjava.api.DockerClient; import java.io.IOException; +import java.net.Socket; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import java.net.Socket; -import org.apache.zookeeper.ZooKeeper; import org.apache.zookeeper.CreateMode; -import org.apache.zookeeper.ZooDefs.Ids; import org.apache.zookeeper.Watcher.Event.KeeperState; +import org.apache.zookeeper.ZooDefs.Ids; +import org.apache.zookeeper.ZooKeeper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Utils for interacting a bookkeeper cluster used for integration tests. + */ public class BookKeeperClusterUtils { private static final Logger LOG = LoggerFactory.getLogger(BookKeeperClusterUtils.class); diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperLogsToTargetDirStopAction.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/BookKeeperLogsToTargetDirStopAction.java similarity index 72% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperLogsToTargetDirStopAction.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/BookKeeperLogsToTargetDirStopAction.java index cab00f8..a5fae2d 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/BookKeeperLogsToTargetDirStopAction.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/BookKeeperLogsToTargetDirStopAction.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,21 +7,23 @@ * "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 + * 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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import org.arquillian.cube.docker.impl.docker.DockerClientExecutor; import org.arquillian.cube.impl.model.CubeId; import org.arquillian.cube.spi.beforeStop.BeforeStopAction; +/** + * An arquillian stop action that dump container logs to maven target directories. + */ public class BookKeeperLogsToTargetDirStopAction implements BeforeStopAction { private DockerClientExecutor dockerClientExecutor; private CubeId containerID; diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/DockerUtils.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/DockerUtils.java similarity index 90% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/DockerUtils.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/DockerUtils.java index 53d6228..9b9fb15 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/DockerUtils.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/DockerUtils.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,30 +7,29 @@ * "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 + * 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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import static java.nio.charset.StandardCharsets.UTF_8; import com.github.dockerjava.api.DockerClient; import com.github.dockerjava.api.async.ResultCallback; import com.github.dockerjava.api.command.InspectExecResponse; -import com.github.dockerjava.api.model.Frame; import com.github.dockerjava.api.model.ContainerNetwork; +import com.github.dockerjava.api.model.Frame; import java.io.Closeable; import java.io.File; import java.io.FileOutputStream; -import java.io.InputStream; import java.io.IOException; +import java.io.InputStream; import java.util.Arrays; import java.util.Map; import java.util.Set; @@ -39,12 +38,15 @@ import java.util.concurrent.ExecutionException; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * Docker utilities for integration tests. + */ public class DockerUtils { private static final Logger LOG = LoggerFactory.getLogger(DockerUtils.class); @@ -92,7 +94,7 @@ public class DockerUtils { } }); future.get(); - } catch (RuntimeException|ExecutionException|IOException e) { + } catch (RuntimeException | ExecutionException | IOException e) { LOG.error("Error dumping log for {}", containerId, e); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); @@ -101,7 +103,7 @@ public class DockerUtils { } public static void dumpContainerLogDirToTarget(DockerClient docker, String containerId, String path) { - final int READ_BLOCK_SIZE = 10000; + final int readBlockSize = 10000; try (InputStream dockerStream = docker.copyArchiveFromContainerCmd(containerId, path).exec(); TarArchiveInputStream stream = new TarArchiveInputStream(dockerStream)) { @@ -110,17 +112,17 @@ public class DockerUtils { if (entry.isFile()) { File output = new File(getTargetDirectory(containerId), entry.getName().replace("/", "-")); try (FileOutputStream os = new FileOutputStream(output)) { - byte[] block = new byte[READ_BLOCK_SIZE]; - int read = stream.read(block, 0, READ_BLOCK_SIZE); + byte[] block = new byte[readBlockSize]; + int read = stream.read(block, 0, readBlockSize); while (read > -1) { os.write(block, 0, read); - read = stream.read(block, 0, READ_BLOCK_SIZE); + read = stream.read(block, 0, readBlockSize); } } } entry = stream.getNextTarEntry(); } - } catch (RuntimeException|IOException e) { + } catch (RuntimeException | IOException e) { LOG.error("Error reading bk logs from container {}", containerId, e); } } diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/LogToTargetDirStopAction.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/LogToTargetDirStopAction.java similarity index 69% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/LogToTargetDirStopAction.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/LogToTargetDirStopAction.java index 24f9761..47990c7 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/LogToTargetDirStopAction.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/LogToTargetDirStopAction.java @@ -1,4 +1,4 @@ -/** +/* * 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 @@ -7,21 +7,23 @@ * "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 + * 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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import org.arquillian.cube.docker.impl.docker.DockerClientExecutor; import org.arquillian.cube.impl.model.CubeId; import org.arquillian.cube.spi.beforeStop.BeforeStopAction; +/** + * An arquillian stop action that copy container log to target directory. + */ public class LogToTargetDirStopAction implements BeforeStopAction { private DockerClientExecutor dockerClientExecutor; private CubeId containerID; diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/MavenClassLoader.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoader.java similarity index 92% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/MavenClassLoader.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoader.java index 2c3bb30..3c1d13f 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/MavenClassLoader.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoader.java @@ -1,5 +1,4 @@ -/** - * +/* * 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 @@ -8,17 +7,15 @@ * "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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import com.google.common.collect.Lists; @@ -48,6 +45,9 @@ import org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenDependency; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * A maven class loader for resolving and loading maven artifacts. + */ public class MavenClassLoader implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(MavenClassLoader.class); @@ -127,7 +127,7 @@ public class MavenClassLoader implements AutoCloseable { try { Object type = k.getField("TYPE").get(null); if (type instanceof Class<?>) { - return (Class<?>)type; + return (Class<?>) type; } else { return k; } @@ -153,7 +153,8 @@ public class MavenClassLoader implements AutoCloseable { return closure.call(args); } else { final Class<?> declaringClass = m.getDeclaringClass(); - return constructor.newInstance(declaringClass, MethodHandles.Lookup.PRIVATE) + return constructor.newInstance( + declaringClass, MethodHandles.Lookup.PRIVATE) .unreflectSpecial(m, declaringClass) .bindTo(proxy) .invokeWithArguments(args); diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/NoopAwaitStrategy.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/NoopAwaitStrategy.java similarity index 56% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/NoopAwaitStrategy.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/NoopAwaitStrategy.java index 6df8167..b8cb66b 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/NoopAwaitStrategy.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/NoopAwaitStrategy.java @@ -1,5 +1,4 @@ -/** - * +/* * 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 @@ -8,20 +7,21 @@ * "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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import org.arquillian.cube.spi.await.AwaitStrategy; +/** + * A noop arquillian await strategy. + */ public class NoopAwaitStrategy implements AwaitStrategy { @Override public boolean await() { diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/ThreadReaper.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/ThreadReaper.java similarity index 81% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/ThreadReaper.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/ThreadReaper.java index abccbd9..fbae638 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/ThreadReaper.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/ThreadReaper.java @@ -1,5 +1,4 @@ -/** - * +/* * 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 @@ -8,17 +7,15 @@ * "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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; @@ -27,6 +24,9 @@ import java.util.concurrent.atomic.AtomicInteger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * A thread reaper. + */ public class ThreadReaper { private static final Logger LOG = LoggerFactory.getLogger(ThreadReaper.class); private static AtomicInteger groupId = new AtomicInteger(0); diff --git a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/ZooKeeperAwaitStrategy.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/ZooKeeperAwaitStrategy.java similarity index 76% rename from tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/ZooKeeperAwaitStrategy.java rename to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/ZooKeeperAwaitStrategy.java index 86d2d69..b1ed5fa 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/ZooKeeperAwaitStrategy.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/ZooKeeperAwaitStrategy.java @@ -1,5 +1,4 @@ -/** - * +/* * 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 @@ -8,31 +7,30 @@ * "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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import java.util.concurrent.TimeUnit; -import org.arquillian.cube.spi.Cube; -import org.arquillian.cube.spi.await.AwaitStrategy; -import org.arquillian.cube.spi.metadata.HasPortBindings; -import org.arquillian.cube.docker.impl.client.config.Await; import org.arquillian.cube.docker.impl.docker.DockerClientExecutor; import org.arquillian.cube.docker.impl.util.Ping; import org.arquillian.cube.docker.impl.util.PingCommand; +import org.arquillian.cube.spi.Cube; +import org.arquillian.cube.spi.await.AwaitStrategy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +/** + * An arquillian await strategy that waits until zookeeper is up running. + */ public class ZooKeeperAwaitStrategy implements AwaitStrategy { private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperAwaitStrategy.class); diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/package-info.java similarity index 64% copy from tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java copy to tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/package-info.java index ec8d914..d1db6a3 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/bookkeeper/tests/containers/MetadataStoreContainer.java +++ b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/package-info.java @@ -16,18 +16,7 @@ * limitations under the License. */ -package org.apache.bookkeeper.tests.containers; - /** - * An abstract class for metadata store container. + * Utilities for bookkeeper integration tests. */ -public abstract class MetadataStoreContainer<SELF extends MetadataStoreContainer<SELF>> extends ChaosContainer<SELF> { - protected MetadataStoreContainer(String clusterName, String image) { - super(clusterName, image); - } - - public abstract String getExternalServiceUri(); - - public abstract String getInternalServiceUri(); - -} +package org.apache.bookkeeper.tests.integration.utils; \ No newline at end of file diff --git a/tests/integration-tests-utils/src/test/java/org/apache/bookkeeper/tests/MavenClassLoaderTest.java b/tests/integration-tests-utils/src/test/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoaderTest.java similarity index 75% rename from tests/integration-tests-utils/src/test/java/org/apache/bookkeeper/tests/MavenClassLoaderTest.java rename to tests/integration-tests-utils/src/test/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoaderTest.java index e4d0533..c20b2ed 100644 --- a/tests/integration-tests-utils/src/test/java/org/apache/bookkeeper/tests/MavenClassLoaderTest.java +++ b/tests/integration-tests-utils/src/test/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoaderTest.java @@ -1,5 +1,4 @@ -/** - * +/* * 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 @@ -8,25 +7,26 @@ * "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. + * 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.bookkeeper.tests; +package org.apache.bookkeeper.tests.integration.utils; import com.google.common.collect.Lists; import org.junit.Assert; import org.junit.Test; +/** + * Unit test of {@link MavenClassLoader}. + */ public class MavenClassLoaderTest { - @Test(expected=ClassNotFoundException.class) + @Test(expected = ClassNotFoundException.class) public void testLog4JReplacement() throws Exception { MavenClassLoader.forBookKeeperVersion("4.0.0") .newInstance("org.apache.log4j.Logger"); diff --git a/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/LocationClientTest.java b/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/LocationClientTest.java index 92e39c3..d231ce9 100644 --- a/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/LocationClientTest.java +++ b/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/LocationClientTest.java @@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue; import com.google.common.collect.Lists; import java.util.List; import lombok.extern.slf4j.Slf4j; -import org.apache.bookkeeper.clients.config.StorageClientSettings; import org.apache.bookkeeper.clients.impl.internal.LocationClientImpl; import org.apache.bookkeeper.clients.impl.internal.api.LocationClient; import org.apache.bookkeeper.common.util.OrderedScheduler; diff --git a/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/StorageAdminClientTest.java b/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/StorageAdminClientTest.java index 569cf7c..4e39dfa 100644 --- a/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/StorageAdminClientTest.java +++ b/tests/integration/cluster/src/test/java/org/apache/bookkeeper/tests/integration/stream/StorageAdminClientTest.java @@ -23,21 +23,17 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import org.apache.bookkeeper.clients.StorageClientBuilder; import org.apache.bookkeeper.clients.admin.StorageAdminClient; -import org.apache.bookkeeper.clients.config.StorageClientSettings; import org.apache.bookkeeper.clients.exceptions.ClientException; import org.apache.bookkeeper.clients.exceptions.NamespaceExistsException; import org.apache.bookkeeper.clients.exceptions.NamespaceNotFoundException; import org.apache.bookkeeper.clients.exceptions.StreamExistsException; import org.apache.bookkeeper.clients.exceptions.StreamNotFoundException; import org.apache.bookkeeper.common.concurrent.FutureUtils; -import org.apache.bookkeeper.common.util.OrderedScheduler; import org.apache.bookkeeper.stream.proto.NamespaceConfiguration; import org.apache.bookkeeper.stream.proto.NamespaceProperties; import org.apache.bookkeeper.stream.proto.StreamConfiguration; import org.apache.bookkeeper.stream.proto.StreamProperties; -import org.apache.bookkeeper.stream.proto.common.Endpoint; import org.apache.bookkeeper.stream.proto.storage.StatusCode; import org.junit.After; import org.junit.Before; diff --git a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/BookieShellTestBase.java b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/BookieShellTestBase.java index f1a58ed..276b842 100644 --- a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/BookieShellTestBase.java +++ b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/BookieShellTestBase.java @@ -24,6 +24,9 @@ import lombok.extern.slf4j.Slf4j; import org.junit.Before; import org.junit.Test; +/** + * Test Base for testing bookie shell scripts. + */ @Slf4j public abstract class BookieShellTestBase { diff --git a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestBookieShellCluster.java b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestBookieShellCluster.java index 04b950a..8b138c7 100644 --- a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestBookieShellCluster.java +++ b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestBookieShellCluster.java @@ -22,8 +22,8 @@ import static org.junit.Assert.assertTrue; import com.github.dockerjava.api.DockerClient; import lombok.extern.slf4j.Slf4j; -import org.apache.bookkeeper.tests.BookKeeperClusterUtils; -import org.apache.bookkeeper.tests.DockerUtils; +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils; +import org.apache.bookkeeper.tests.integration.utils.DockerUtils; import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.test.api.ArquillianResource; import org.junit.FixMethodOrder; @@ -31,6 +31,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; +/** + * Test cluster related commands in bookie shell. + */ @Slf4j @RunWith(Arquillian.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) diff --git a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestCLI.java b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestCLI.java index 7761808..27c376c 100644 --- a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestCLI.java +++ b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestCLI.java @@ -22,8 +22,8 @@ import static org.junit.Assert.assertTrue; import com.github.dockerjava.api.DockerClient; import lombok.extern.slf4j.Slf4j; -import org.apache.bookkeeper.tests.BookKeeperClusterUtils; -import org.apache.bookkeeper.tests.DockerUtils; +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils; +import org.apache.bookkeeper.tests.integration.utils.DockerUtils; import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.test.api.ArquillianResource; import org.junit.Before; @@ -32,6 +32,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; +/** + * Test `bin/bookkeeper-cli`. + */ @Slf4j @RunWith(Arquillian.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) diff --git a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestDlogCLI.java b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestDlogCLI.java index 83ecde6..34b88c1 100644 --- a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestDlogCLI.java +++ b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestDlogCLI.java @@ -25,8 +25,8 @@ import com.github.dockerjava.api.DockerClient; import java.util.HashSet; import java.util.Set; import lombok.extern.slf4j.Slf4j; -import org.apache.bookkeeper.tests.BookKeeperClusterUtils; -import org.apache.bookkeeper.tests.DockerUtils; +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils; +import org.apache.bookkeeper.tests.integration.utils.DockerUtils; import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.test.api.ArquillianResource; import org.junit.Before; @@ -35,6 +35,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; +/** + * Test `bin/dlog`. + */ @Slf4j @RunWith(Arquillian.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) diff --git a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestSmoke.java b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestSmoke.java index 8ecf28b..2662b18 100644 --- a/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestSmoke.java +++ b/tests/integration/smoke/src/test/java/org/apache/bookkeeper/tests/integration/TestSmoke.java @@ -41,7 +41,7 @@ import org.apache.bookkeeper.client.LedgerEntry; import org.apache.bookkeeper.client.LedgerHandle; import org.apache.bookkeeper.common.concurrent.FutureUtils; import org.apache.bookkeeper.conf.ClientConfiguration; -import org.apache.bookkeeper.tests.BookKeeperClusterUtils; +import org.apache.bookkeeper.tests.integration.utils.BookKeeperClusterUtils; import org.jboss.arquillian.junit.Arquillian; import org.jboss.arquillian.test.api.ArquillianResource; import org.junit.Assert; @@ -50,11 +50,14 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; +/** + * Smoke tests for ledger apis. + */ @Slf4j @RunWith(Arquillian.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestSmoke { - private static byte[] PASSWD = "foobar".getBytes(); + private static final byte[] PASSWD = "foobar".getBytes(); @ArquillianResource DockerClient docker; diff --git a/tests/shaded/bookkeeper-server-shaded-test/pom.xml b/tests/shaded/bookkeeper-server-shaded-test/pom.xml index d17fa1f..9a8d95d 100644 --- a/tests/shaded/bookkeeper-server-shaded-test/pom.xml +++ b/tests/shaded/bookkeeper-server-shaded-test/pom.xml @@ -57,10 +57,6 @@ <artifactId>maven-compiler-plugin</artifactId> <version>${maven-compiler-plugin.version}</version> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> </project> diff --git a/tests/shaded/bookkeeper-server-tests-shaded-test/pom.xml b/tests/shaded/bookkeeper-server-tests-shaded-test/pom.xml index 6f6fbd4..81fcbb0 100644 --- a/tests/shaded/bookkeeper-server-tests-shaded-test/pom.xml +++ b/tests/shaded/bookkeeper-server-tests-shaded-test/pom.xml @@ -73,10 +73,6 @@ <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - </plugin> </plugins> </build> </project> diff --git a/tests/shaded/distributedlog-core-shaded-test/pom.xml b/tests/shaded/distributedlog-core-shaded-test/pom.xml index 39b6e02..647676f 100644 --- a/tests/shaded/distributedlog-core-shaded-test/pom.xml +++ b/tests/shaded/distributedlog-core-shaded-test/pom.xml @@ -77,13 +77,6 @@ <groupId>com.github.spotbugs</groupId> <artifactId>spotbugs-maven-plugin</artifactId> </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-checkstyle-plugin</artifactId> - <configuration> - <suppressionsLocation>distributedlog/suppressions.xml</suppressionsLocation> - </configuration> - </plugin> </plugins> </build> </project> -- To stop receiving notification emails like this one, please contact si...@apache.org.