diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/ITContainers.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/ITContainers.java index 15237df0dc344..b2433d2902aa3 100644 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/ITContainers.java +++ b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/ITContainers.java @@ -23,7 +23,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.test.e2e.env.container.atomic.governance.GovernanceContainer; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.natived.NativeStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.NativeStorageContainer; import org.awaitility.Awaitility; import org.slf4j.LoggerFactory; import org.testcontainers.containers.Network; diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/adapter/impl/ShardingSphereProxyEmbeddedContainer.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/adapter/impl/ShardingSphereProxyEmbeddedContainer.java index c40ad660df667..90140a9528a65 100644 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/adapter/impl/ShardingSphereProxyEmbeddedContainer.java +++ b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/adapter/impl/ShardingSphereProxyEmbeddedContainer.java @@ -36,7 +36,7 @@ import org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.config.AdaptorContainerConfiguration; import org.apache.shardingsphere.test.e2e.env.container.atomic.constants.ProxyContainerConstants; import org.apache.shardingsphere.test.e2e.env.container.atomic.constants.StorageContainerConstants; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.natived.NativeStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.NativeStorageContainer; import org.apache.shardingsphere.test.e2e.env.container.atomic.util.StorageContainerUtils; import org.apache.shardingsphere.test.e2e.env.container.wait.JdbcConnectionWaitStrategy; import org.apache.shardingsphere.test.e2e.env.runtime.E2ETestEnvironment; diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/StorageContainerFactory.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/StorageContainerFactory.java index 3f745ebdd0887..1340237807949 100644 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/StorageContainerFactory.java +++ b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/StorageContainerFactory.java @@ -21,8 +21,7 @@ import lombok.NoArgsConstructor; import org.apache.shardingsphere.database.connector.core.type.DatabaseType; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.option.StorageContainerConfigurationOption; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.DockerStorageContainer; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.impl.HiveContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.DockerStorageContainer; import org.apache.shardingsphere.test.e2e.env.runtime.E2ETestEnvironment; /** @@ -60,9 +59,8 @@ public static StorageContainer newInstance(final DatabaseType databaseType, fina case "PostgreSQL": case "openGauss": case "MariaDB": - return new DockerStorageContainer(storageContainerImage, option, scenario); case "Hive": - return new HiveContainer(storageContainerImage, option, scenario); + return new DockerStorageContainer(storageContainerImage, option, scenario); default: throw new RuntimeException(String.format("Database `%s` is unknown.", databaseType.getType())); } diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/docker/DockerStorageContainer.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/DockerStorageContainer.java similarity index 94% rename from test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/docker/DockerStorageContainer.java rename to test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/DockerStorageContainer.java index 652f59fd9ae36..2e88c10df34f8 100644 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/docker/DockerStorageContainer.java +++ b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/DockerStorageContainer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker; +package org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type; import com.github.dockerjava.api.command.InspectContainerResponse; import com.google.common.base.Preconditions; @@ -55,7 +55,7 @@ /** * Docker storage container. */ -public class DockerStorageContainer extends DockerITContainer implements StorageContainer { +public final class DockerStorageContainer extends DockerITContainer implements StorageContainer { private final StorageContainerConfigurationOption option; @@ -82,7 +82,7 @@ private static String getContainerImage(final String containerImage, final Stora } @Override - protected final void configure() { + protected void configure() { setCommands(); addEnvironments(); mapResources(new MountConfigurationResourceGenerator(option).generate(majorVersion, scenario)); @@ -126,7 +126,7 @@ private String getURL() { @SneakyThrows({SQLException.class, InterruptedException.class}) @Override - protected final void containerIsStarted(final InspectContainerResponse containerInfo) { + protected void containerIsStarted(final InspectContainerResponse containerInfo) { if (option.isSupportDockerEntrypoint()) { return; } @@ -164,7 +164,7 @@ private Map createAccessDataSources(final Collection * @param dataSourceName data source name * @return access data source */ - public final DataSource createAccessDataSource(final String dataSourceName) { + public DataSource createAccessDataSource(final String dataSourceName) { return StorageContainerUtils.generateDataSource(getJdbcUrl(dataSourceName), StorageContainerConstants.OPERATION_USER, StorageContainerConstants.OPERATION_PASSWORD, 20); } @@ -174,7 +174,7 @@ public final DataSource createAccessDataSource(final String dataSourceName) { * @param dataSourceName datasource name * @return JDBC URL */ - public final String getJdbcUrl(final String dataSourceName) { + public String getJdbcUrl(final String dataSourceName) { DataSourceEnvironment dataSourceEnvironment = DatabaseTypedSPILoader.getService(DataSourceEnvironment.class, option.getType()); return dataSourceEnvironment.getURL(getHost(), getMappedPort(), Strings.isNullOrEmpty(dataSourceName) ? option.getDefaultDatabaseName(majorVersion).orElse("") : dataSourceName); } @@ -184,7 +184,7 @@ public final String getJdbcUrl(final String dataSourceName) { * * @return exposed database container port */ - public final int getExposedPort() { + public int getExposedPort() { return option.getPort(); } @@ -193,17 +193,17 @@ public final int getExposedPort() { * * @return mapped database container port */ - public final int getMappedPort() { + public int getMappedPort() { return getMappedPort(getExposedPort()); } @Override - public final String getAbbreviation() { + public String getAbbreviation() { return option.getDatabaseType().toLowerCase(); } @Override - public final Map getLinkReplacements() { + public Map getLinkReplacements() { Map result = new HashMap<>(); for (String each : getNetworkAliases()) { for (Integer exposedPort : getExposedPorts()) { diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/natived/NativeStorageContainer.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/NativeStorageContainer.java similarity index 99% rename from test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/natived/NativeStorageContainer.java rename to test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/NativeStorageContainer.java index f65c0e12d2140..e11fde29bf448 100644 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/natived/NativeStorageContainer.java +++ b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/NativeStorageContainer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.natived; +package org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type; import lombok.Getter; import lombok.Setter; diff --git a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/docker/impl/HiveContainer.java b/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/docker/impl/HiveContainer.java deleted file mode 100644 index a742b72dedb19..0000000000000 --- a/test/e2e/env/src/test/java/org/apache/shardingsphere/test/e2e/env/container/atomic/storage/type/docker/impl/HiveContainer.java +++ /dev/null @@ -1,46 +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.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.impl; - -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.option.StorageContainerConfigurationOption; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.DockerStorageContainer; - -import java.io.IOException; - -/** - * Hive container. - */ -@Slf4j -public final class HiveContainer extends DockerStorageContainer { - - public HiveContainer(final String containerImage, final StorageContainerConfigurationOption option, final String scenario) { - super(containerImage, option, scenario); - } - - @Override - protected void postStart() { - try { - execInContainer("bash", "-c", "beeline -u \"jdbc:hive2://localhost:10000/default\" -e \"CREATE DATABASE IF NOT EXISTS encrypt; CREATE DATABASE IF NOT EXISTS expected_dataset;\""); - } catch (final InterruptedException | IOException ex) { - log.error("Failed to create databases in postStart()", ex); - } - super.postStart(); - log.info("Hive container postStart completed successfully"); - } -} diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/PipelineContainerComposer.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/PipelineContainerComposer.java index 3f4fe51b58696..ba91b049f291d 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/PipelineContainerComposer.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/PipelineContainerComposer.java @@ -43,7 +43,7 @@ import org.apache.shardingsphere.single.yaml.config.YamlSingleRuleConfiguration; import org.apache.shardingsphere.test.e2e.env.container.atomic.constants.ProxyContainerConstants; import org.apache.shardingsphere.test.e2e.env.container.atomic.constants.StorageContainerConstants; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.DockerStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.DockerStorageContainer; import org.apache.shardingsphere.test.e2e.env.container.atomic.util.StorageContainerUtils; import org.apache.shardingsphere.test.e2e.env.runtime.datasource.DataSourceEnvironment; import org.apache.shardingsphere.test.e2e.operation.pipeline.command.ExtraSQLCommand; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java index 3c7db9c0febb5..deb905bd36897 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/cases/createtable/CreateTableSQLGeneratorIT.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainerFactory; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.option.StorageContainerConfigurationOption; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.DockerStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.DockerStorageContainer; import org.apache.shardingsphere.test.e2e.operation.pipeline.entity.CreateTableSQLGeneratorAssertionEntity; import org.apache.shardingsphere.test.e2e.operation.pipeline.entity.CreateTableSQLGeneratorAssertionsRootEntity; import org.apache.shardingsphere.test.e2e.operation.pipeline.entity.CreateTableSQLGeneratorOutputEntity; diff --git a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/framework/container/compose/docker/PipelineDockerContainerComposer.java b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/framework/container/compose/docker/PipelineDockerContainerComposer.java index 34244d7193299..ed20d7300fe84 100644 --- a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/framework/container/compose/docker/PipelineDockerContainerComposer.java +++ b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/framework/container/compose/docker/PipelineDockerContainerComposer.java @@ -28,7 +28,7 @@ import org.apache.shardingsphere.test.e2e.env.container.atomic.governance.impl.ZookeeperContainer; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainerFactory; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.option.StorageContainerConfigurationOption; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.DockerStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.DockerStorageContainer; import org.apache.shardingsphere.test.e2e.env.runtime.datasource.DataSourceEnvironment; import org.apache.shardingsphere.test.e2e.operation.pipeline.env.PipelineE2EEnvironment; import org.apache.shardingsphere.test.e2e.operation.pipeline.env.enums.PipelineProxyTypeEnum; diff --git a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/engine/base/TransactionBaseE2EIT.java b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/engine/base/TransactionBaseE2EIT.java index 01bb6b68811ed..28ad38ba836fa 100644 --- a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/engine/base/TransactionBaseE2EIT.java +++ b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/engine/base/TransactionBaseE2EIT.java @@ -25,7 +25,7 @@ import org.apache.shardingsphere.database.connector.core.type.DatabaseType; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.apache.shardingsphere.test.e2e.env.container.atomic.adapter.enums.AdapterType; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.DockerStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.DockerStorageContainer; import org.apache.shardingsphere.test.e2e.env.runtime.datasource.DataSourceEnvironment; import org.apache.shardingsphere.test.e2e.operation.transaction.cases.base.BaseTransactionTestCase; import org.apache.shardingsphere.test.e2e.operation.transaction.cases.base.BaseTransactionTestCase.TransactionTestCaseParameter; diff --git a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/framework/container/compose/TransactionDockerContainerComposer.java b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/framework/container/compose/TransactionDockerContainerComposer.java index 9fde1e4b19ee3..ebee0c0d803f7 100644 --- a/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/framework/container/compose/TransactionDockerContainerComposer.java +++ b/test/e2e/operation/transaction/src/test/java/org/apache/shardingsphere/test/e2e/operation/transaction/framework/container/compose/TransactionDockerContainerComposer.java @@ -35,8 +35,8 @@ import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainer; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainerFactory; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.option.StorageContainerConfigurationOption; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.docker.DockerStorageContainer; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.natived.NativeStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.DockerStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.NativeStorageContainer; import org.apache.shardingsphere.test.e2e.operation.transaction.env.TransactionE2EEnvironment; import org.apache.shardingsphere.test.e2e.operation.transaction.env.enums.TransactionE2EEnvTypeEnum; import org.apache.shardingsphere.test.e2e.operation.transaction.framework.container.config.TransactionProxyContainerConfigurationFactory; diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/ClusterContainerComposer.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/ClusterContainerComposer.java index 4a41f26ea211e..920f4a6660145 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/ClusterContainerComposer.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/ClusterContainerComposer.java @@ -32,7 +32,7 @@ import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainer; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainerFactory; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.option.StorageContainerConfigurationOption; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.natived.NativeStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.NativeStorageContainer; import org.apache.shardingsphere.test.e2e.env.runtime.E2ETestEnvironment; import org.apache.shardingsphere.test.e2e.env.runtime.cluster.ClusterEnvironment.Type; import org.apache.shardingsphere.test.e2e.sql.env.container.compose.ContainerComposer; diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/StandaloneContainerComposer.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/StandaloneContainerComposer.java index 2022a3a44f53d..5af53ddd2b518 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/StandaloneContainerComposer.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/env/container/compose/mode/StandaloneContainerComposer.java @@ -29,7 +29,7 @@ import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainer; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.StorageContainerFactory; import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.option.StorageContainerConfigurationOption; -import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.natived.NativeStorageContainer; +import org.apache.shardingsphere.test.e2e.env.container.atomic.storage.type.NativeStorageContainer; import org.apache.shardingsphere.test.e2e.env.runtime.E2ETestEnvironment; import org.apache.shardingsphere.test.e2e.env.runtime.cluster.ClusterEnvironment.Type; import org.apache.shardingsphere.test.e2e.sql.env.container.compose.ContainerComposer;