sijie closed pull request #2180: Cleanup Arquillian consolidate projects URL: https://github.com/apache/incubator-pulsar/pull/2180
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/tests/README.md b/tests/README.md index ccd4a8fe73..b2eacbc4ae 100644 --- a/tests/README.md +++ b/tests/README.md @@ -21,9 +21,7 @@ This directory contains integration tests for Pulsar. -The integration tests use a framework called [Arquillian Cube](https://github.com/arquillian/arquillian-cube) to bring up a bunch of docker containers running Pulsar services. TestNG can then be used to test functionallity against these containers. - -Arquillian sets up a clean set of containers for each test suite. However, if maven is configured to fork per test class, Arquillian will set up a clean set of containers _per test class_. The test cases within the class will share the environment, so tests which leave the cluster in a different state after running should be put in their own test class. +The integration tests use a framework called [Test Containers](https://www.testcontainers.org/) to bring up a bunch of docker containers running Pulsar services. TestNG can then be used to test functionallity against these containers. The tests require that docker is installed and running. Tests will only run if the integrationTests system property is defined. To run the tests: ```shell @@ -36,8 +34,5 @@ pulsar/ $ mvn -f tests/pom.xml test -DintegrationTests The directories are as follows: - docker-images/ : Docker images for integration testing. -- integration/ : The integration tests themselves. -- integration-tests-base/ : A base module for integration test modules. Contains common settings and dependencies. -- integration-tests-topologies/ : Arquillian cluster definitions for use in integration tests. -- integration-tests-utils/ : Utilities for working with arquillian test clusters. +- integration/ : The integration tests and utilities themselves. diff --git a/tests/integration-tests-base/pom.xml b/tests/integration-tests-base/pom.xml deleted file mode 100644 index f0e5505f8b..0000000000 --- a/tests/integration-tests-base/pom.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>tests-parent</artifactId> - <version>2.2.0-incubating-SNAPSHOT</version> - </parent> - - <artifactId>integration-tests-base</artifactId> - <packaging>pom</packaging> - - <name>Apache Pulsar :: Tests :: Base module for Arquillian based integration tests</name> - - <dependencies> - - <dependency> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-utils</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-topologies</artifactId> - <version>${project.version}</version> - </dependency> - - <dependency> - <groupId>org.jboss.arquillian.testng</groupId> - <artifactId>arquillian-testng-standalone</artifactId> - <version>1.1.14.Final</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <!-- only run tests when -DintegrationTests is specified //--> - <skipTests>true</skipTests> - <systemPropertyVariables> - <currentVersion>${project.version}</currentVersion> - <maven.buildDirectory>${project.build.directory}</maven.buildDirectory> - </systemPropertyVariables> - </configuration> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>integrationTests</id> - <activation> - <property> - <name>integrationTests</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <properties> - <property> - <name>listener</name> - <!-- AnnotationListener breaks arquillian, so don't use it //--> - <value>org.apache.pulsar.tests.PulsarTestListener</value> - </property> - </properties> - - <argLine>-Xmx2G -XX:MaxDirectMemorySize=8G - -Dio.netty.leakDetectionLevel=advanced - </argLine> - <skipTests>false</skipTests> - </configuration> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project> diff --git a/tests/integration-tests-topologies/pom.xml b/tests/integration-tests-topologies/pom.xml deleted file mode 100644 index 4b84adf6f7..0000000000 --- a/tests/integration-tests-topologies/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>tests-parent</artifactId> - <version>2.2.0-incubating-SNAPSHOT</version> - </parent> - - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-topologies</artifactId> - <packaging>jar</packaging> - - <name>Apache Pulsar :: Tests :: Common topologies for Arquillian based integration tests</name> - <dependencies> - <dependency> - <groupId>org.testcontainers</groupId> - <artifactId>testcontainers</artifactId> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-utils</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - -</project> diff --git a/tests/integration-tests-topologies/src/main/resources/cube-definitions/single-cluster-3-bookie-2-broker-unstarted.yaml b/tests/integration-tests-topologies/src/main/resources/cube-definitions/single-cluster-3-bookie-2-broker-unstarted.yaml deleted file mode 100644 index 7664091213..0000000000 --- a/tests/integration-tests-topologies/src/main/resources/cube-definitions/single-cluster-3-bookie-2-broker-unstarted.yaml +++ /dev/null @@ -1,189 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -networks: - pulsarnet*: - driver: bridge - -zookeeper*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: [ZOOKEEPER_SERVERS=zookeeper] - labels: - cluster: test - service: zookeeper - entryPoint: [bin/run-local-zk.sh] - aliases: - - zookeeper - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.ZKJournalToTargetDirStopAction - networkMode: pulsarnet* - -configuration-store*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: [ZOOKEEPER_SERVERS=configuration-store] - labels: - cluster: test - service: configuration-store - entryPoint: [bin/run-global-zk.sh] - aliases: - - configuration-store - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.ZKJournalToTargetDirStopAction - networkMode: pulsarnet* - -init*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - clusterName=test - - zkServers=zookeeper - - configurationStore=configuration-store:2184 - - pulsarNode=pulsar-broker1 - labels: - cluster: test - service: init - entryPoint: [bin/init-cluster.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.LogToTargetDirStopAction - networkMode: pulsarnet* - -bookkeeper1*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - clusterName=test - - zkServers=zookeeper - - useHostNameAsBookieID=true - labels: - cluster: test - service: bookie - entryPoint: [bin/run-bookie.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -bookkeeper2*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - clusterName=test - - zkServers=zookeeper - - useHostNameAsBookieID=true - labels: - cluster: test - service: bookie - entryPoint: [bin/run-bookie.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -bookkeeper3*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - clusterName=test - - zkServers=zookeeper - - useHostNameAsBookieID=true - labels: - cluster: test - service: bookie - entryPoint: [bin/run-bookie.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -pulsar-broker1*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - aliases: - - pulsar-broker1 - env: - - clusterName=test - - zookeeperServers=zookeeper - - configurationStoreServers=configuration-store:2184 - - NO_AUTOSTART=true - labels: - cluster: test - service: pulsar-broker - entryPoint: [bin/run-broker.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -pulsar-broker2*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - aliases: - - pulsar-broker2 - env: - - clusterName=test - - zookeeperServers=zookeeper - - configurationStoreServers=configuration-store:2184 - - NO_AUTOSTART=true - labels: - cluster: test - service: pulsar-broker - entryPoint: [bin/run-broker.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -pulsar-proxy*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - aliases: - - pulsar-broker2 - env: - - clusterName=test - - zookeeperServers=zookeeper - - configurationStoreServers=configuration-store:2184 - - NO_AUTOSTART=true - labels: - cluster: test - service: pulsar-proxy - entryPoint: [bin/run-proxy.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - - diff --git a/tests/integration-tests-topologies/src/main/resources/cube-definitions/single-cluster-3-bookie-2-broker.yaml b/tests/integration-tests-topologies/src/main/resources/cube-definitions/single-cluster-3-bookie-2-broker.yaml deleted file mode 100644 index 082a4d1585..0000000000 --- a/tests/integration-tests-topologies/src/main/resources/cube-definitions/single-cluster-3-bookie-2-broker.yaml +++ /dev/null @@ -1,187 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -networks: - pulsarnet*: - driver: bridge - -zookeeper*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: [ZOOKEEPER_SERVERS=zookeeper] - labels: - cluster: test - service: zookeeper - entryPoint: [bin/run-local-zk.sh] - aliases: - - zookeeper - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.ZKJournalToTargetDirStopAction - networkMode: pulsarnet* - -configuration-store*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: [ZOOKEEPER_SERVERS=configuration-store] - labels: - cluster: test - service: configuration-store - entryPoint: [bin/run-global-zk.sh] - aliases: - - configuration-store - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.ZKJournalToTargetDirStopAction - networkMode: pulsarnet* - -init*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - clusterName=test - - zkServers=zookeeper - - configurationStore=configuration-store:2184 - - pulsarNode=pulsar-broker1 - labels: - cluster: test - service: init - entryPoint: [bin/init-cluster.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.LogToTargetDirStopAction - networkMode: pulsarnet* - -bookkeeper1*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - zkServers=zookeeper - - useHostNameAsBookieID=true - - clusterName=test - labels: - cluster: test - service: bookie - entryPoint: [bin/run-bookie.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -bookkeeper2*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - zkServers=zookeeper - - useHostNameAsBookieID=true - labels: - cluster: test - service: bookie - entryPoint: [bin/run-bookie.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -bookkeeper3*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - env: - - zkServers=zookeeper - - useHostNameAsBookieID=true - - clusterName=test - labels: - cluster: test - service: bookie - entryPoint: [bin/run-bookie.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -pulsar-broker1*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - aliases: - - pulsar-broker1 - env: - - zookeeperServers=zookeeper - - configurationStoreServers=configuration-store:2184 - - clusterName=test - - brokerServiceCompactionMonitorIntervalInSeconds=1 - labels: - cluster: test - service: pulsar-broker - entryPoint: [bin/run-broker.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -pulsar-broker2*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - aliases: - - pulsar-broker2 - env: - - zookeeperServers=zookeeper - - configurationStoreServers=configuration-store:2184 - - clusterName=test - - brokerServiceCompactionMonitorIntervalInSeconds=1 - labels: - cluster: test - service: pulsar-broker - entryPoint: [bin/run-broker.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - -pulsar-proxy*: - image: apachepulsar/pulsar-test-latest-version:latest - await: - strategy: org.apache.pulsar.tests.NoopAwaitStrategy - aliases: - - pulsar-broker2 - env: - - zookeeperServers=zookeeper - - configurationStoreServers=configuration-store:2184 - - clusterName=test - labels: - cluster: test - service: pulsar-proxy - entryPoint: [bin/run-proxy.sh] - beforeStop: - - customBeforeStopAction: - strategy: org.apache.pulsar.tests.PulsarLogsToTargetDirStopAction - networkMode: pulsarnet* - - diff --git a/tests/integration-tests-utils/pom.xml b/tests/integration-tests-utils/pom.xml deleted file mode 100644 index 2ebed73556..0000000000 --- a/tests/integration-tests-utils/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>tests-parent</artifactId> - <version>2.2.0-incubating-SNAPSHOT</version> - </parent> - - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-utils</artifactId> - <packaging>jar</packaging> - - <name>Apache Pulsar :: Tests :: Utility module for Arquillian based integration tests</name> - - <dependencies> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-compress</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.zookeeper</groupId> - <artifactId>zookeeper</artifactId> - </dependency> - - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - </dependency> - - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.core</groupId> - <artifactId>jackson-databind</artifactId> - </dependency> - - <dependency> - <groupId>com.fasterxml.jackson.dataformat</groupId> - <artifactId>jackson-dataformat-yaml</artifactId> - </dependency> - - <dependency> - <groupId>org.arquillian.cube</groupId> - <artifactId>arquillian-cube-docker</artifactId> - </dependency> - - </dependencies> -</project> diff --git a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/LogToTargetDirStopAction.java b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/LogToTargetDirStopAction.java deleted file mode 100644 index f74ce471ff..0000000000 --- a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/LogToTargetDirStopAction.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pulsar.tests; - -import org.arquillian.cube.docker.impl.docker.DockerClientExecutor; -import org.arquillian.cube.impl.model.CubeId; -import org.arquillian.cube.spi.beforeStop.BeforeStopAction; - -public class LogToTargetDirStopAction implements BeforeStopAction { - private DockerClientExecutor dockerClientExecutor; - private CubeId containerID; - - public void setDockerClientExecutor(DockerClientExecutor executor) { - this.dockerClientExecutor = executor; - } - - public void setContainerID(CubeId containerID) { - this.containerID = containerID; - } - - @Override - public void doBeforeStop() { - DockerUtils.dumpContainerLogToTarget(dockerClientExecutor.getDockerClient(), containerID.getId()); - } -} diff --git a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/NoopAwaitStrategy.java b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/NoopAwaitStrategy.java deleted file mode 100644 index d9ef56c8c2..0000000000 --- a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/NoopAwaitStrategy.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pulsar.tests; - -import org.arquillian.cube.spi.await.AwaitStrategy; - -public class NoopAwaitStrategy implements AwaitStrategy { - @Override - public boolean await() { - return true; - } -} diff --git a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarClusterUtils.java b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarClusterUtils.java deleted file mode 100644 index e5197600f9..0000000000 --- a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarClusterUtils.java +++ /dev/null @@ -1,306 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pulsar.tests; - -import static java.nio.charset.StandardCharsets.UTF_8; - -import com.github.dockerjava.api.DockerClient; -import com.google.common.collect.ImmutableMap; - -import java.io.IOException; -import java.util.Optional; -import java.util.Set; -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.Watcher.Event.KeeperState; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class PulsarClusterUtils { - private static final Logger LOG = LoggerFactory.getLogger(PulsarClusterUtils.class); - static final short BROKER_PORT = 8080; - - public static final String PULSAR_ADMIN = "/pulsar/bin/pulsar-admin"; - public static final String PULSAR = "/pulsar/bin/pulsar"; - - public static String zookeeperConnectString(DockerClient docker, String cluster) { - return DockerUtils.cubeIdsWithLabels(docker, ImmutableMap.of("service", "zookeeper", "cluster", cluster)) - .stream().map((id) -> DockerUtils.getContainerIP(docker, id)).collect(Collectors.joining(":")); - } - - public static ZooKeeper zookeeperClient(DockerClient docker, String cluster) throws Exception { - String connectString = zookeeperConnectString(docker, cluster); - LOG.info("Connecting to zookeeper {}", connectString); - CompletableFuture<Void> future = new CompletableFuture<>(); - ZooKeeper zk = new ZooKeeper(connectString, 10000, - (e) -> { - if (e.getState().equals(KeeperState.SyncConnected)) { - future.complete(null); - } - }); - future.get(); - return zk; - } - - public static boolean zookeeperRunning(DockerClient docker, String containerId) { - String ip = DockerUtils.getContainerIP(docker, containerId); - try (Socket socket = new Socket(ip, 2181)) { - socket.setSoTimeout(1000); - socket.getOutputStream().write("ruok".getBytes(UTF_8)); - byte[] resp = new byte[4]; - if (socket.getInputStream().read(resp) == 4) { - return new String(resp, UTF_8).equals("imok"); - } - } catch (IOException e) { - // ignore, we'll return fallthrough to return false - } - return false; - } - - public static boolean waitZooKeeperUp(DockerClient docker, String cluster, int timeout, TimeUnit timeoutUnit) - throws Exception { - Optional<String> zookeeper = zookeeperSet(docker, cluster).stream().findAny(); - if (zookeeper.isPresent()) { - long timeoutMillis = timeoutUnit.toMillis(timeout); - long pollMillis = 1000; - while (timeoutMillis > 0) { - if (zookeeperRunning(docker, zookeeper.get())) { - return true; - } - Thread.sleep(pollMillis); - timeoutMillis -= pollMillis; - } - return false; - } else { - LOG.warn("No zookeeper containers found"); - return false; - } - } - - public static boolean runOnAnyBroker(DockerClient docker, String cluster, String... cmds) throws Exception { - Optional<String> broker = DockerUtils.cubeIdsWithLabels( - docker,ImmutableMap.of("service", "pulsar-broker", "cluster", cluster)).stream().findAny(); - if (broker.isPresent()) { - DockerUtils.runCommand(docker, broker.get(), cmds); - return true; - } else { - return false; - } - } - - public static void runOnAllBrokers(DockerClient docker, String cluster, String... cmds) throws Exception { - DockerUtils.cubeIdsWithLabels(docker,ImmutableMap.of("service", "pulsar-broker", "cluster", cluster)) - .stream().forEach((b) -> DockerUtils.runCommand(docker, b, cmds)); - } - - private static boolean waitBrokerState(DockerClient docker, String containerId, - int timeout, TimeUnit timeoutUnit, - boolean upOrDown) { - long timeoutMillis = timeoutUnit.toMillis(timeout); - long pollMillis = 1000; - String brokerId = DockerUtils.getContainerHostname(docker, containerId) + ":" + BROKER_PORT; - Optional<String> containerCluster = DockerUtils.getContainerCluster(docker, containerId); - if (!containerCluster.isPresent()) { - LOG.error("Unable to determine cluster for container {}. Missing label?", containerId); - return false; - } - - ZooKeeper zk = null; - try { - zk = zookeeperClient(docker, containerCluster.get()); - String path = "/loadbalance/brokers/" + brokerId; - while (timeoutMillis > 0) { - if ((zk.exists(path, false) != null) == upOrDown) { - return true; - } - Thread.sleep(pollMillis); - timeoutMillis -= pollMillis; - } - } catch (Exception e) { - LOG.error("Exception checking for broker state", e); - return false; - } finally { - try { - if (zk != null) { - zk.close(); - } - } catch (Exception e) { - LOG.error("Exception closing zookeeper client", e); - return false; - } - } - LOG.warn("Broker {} didn't go {} after {} seconds", - containerId, upOrDown ? "up" : "down", - timeoutUnit.toSeconds(timeout)); - return false; - } - - public static boolean waitBrokerUp(DockerClient docker, String containerId, - int timeout, TimeUnit timeoutUnit) { - if (waitBrokerState(docker, containerId, timeout, timeoutUnit, true)) { - String ip = DockerUtils.getContainerIP(docker, containerId); - - long timeoutMillis = timeoutUnit.toMillis(timeout); - long pollMillis = 100; - - while (timeoutMillis > 0) { - try (Socket socket = new Socket(ip, BROKER_PORT)) { - return true; - } catch (Exception e) { - // couldn't connect, try again after sleep - LOG.debug("Failed to connect {} @ {}", ip, BROKER_PORT, e); - } - try { - Thread.sleep(pollMillis); - } catch (InterruptedException ie) { - Thread.currentThread().interrupt(); - break; - } - timeoutMillis -= pollMillis; - } - } - return false; - } - - public static boolean waitBrokerDown(DockerClient docker, String containerId, - int timeout, TimeUnit timeoutUnit) { - return waitBrokerState(docker, containerId, timeout, timeoutUnit, false); - } - - public static boolean waitAllBrokersUp(DockerClient docker, String cluster) { - return brokerSet(docker, cluster).stream() - .map((b) -> waitBrokerUp(docker, b, 60, TimeUnit.SECONDS)) - .reduce(true, (accum, res) -> accum && res); - } - - public static boolean waitAllBrokersDown(DockerClient docker, String cluster) { - return brokerSet(docker, cluster).stream() - .map((b) -> waitBrokerDown(docker, b, 60, TimeUnit.SECONDS)) - .reduce(true, (accum, res) -> accum && res); - } - - public static void waitSupervisord(DockerClient docker, String containerId) { - DockerUtils.runCommand(docker, containerId, "timeout", "60", "bash", "-c", - "until test -S /var/run/supervisor/supervisor.sock; do sleep 0.1; done"); - } - - public static boolean startAllBrokers(DockerClient docker, String cluster) { - brokerSet(docker, cluster).stream().forEach( - (b) -> { - waitSupervisord(docker, b); - DockerUtils.runCommand(docker, b, "supervisorctl", "start", "broker"); - }); - - return waitAllBrokersUp(docker, cluster); - } - - public static boolean stopAllBrokers(DockerClient docker, String cluster) { - brokerSet(docker, cluster).stream().forEach( - (b) -> DockerUtils.runCommand(docker, b, "supervisorctl", "stop", "broker")); - - return waitAllBrokersDown(docker, cluster); - } - - public static Set<String> brokerSet(DockerClient docker, String cluster) { - return DockerUtils.cubeIdsWithLabels(docker, ImmutableMap.of("service", "pulsar-broker", - "cluster", cluster)); - } - - public static boolean waitProxyUp(DockerClient docker, String containerId, - int timeout, TimeUnit timeoutUnit) { - String ip = DockerUtils.getContainerIP(docker, containerId); - long timeoutMillis = timeoutUnit.toMillis(timeout); - long pollMillis = 100; - - while (timeoutMillis > 0) { - try (Socket socket = new Socket(ip, BROKER_PORT)) { - return true; - } catch (Exception e) { - // couldn't connect, try again after sleep - } - try { - Thread.sleep(pollMillis); - } catch (InterruptedException ie) { - Thread.currentThread().interrupt(); - break; - } - timeoutMillis -= pollMillis; - } - return false; - } - - public static boolean waitAllProxiesUp(DockerClient docker, String cluster) { - return proxySet(docker, cluster).stream() - .map((b) -> waitProxyUp(docker, b, 60, TimeUnit.SECONDS)) - .reduce(true, (accum, res) -> accum && res); - } - - public static boolean startAllProxies(DockerClient docker, String cluster) { - proxySet(docker, cluster).stream().forEach( - (b) -> { - waitSupervisord(docker, b); - DockerUtils.runCommand(docker, b, "supervisorctl", "start", "proxy"); - }); - - return waitAllProxiesUp(docker, cluster); - } - - public static void stopAllProxies(DockerClient docker, String cluster) { - proxySet(docker, cluster).stream().forEach( - (b) -> DockerUtils.runCommand(docker, b, "supervisorctl", "stop", "proxy")); - } - - public static Set<String> proxySet(DockerClient docker, String cluster) { - return DockerUtils.cubeIdsWithLabels(docker, ImmutableMap.of("service", "pulsar-proxy", - "cluster", cluster)); - } - - public static Set<String> zookeeperSet(DockerClient docker, String cluster) { - return DockerUtils.cubeIdsWithLabels(docker, ImmutableMap.of("service", "zookeeper", - "cluster", cluster)); - } - - public static void updateConf(DockerClient docker, String containerId, - String confFile, String key, String value) throws Exception { - String sedProgram = String.format( - "/[[:blank:]]*%s[[:blank:]]*=/ { h; s^=.*^=%s^; }; ${x;/^$/ { s^^%s=%s^;H; }; x}", - key, value, key, value); - DockerUtils.runCommand(docker, containerId, "sed", "-i", "-e", sedProgram, confFile); - } - - public static void setLogLevel(DockerClient docker, String containerId, - String loggerName, String level) throws Exception { - String sedProgram = String.format( - "/ Logger:/ a\\\n" - +" - name: %s\\n" - +" level: %s\\n" - +" additivity: false\\n" - +" AppenderRef:\\n" - +" - ref: Console\\n" - +" - level: debug\\n", - loggerName, level); - String logConf = "/pulsar/conf/log4j2.yaml"; - DockerUtils.runCommand(docker, containerId, "sed", "-i", "-e", sedProgram, logConf); - } -} diff --git a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarLogsToTargetDirStopAction.java b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarLogsToTargetDirStopAction.java deleted file mode 100644 index 00233595db..0000000000 --- a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/PulsarLogsToTargetDirStopAction.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pulsar.tests; - -import org.arquillian.cube.docker.impl.docker.DockerClientExecutor; -import org.arquillian.cube.impl.model.CubeId; -import org.arquillian.cube.spi.beforeStop.BeforeStopAction; - -public class PulsarLogsToTargetDirStopAction implements BeforeStopAction { - private DockerClientExecutor dockerClientExecutor; - private CubeId containerID; - - public void setDockerClientExecutor(DockerClientExecutor executor) { - this.dockerClientExecutor = executor; - } - - public void setContainerID(CubeId containerID) { - this.containerID = containerID; - } - - @Override - public void doBeforeStop() { - DockerUtils.dumpContainerLogToTarget(dockerClientExecutor.getDockerClient(), containerID.getId()); - DockerUtils.dumpContainerLogDirToTarget(dockerClientExecutor.getDockerClient(), - containerID.getId(), "/var/log/pulsar"); - } -} diff --git a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/ZKJournalToTargetDirStopAction.java b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/ZKJournalToTargetDirStopAction.java deleted file mode 100644 index 309c7a65ce..0000000000 --- a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/ZKJournalToTargetDirStopAction.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pulsar.tests; - -import org.arquillian.cube.docker.impl.docker.DockerClientExecutor; -import org.arquillian.cube.impl.model.CubeId; -import org.arquillian.cube.spi.beforeStop.BeforeStopAction; - -public class ZKJournalToTargetDirStopAction implements BeforeStopAction { - private DockerClientExecutor dockerClientExecutor; - private CubeId containerID; - - public void setDockerClientExecutor(DockerClientExecutor executor) { - this.dockerClientExecutor = executor; - } - - public void setContainerID(CubeId containerID) { - this.containerID = containerID; - } - - @Override - public void doBeforeStop() { - DockerUtils.dumpContainerDirToTargetCompressed(dockerClientExecutor.getDockerClient(), - containerID.getId(), "/pulsar/data/zookeeper"); - } -} diff --git a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/ZooKeeperAwaitStrategy.java b/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/ZooKeeperAwaitStrategy.java deleted file mode 100644 index 7cad4cb76a..0000000000 --- a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/ZooKeeperAwaitStrategy.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pulsar.tests; - -import java.util.concurrent.TimeUnit; - -import org.arquillian.cube.spi.Cube; -import org.arquillian.cube.spi.await.AwaitStrategy; -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.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ZooKeeperAwaitStrategy implements AwaitStrategy { - private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperAwaitStrategy.class); - - private static final int DEFAULT_POLL_ITERATIONS = 10; - private static final int DEFAULT_SLEEP_TIME = 1; - private static final TimeUnit DEFAULT_SLEEP_TIMEUNIT = TimeUnit.SECONDS; - - private Cube<?> cube; - private DockerClientExecutor dockerClientExecutor; - - @Override - public boolean await() { - return Ping.ping(DEFAULT_POLL_ITERATIONS, DEFAULT_SLEEP_TIME, DEFAULT_SLEEP_TIMEUNIT, - new PingCommand() { - @Override - public boolean call() { - return PulsarClusterUtils.zookeeperRunning(dockerClientExecutor.getDockerClient(), - cube.getId()); - } - }); - } -} diff --git a/tests/integration-tests-utils/src/main/resources/log4j2.yml b/tests/integration-tests-utils/src/main/resources/log4j2.yml deleted file mode 100644 index 94ad627c63..0000000000 --- a/tests/integration-tests-utils/src/main/resources/log4j2.yml +++ /dev/null @@ -1,41 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -Configuration: - name: test - - Appenders: - - # Console - Console: - name: Console - target: SYSTEM_OUT - PatternLayout: - Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" - - Loggers: - - Root: - level: warn - AppenderRef: - - ref: Console - - Logger: - name: org.apache.pulsar - level: info diff --git a/tests/integration/compaction/pom.xml b/tests/integration/compaction/pom.xml deleted file mode 100644 index 6ef6f576c1..0000000000 --- a/tests/integration/compaction/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-base</artifactId> - <version>2.2.0-incubating-SNAPSHOT</version> - <relativePath>../../integration-tests-base</relativePath> - </parent> - - <groupId>org.apache.pulsar.tests.integration</groupId> - <artifactId>compaction</artifactId> - <packaging>jar</packaging> - <name>Apache Pulsar :: Tests :: Integration Tests :: Topic Compaction</name> - - <dependencies> - <dependency> - <groupId>org.apache.pulsar</groupId> - <artifactId>pulsar-client</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-topologies</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index faa311de50..c1e61f6e28 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -21,7 +21,6 @@ --> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <packaging>pom</packaging> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.apache.pulsar.tests</groupId> @@ -31,12 +30,66 @@ <groupId>org.apache.pulsar.tests</groupId> <artifactId>integration</artifactId> + <packaging>jar</packaging> <name>Apache Pulsar :: Tests :: Integration</name> - <modules> - <module>compaction</module> - <module>s3-offload</module> - <module>semantics</module> - </modules> + + <dependencies> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.pulsar</groupId> + <artifactId>pulsar-client</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.pulsar</groupId> + <artifactId>pulsar-client-admin</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.pulsar</groupId> + <artifactId>managed-ledger-original</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.datastax.cassandra</groupId> + <artifactId>cassandra-driver-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.testcontainers</groupId> + <artifactId>kafka</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.pulsar</groupId> + <artifactId>pulsar-io-kafka</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.dataformat</groupId> + <artifactId>jackson-dataformat-yaml</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + <build> <plugins> <plugin> @@ -71,11 +124,9 @@ <properties> <property> <name>listener</name> - <!-- AnnotationListener breaks arquillian, so don't use it //--> <value>org.apache.pulsar.tests.PulsarTestListener</value> </property> </properties> - <argLine>-Xmx2G -XX:MaxDirectMemorySize=8G -Dio.netty.leakDetectionLevel=advanced </argLine> diff --git a/tests/integration/s3-offload/pom.xml b/tests/integration/s3-offload/pom.xml deleted file mode 100644 index 2dbe1bb6aa..0000000000 --- a/tests/integration/s3-offload/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-base</artifactId> - <version>2.2.0-incubating-SNAPSHOT</version> - <relativePath>../../integration-tests-base</relativePath> - </parent> - - <groupId>org.apache.pulsar.tests.integration</groupId> - <artifactId>s3-offload</artifactId> - <packaging>jar</packaging> - <name>Apache Pulsar :: Tests :: Integration Tests :: S3 Offload</name> - - <dependencies> - <dependency> - <groupId>org.apache.pulsar</groupId> - <artifactId>pulsar-client-admin-original</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.pulsar</groupId> - <artifactId>managed-ledger-original</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-topologies</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> diff --git a/tests/integration/semantics/pom.xml b/tests/integration/semantics/pom.xml deleted file mode 100644 index 09258dba21..0000000000 --- a/tests/integration/semantics/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation=" - http://maven.apache.org/POM/4.0.0 - http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration</artifactId> - <version>2.2.0-incubating-SNAPSHOT</version> - </parent> - - <groupId>org.apache.pulsar.tests.integration</groupId> - <artifactId>semantics</artifactId> - <packaging>jar</packaging> - <name>Apache Pulsar :: Tests :: Integration Tests :: Semantics</name> - - <dependencies> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - </dependency> - <dependency> - <groupId>org.apache.pulsar</groupId> - <artifactId>pulsar-client</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.pulsar.tests</groupId> - <artifactId>integration-tests-topologies</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.datastax.cassandra</groupId> - <artifactId>cassandra-driver-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.testcontainers</groupId> - <artifactId>kafka</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.pulsar</groupId> - <artifactId>pulsar-io-kafka</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - </dependencies> -</project> diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/utils/TestUtils.java b/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/utils/TestUtils.java deleted file mode 100644 index 726e9f208f..0000000000 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/utils/TestUtils.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.pulsar.tests.integration.utils; - -import java.util.concurrent.ThreadLocalRandom; - -public final class TestUtils { - - private TestUtils() {} - - public static String randomName(int numChars) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < numChars; i++) { - sb.append((char) (ThreadLocalRandom.current().nextInt(26) + 'a')); - } - return sb.toString(); - } - -} diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/cli/CLITest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/cli/CLITest.java similarity index 96% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/cli/CLITest.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/cli/CLITest.java index 8d9ed206a7..7b4d0d00dd 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/cli/CLITest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/cli/CLITest.java @@ -21,9 +21,9 @@ import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; -import org.apache.pulsar.tests.containers.BrokerContainer; -import org.apache.pulsar.tests.topologies.PulsarCluster; -import org.apache.pulsar.tests.topologies.PulsarClusterTestBase; +import org.apache.pulsar.tests.integration.containers.BrokerContainer; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase; import org.testcontainers.containers.Container.ExecResult; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/tests/integration/compaction/src/test/java/org/apache/pulsar/tests/integration/TestCompaction.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/compaction/TestCompaction.java similarity index 98% rename from tests/integration/compaction/src/test/java/org/apache/pulsar/tests/integration/TestCompaction.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/compaction/TestCompaction.java index 9bee2273cf..6825e73520 100644 --- a/tests/integration/compaction/src/test/java/org/apache/pulsar/tests/integration/TestCompaction.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/compaction/TestCompaction.java @@ -16,17 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.integration; +package org.apache.pulsar.tests.integration.compaction; import org.apache.pulsar.client.api.Consumer; import org.apache.pulsar.client.api.Message; import org.apache.pulsar.client.api.MessageBuilder; import org.apache.pulsar.client.api.Producer; import org.apache.pulsar.client.api.PulsarClient; -import org.apache.pulsar.tests.topologies.PulsarClusterTestBase; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase; import org.testcontainers.containers.Container; import org.testng.Assert; -import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import static java.util.stream.Collectors.joining; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/BKContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/BKContainer.java similarity index 95% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/BKContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/BKContainer.java index 688b739729..36f17cd35c 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/BKContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/BKContainer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; /** * A pulsar container that runs bookkeeper. diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/BrokerContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/BrokerContainer.java similarity index 95% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/BrokerContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/BrokerContainer.java index 63499bb2a2..132c7979aa 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/BrokerContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/BrokerContainer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; /** * A pulsar container that runs bookkeeper. diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/CSContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/CSContainer.java similarity index 95% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/CSContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/CSContainer.java index e73fef4337..3544c4b5e7 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/CSContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/CSContainer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; /** * A pulsar container that runs configuration store. diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/CassandraContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/CassandraContainer.java similarity index 96% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/CassandraContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/CassandraContainer.java index b0d244b6d7..d4d505ca78 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/CassandraContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/CassandraContainer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; import lombok.extern.slf4j.Slf4j; import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ChaosContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ChaosContainer.java similarity index 97% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ChaosContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ChaosContainer.java index e3b0fd7a4a..32e9583b17 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ChaosContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ChaosContainer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; import static java.nio.charset.StandardCharsets.UTF_8; @@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; -import org.apache.pulsar.tests.DockerUtils; +import org.apache.pulsar.tests.integration.utils.DockerUtils; import org.testcontainers.containers.GenericContainer; /** diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ProxyContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ProxyContainer.java similarity index 96% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ProxyContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ProxyContainer.java index ec002b4ec7..71a464b243 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ProxyContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ProxyContainer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; /** * A pulsar container that runs bookkeeper. diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/PulsarContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java similarity index 96% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/PulsarContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java index ce6be1370e..2971c59c28 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/PulsarContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/PulsarContainer.java @@ -16,15 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; import static java.time.temporal.ChronoUnit.SECONDS; import java.time.Duration; import java.util.Objects; import lombok.extern.slf4j.Slf4j; -import org.apache.pulsar.tests.DockerUtils; -import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.apache.pulsar.tests.integration.utils.DockerUtils; import org.testcontainers.containers.wait.strategy.HostPortWaitStrategy; /** diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/S3Container.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/S3Container.java similarity index 96% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/S3Container.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/S3Container.java index 9efee214c9..42f0300896 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/S3Container.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/S3Container.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; import lombok.extern.slf4j.Slf4j; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/WorkerContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/WorkerContainer.java similarity index 95% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/WorkerContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/WorkerContainer.java index 574c173b2f..03e2053b00 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/WorkerContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/WorkerContainer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; /** * A pulsar container that runs functions worker. diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ZKContainer.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ZKContainer.java similarity index 94% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ZKContainer.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ZKContainer.java index 66b56046aa..cfdf82d526 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/ZKContainer.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/ZKContainer.java @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.containers; +package org.apache.pulsar.tests.integration.containers; -import org.apache.pulsar.tests.DockerUtils; +import org.apache.pulsar.tests.integration.utils.DockerUtils; /** * A pulsar container that runs zookeeper. diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/package-info.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/package-info.java similarity index 94% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/package-info.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/package-info.java index 2e0ad98ac7..0ef7fd7a7e 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/containers/package-info.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/containers/package-info.java @@ -19,4 +19,4 @@ /** * Test containers used for running integration tests. */ -package org.apache.pulsar.tests.containers; \ No newline at end of file +package org.apache.pulsar.tests.integration.containers; \ No newline at end of file diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java similarity index 95% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java index d0dfafc18a..d83661ca69 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java @@ -21,9 +21,9 @@ import static org.testng.Assert.assertTrue; import lombok.extern.slf4j.Slf4j; -import org.apache.pulsar.tests.containers.WorkerContainer; +import org.apache.pulsar.tests.integration.containers.WorkerContainer; import org.apache.pulsar.tests.integration.functions.utils.UploadDownloadCommandGenerator; -import org.apache.pulsar.tests.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; import org.testcontainers.containers.Container.ExecResult; import org.testng.annotations.Test; diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTestBase.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTestBase.java similarity index 93% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTestBase.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTestBase.java index 9da03afe64..8e82662bad 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTestBase.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTestBase.java @@ -20,9 +20,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.pulsar.tests.integration.functions.utils.CommandGenerator.Runtime; -import org.apache.pulsar.tests.topologies.FunctionRuntimeType; -import org.apache.pulsar.tests.topologies.PulsarClusterSpec; -import org.apache.pulsar.tests.topologies.PulsarClusterTestBase; +import org.apache.pulsar.tests.integration.topologies.FunctionRuntimeType; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterSpec; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase; import org.testng.annotations.DataProvider; /** diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/runtime/PulsarFunctionsRuntimeTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/runtime/PulsarFunctionsRuntimeTest.java similarity index 97% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/runtime/PulsarFunctionsRuntimeTest.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/runtime/PulsarFunctionsRuntimeTest.java index b2c85eb3ed..6477323d99 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/runtime/PulsarFunctionsRuntimeTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/runtime/PulsarFunctionsRuntimeTest.java @@ -31,10 +31,9 @@ import org.apache.pulsar.tests.integration.functions.PulsarFunctionsTestBase; import org.apache.pulsar.tests.integration.functions.utils.CommandGenerator; import org.apache.pulsar.tests.integration.functions.utils.CommandGenerator.Runtime; -import org.apache.pulsar.tests.topologies.FunctionRuntimeType; -import org.apache.pulsar.tests.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.FunctionRuntimeType; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; import org.testcontainers.containers.Container.ExecResult; -import org.testng.annotations.DataProvider; import org.testng.annotations.Factory; import org.testng.annotations.Test; diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/utils/CommandGenerator.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/utils/CommandGenerator.java similarity index 99% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/utils/CommandGenerator.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/utils/CommandGenerator.java index 71466160fe..6578d08cf2 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/utils/CommandGenerator.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/utils/CommandGenerator.java @@ -24,7 +24,7 @@ import lombok.Getter; import lombok.Setter; import lombok.ToString; -import org.apache.pulsar.tests.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; @Getter @Setter diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/utils/UploadDownloadCommandGenerator.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/utils/UploadDownloadCommandGenerator.java similarity index 97% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/utils/UploadDownloadCommandGenerator.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/utils/UploadDownloadCommandGenerator.java index adc0228a91..a8bca83ddf 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/functions/utils/UploadDownloadCommandGenerator.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/utils/UploadDownloadCommandGenerator.java @@ -21,7 +21,7 @@ import lombok.Getter; import lombok.Setter; import lombok.ToString; -import org.apache.pulsar.tests.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; @Getter @Setter diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/CassandraSinkTester.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/CassandraSinkTester.java similarity index 94% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/CassandraSinkTester.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/CassandraSinkTester.java index 6bbfbe3a25..981ffbb225 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/CassandraSinkTester.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/CassandraSinkTester.java @@ -18,22 +18,22 @@ */ package org.apache.pulsar.tests.integration.io; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; - import com.datastax.driver.core.Cluster; import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Row; import com.datastax.driver.core.Session; -import com.google.common.collect.Lists; -import java.util.List; -import java.util.Map; import lombok.extern.slf4j.Slf4j; -import org.apache.pulsar.tests.containers.CassandraContainer; -import org.apache.pulsar.tests.integration.utils.TestUtils; +import org.apache.pulsar.tests.integration.containers.CassandraContainer; import org.testcontainers.containers.GenericContainer; import org.testng.collections.Maps; +import java.util.List; +import java.util.Map; + +import static org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase.randomName; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + /** * A tester for testing cassandra sink. */ @@ -55,7 +55,7 @@ public CassandraSinkTester() { super("cassandra"); - String suffix = TestUtils.randomName(8) + "_" + System.currentTimeMillis(); + String suffix = randomName(8) + "_" + System.currentTimeMillis(); this.keySpace = "keySpace_" + suffix; this.tableName = "tableName_" + suffix; diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSinkTester.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSinkTester.java similarity index 95% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSinkTester.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSinkTester.java index 66595316c7..2cad433d33 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSinkTester.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSinkTester.java @@ -18,6 +18,7 @@ */ package org.apache.pulsar.tests.integration.io; +import static org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase.randomName; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; @@ -30,7 +31,6 @@ import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.common.serialization.StringDeserializer; -import org.apache.pulsar.tests.integration.utils.TestUtils; import org.testcontainers.containers.Container.ExecResult; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.KafkaContainer; @@ -53,7 +53,7 @@ public KafkaSinkTester() { super(NAME); - String suffix = TestUtils.randomName(8) + "_" + System.currentTimeMillis(); + String suffix = randomName(8) + "_" + System.currentTimeMillis(); this.kafkaTopicName = "kafka_sink_topic_" + suffix; sinkConfig.put("bootstrapServers", NAME + ":9092"); @@ -97,7 +97,7 @@ protected void prepareSink() throws Exception { kafkaConsumer = new KafkaConsumer<>( ImmutableMap.of( ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaContainer.getBootstrapServers(), - ConsumerConfig.GROUP_ID_CONFIG, "sink-test-" + TestUtils.randomName(8), + ConsumerConfig.GROUP_ID_CONFIG, "sink-test-" + randomName(8), ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest" ), new StringDeserializer(), diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSourceTester.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSourceTester.java similarity index 96% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSourceTester.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSourceTester.java index e690d6beb5..a23fba5dea 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSourceTester.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/KafkaSourceTester.java @@ -18,6 +18,7 @@ */ package org.apache.pulsar.tests.integration.io; +import static org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase.randomName; import static org.testng.Assert.assertTrue; import java.util.Arrays; @@ -32,7 +33,6 @@ import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.common.serialization.StringDeserializer; import org.apache.kafka.common.serialization.StringSerializer; -import org.apache.pulsar.tests.integration.utils.TestUtils; import org.testcontainers.containers.Container.ExecResult; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.KafkaContainer; @@ -55,7 +55,7 @@ public KafkaSourceTester() { super(NAME); - String suffix = TestUtils.randomName(8) + "_" + System.currentTimeMillis(); + String suffix = randomName(8) + "_" + System.currentTimeMillis(); this.kafkaTopicName = "kafka_source_topic_" + suffix; sourceConfig.put("bootstrapServers", NAME + ":9092"); @@ -101,7 +101,7 @@ protected void prepareSource() throws Exception { kafkaConsumer = new KafkaConsumer<>( ImmutableMap.of( ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaContainer.getBootstrapServers(), - ConsumerConfig.GROUP_ID_CONFIG, "source-test-" + TestUtils.randomName(8), + ConsumerConfig.GROUP_ID_CONFIG, "source-test-" + randomName(8), ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest" ), new StringDeserializer(), diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSinkTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSinkTest.java similarity index 97% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSinkTest.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSinkTest.java index 464a716fcd..d0aab47f36 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSinkTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSinkTest.java @@ -33,9 +33,9 @@ import org.apache.pulsar.client.api.Schema; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.tests.integration.functions.PulsarFunctionsTestBase; -import org.apache.pulsar.tests.topologies.FunctionRuntimeType; -import org.apache.pulsar.tests.topologies.PulsarCluster; -import org.apache.pulsar.tests.topologies.PulsarClusterSpec.PulsarClusterSpecBuilder; +import org.apache.pulsar.tests.integration.topologies.FunctionRuntimeType; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterSpec.PulsarClusterSpecBuilder; import org.testcontainers.containers.Container.ExecResult; import org.testcontainers.containers.GenericContainer; import org.testng.annotations.DataProvider; diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSourceTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSourceTest.java similarity index 97% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSourceTest.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSourceTest.java index 98cb1f2276..78d8874d4f 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSourceTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/PulsarIOSourceTest.java @@ -35,9 +35,9 @@ import org.apache.pulsar.client.api.SubscriptionType; import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.tests.integration.functions.PulsarFunctionsTestBase; -import org.apache.pulsar.tests.topologies.FunctionRuntimeType; -import org.apache.pulsar.tests.topologies.PulsarCluster; -import org.apache.pulsar.tests.topologies.PulsarClusterSpec.PulsarClusterSpecBuilder; +import org.apache.pulsar.tests.integration.topologies.FunctionRuntimeType; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterSpec.PulsarClusterSpecBuilder; import org.testcontainers.containers.Container.ExecResult; import org.testcontainers.containers.GenericContainer; import org.testng.annotations.DataProvider; diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/SinkTester.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/SinkTester.java similarity index 100% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/SinkTester.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/SinkTester.java diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/SourceTester.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/SourceTester.java similarity index 100% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/io/SourceTester.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/io/SourceTester.java diff --git a/tests/integration/s3-offload/src/test/java/org/apache/pulsar/tests/integration/TestS3Offload.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/offload/TestS3Offload.java similarity index 94% rename from tests/integration/s3-offload/src/test/java/org/apache/pulsar/tests/integration/TestS3Offload.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/offload/TestS3Offload.java index 0e8f48f3fb..b595dd3729 100644 --- a/tests/integration/s3-offload/src/test/java/org/apache/pulsar/tests/integration/TestS3Offload.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/offload/TestS3Offload.java @@ -16,15 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.integration; +package org.apache.pulsar.tests.integration.offload; -import java.util.Collection; -import java.util.Collections; import java.util.concurrent.TimeUnit; import java.util.stream.Stream; import com.google.common.collect.ImmutableMap; -import lombok.Builder; import lombok.extern.slf4j.Slf4j; import org.apache.bookkeeper.client.BookKeeper; import org.apache.bookkeeper.conf.ClientConfiguration; @@ -36,21 +33,15 @@ import org.apache.pulsar.client.api.Producer; import org.apache.pulsar.client.api.PulsarClient; -import org.apache.pulsar.tests.containers.BrokerContainer; -import org.apache.pulsar.tests.containers.S3Container; -import org.apache.pulsar.tests.topologies.PulsarCluster; -import org.apache.pulsar.tests.topologies.PulsarClusterSpec; -import org.apache.pulsar.tests.topologies.PulsarClusterTestBase; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.pulsar.tests.integration.containers.BrokerContainer; +import org.apache.pulsar.tests.integration.containers.S3Container; +import org.apache.pulsar.tests.integration.topologies.PulsarCluster; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterSpec; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase; import org.testng.Assert; -import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import org.testng.collections.Maps; import static java.util.stream.Collectors.joining; diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/semantics/SemanticsTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/semantics/SemanticsTest.java similarity index 99% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/semantics/SemanticsTest.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/semantics/SemanticsTest.java index c325e149a2..20787269d3 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/semantics/SemanticsTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/semantics/SemanticsTest.java @@ -41,7 +41,7 @@ import org.apache.pulsar.client.api.SubscriptionType; import org.apache.pulsar.client.impl.BatchMessageIdImpl; import org.apache.pulsar.client.impl.TopicMessageIdImpl; -import org.apache.pulsar.tests.topologies.PulsarClusterTestBase; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase; import org.testng.annotations.Test; import org.testng.collections.Lists; diff --git a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/smoke/SmokeTest.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/smoke/SmokeTest.java similarity index 97% rename from tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/smoke/SmokeTest.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/smoke/SmokeTest.java index f15ccf0574..85a8d2db35 100644 --- a/tests/integration/semantics/src/test/java/org/apache/pulsar/tests/integration/smoke/SmokeTest.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/smoke/SmokeTest.java @@ -25,7 +25,7 @@ import org.apache.pulsar.client.api.PulsarClient; import org.apache.pulsar.client.api.Schema; import org.apache.pulsar.client.api.SubscriptionType; -import org.apache.pulsar.tests.topologies.PulsarClusterTestBase; +import org.apache.pulsar.tests.integration.topologies.PulsarClusterTestBase; import org.testcontainers.containers.Container; import org.testng.Assert; import org.testng.annotations.Test; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/FunctionRuntimeType.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/FunctionRuntimeType.java similarity index 94% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/FunctionRuntimeType.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/FunctionRuntimeType.java index a3efd312f4..e59dc0306d 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/FunctionRuntimeType.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/FunctionRuntimeType.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.topologies; +package org.apache.pulsar.tests.integration.topologies; /** * Runtime type to run functions. diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarCluster.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarCluster.java similarity index 95% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarCluster.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarCluster.java index 331d7e2ddf..bdd8123a0f 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarCluster.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarCluster.java @@ -16,11 +16,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.topologies; +package org.apache.pulsar.tests.integration.topologies; import static com.google.common.base.Preconditions.checkArgument; -import static org.apache.pulsar.tests.containers.PulsarContainer.CS_PORT; -import static org.apache.pulsar.tests.containers.PulsarContainer.ZK_PORT; +import static org.apache.pulsar.tests.integration.containers.PulsarContainer.CS_PORT; +import static org.apache.pulsar.tests.integration.containers.PulsarContainer.ZK_PORT; import com.google.common.collect.Lists; import com.google.common.collect.Maps; @@ -36,13 +36,13 @@ import com.google.common.collect.Streams; import lombok.Getter; import lombok.extern.slf4j.Slf4j; -import org.apache.pulsar.tests.containers.BKContainer; -import org.apache.pulsar.tests.containers.BrokerContainer; -import org.apache.pulsar.tests.containers.CSContainer; -import org.apache.pulsar.tests.containers.ProxyContainer; -import org.apache.pulsar.tests.containers.PulsarContainer; -import org.apache.pulsar.tests.containers.WorkerContainer; -import org.apache.pulsar.tests.containers.ZKContainer; +import org.apache.pulsar.tests.integration.containers.BKContainer; +import org.apache.pulsar.tests.integration.containers.BrokerContainer; +import org.apache.pulsar.tests.integration.containers.CSContainer; +import org.apache.pulsar.tests.integration.containers.ProxyContainer; +import org.apache.pulsar.tests.integration.containers.PulsarContainer; +import org.apache.pulsar.tests.integration.containers.WorkerContainer; +import org.apache.pulsar.tests.integration.containers.ZKContainer; import org.testcontainers.containers.Container.ExecResult; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.Network; diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarClusterSpec.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterSpec.java similarity index 96% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarClusterSpec.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterSpec.java index ceb30b54cc..c190421e20 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarClusterSpec.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterSpec.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.topologies; +package org.apache.pulsar.tests.integration.topologies; import java.util.Collections; import java.util.Map; @@ -25,7 +25,6 @@ import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; -import org.apache.pulsar.tests.containers.ChaosContainer; import org.testcontainers.containers.GenericContainer; /** diff --git a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarClusterTestBase.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterTestBase.java similarity index 97% rename from tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarClusterTestBase.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterTestBase.java index addb04a2df..e2e89dc762 100644 --- a/tests/integration-tests-topologies/src/main/java/org/apache/pulsar/tests/topologies/PulsarClusterTestBase.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/topologies/PulsarClusterTestBase.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests.topologies; +package org.apache.pulsar.tests.integration.topologies; import lombok.extern.slf4j.Slf4j; import org.testng.annotations.AfterClass; @@ -109,7 +109,7 @@ public void tearDownCluster() { } } - protected static String randomName(int numChars) { + public static String randomName(int numChars) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < numChars; i++) { sb.append((char) (ThreadLocalRandom.current().nextInt(26) + 'a')); diff --git a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/DockerUtils.java b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/utils/DockerUtils.java similarity index 91% rename from tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/DockerUtils.java rename to tests/integration/src/test/java/org/apache/pulsar/tests/integration/utils/DockerUtils.java index 90b665acf9..d3d7ba251d 100644 --- a/tests/integration-tests-utils/src/main/java/org/apache/pulsar/tests/DockerUtils.java +++ b/tests/integration/src/test/java/org/apache/pulsar/tests/integration/utils/DockerUtils.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.pulsar.tests; +package org.apache.pulsar.tests.integration.utils; import com.github.dockerjava.api.DockerClient; import com.github.dockerjava.api.async.ResultCallback; @@ -227,25 +227,4 @@ public void onComplete() { return Optional.ofNullable(docker.inspectContainerCmd(containerId) .exec().getConfig().getLabels().get("cluster")); } - - public static Set<String> allCubeIds() { - Pattern pattern = Pattern.compile("^arq.cube.docker.([^.]*).ip$"); - return System.getProperties().keySet().stream() - .map(k -> pattern.matcher(k.toString())) - .filter(m -> m.matches()) - .map(m -> m.group(1)) - .collect(Collectors.toSet()); - } - - public static Set<String> cubeIdsWithLabels(DockerClient docker, Map<String,String> labels) { - return allCubeIds().stream() - .filter(id -> { - Map<String,String> configuredLabels = docker.inspectContainerCmd(id).exec().getConfig().getLabels(); - return labels.entrySet().stream() - .map(e -> configuredLabels.containsKey(e.getKey()) - && configuredLabels.get(e.getKey()).equals(e.getValue())) - .reduce(true, (acc, res) -> acc && res); - }) - .collect(Collectors.toSet()); - } } diff --git a/tests/integration-tests-topologies/src/main/resources/kafka-zookeeper.properties b/tests/integration/src/test/resources/kafka-zookeeper.properties similarity index 100% rename from tests/integration-tests-topologies/src/main/resources/kafka-zookeeper.properties rename to tests/integration/src/test/resources/kafka-zookeeper.properties diff --git a/tests/pom.xml b/tests/pom.xml index 44e0f2f502..a10d354705 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -33,9 +33,6 @@ <name>Apache Pulsar :: Tests</name> <modules> <module>docker-images</module> - <module>integration-tests-utils</module> - <module>integration-tests-topologies</module> - <module>integration-tests-base</module> <module>integration</module> </modules> <build> ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
