terrymanu commented on code in PR #20021:
URL: https://github.com/apache/shardingsphere/pull/20021#discussion_r942489069
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType,
"localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
+ for (String each : commands) {
+ setCommand(each);
+ }
+ }
+ }
+
+ protected void addEnvs(final Map<String, String> envs) {
+ if (!envs.isEmpty()) {
Review Comment:
Unnecessary to judge !envs.isEmpty()
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType,
"localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
+ for (String each : commands) {
+ setCommand(each);
+ }
+ }
+ }
+
+ protected void addEnvs(final Map<String, String> envs) {
+ if (!envs.isEmpty()) {
+ envs.forEach(this::addEnv);
+ }
+ }
+
+ protected void mapResources(final Map<String, String> resources) {
Review Comment:
Please add final if method does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
Review Comment:
Config should be configuration
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
+ */
+public interface StorageContainerConfiguration {
+
+ /**
+ * get docker container commands.
+ *
+ * @return docker container commands
+ */
+ String[] getCommands();
+
+ /**
+ * get docker container environment variables.
+ *
+ * @return docker container environments
+ */
+ Map<String, String> getEnvs();
+
+ /**
+ * get docker container mapping resources.
Review Comment:
Please upper case for the first letter in the sentence
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements
StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ // TODO need auto set server-id by generator, now always set server-id
to 1
+ String[] commands = new String[1];
+ commands[0] = "--server-id=1";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("LANG",
"C.UTF-8").put("MYSQL_RANDOM_ROOT_PASSWORD", "yes").build();
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/mysql/my.cnf",
"/etc/mysql/my.cnf").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/ScalingMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingMySQLContainerConfiguration extends
DefaultMySQLContainerConfiguration {
+
+ public ScalingMySQLContainerConfiguration(final String scenario) {
+ super(scenario);
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder().put("/env/mysql/my.cnf",
"/etc/mysql/my.cnf").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
Review Comment:
How about use default method?
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements
StorageContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends
DefaultPostgreSQLContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/DockerStorageContainer.java:
##########
@@ -78,6 +78,26 @@ protected void configure() {
: DataSourceEnvironment.getURL(databaseType,
"localhost", getFirstMappedPort()), getUsername(), getUnifiedPassword())));
}
+ protected void setCommands(final String[] commands) {
+ if (commands.length > 0) {
Review Comment:
Unnecessary to judge commands.length > 0
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfigurationFactory.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.DefaultMySQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.ScalingMySQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss.DefaultOpenGaussContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.DefaultPostgreSQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.ScalingPostgreSQLContainerConfiguration;
+
+public class StorageContainerConfigurationFactory {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
Review Comment:
Only first letter in the sentence could be upper case.
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfigurationFactory.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.DefaultMySQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.ScalingMySQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss.DefaultOpenGaussContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.DefaultPostgreSQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.ScalingPostgreSQLContainerConfiguration;
+
+public class StorageContainerConfigurationFactory {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
+ */
+public interface StorageContainerConfiguration {
+
+ /**
+ * get docker container commands.
Review Comment:
Please upper case for the first letter in the sentence
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import java.util.Map;
+
+/**
+ * Docker Storage Container Config.
+ */
+public interface StorageContainerConfiguration {
+
+ /**
+ * get docker container commands.
+ *
+ * @return docker container commands
+ */
+ String[] getCommands();
+
+ /**
+ * get docker container environment variables.
Review Comment:
Please upper case for the first letter in the sentence
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements
StorageContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/StorageContainerFactory.java:
##########
@@ -40,13 +41,26 @@ public final class StorageContainerFactory {
* @return created instance
*/
public static StorageContainer newInstance(final DatabaseType
databaseType, final String dockerImageName, final String scenario) {
+ return newInstance(databaseType, dockerImageName, scenario, "");
+ }
+
+ /**
+ * Create new instance of storage container.
+ *
+ * @param databaseType database type
+ * @param dockerImageName docker image name
+ * @param scenario scenario
+ * @param module module
+ * @return created instance
+ */
+ public static StorageContainer newInstance(final DatabaseType
databaseType, final String dockerImageName, final String scenario, final String
module) {
Review Comment:
env is the basic module, please do not include `module` argument
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/StorageContainerConfigurationFactory.java:
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.integration.env.container.atomic.storage.config;
+
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.DefaultMySQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.mysql.ScalingMySQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.opengauss.DefaultOpenGaussContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.DefaultPostgreSQLContainerConfiguration;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.impl.postgresql.ScalingPostgreSQLContainerConfiguration;
+
+public class StorageContainerConfigurationFactory {
+
+ /**
+ * Create new instance of storage container.
+ *
+ * @param databaseType database type
+ * @param module module
+ * @param scenario scenario
+ * @return created instance
+ */
+ public static StorageContainerConfiguration newInstance(final DatabaseType
databaseType, final String scenario, final String module) {
Review Comment:
env is the basic module, please do not include `module` argument
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements
StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/ScalingMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingMySQLContainerConfiguration extends
DefaultMySQLContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements
StorageContainerConfiguration {
Review Comment:
Missed javadoc
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/DefaultMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,48 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultMySQLContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ // TODO need auto set server-id by generator, now always set server-id
to 1
+ String[] commands = new String[1];
+ commands[0] = "--server-id=1";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("LANG",
"C.UTF-8").put("MYSQL_RANDOM_ROOT_PASSWORD", "yes").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/mysql/ScalingMySQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.mysql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingMySQLContainerConfiguration extends
DefaultMySQLContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements
StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ return new String[0];
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("GS_PASSWORD",
"Test@123").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements
StorageContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
Review Comment:
return value should name as `result`
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/opengauss/DefaultOpenGaussContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.opengauss;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultOpenGaussContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ return new String[0];
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("GS_PASSWORD",
"Test@123").build();
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String, String>builder()
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("POSTGRES_PASSWORD",
"Test@123").build();
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String,
String>builder().put("/env/postgresql/postgresql.conf",
"/etc/postgresql/postgresql.conf").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/DefaultPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import lombok.RequiredArgsConstructor;
+import
org.apache.shardingsphere.test.integration.env.container.atomic.storage.config.StorageContainerConfiguration;
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+@RequiredArgsConstructor
+public class DefaultPostgreSQLContainerConfiguration implements
StorageContainerConfiguration {
+
+ private final String scenario;
+
+ @Override
+ public String[] getCommands() {
+ String[] commands = new String[1];
+ commands[0] = "-c config_file=/etc/postgresql/postgresql.conf";
+ return commands;
+ }
+
+ @Override
+ public Map<String, String> getEnvs() {
+ return ImmutableMap.<String, String>builder().put("POSTGRES_PASSWORD",
"Test@123").build();
Review Comment:
Please avoid to use guava API if possible
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends
DefaultPostgreSQLContainerConfiguration {
Review Comment:
Please add final if class does not design for extension
##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-env/src/test/java/org/apache/shardingsphere/test/integration/env/container/atomic/storage/config/impl/postgresql/ScalingPostgreSQLContainerConfiguration.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.integration.env.container.atomic.storage.config.impl.postgresql;
+
+import org.testcontainers.shaded.com.google.common.collect.ImmutableMap;
+
+import java.util.Map;
+
+public class ScalingPostgreSQLContainerConfiguration extends
DefaultPostgreSQLContainerConfiguration {
+
+ public ScalingPostgreSQLContainerConfiguration(final String scenario) {
+ super(scenario);
+ }
+
+ @Override
+ public Map<String, String> getResourceMappings() {
+ return ImmutableMap.<String,
String>builder().put("/env/postgresql/postgresql.conf",
"/etc/postgresql/postgresql.conf").build();
Review Comment:
Please avoid to use guava API if possible
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]