You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/02/11 13:35:53 UTC

[shardingsphere] branch master updated: Remove ComposedContainer.getDataSourceMap() (#15368)

This is an automated email from the ASF dual-hosted git repository.

panjuan 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 ba1d05b  Remove ComposedContainer.getDataSourceMap() (#15368)
ba1d05b is described below

commit ba1d05b1985f010d6c4020265f05aaae8d8187ff
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Feb 11 21:34:56 2022 +0800

    Remove ComposedContainer.getDataSourceMap() (#15368)
---
 .../test/integration/engine/BaseITCase.java        |  8 +++-----
 .../test/integration/engine/BatchITCase.java       |  2 +-
 .../test/integration/engine/ddl/BaseDDLIT.java     |  6 +++---
 .../test/integration/engine/dml/BaseDMLIT.java     |  4 ++--
 .../test/integration/engine/ral/GeneralRALIT.java  |  2 +-
 .../test/integration/engine/rdl/GeneralRDLIT.java  |  2 +-
 .../container/atomic/adapter/AdapterContainer.java | 16 ++++++++--------
 .../adapter/impl/ShardingSphereJDBCContainer.java  | 22 +++++++++++-----------
 .../adapter/impl/ShardingSphereProxyContainer.java |  4 ++--
 .../container/compose/ComposedContainer.java       |  9 ++++-----
 .../compose/mode/ClusterComposedContainer.java     | 19 +++++++++++--------
 .../compose/mode/MemoryComposedContainer.java      |  8 +++-----
 12 files changed, 50 insertions(+), 52 deletions(-)

diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BaseITCase.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BaseITCase.java
index efed83a..6d753dd 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BaseITCase.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BaseITCase.java
@@ -38,7 +38,6 @@ import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.text.ParseException;
-import java.util.Map;
 
 @RunWith(ShardingSphereIntegrationTestParameterized.class)
 @Getter(AccessLevel.PROTECTED)
@@ -62,7 +61,7 @@ public abstract class BaseITCase {
     
     private DataSource targetDataSource;
     
-    private DataSource dataSourceForReader;
+    private DataSource anotherClientDataSource;
     
     public BaseITCase(final ParameterizedArray parameterizedArray) {
         adapter = parameterizedArray.getAdapter();
@@ -76,10 +75,9 @@ public abstract class BaseITCase {
     
     @Before
     public void init() throws Exception {
-        Map<String, DataSource> dataSourceMap = composedContainer.getDataSourceMap();
-        targetDataSource = dataSourceMap.get("adapterForWriter");
+        targetDataSource = composedContainer.getClientDataSource();
         if (composedContainer instanceof ClusterComposedContainer) {
-            dataSourceForReader = dataSourceMap.get("adapterForReader");
+            anotherClientDataSource = ((ClusterComposedContainer) composedContainer).getAnotherClientDataSource();
             int waitForGov = 10;
             while (waitForGov-- > 0) {
                 try (Connection ignored = targetDataSource.getConnection()) {
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BatchITCase.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BatchITCase.java
index 06a93c2..134c293 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BatchITCase.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/BatchITCase.java
@@ -93,7 +93,7 @@ public abstract class BatchITCase extends BaseITCase {
         for (String each : new InlineExpressionParser(expectedDataSetMetaData.getDataNodes()).splitAndEvaluate()) {
             DataNode dataNode = new DataNode(each);
             DataSource dataSource = getComposedContainer() instanceof ClusterComposedContainer
-                    ? getDataSourceForReader() : getStorageContainer().getDataSourceMap().get(dataNode.getDataSourceName());
+                    ? getAnotherClientDataSource() : getStorageContainer().getDataSourceMap().get(dataNode.getDataSourceName());
             try (Connection connection = dataSource.getConnection();
                  PreparedStatement preparedStatement = connection.prepareStatement(String.format("SELECT * FROM %s ORDER BY 1", dataNode.getTableName()))) {
                 assertDataSet(preparedStatement, expected.findRows(dataNode), expectedDataSetMetaData);
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java
index bce3e9f..a45b35e 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ddl/BaseDDLIT.java
@@ -99,7 +99,7 @@ public abstract class BaseDDLIT extends SingleITCase {
     private void assertNotContainsTable(final Collection<DataNode> dataNodes) throws SQLException {
         for (DataNode each : dataNodes) {
             try (Connection connection = getComposedContainer() instanceof ClusterComposedContainer
-                    ? getDataSourceForReader().getConnection() : getStorageContainer().getDataSourceMap().get(each.getDataSourceName()).getConnection()) {
+                    ? getAnotherClientDataSource().getConnection() : getStorageContainer().getDataSourceMap().get(each.getDataSourceName()).getConnection()) {
                 assertNotContainsTable(connection, each.getTableName());
             }
         }
@@ -113,7 +113,7 @@ public abstract class BaseDDLIT extends SingleITCase {
         Set<DataSetColumn> result = new LinkedHashSet<>();
         for (DataNode each : dataNodes) {
             DataSource dataSource = getComposedContainer() instanceof ClusterComposedContainer
-                    ? getDataSourceForReader() : getStorageContainer().getDataSourceMap().get(each.getDataSourceName());
+                    ? getAnotherClientDataSource() : getStorageContainer().getDataSourceMap().get(each.getDataSourceName());
             try (Connection connection = dataSource.getConnection()) {
                 result.addAll(getActualColumns(connection, each.getTableName()));
             }
@@ -139,7 +139,7 @@ public abstract class BaseDDLIT extends SingleITCase {
         Set<DataSetIndex> result = new LinkedHashSet<>();
         for (DataNode each : dataNodes) {
             DataSource dataSource = getComposedContainer() instanceof ClusterComposedContainer
-                    ? getDataSourceForReader() : getStorageContainer().getDataSourceMap().get(each.getDataSourceName());
+                    ? getAnotherClientDataSource() : getStorageContainer().getDataSourceMap().get(each.getDataSourceName());
             try (Connection connection = dataSource.getConnection()) {
                 result.addAll(getActualIndexes(connection, each.getTableName()));
             }
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/dml/BaseDMLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/dml/BaseDMLIT.java
index 4722702..c48966b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/dml/BaseDMLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/dml/BaseDMLIT.java
@@ -75,7 +75,7 @@ public abstract class BaseDMLIT extends SingleITCase {
         for (String each : new InlineExpressionParser(expectedDataSetMetaData.getDataNodes()).splitAndEvaluate()) {
             DataNode dataNode = new DataNode(each);
             DataSource dataSource = getComposedContainer() instanceof ClusterComposedContainer
-                    ? getDataSourceForReader() : getStorageContainer().getDataSourceMap().get(dataNode.getDataSourceName());
+                    ? getAnotherClientDataSource() : getStorageContainer().getDataSourceMap().get(dataNode.getDataSourceName());
             try (
                     Connection connection = dataSource.getConnection();
                     PreparedStatement preparedStatement = connection.prepareStatement(generateFetchActualDataSQL(dataNode))) {
@@ -103,7 +103,7 @@ public abstract class BaseDMLIT extends SingleITCase {
         String sql = String.format("SELECT a.attname, format_type(a.atttypid, a.atttypmod) AS data_type "
                 + "FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) WHERE i.indrelid = '%s'::regclass AND i.indisprimary", dataNode.getTableName());
         DataSource dataSource = getComposedContainer() instanceof ClusterComposedContainer
-                ? getDataSourceForReader() : getStorageContainer().getDataSourceMap().get(dataNode.getDataSourceName());
+                ? getAnotherClientDataSource() : getStorageContainer().getDataSourceMap().get(dataNode.getDataSourceName());
         try (
                 Connection connection = dataSource.getConnection();
                 Statement statement = connection.createStatement();
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java
index 89728ba..3027e52 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/ral/GeneralRALIT.java
@@ -62,7 +62,7 @@ public final class GeneralRALIT extends BaseRALIT {
     @Test
     public void assertExecute() throws SQLException, ParseException {
         DataSource dataSource = getComposedContainer() instanceof ClusterComposedContainer
-                ? getDataSourceForReader() : getTargetDataSource();
+                ? getAnotherClientDataSource() : getTargetDataSource();
         try (Connection connection = dataSource.getConnection()) {
             assertExecuteForStatement(connection);
         }
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/rdl/GeneralRDLIT.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/rdl/GeneralRDLIT.java
index cb3e93b..3516060 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/rdl/GeneralRDLIT.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/engine/rdl/GeneralRDLIT.java
@@ -62,7 +62,7 @@ public final class GeneralRDLIT extends BaseRDLIT {
     @Test
     public void assertExecute() throws SQLException, ParseException {
         DataSource dataSource = getComposedContainer() instanceof ClusterComposedContainer
-                ? getDataSourceForReader() : getTargetDataSource();
+                ? getAnotherClientDataSource() : getTargetDataSource();
         try (Connection connection = dataSource.getConnection()) {
             assertExecuteForStatement(connection);
         }
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/AdapterContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/AdapterContainer.java
index 9ea8ffd..dd67ad9 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/AdapterContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/AdapterContainer.java
@@ -38,18 +38,18 @@ public abstract class AdapterContainer extends ShardingSphereContainer {
     }
     
     /**
-     * Get data source.
+     * Get client data source.
      *
-     * @param serverLists server list
-     * @return data source
+     * @param serverLists server lists
+     * @return client data source
      */
-    public abstract DataSource getDataSource(String serverLists);
+    public abstract DataSource getClientDataSource(String serverLists);
     
     /**
-     * Get governance data source.
+     * Get another client data source.
      *
-     * @param serverLists server list
-     * @return data source
+     * @param serverLists server lists
+     * @return another client data source
      */
-    public abstract DataSource getDataSourceForReader(String serverLists);
+    public abstract DataSource getAnotherClientDataSource(String serverLists);
 }
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereJDBCContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereJDBCContainer.java
index ab0943a..8921068 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereJDBCContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereJDBCContainer.java
@@ -48,9 +48,9 @@ public final class ShardingSphereJDBCContainer extends AdapterContainer {
     
     private Map<String, DataSource> dataSourceMap;
     
-    private final AtomicReference<DataSource> dataSourceProvider = new AtomicReference<>();
+    private final AtomicReference<DataSource> clientDataSourceProvider = new AtomicReference<>();
     
-    private final AtomicReference<DataSource> dataSourceForReaderProvider = new AtomicReference<>();
+    private final AtomicReference<DataSource> anotherClientDataSourceProvider = new AtomicReference<>();
     
     public ShardingSphereJDBCContainer(final ParameterizedArray parameterizedArray) {
         super("ShardingSphere-JDBC", "ShardingSphere-JDBC", true, parameterizedArray);
@@ -75,21 +75,21 @@ public final class ShardingSphereJDBCContainer extends AdapterContainer {
      * @param serverLists server list
      * @return data source
      */
-    public DataSource getDataSource(final String serverLists) {
-        DataSource dataSource = dataSourceProvider.get();
+    public DataSource getClientDataSource(final String serverLists) {
+        DataSource dataSource = clientDataSourceProvider.get();
         if (Objects.isNull(dataSource)) {
             if (Strings.isNullOrEmpty(serverLists)) {
                 try {
-                    dataSourceProvider.set(
+                    clientDataSourceProvider.set(
                             YamlShardingSphereDataSourceFactory.createDataSource(dataSourceMap, new File(EnvironmentPath.getRulesConfigurationFile(getParameterizedArray().getScenario()))));
                 } catch (final SQLException | IOException ex) {
                     throw new RuntimeException(ex);
                 }
             } else {
-                dataSourceProvider.set(createGovernanceDataSource(serverLists));
+                clientDataSourceProvider.set(createGovernanceDataSource(serverLists));
             }
         }
-        return dataSourceProvider.get();
+        return clientDataSourceProvider.get();
     }
     
     /**
@@ -98,12 +98,12 @@ public final class ShardingSphereJDBCContainer extends AdapterContainer {
      * @param serverLists server list
      * @return data source
      */
-    public DataSource getDataSourceForReader(final String serverLists) {
-        DataSource dataSource = dataSourceForReaderProvider.get();
+    public DataSource getAnotherClientDataSource(final String serverLists) {
+        DataSource dataSource = anotherClientDataSourceProvider.get();
         if (Objects.isNull(dataSource)) {
-            dataSourceForReaderProvider.set(createGovernanceDataSource(serverLists));
+            anotherClientDataSourceProvider.set(createGovernanceDataSource(serverLists));
         }
-        return dataSourceForReaderProvider.get();
+        return anotherClientDataSourceProvider.get();
     }
     
     private DataSource createGovernanceDataSource(final String serverLists) {
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java
index ad39ded..1745635 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/atomic/adapter/impl/ShardingSphereProxyContainer.java
@@ -113,7 +113,7 @@ public final class ShardingSphereProxyContainer extends AdapterContainer {
      * @param serverLists server list
      * @return data source
      */
-    public DataSource getDataSource(final String serverLists) {
+    public DataSource getClientDataSource(final String serverLists) {
         return getProxyDataSource();
     }
     
@@ -123,7 +123,7 @@ public final class ShardingSphereProxyContainer extends AdapterContainer {
      * @param serverLists server list
      * @return data source
      */
-    public DataSource getDataSourceForReader(final String serverLists) {
+    public DataSource getAnotherClientDataSource(final String serverLists) {
         return getProxyDataSource();
     }
     
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/ComposedContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/ComposedContainer.java
index 0a4a6ae..c4ca835 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/ComposedContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/ComposedContainer.java
@@ -21,7 +21,6 @@ import org.apache.shardingsphere.test.integration.framework.container.atomic.Sha
 import org.apache.shardingsphere.test.integration.framework.container.atomic.storage.StorageContainer;
 
 import javax.sql.DataSource;
-import java.util.Map;
 
 /**
  * Composed container.
@@ -43,9 +42,9 @@ public interface ComposedContainer {
     StorageContainer getStorageContainer();
     
     /**
-     * Get data source map.
-     *
-     * @return data source map
+     * Get client data source.
+     * 
+     * @return client data source
      */
-    Map<String, DataSource> getDataSourceMap();
+    DataSource getClientDataSource();
 }
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/ClusterComposedContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/ClusterComposedContainer.java
index b808248..455a022 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/ClusterComposedContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/ClusterComposedContainer.java
@@ -29,8 +29,6 @@ import org.apache.shardingsphere.test.integration.framework.container.compose.Co
 import org.apache.shardingsphere.test.integration.framework.param.model.ParameterizedArray;
 
 import javax.sql.DataSource;
-import java.util.HashMap;
-import java.util.Map;
 
 /**
  * Cluster composed container.
@@ -66,11 +64,16 @@ public final class ClusterComposedContainer implements ComposedContainer {
     }
     
     @Override
-    public Map<String, DataSource> getDataSourceMap() {
-        Map<String, DataSource> result = new HashMap<>(2, 1);
-        String serverLists = zookeeperContainer.getServerLists();
-        result.put("adapterForWriter", adapterContainer.getDataSource(serverLists));
-        result.put("adapterForReader", adapterContainerForReader.getDataSourceForReader(serverLists));
-        return result;
+    public DataSource getClientDataSource() {
+        return adapterContainer.getClientDataSource(zookeeperContainer.getServerLists());
+    }
+    
+    /**
+     * Get another client data source.
+     * 
+     * @return another client data source
+     */
+    public DataSource getAnotherClientDataSource() {
+        return adapterContainerForReader.getAnotherClientDataSource(zookeeperContainer.getServerLists());
     }
 }
diff --git a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/MemoryComposedContainer.java b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/MemoryComposedContainer.java
index bc4d637..a2d4e5b 100644
--- a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/MemoryComposedContainer.java
+++ b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-suite/src/test/java/org/apache/shardingsphere/test/integration/framework/container/compose/mode/MemoryComposedContainer.java
@@ -18,17 +18,15 @@
 package org.apache.shardingsphere.test.integration.framework.container.compose.mode;
 
 import lombok.Getter;
-import org.apache.shardingsphere.test.integration.framework.container.compose.ComposedContainer;
 import org.apache.shardingsphere.test.integration.framework.container.atomic.ShardingSphereContainers;
 import org.apache.shardingsphere.test.integration.framework.container.atomic.adapter.AdapterContainer;
 import org.apache.shardingsphere.test.integration.framework.container.atomic.adapter.AdapterContainerFactory;
 import org.apache.shardingsphere.test.integration.framework.container.atomic.storage.StorageContainer;
 import org.apache.shardingsphere.test.integration.framework.container.atomic.storage.StorageContainerFactory;
+import org.apache.shardingsphere.test.integration.framework.container.compose.ComposedContainer;
 import org.apache.shardingsphere.test.integration.framework.param.model.ParameterizedArray;
 
 import javax.sql.DataSource;
-import java.util.Collections;
-import java.util.Map;
 
 /**
  * Memory composed container.
@@ -50,7 +48,7 @@ public final class MemoryComposedContainer implements ComposedContainer {
     }
     
     @Override
-    public Map<String, DataSource> getDataSourceMap() {
-        return Collections.singletonMap("adapterForWriter", adapterContainer.getDataSource(null));
+    public DataSource getClientDataSource() {
+        return adapterContainer.getClientDataSource(null);
     }
 }