This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 60a1c15524a Refactor : polish the IT related code to make it more
readable. (#20322)
60a1c15524a is described below
commit 60a1c15524a0da04623b946d15bf44a4a0753698
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Sun Aug 21 10:01:41 2022 +0800
Refactor : polish the IT related code to make it more readable. (#20322)
---
.../atomic/adapter/AdapterContainerFactory.java | 4 +--
.../ProxyClusterContainerConfigurationFactory.java | 2 +-
...ainer.java => ShardingSphereJdbcContainer.java} | 4 +--
.../impl/ShardingSphereProxyClusterContainer.java | 17 ++++++------
.../ShardingSphereProxyStandaloneContainer.java | 15 +++++------
.../ProxyContainerConstants.java} | 24 +++++------------
.../StorageContainerConstants.java} | 30 ++++++++++------------
.../atomic/storage/DockerStorageContainer.java | 9 ++++---
.../mysql/MySQLContainerConfigurationFactory.java | 3 ++-
.../OpenGaussContainerConfigurationFactory.java | 7 ++---
.../PostgreSQLContainerConfigurationFactory.java | 7 ++---
.../atomic/storage/impl/OpenGaussContainer.java | 5 ++--
...rategy.java => JdbcConnectionWaitStrategy.java} | 2 +-
.../src/test/resources/env/{ => log}/logback.xml | 0
.../data/pipeline/cases/base/BaseITCase.java | 11 ++++----
.../transaction/engine/base/BaseITCase.java | 2 +-
.../engine/base/BaseTransactionITCase.java | 4 +--
.../{JDBCDataSource.java => JdbcDataSource.java} | 4 +--
.../env/IntegrationTestEnvironment.java | 16 ++++++------
.../mysql/MySQLContainerConfigurationFactory.java | 3 ++-
.../OpenGaussContainerConfigurationFactory.java | 5 ++--
.../PostgreSQLContainerConfigurationFactory.java | 7 ++---
22 files changed, 87 insertions(+), 94 deletions(-)
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java
index 27800be20ab..0517ca88bdc 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/AdapterContainerFactory.java
@@ -21,7 +21,7 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.impl.ShardingSphereJDBCContainer;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.impl.ShardingSphereJdbcContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.impl.ShardingSphereProxyClusterContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.impl.ShardingSphereProxyStandaloneContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.StorageContainer;
@@ -51,7 +51,7 @@ public final class AdapterContainerFactory {
? new
ShardingSphereProxyClusterContainer(databaseType, containerConfig)
: new
ShardingSphereProxyStandaloneContainer(databaseType, containerConfig);
case "jdbc":
- return new ShardingSphereJDBCContainer(storageContainer,
scenario);
+ return new ShardingSphereJdbcContainer(storageContainer,
scenario);
default:
throw new RuntimeException(String.format("Adapter [%s] is
unknown.", adapter));
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
index ef66480d364..3dd3cfbdd85 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
@@ -39,6 +39,6 @@ public final class ProxyClusterContainerConfigurationFactory {
}
private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/logback.xml",
"/opt/shardingsphere-proxy/conf/logback.xml");
+ return Collections.singletonMap("/env/log/logback.xml",
"/opt/shardingsphere-proxy/conf/logback.xml");
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereJDBCContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereJdbcContainer.java
similarity index 97%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereJDBCContainer.java
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereJdbcContainer.java
index 1a6e62bf1ce..f261adec2be 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereJDBCContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereJdbcContainer.java
@@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicReference;
/**
* ShardingSphere JDBC container.
*/
-public final class ShardingSphereJDBCContainer implements EmbeddedITContainer,
AdapterContainer {
+public final class ShardingSphereJdbcContainer implements EmbeddedITContainer,
AdapterContainer {
private final StorageContainer storageContainer;
@@ -48,7 +48,7 @@ public final class ShardingSphereJDBCContainer implements
EmbeddedITContainer, A
private final AtomicReference<DataSource> targetDataSourceProvider = new
AtomicReference<>();
- public ShardingSphereJDBCContainer(final StorageContainer
storageContainer, final String scenario) {
+ public ShardingSphereJdbcContainer(final StorageContainer
storageContainer, final String scenario) {
this.storageContainer = storageContainer;
scenarioCommonPath = new ScenarioCommonPath(scenario);
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyClusterContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyClusterContainer.java
index 74fd5013f00..d1b5ed4ac2d 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyClusterContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyClusterContainer.java
@@ -22,7 +22,8 @@ import
org.apache.shardingsphere.infra.database.type.DatabaseType;
import
org.apache.shardingsphere.test.integration.env.container.atomic.DockerITContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.AdapterContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import
org.apache.shardingsphere.test.integration.env.container.wait.JDBCConnectionWaitStrategy;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.ProxyContainerConstants;
+import
org.apache.shardingsphere.test.integration.env.container.wait.JdbcConnectionWaitStrategy;
import
org.apache.shardingsphere.test.integration.env.runtime.DataSourceEnvironment;
import org.testcontainers.containers.BindMode;
@@ -36,8 +37,6 @@ import java.util.concurrent.atomic.AtomicReference;
*/
public final class ShardingSphereProxyClusterContainer extends
DockerITContainer implements AdapterContainer {
- private static final String AGENT_HOME_IN_CONTAINER =
"/usr/local/shardingsphere-agent";
-
private static final String PROPERTY_AGENT_HOME = "AGENT_HOME";
private final DatabaseType databaseType;
@@ -59,8 +58,8 @@ public final class ShardingSphereProxyClusterContainer
extends DockerITContainer
* @return self
*/
public ShardingSphereProxyClusterContainer withAgent(final String
agentHome) {
- withEnv(PROPERTY_AGENT_HOME, AGENT_HOME_IN_CONTAINER);
- withFileSystemBind(agentHome, AGENT_HOME_IN_CONTAINER,
BindMode.READ_ONLY);
+ withEnv(PROPERTY_AGENT_HOME,
ProxyContainerConstants.AGENT_HOME_IN_CONTAINER);
+ withFileSystemBind(agentHome,
ProxyContainerConstants.AGENT_HOME_IN_CONTAINER, BindMode.READ_ONLY);
return this;
}
@@ -68,8 +67,8 @@ public final class ShardingSphereProxyClusterContainer
extends DockerITContainer
protected void configure() {
withExposedPorts(3307);
mountConfigurationFiles();
- setWaitStrategy(new JDBCConnectionWaitStrategy(() ->
DriverManager.getConnection(DataSourceEnvironment.getURL(databaseType,
- getHost(), getMappedPort(3307),
config.getProxyDataSourceName()), "proxy", "Proxy@123")));
+ setWaitStrategy(new JdbcConnectionWaitStrategy(() ->
DriverManager.getConnection(DataSourceEnvironment.getURL(databaseType,
+ getHost(), getMappedPort(3307),
config.getProxyDataSourceName()), ProxyContainerConstants.USERNAME,
ProxyContainerConstants.PASSWORD)));
}
private void mountConfigurationFiles() {
@@ -89,8 +88,8 @@ public final class ShardingSphereProxyClusterContainer
extends DockerITContainer
HikariDataSource result = new HikariDataSource();
result.setDriverClassName(DataSourceEnvironment.getDriverClassName(databaseType));
result.setJdbcUrl(DataSourceEnvironment.getURL(databaseType,
getHost(), getMappedPort(3307), config.getProxyDataSourceName()));
- result.setUsername("proxy");
- result.setPassword("Proxy@123");
+ result.setUsername(ProxyContainerConstants.USERNAME);
+ result.setPassword(ProxyContainerConstants.PASSWORD);
result.setMaximumPoolSize(2);
result.setTransactionIsolation("TRANSACTION_READ_COMMITTED");
return result;
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyStandaloneContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyStandaloneContainer.java
index 56bad3a12e6..31db855f11e 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyStandaloneContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/impl/ShardingSphereProxyStandaloneContainer.java
@@ -23,7 +23,8 @@ import
org.apache.shardingsphere.infra.database.type.DatabaseType;
import
org.apache.shardingsphere.test.integration.env.container.atomic.DockerITContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.AdapterContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config.AdaptorContainerConfiguration;
-import
org.apache.shardingsphere.test.integration.env.container.wait.JDBCConnectionWaitStrategy;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.ProxyContainerConstants;
+import
org.apache.shardingsphere.test.integration.env.container.wait.JdbcConnectionWaitStrategy;
import
org.apache.shardingsphere.test.integration.env.runtime.DataSourceEnvironment;
import org.testcontainers.containers.BindMode;
@@ -38,8 +39,6 @@ import java.util.concurrent.atomic.AtomicReference;
@Slf4j
public final class ShardingSphereProxyStandaloneContainer extends
DockerITContainer implements AdapterContainer {
- private static final String AGENT_HOME_IN_CONTAINER =
"/usr/local/shardingsphere-agent";
-
private static final String PROPERTY_AGENT_HOME = "AGENT_HOME";
private final DatabaseType databaseType;
@@ -61,8 +60,8 @@ public final class ShardingSphereProxyStandaloneContainer
extends DockerITContai
* @return self
*/
public ShardingSphereProxyStandaloneContainer withAgent(final String
agentHome) {
- withEnv(PROPERTY_AGENT_HOME, AGENT_HOME_IN_CONTAINER);
- withFileSystemBind(agentHome, AGENT_HOME_IN_CONTAINER,
BindMode.READ_ONLY);
+ withEnv(PROPERTY_AGENT_HOME,
ProxyContainerConstants.AGENT_HOME_IN_CONTAINER);
+ withFileSystemBind(agentHome,
ProxyContainerConstants.AGENT_HOME_IN_CONTAINER, BindMode.READ_ONLY);
return this;
}
@@ -70,7 +69,7 @@ public final class ShardingSphereProxyStandaloneContainer
extends DockerITContai
protected void configure() {
withExposedPorts(3307);
mountConfigurationFiles();
- setWaitStrategy(new JDBCConnectionWaitStrategy(() ->
DriverManager.getConnection(
+ setWaitStrategy(new JdbcConnectionWaitStrategy(() ->
DriverManager.getConnection(
DataSourceEnvironment.getURL(databaseType, getHost(),
getMappedPort(3307), config.getProxyDataSourceName()), "root", "Root@123")));
}
@@ -91,8 +90,8 @@ public final class ShardingSphereProxyStandaloneContainer
extends DockerITContai
HikariDataSource result = new HikariDataSource();
result.setDriverClassName(DataSourceEnvironment.getDriverClassName(databaseType));
result.setJdbcUrl(DataSourceEnvironment.getURL(databaseType,
getHost(), getMappedPort(3307), config.getProxyDataSourceName()));
- result.setUsername("proxy");
- result.setPassword("Proxy@123");
+ result.setUsername(ProxyContainerConstants.USERNAME);
+ result.setPassword(ProxyContainerConstants.PASSWORD);
result.setMaximumPoolSize(2);
result.setTransactionIsolation("TRANSACTION_READ_COMMITTED");
return result;
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/constants/ProxyContainerConstants.java
similarity index 61%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/constants/ProxyContainerConstants.java
index ef66480d364..d8ec478e691 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/constants/ProxyContainerConstants.java
@@ -15,30 +15,20 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config;
+package
org.apache.shardingsphere.test.integration.env.container.atomic.constants;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import java.util.Collections;
-import java.util.Map;
-
/**
- * Proxy cluster container configuration factory.
+ * Proxy container constants.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ProxyClusterContainerConfigurationFactory {
+public class ProxyContainerConstants {
+
+ public static final String USERNAME = "proxy";
- /**
- * Create new instance of adaptor container configuration.
- *
- * @return created instance
- */
- public static AdaptorContainerConfiguration newInstance() {
- return new AdaptorContainerConfiguration("", getMountedResources());
- }
+ public static final String PASSWORD = "Proxy@123";
- private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/logback.xml",
"/opt/shardingsphere-proxy/conf/logback.xml");
- }
+ public static final String AGENT_HOME_IN_CONTAINER =
"/usr/local/shardingsphere-agent";
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/constants/StorageContainerConstants.java
similarity index 60%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/constants/StorageContainerConstants.java
index ef66480d364..1fc59949727 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/adapter/config/ProxyClusterContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/constants/StorageContainerConstants.java
@@ -15,30 +15,26 @@
* limitations under the License.
*/
-package
org.apache.shardingsphere.test.integration.env.container.atomic.adapter.config;
+package
org.apache.shardingsphere.test.integration.env.container.atomic.constants;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import java.util.Collections;
-import java.util.Map;
-
/**
- * Proxy cluster container configuration factory.
+ * Storage container constants.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ProxyClusterContainerConfigurationFactory {
+public class StorageContainerConstants {
+
+ public static final String USERNAME = "test_user";
+
+ public static final String PASSWORD = "Test@123";
+
+ public static final String MYSQL_CONF_IN_CONTAINER = "/etc/mysql/my.cnf";
+
+ public static final String POSTGRESQL_CONF_IN_CONTAINER =
"/etc/postgresql/postgresql.conf";
- /**
- * Create new instance of adaptor container configuration.
- *
- * @return created instance
- */
- public static AdaptorContainerConfiguration newInstance() {
- return new AdaptorContainerConfiguration("", getMountedResources());
- }
+ public static final String OPENGAUSS_CONF_IN_CONTAINER =
"/usr/local/opengauss/share/postgresql/postgresql.conf.sample";
- private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/logback.xml",
"/opt/shardingsphere-proxy/conf/logback.xml");
- }
+ public static final String OPENGAUSS_HBA_IN_CONF_CONTAINER =
"/usr/local/opengauss/share/postgresql/pg_hba.conf.sample";
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java
index f237ab0a356..6dc29fddb5a 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java
@@ -24,7 +24,8 @@ import lombok.Getter;
import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import
org.apache.shardingsphere.test.integration.env.container.atomic.DockerITContainer;
-import
org.apache.shardingsphere.test.integration.env.container.wait.JDBCConnectionWaitStrategy;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
+import
org.apache.shardingsphere.test.integration.env.container.wait.JdbcConnectionWaitStrategy;
import
org.apache.shardingsphere.test.integration.env.runtime.DataSourceEnvironment;
import
org.apache.shardingsphere.test.integration.env.runtime.scenario.database.DatabaseEnvironmentManager;
import
org.apache.shardingsphere.test.integration.env.runtime.scenario.path.ScenarioDataPath;
@@ -73,7 +74,7 @@ public abstract class DockerStorageContainer extends
DockerITContainer implement
withClasspathResourceMapping(new
ScenarioDataPath(scenario).getInitSQLResourcePath(Type.EXPECTED, databaseType),
"/docker-entrypoint-initdb.d/", BindMode.READ_ONLY);
}
withExposedPorts(getPort());
- setWaitStrategy(new JDBCConnectionWaitStrategy(
+ setWaitStrategy(new JdbcConnectionWaitStrategy(
() ->
DriverManager.getConnection(getDefaultDatabaseName().isPresent()
? DataSourceEnvironment.getURL(databaseType,
"localhost", getFirstMappedPort(), getDefaultDatabaseName().get())
: DataSourceEnvironment.getURL(databaseType,
"localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
@@ -133,7 +134,7 @@ public abstract class DockerStorageContainer extends
DockerITContainer implement
* @return username
*/
public final String getUsername() {
- return "test_user";
+ return StorageContainerConstants.USERNAME;
}
/**
@@ -149,7 +150,7 @@ public abstract class DockerStorageContainer extends
DockerITContainer implement
* @return unified database access password
*/
public final String getUnifiedPassword() {
- return "Test@123";
+ return StorageContainerConstants.PASSWORD;
}
protected abstract Optional<String> getDefaultDatabaseName();
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/MySQLContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/MySQLContainerConfigurationFactory.java
index f7629edc874..945ca4c2f7b 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/MySQLContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/MySQLContainerConfigurationFactory.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.test.integration.env.container.atomic.storage.
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
import
org.apache.shardingsphere.test.integration.env.container.atomic.util.MySQLContainerUtil;
@@ -53,6 +54,6 @@ public final class MySQLContainerConfigurationFactory {
}
private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/mysql/my.cnf",
"/etc/mysql/my.cnf");
+ return Collections.singletonMap("/env/mysql/my.cnf",
StorageContainerConstants.MYSQL_CONF_IN_CONTAINER);
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/OpenGaussContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/OpenGaussContainerConfigurationFactory.java
index 148bbb5323a..80df6213f15 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/OpenGaussContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/OpenGaussContainerConfigurationFactory.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.test.integration.env.container.atomic.storage.
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
import java.util.Collections;
@@ -45,13 +46,13 @@ public final class OpenGaussContainerConfigurationFactory {
}
private static Map<String, String> getContainerEnvironments() {
- return Collections.singletonMap("GS_PASSWORD", "Test@123");
+ return Collections.singletonMap("GS_PASSWORD",
StorageContainerConstants.PASSWORD);
}
private static Map<String, String> getMountedResources() {
Map<String, String> result = new HashMap<>(2, 1);
- result.put("/env/postgresql/postgresql.conf",
"/usr/local/opengauss/share/postgresql/postgresql.conf.sample");
- result.put("/env/opengauss/pg_hba.conf",
"/usr/local/opengauss/share/postgresql/pg_hba.conf.sample");
+ result.put("/env/postgresql/postgresql.conf",
StorageContainerConstants.OPENGAUSS_CONF_IN_CONTAINER);
+ result.put("/env/opengauss/pg_hba.conf",
StorageContainerConstants.OPENGAUSS_HBA_IN_CONF_CONTAINER);
return result;
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/PostgreSQLContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/PostgreSQLContainerConfigurationFactory.java
index a171bef5201..0b7a1fb71b9 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/PostgreSQLContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/PostgreSQLContainerConfigurationFactory.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.test.integration.env.container.atomic.storage.
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
import java.util.Collections;
@@ -40,14 +41,14 @@ public final class PostgreSQLContainerConfigurationFactory {
}
private static String getCommand() {
- return "-c config_file=/etc/postgresql/postgresql.conf";
+ return "-c config_file=" +
StorageContainerConstants.POSTGRESQL_CONF_IN_CONTAINER;
}
private static Map<String, String> getContainerEnvironments() {
- return Collections.singletonMap("POSTGRES_PASSWORD", "Test@123");
+ return Collections.singletonMap("POSTGRES_PASSWORD",
StorageContainerConstants.PASSWORD);
}
private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/postgresql/postgresql.conf",
"/etc/postgresql/postgresql.conf");
+ return Collections.singletonMap("/env/postgresql/postgresql.conf",
StorageContainerConstants.POSTGRESQL_CONF_IN_CONTAINER);
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/impl/OpenGaussContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/impl/OpenGaussContainer.java
index caba1478c69..3901eb01c2a 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/impl/OpenGaussContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/impl/OpenGaussContainer.java
@@ -20,6 +20,7 @@ package
org.apache.shardingsphere.test.integration.env.container.atomic.storage.
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeFactory;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.DockerStorageContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
import
org.apache.shardingsphere.test.integration.env.runtime.DataSourceEnvironment;
@@ -54,11 +55,11 @@ public final class OpenGaussContainer extends
DockerStorageContainer {
@Override
protected Optional<String> getDefaultDatabaseName() {
- return Optional.of("test_user");
+ return Optional.of(StorageContainerConstants.USERNAME);
}
@Override
public String getJdbcUrl(final String dataSourceName) {
- return DataSourceEnvironment.getURL(getDatabaseType(), getHost(),
getMappedPort(getPort()), StringUtils.isNotEmpty(dataSourceName) ?
dataSourceName : "test_user");
+ return DataSourceEnvironment.getURL(getDatabaseType(), getHost(),
getMappedPort(getPort()), StringUtils.isNotEmpty(dataSourceName) ?
dataSourceName : StorageContainerConstants.USERNAME);
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/wait/JDBCConnectionWaitStrategy.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/wait/JdbcConnectionWaitStrategy.java
similarity index 96%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/wait/JDBCConnectionWaitStrategy.java
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/wait/JdbcConnectionWaitStrategy.java
index 9d74357e3b4..a589211cea8 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/wait/JDBCConnectionWaitStrategy.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/wait/JdbcConnectionWaitStrategy.java
@@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit;
*/
@RequiredArgsConstructor
@Slf4j
-public final class JDBCConnectionWaitStrategy extends AbstractWaitStrategy {
+public final class JdbcConnectionWaitStrategy extends AbstractWaitStrategy {
private final Callable<Connection> connectionSupplier;
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/resources/env/logback.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/resources/env/log/logback.xml
similarity index 100%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/resources/env/logback.xml
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/resources/env/log/logback.xml
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java
index 7804b14c948..8ccd188320e 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java
@@ -38,6 +38,7 @@ import
org.apache.shardingsphere.integration.data.pipeline.framework.container.c
import
org.apache.shardingsphere.integration.data.pipeline.framework.container.compose.NativeComposedContainer;
import
org.apache.shardingsphere.integration.data.pipeline.framework.param.ScalingParameterized;
import
org.apache.shardingsphere.integration.data.pipeline.framework.watcher.ScalingWatcher;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.ProxyContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.DockerStorageContainer;
import
org.apache.shardingsphere.test.integration.env.container.atomic.util.DatabaseTypeUtil;
import
org.apache.shardingsphere.test.integration.env.runtime.DataSourceEnvironment;
@@ -146,7 +147,7 @@ public abstract class BaseITCase {
defaultDatabaseName = "postgres";
}
String jdbcUrl =
composedContainer.getProxyJdbcUrl(defaultDatabaseName);
- try (Connection connection = DriverManager.getConnection(jdbcUrl,
"proxy", "Proxy@123")) {
+ try (Connection connection = DriverManager.getConnection(jdbcUrl,
ProxyContainerConstants.USERNAME, ProxyContainerConstants.PASSWORD)) {
if (ENV.getItEnvType() == ScalingITEnvTypeEnum.NATIVE) {
try {
executeWithLog(connection, "DROP DATABASE sharding_db");
@@ -165,8 +166,8 @@ public abstract class BaseITCase {
HikariDataSource result = new HikariDataSource();
result.setDriverClassName(DataSourceEnvironment.getDriverClassName(getDatabaseType()));
result.setJdbcUrl(composedContainer.getProxyJdbcUrl(databaseName));
- result.setUsername("proxy");
- result.setPassword("Proxy@123");
+ result.setUsername(ProxyContainerConstants.USERNAME);
+ result.setPassword(ProxyContainerConstants.PASSWORD);
result.setMaximumPoolSize(2);
result.setTransactionIsolation("TRANSACTION_READ_COMMITTED");
return result;
@@ -191,12 +192,12 @@ public abstract class BaseITCase {
protected void addSourceResource() {
// TODO if mysql can append database firstly, they can be combined
if (databaseType instanceof MySQLDatabaseType) {
- try (Connection connection =
DriverManager.getConnection(getComposedContainer().getProxyJdbcUrl(""),
"proxy", "Proxy@123")) {
+ try (Connection connection =
DriverManager.getConnection(getComposedContainer().getProxyJdbcUrl(""),
ProxyContainerConstants.USERNAME, ProxyContainerConstants.PASSWORD)) {
connection.createStatement().execute("USE sharding_db");
addSourceResource0(connection);
}
} else {
- try (Connection connection =
DriverManager.getConnection(getComposedContainer().getProxyJdbcUrl("sharding_db"),
"proxy", "Proxy@123")) {
+ try (Connection connection =
DriverManager.getConnection(getComposedContainer().getProxyJdbcUrl("sharding_db"),
ProxyContainerConstants.USERNAME, ProxyContainerConstants.PASSWORD)) {
addSourceResource0(connection);
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
index 3d9ed5c7e28..019edebf521 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
@@ -132,7 +132,7 @@ public abstract class BaseITCase {
Map<String, DataSource> actualDataSourceMap =
databaseContainer.getActualDataSourceMap();
actualDataSourceMap.put("ds_0",
createDataSource(databaseContainer, DS_0));
actualDataSourceMap.put("ds_1",
createDataSource(databaseContainer, DS_1));
- dataSource = new JDBCDataSource(dockerComposedContainer);
+ dataSource = new JdbcDataSource(dockerComposedContainer);
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
index be0db28edbe..14ca5130533 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
@@ -48,7 +48,7 @@ public abstract class BaseTransactionITCase extends
BaseITCase {
if (isProxyAdapter(parameterized)) {
initProxyConfig();
} else {
- initJDBCConfig();
+ initJdbcConfig();
}
}
@@ -60,7 +60,7 @@ public abstract class BaseTransactionITCase extends
BaseITCase {
createTables();
}
- private void initJDBCConfig() throws SQLException {
+ private void initJdbcConfig() throws SQLException {
createTables();
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/JDBCDataSource.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/JdbcDataSource.java
similarity index 94%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/JDBCDataSource.java
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/JdbcDataSource.java
index 576ceb933b5..2281e31cea5 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/JDBCDataSource.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/JdbcDataSource.java
@@ -27,11 +27,11 @@ import java.sql.SQLException;
* JDBC data source.
*/
@Slf4j
-public final class JDBCDataSource extends AutoDataSource {
+public final class JdbcDataSource extends AutoDataSource {
private final DockerComposedContainer composedContainer;
- public JDBCDataSource(final DockerComposedContainer composedContainer) {
+ public JdbcDataSource(final DockerComposedContainer composedContainer) {
this.composedContainer = composedContainer;
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
index 954db8df779..87f2a3349f1 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
@@ -24,6 +24,8 @@ import
org.apache.shardingsphere.infra.database.type.DatabaseType;
import
org.apache.shardingsphere.integration.transaction.engine.entity.JdbcInfoEntity;
import
org.apache.shardingsphere.integration.transaction.env.enums.TransactionITEnvTypeEnum;
import
org.apache.shardingsphere.integration.transaction.env.enums.TransactionTestCaseRegistry;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.ProxyContainerConstants;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import java.io.IOException;
import java.io.InputStream;
@@ -164,10 +166,9 @@ public final class IntegrationTestEnvironment {
* @return actual data source username
*/
public String getActualDataSourceUsername(final DatabaseType databaseType)
{
- String username = "test_user";
return itEnvType == TransactionITEnvTypeEnum.NATIVE
- ?
String.valueOf(props.getOrDefault(String.format("transaction.it.native.%s.username",
databaseType.getType().toLowerCase()), username))
- : username;
+ ?
String.valueOf(props.getOrDefault(String.format("transaction.it.native.%s.username",
databaseType.getType().toLowerCase()), ProxyContainerConstants.USERNAME))
+ : StorageContainerConstants.USERNAME;
}
/**
@@ -177,10 +178,9 @@ public final class IntegrationTestEnvironment {
* @return actual data source username
*/
public String getActualDataSourcePassword(final DatabaseType databaseType)
{
- String password = "Test@123";
return itEnvType == TransactionITEnvTypeEnum.NATIVE
- ?
props.getOrDefault(String.format("transaction.it.native.%s.password",
databaseType.getType().toLowerCase()), password).toString()
- : password;
+ ?
props.getOrDefault(String.format("transaction.it.native.%s.password",
databaseType.getType().toLowerCase()),
ProxyContainerConstants.PASSWORD).toString()
+ : StorageContainerConstants.PASSWORD;
}
/**
@@ -190,7 +190,7 @@ public final class IntegrationTestEnvironment {
*/
public String getProxyPassword() {
// TODO this should extract into a constant
- return props.getOrDefault("transaction.it.proxy.password",
"Proxy@123").toString();
+ return props.getOrDefault("transaction.it.proxy.password",
ProxyContainerConstants.PASSWORD).toString();
}
/**
@@ -200,7 +200,7 @@ public final class IntegrationTestEnvironment {
*/
public String getProxyUserName() {
// TODO this should extract into a constant
- return props.getOrDefault("transaction.it.proxy.username",
"proxy").toString();
+ return props.getOrDefault("transaction.it.proxy.username",
ProxyContainerConstants.USERNAME).toString();
}
/**
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/mysql/MySQLContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/mysql/MySQLContainerConfigurationFactory.java
index e0057a6903b..149ce2c473c 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/mysql/MySQLContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/mysql/MySQLContainerConfigurationFactory.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.integration.transaction.framework.container.co
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
import java.util.Collections;
@@ -53,6 +54,6 @@ public final class MySQLContainerConfigurationFactory {
}
private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/mysql/my.cnf",
"/etc/mysql/my.cnf");
+ return Collections.singletonMap("/env/mysql/my.cnf",
StorageContainerConstants.MYSQL_CONF_IN_CONTAINER);
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/opengauss/OpenGaussContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/opengauss/OpenGaussContainerConfigurationFactory.java
index c13c6484d95..beb4d9729f0 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/opengauss/OpenGaussContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/opengauss/OpenGaussContainerConfigurationFactory.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.integration.transaction.framework.container.co
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
import java.util.Collections;
@@ -44,10 +45,10 @@ public final class OpenGaussContainerConfigurationFactory {
}
private static Map<String, String> getContainerEnvironments() {
- return Collections.singletonMap("GS_PASSWORD", "Test@123");
+ return Collections.singletonMap("GS_PASSWORD",
StorageContainerConstants.PASSWORD);
}
private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/postgresql/postgresql.conf",
"/usr/local/opengauss/share/postgresql/postgresql.conf.sample");
+ return Collections.singletonMap("/env/postgresql/postgresql.conf",
StorageContainerConstants.OPENGAUSS_CONF_IN_CONTAINER);
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/postgresql/PostgreSQLContainerConfigurationFactory.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/postgresql/PostgreSQLContainerConfigurationFactory.java
index bfbe5fba910..53f6327dfe2 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/postgresql/PostgreSQLContainerConfigurationFactory.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/config/postgresql/PostgreSQLContainerConfigurationFactory.java
@@ -19,6 +19,7 @@ package
org.apache.shardingsphere.integration.transaction.framework.container.co
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.constants.StorageContainerConstants;
import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
import java.util.Collections;
@@ -46,12 +47,12 @@ public final class PostgreSQLContainerConfigurationFactory {
private static Map<String, String> getContainerEnvironments() {
Map<String, String> result = new HashMap<>(2, 1);
- result.put("POSTGRES_HOST", "test_user");
- result.put("POSTGRES_PASSWORD", "Test@123");
+ result.put("POSTGRES_HOST", StorageContainerConstants.USERNAME);
+ result.put("POSTGRES_PASSWORD", StorageContainerConstants.PASSWORD);
return result;
}
private static Map<String, String> getMountedResources() {
- return Collections.singletonMap("/env/postgresql/postgresql.conf",
"/usr/local/opengauss/share/postgresql/postgresql.conf.sample");
+ return Collections.singletonMap("/env/postgresql/postgresql.conf",
StorageContainerConstants.OPENGAUSS_CONF_IN_CONTAINER);
}
}