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 2020/10/18 10:03:28 UTC
[shardingsphere] branch master updated: Rename DatabaseTypes to
DatabaseTypeRegistry (#7834)
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 c82441b Rename DatabaseTypes to DatabaseTypeRegistry (#7834)
c82441b is described below
commit c82441ba41bc9913a997147b70dbcc9dbb47ae60
Author: Liang Zhang <te...@163.com>
AuthorDate: Sun Oct 18 18:03:07 2020 +0800
Rename DatabaseTypes to DatabaseTypeRegistry (#7834)
---
.../merge/dql/ShardingDQLResultMerger.java | 4 +-
.../merge/ShardingResultMergerEngineTest.java | 8 ++--
.../merge/dql/ShardingDQLResultMergerTest.java | 44 +++++++++++-----------
.../dql/groupby/GroupByMemoryMergedResultTest.java | 8 ++--
.../dql/groupby/GroupByStreamMergedResultTest.java | 8 ++--
.../iterator/IteratorStreamMergedResultTest.java | 14 +++----
.../dql/orderby/OrderByStreamMergedResultTest.java | 12 +++---
.../pagination/LimitDecoratorMergedResultTest.java | 8 ++--
.../RowNumberDecoratorMergedResultTest.java | 10 ++---
.../TopAndRowNumberDecoratorMergedResultTest.java | 12 +++---
.../engine/type/standard/AbstractSQLRouteTest.java | 4 +-
.../context/schema/GovernanceSchemaContexts.java | 4 +-
...atabaseTypes.java => DatabaseTypeRegistry.java} | 4 +-
.../database/type/dialect/H2DatabaseType.java | 4 +-
.../database/type/dialect/MariaDBDatabaseType.java | 4 +-
...ypesTest.java => DatabaseTypeRegistryTest.java} | 20 +++++-----
.../model/datasource/DataSourcesMetaDataTest.java | 10 ++---
.../jdbc/MetaDataConnectionAdapterTest.java | 4 +-
.../DatabaseMetaDataDialectHandlerFactoryTest.java | 6 +--
.../model/column/ColumnMetaDataLoaderTest.java | 4 +-
.../model/schema/SchemaMetaDataLoaderTest.java | 4 +-
.../model/table/TableMetaDataLoaderTest.java | 4 +-
.../context/schema/SchemaContextsBuilderTest.java | 8 ++--
.../schema/impl/StandardSchemaContextsTest.java | 4 +-
.../impl/DefaultSQLExecutorCallbackTest.java | 4 +-
.../dbtest/engine/dcl/GeneralDCLIT.java | 4 +-
.../dbtest/engine/ddl/GeneralDDLIT.java | 4 +-
.../dbtest/engine/dml/BatchDMLIT.java | 4 +-
.../dbtest/engine/dml/GeneralDMLIT.java | 4 +-
.../dbtest/engine/dql/GeneralDQLIT.java | 4 +-
.../engine/util/IntegrateTestParameters.java | 4 +-
.../dbtest/env/IntegrateTestEnvironment.java | 4 +-
.../dbtest/env/authority/AuthoritySQLSet.java | 4 +-
.../env/dataset/DataSetEnvironmentManager.java | 6 +--
.../core/datasource/ShardingSphereDataSource.java | 4 +-
.../statement/ShardingSpherePreparedStatement.java | 4 +-
.../core/statement/ShardingSphereStatement.java | 4 +-
.../driver/common/base/AbstractSQLTest.java | 4 +-
.../driver/common/env/DatabaseEnvironment.java | 12 +++---
.../driver/executor/AbstractBaseExecutorTest.java | 4 +-
.../driver/jdbc/adapter/ResultSetAdapterTest.java | 18 ++++-----
.../jdbc/adapter/ResultSetGetterAdapterTest.java | 44 +++++++++++-----------
.../driver/jdbc/adapter/StatementAdapterTest.java | 6 +--
.../connection/ShardingSphereConnectionTest.java | 4 +-
.../datasource/ShardingSphereDataSourceTest.java | 26 ++++++-------
.../statement/EncryptPreparedStatementTest.java | 4 +-
.../jdbc/core/statement/EncryptStatementTest.java | 4 +-
.../statement/ShadowPreparedStatementTest.java | 6 +--
.../jdbc/core/statement/ShadowStatementTest.java | 4 +-
.../GovernanceShardingSphereDataSource.java | 4 +-
.../explain/ShardingCTLExplainBackendHandler.java | 5 ++-
.../TextProtocolBackendHandlerFactoryTest.java | 4 +-
.../impl/AbstractBootstrapInitializer.java | 4 +-
.../DatabaseProtocolFrontendEngineFactory.java | 4 +-
.../DatabaseProtocolFrontendEngineFactoryTest.java | 4 +-
.../execute/MySQLComStmtExecuteExecutor.java | 5 ++-
.../prepare/MySQLComStmtPrepareExecutor.java | 5 ++-
.../fieldlist/MySQLComFieldListPacketExecutor.java | 5 ++-
.../text/query/MySQLComQueryPacketExecutor.java | 4 +-
.../binary/bind/PostgreSQLComBindExecutor.java | 5 ++-
.../binary/parse/PostgreSQLComParseExecutor.java | 5 ++-
.../query/text/PostgreSQLComQueryExecutor.java | 4 +-
.../config/JDBCScalingDataSourceConfiguration.java | 4 +-
...ngSphereJDBCScalingDataSourceConfiguration.java | 5 ++-
.../scaling/core/metadata/MetaDataManager.java | 4 +-
.../jaxb/sql/loader/SQLCasesLoader.java | 4 +-
.../properties/XADataSourceDefinitionFactory.java | 4 +-
.../xa/XAShardingTransactionManagerTest.java | 6 +--
.../xa/jta/connection/XAConnectionFactoryTest.java | 14 +++----
.../dialect/MariaDBXAConnectionWrapperTest.java | 6 +--
.../dialect/MySQLXAConnectionWrapperTest.java | 6 +--
.../dialect/OracleXAConnectionWrapperTest.java | 6 +--
.../dialect/PostgreSQLXAConnectionWrapperTest.java | 6 +--
.../xa/jta/datasource/XADataSourceFactoryTest.java | 10 ++---
.../datasource/XATransactionDataSourceTest.java | 18 ++++-----
.../XADataSourceDefinitionFactoryTest.java | 14 +++----
.../at/SeataATShardingTransactionManagerTest.java | 4 +-
.../ShardingTransactionManagerEngineTest.java | 4 +-
78 files changed, 291 insertions(+), 284 deletions(-)
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
index 655a45e..2a7b6b4 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/main/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMerger.java
@@ -34,7 +34,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementConte
import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
import org.apache.shardingsphere.sql.parser.sql.common.util.SQLUtil;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.engine.merger.ResultMerger;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
@@ -119,7 +119,7 @@ public final class ShardingDQLResultMerger implements ResultMerger {
if (!paginationContext.isHasPagination() || 1 == queryResults.size()) {
return mergedResult;
}
- String trunkDatabaseName = DatabaseTypes.getTrunkDatabaseType(databaseType.getName()).getName();
+ String trunkDatabaseName = DatabaseTypeRegistry.getTrunkDatabaseType(databaseType.getName()).getName();
if ("MySQL".equals(trunkDatabaseName) || "PostgreSQL".equals(trunkDatabaseName)) {
return new LimitDecoratorMergedResult(mergedResult, paginationContext);
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
index 06099e7..fc95de7 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/ShardingResultMergerEngineTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.merge.engine.merger.impl.TransparentResultMerger;
import org.apache.shardingsphere.sharding.merge.dal.ShardingDALResultMerger;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
@@ -84,14 +84,14 @@ public final class ShardingResultMergerEngineTest {
SelectStatementContext sqlStatementContext = new SelectStatementContext(selectStatement,
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()), new PaginationContext(null, null, Collections.emptyList()));
- assertThat(new ShardingResultMergerEngine().newInstance(DatabaseTypes.getActualDatabaseType("MySQL"), null, props, sqlStatementContext), instanceOf(ShardingDQLResultMerger.class));
+ assertThat(new ShardingResultMergerEngine().newInstance(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), null, props, sqlStatementContext), instanceOf(ShardingDQLResultMerger.class));
}
@Test
public void assertNewInstanceWithDALStatement() {
ConfigurationProperties props = new ConfigurationProperties(new Properties());
CommonSQLStatementContext<PostgreSQLShowStatement> sqlStatementContext = new CommonSQLStatementContext<>(new PostgreSQLShowStatement());
- assertThat(new ShardingResultMergerEngine().newInstance(DatabaseTypes.getActualDatabaseType("MySQL"), null, props, sqlStatementContext), instanceOf(ShardingDALResultMerger.class));
+ assertThat(new ShardingResultMergerEngine().newInstance(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), null, props, sqlStatementContext), instanceOf(ShardingDALResultMerger.class));
}
@Test
@@ -102,6 +102,6 @@ public final class ShardingResultMergerEngineTest {
insertStatement.setInsertColumns(insertColumnsSegment);
InsertStatementContext sqlStatementContext = new InsertStatementContext(mock(PhysicalSchemaMetaData.class), Collections.emptyList(), insertStatement);
ConfigurationProperties props = new ConfigurationProperties(new Properties());
- assertThat(new ShardingResultMergerEngine().newInstance(DatabaseTypes.getActualDatabaseType("MySQL"), null, props, sqlStatementContext), instanceOf(TransparentResultMerger.class));
+ assertThat(new ShardingResultMergerEngine().newInstance(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), null, props, sqlStatementContext), instanceOf(TransparentResultMerger.class));
}
}
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
index d2215f0..41a766a 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/ShardingDQLResultMergerTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql;
import com.google.common.collect.ImmutableMap;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.groupby.GroupByMemoryMergedResult;
@@ -67,7 +67,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildIteratorStreamMergedResult() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new MySQLSelectStatement()),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()), new PaginationContext(null, null, Collections.emptyList()));
@@ -76,7 +76,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildIteratorStreamMergedResultWithLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new MySQLSelectStatement()),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -86,7 +86,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildIteratorStreamMergedResultWithMySQLLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new MySQLSelectStatement()),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -98,7 +98,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildIteratorStreamMergedResultWithOracleLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new OracleSelectStatement()),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -110,7 +110,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildIteratorStreamMergedResultWithSQLServerLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new SQLServerSelectStatement()),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -122,7 +122,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildOrderByStreamMergedResult() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(
createSelectStatement(new MySQLSelectStatement()), new GroupByContext(Collections.emptyList(), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -132,7 +132,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildOrderByStreamMergedResultWithMySQLLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(
createSelectStatement(new MySQLSelectStatement()), new GroupByContext(Collections.emptyList(), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -145,7 +145,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildOrderByStreamMergedResultWithOracleLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(
createSelectStatement(new OracleSelectStatement()), new GroupByContext(Collections.emptyList(), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -158,7 +158,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildOrderByStreamMergedResultWithSQLServerLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(
createSelectStatement(new SQLServerSelectStatement()), new GroupByContext(Collections.emptyList(), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -171,7 +171,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByStreamMergedResult() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new MySQLSelectStatement()),
new GroupByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -181,7 +181,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByStreamMergedResultWithMySQLLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new MySQLSelectStatement()),
new GroupByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -194,7 +194,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByStreamMergedResultWithOracleLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new OracleSelectStatement()),
new GroupByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -207,7 +207,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByStreamMergedResultWithSQLServerLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new SQLServerSelectStatement()),
new GroupByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -220,7 +220,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResult() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new MySQLSelectStatement()),
new GroupByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), 0),
new OrderByContext(Collections.emptyList(), false), new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -230,7 +230,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResultWithMySQLLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new MySQLSelectStatement()),
new GroupByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), 0),
new OrderByContext(Collections.emptyList(), false), new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -242,7 +242,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResultWithOracleLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new OracleSelectStatement()),
new GroupByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC))), 0),
new OrderByContext(Collections.singletonList(new OrderByItem(new IndexOrderByItemSegment(0, 0, 2, OrderDirection.DESC, OrderDirection.ASC))), false),
@@ -255,7 +255,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResultWithSQLServerLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(createSelectStatement(new SQLServerSelectStatement()),
new GroupByContext(Arrays.asList(
new OrderByItem(new IndexOrderByItemSegment(0, 0, 1, OrderDirection.DESC, OrderDirection.ASC)),
@@ -269,7 +269,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResultWithAggregationOnly() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
ProjectionsContext projectionsContext = new ProjectionsContext(
0, 0, false, Collections.singletonList(new AggregationProjection(AggregationType.COUNT, "(*)", null)));
SelectStatementContext selectStatementContext = new SelectStatementContext(
@@ -280,7 +280,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResultWithAggregationOnlyWithMySQLLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
ProjectionsContext projectionsContext = new ProjectionsContext(
0, 0, false, Collections.singletonList(new AggregationProjection(AggregationType.COUNT, "(*)", null)));
SelectStatementContext selectStatementContext = new SelectStatementContext(
@@ -293,7 +293,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResultWithAggregationOnlyWithOracleLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
ProjectionsContext projectionsContext = new ProjectionsContext(
0, 0, false, Collections.singletonList(new AggregationProjection(AggregationType.COUNT, "(*)", null)));
SelectStatementContext selectStatementContext = new SelectStatementContext(
@@ -306,7 +306,7 @@ public final class ShardingDQLResultMergerTest {
@Test
public void assertBuildGroupByMemoryMergedResultWithAggregationOnlyWithSQLServerLimit() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
ProjectionsContext projectionsContext = new ProjectionsContext(
0, 0, false, Collections.singletonList(new AggregationProjection(AggregationType.COUNT, "(*)", null)));
SelectStatementContext selectStatementContext = new SelectStatementContext(
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
index aa60661..15c2321 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByMemoryMergedResultTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.merge.dql.groupby;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
@@ -53,7 +53,7 @@ public final class GroupByMemoryMergedResultTest {
@Test
public void assertNextForResultSetsAllEmpty() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(Arrays.asList(createQueryResult(), createQueryResult(), createQueryResult()), createSelectStatementContext(), null);
assertTrue(actual.next());
assertThat(actual.getValue(1, Object.class), is(0));
@@ -78,7 +78,7 @@ public final class GroupByMemoryMergedResultTest {
when(queryResult3.getValue(3, Object.class)).thenReturn(2, 3);
when(queryResult3.getValue(4, Object.class)).thenReturn(2, 2, 3);
when(queryResult3.getValue(5, Object.class)).thenReturn(20, 20, 30);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(Arrays.asList(queryResult1, queryResult2, queryResult3), createSelectStatementContext(), null);
assertTrue(actual.next());
assertThat(actual.getValue(1, Object.class), is(new BigDecimal(30)));
@@ -133,7 +133,7 @@ public final class GroupByMemoryMergedResultTest {
when(queryResult3.getValue(3, Object.class)).thenReturn(2, 3);
when(queryResult3.getValue(4, Object.class)).thenReturn(2, 2, 3);
when(queryResult3.getValue(5, Object.class)).thenReturn(20, 20, 30);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(Arrays.asList(queryResult1, queryResult2, queryResult3), createSelectStatementContext(), null);
assertTrue(actual.next());
assertThat(actual.getValue(1, Object.class), is(new BigDecimal(30)));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
index af04e70..84e9215 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/groupby/GroupByStreamMergedResultTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql.groupby;
import com.google.common.collect.ImmutableMap;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
@@ -59,7 +59,7 @@ public final class GroupByStreamMergedResultTest {
@Test
public void assertNextForResultSetsAllEmpty() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(Arrays.asList(createQueryResult(), createQueryResult(), createQueryResult()), createSelectStatementContext(), createSchemaMetaData());
assertFalse(actual.next());
}
@@ -83,7 +83,7 @@ public final class GroupByStreamMergedResultTest {
when(queryResult3.getValue(4, Object.class)).thenReturn(new Date(0L));
when(queryResult3.getValue(5, Object.class)).thenReturn(2, 2, 3);
when(queryResult3.getValue(6, Object.class)).thenReturn(20, 20, 30);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(Arrays.asList(queryResult1, queryResult2, queryResult3), createSelectStatementContext(), createSchemaMetaData());
assertTrue(actual.next());
assertThat(actual.getValue(1, Object.class), is(new BigDecimal(40)));
@@ -125,7 +125,7 @@ public final class GroupByStreamMergedResultTest {
when(queryResult3.getValue(3, Object.class)).thenReturn(1, 1, 1, 1, 3);
when(queryResult3.getValue(5, Object.class)).thenReturn(1, 1, 3);
when(queryResult3.getValue(6, Object.class)).thenReturn(10, 10, 30);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(Arrays.asList(queryResult1, queryResult2, queryResult3), createSelectStatementContext(), createSchemaMetaData());
assertTrue(actual.next());
assertThat(actual.getValue(1, Object.class), is(new BigDecimal(10)));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java
index 45c1429..6b285e5 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/iterator/IteratorStreamMergedResultTest.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.pagination.Paginati
import org.apache.shardingsphere.infra.binder.segment.select.projection.ProjectionsContext;
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dml.MySQLSelectStatement;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.junit.Before;
@@ -54,7 +54,7 @@ public final class IteratorStreamMergedResultTest {
@Test
public void assertNextForResultSetsAllEmpty() throws SQLException {
List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
assertFalse(actual.next());
}
@@ -65,7 +65,7 @@ public final class IteratorStreamMergedResultTest {
for (QueryResult each : queryResults) {
when(each.next()).thenReturn(true, false);
}
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
assertTrue(actual.next());
assertTrue(actual.next());
@@ -77,7 +77,7 @@ public final class IteratorStreamMergedResultTest {
public void assertNextForFirstResultSetsNotEmptyOnly() throws SQLException {
List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
when(queryResults.get(0).next()).thenReturn(true, false);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
assertTrue(actual.next());
assertFalse(actual.next());
@@ -87,7 +87,7 @@ public final class IteratorStreamMergedResultTest {
public void assertNextForMiddleResultSetsNotEmpty() throws SQLException {
List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
when(queryResults.get(1).next()).thenReturn(true, false);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
assertTrue(actual.next());
assertFalse(actual.next());
@@ -97,7 +97,7 @@ public final class IteratorStreamMergedResultTest {
public void assertNextForLastResultSetsNotEmptyOnly() throws SQLException {
List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
when(queryResults.get(2).next()).thenReturn(true, false);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
assertTrue(actual.next());
assertFalse(actual.next());
@@ -110,7 +110,7 @@ public final class IteratorStreamMergedResultTest {
when(queryResults.get(1).next()).thenReturn(true, false);
when(queryResults.get(3).next()).thenReturn(true, false);
when(queryResults.get(5).next()).thenReturn(true, false);
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, null);
assertTrue(actual.next());
assertTrue(actual.next());
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
index ea2f702..3cf5435 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/orderby/OrderByStreamMergedResultTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.sharding.merge.dql.orderby;
import com.google.common.collect.ImmutableMap;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
@@ -73,7 +73,7 @@ public final class OrderByStreamMergedResultTest {
@Test
public void assertNextForResultSetsAllEmpty() throws SQLException {
List<QueryResult> queryResults = Arrays.asList(mock(QueryResult.class), mock(QueryResult.class), mock(QueryResult.class));
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, createSchemaMetaData());
assertFalse(actual.next());
}
@@ -85,7 +85,7 @@ public final class OrderByStreamMergedResultTest {
when(queryResults.get(i).getColumnName(1)).thenReturn("col1");
when(queryResults.get(i).getColumnName(2)).thenReturn("col2");
}
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
when(queryResults.get(0).next()).thenReturn(true, false);
when(queryResults.get(0).getValue(1, Object.class)).thenReturn("2");
when(queryResults.get(2).next()).thenReturn(true, true, false);
@@ -107,7 +107,7 @@ public final class OrderByStreamMergedResultTest {
when(queryResults.get(i).getColumnName(1)).thenReturn("col1");
when(queryResults.get(i).getColumnName(2)).thenReturn("col2");
}
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
when(queryResults.get(0).next()).thenReturn(true, false);
when(queryResults.get(0).getValue(1, Object.class)).thenReturn("2");
when(queryResults.get(1).next()).thenReturn(true, true, true, false);
@@ -143,7 +143,7 @@ public final class OrderByStreamMergedResultTest {
when(queryResults.get(1).getValue(1, Object.class)).thenReturn("B", "B", "a", "a");
when(queryResults.get(2).next()).thenReturn(true, false);
when(queryResults.get(2).getValue(1, Object.class)).thenReturn("A");
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, createSchemaMetaData());
assertTrue(actual.next());
assertThat(actual.getValue(1, Object.class).toString(), is("A"));
@@ -169,7 +169,7 @@ public final class OrderByStreamMergedResultTest {
when(queryResults.get(1).getValue(2, Object.class)).thenReturn("a", "a", "B", "B");
when(queryResults.get(2).next()).thenReturn(true, false);
when(queryResults.get(2).getValue(2, Object.class)).thenReturn("A");
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
MergedResult actual = resultMerger.merge(queryResults, selectStatementContext, createSchemaMetaData());
assertTrue(actual.next());
assertThat(actual.getValue(2, Object.class).toString(), is("a"));
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java
index 05c690f..fe8a903 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/LimitDecoratorMergedResultTest.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.infra.binder.segment.select.projection.Projecti
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.limit.NumberLiteralLimitValueSegment;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dml.MySQLSelectStatement;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.junit.Test;
@@ -43,7 +43,7 @@ public final class LimitDecoratorMergedResultTest {
@Test
public void assertNextForSkipAll() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new MySQLSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -54,7 +54,7 @@ public final class LimitDecoratorMergedResultTest {
@Test
public void assertNextWithoutRowCount() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new MySQLSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -68,7 +68,7 @@ public final class LimitDecoratorMergedResultTest {
@Test
public void assertNextWithRowCount() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("MySQL"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new MySQLSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java
index 1c27be0..594b945 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/RowNumberDecoratorMergedResultTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.merge.dql.pagination;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
@@ -43,7 +43,7 @@ public final class RowNumberDecoratorMergedResultTest {
@Test
public void assertNextForSkipAll() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new OracleSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -54,7 +54,7 @@ public final class RowNumberDecoratorMergedResultTest {
@Test
public void assertNextWithoutOffsetWithoutRowCount() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new OracleSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()), new PaginationContext(null, null, Collections.emptyList()));
@@ -67,7 +67,7 @@ public final class RowNumberDecoratorMergedResultTest {
@Test
public void assertNextForRowCountBoundOpenedFalse() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new OracleSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -80,7 +80,7 @@ public final class RowNumberDecoratorMergedResultTest {
@Test
public void assertNextForRowCountBoundOpenedTrue() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("Oracle"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new OracleSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
index e59ebe8..7e2837c 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-merge/src/test/java/org/apache/shardingsphere/sharding/merge/dql/pagination/TopAndRowNumberDecoratorMergedResultTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.sharding.merge.dql.pagination;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.merge.result.MergedResult;
import org.apache.shardingsphere.sharding.merge.dql.ShardingDQLResultMerger;
@@ -48,14 +48,14 @@ public final class TopAndRowNumberDecoratorMergedResultTest {
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
new PaginationContext(new NumberLiteralRowNumberValueSegment(0, 0, Integer.MAX_VALUE, true), null, Collections.emptyList()));
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
MergedResult actual = resultMerger.merge(Arrays.asList(createQueryResult(), createQueryResult(), createQueryResult(), createQueryResult()), selectStatementContext, null);
assertFalse(actual.next());
}
@Test
public void assertNextWithoutOffsetWithRowCount() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new SQLServerSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -69,7 +69,7 @@ public final class TopAndRowNumberDecoratorMergedResultTest {
@Test
public void assertNextWithOffsetWithoutRowCount() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new SQLServerSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -83,7 +83,7 @@ public final class TopAndRowNumberDecoratorMergedResultTest {
@Test
public void assertNextWithOffsetBoundOpenedFalse() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new SQLServerSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
@@ -96,7 +96,7 @@ public final class TopAndRowNumberDecoratorMergedResultTest {
@Test
public void assertNextWithOffsetBoundOpenedTrue() throws SQLException {
- ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypes.getActualDatabaseType("SQLServer"));
+ ShardingDQLResultMerger resultMerger = new ShardingDQLResultMerger(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"));
SelectStatementContext selectStatementContext = new SelectStatementContext(new SQLServerSelectStatement(),
new GroupByContext(Collections.emptyList(), 0), new OrderByContext(Collections.emptyList(), false),
new ProjectionsContext(0, 0, false, Collections.emptyList()),
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/AbstractSQLRouteTest.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/AbstractSQLRouteTest.java
index a949cc1..ec9f0d1 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/AbstractSQLRouteTest.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/AbstractSQLRouteTest.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.binder.SQLStatementContextFactory;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.config.DatabaseAccessConfiguration;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.metadata.model.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.model.addressing.TableAddressingMetaData;
import org.apache.shardingsphere.infra.metadata.model.datasource.CachedDatabaseMetaData;
@@ -76,7 +76,7 @@ public abstract class AbstractSQLRouteTest extends AbstractRoutingEngineTest {
dataSourceInfoMap.put("main", mainDatabaseAccessConfig);
dataSourceInfoMap.put("ds_0", databaseAccessConfiguration0);
dataSourceInfoMap.put("ds_1", databaseAccessConfiguration1);
- return new DataSourcesMetaData(DatabaseTypes.getActualDatabaseType("MySQL"), dataSourceInfoMap);
+ return new DataSourcesMetaData(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), dataSourceInfoMap);
}
private LogicSchemaMetaData buildLogicSchemaMetaData() {
diff --git a/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-context/src/main/java/org/apache/shardingsphere/governance/context/schema/GovernanceSchemaContexts.java b/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-context/src/main/java/org/apache/shardingsphere/governance/context/schema/GovernanceSchemaContexts.java
index 0aff7e3..c5b7981 100644
--- a/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-context/src/main/java/org/apache/shardingsphere/governance/context/schema/GovernanceSchemaContexts.java
+++ b/shardingsphere-governance/shardingsphere-governance-core/shardingsphere-governance-core-context/src/main/java/org/apache/shardingsphere/governance/context/schema/GovernanceSchemaContexts.java
@@ -41,7 +41,7 @@ import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
import org.apache.shardingsphere.infra.context.schema.SchemaContextsBuilder;
import org.apache.shardingsphere.infra.context.schema.impl.StandardSchemaContexts;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.kernel.ExecutorKernel;
import org.apache.shardingsphere.infra.metadata.model.ShardingSphereMetaData;
import org.apache.shardingsphere.infra.metadata.model.logic.LogicSchemaMetaData;
@@ -109,7 +109,7 @@ public final class GovernanceSchemaContexts implements SchemaContexts {
}
DataSource dataSource = dataSourcesMap.values().iterator().next().values().iterator().next();
try (Connection connection = dataSource.getConnection()) {
- return DatabaseTypes.getDatabaseTypeByURL(connection.getMetaData().getURL());
+ return DatabaseTypeRegistry.getDatabaseTypeByURL(connection.getMetaData().getURL());
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypes.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRegistry.java
similarity index 97%
rename from shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypes.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRegistry.java
index 834b65e..e9a901e 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypes.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRegistry.java
@@ -27,10 +27,10 @@ import java.util.Optional;
import java.util.ServiceLoader;
/**
- * Database types.
+ * Database type registry.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class DatabaseTypes {
+public final class DatabaseTypeRegistry {
private static final Map<String, DatabaseType> DATABASE_TYPES = new HashMap<>();
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java
index c064635..b11988b 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/H2DatabaseType.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.H2DataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.BranchDatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import java.util.Collection;
import java.util.Collections;
@@ -47,6 +47,6 @@ public final class H2DatabaseType implements BranchDatabaseType {
@Override
public DatabaseType getTrunkDatabaseType() {
- return DatabaseTypes.getActualDatabaseType("MySQL");
+ return DatabaseTypeRegistry.getActualDatabaseType("MySQL");
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java
index dadde85..66d8576 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/database/type/dialect/MariaDBDatabaseType.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.database.type.dialect;
import org.apache.shardingsphere.infra.database.metadata.dialect.MariaDBDataSourceMetaData;
import org.apache.shardingsphere.infra.database.type.BranchDatabaseType;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import java.util.Collection;
import java.util.Collections;
@@ -47,6 +47,6 @@ public final class MariaDBDatabaseType implements BranchDatabaseType {
@Override
public DatabaseType getTrunkDatabaseType() {
- return DatabaseTypes.getActualDatabaseType("MySQL");
+ return DatabaseTypeRegistry.getActualDatabaseType("MySQL");
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypesTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRegistryTest.java
similarity index 67%
rename from shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypesTest.java
rename to shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRegistryTest.java
index b3ee961..477f578 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypesTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeRegistryTest.java
@@ -25,50 +25,50 @@ import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-public final class DatabaseTypesTest {
+public final class DatabaseTypeRegistryTest {
@Test
public void assertGetTrunkDatabaseTypeNameWithTrunkDatabaseType() {
- assertThat(DatabaseTypes.getTrunkDatabaseTypeName(new MySQLDatabaseType()), is("MySQL"));
+ assertThat(DatabaseTypeRegistry.getTrunkDatabaseTypeName(new MySQLDatabaseType()), is("MySQL"));
}
@Test
public void assertGetTrunkDatabaseTypeNameWithBranchDatabaseType() {
- assertThat(DatabaseTypes.getTrunkDatabaseTypeName(new MariaDBDatabaseType()), is("MySQL"));
+ assertThat(DatabaseTypeRegistry.getTrunkDatabaseTypeName(new MariaDBDatabaseType()), is("MySQL"));
}
@Test
public void assertGetActualDatabaseType() {
- assertThat(DatabaseTypes.getActualDatabaseType("MySQL").getName(), is("MySQL"));
+ assertThat(DatabaseTypeRegistry.getActualDatabaseType("MySQL").getName(), is("MySQL"));
}
@Test(expected = ShardingSphereException.class)
public void assertGetActualDatabaseTypeWithNotExistedDatabaseType() {
- DatabaseTypes.getActualDatabaseType("Invalid");
+ DatabaseTypeRegistry.getActualDatabaseType("Invalid");
}
@Test
public void assertGetTrunkDatabaseTypeWithTrunkDatabaseType() {
- assertThat(DatabaseTypes.getTrunkDatabaseType("MySQL").getName(), is("MySQL"));
+ assertThat(DatabaseTypeRegistry.getTrunkDatabaseType("MySQL").getName(), is("MySQL"));
}
@Test
public void assertGetTrunkDatabaseTypeWithBranchDatabaseType() {
- assertThat(DatabaseTypes.getTrunkDatabaseType("H2").getName(), is("MySQL"));
+ assertThat(DatabaseTypeRegistry.getTrunkDatabaseType("H2").getName(), is("MySQL"));
}
@Test
public void assertGetDatabaseTypeByStandardURL() {
- assertThat(DatabaseTypes.getDatabaseTypeByURL("jdbc:mysql://localhost:3306/test").getName(), is("MySQL"));
+ assertThat(DatabaseTypeRegistry.getDatabaseTypeByURL("jdbc:mysql://localhost:3306/test").getName(), is("MySQL"));
}
@Test
public void assertGetDatabaseTypeByURLAlias() {
- assertThat(DatabaseTypes.getDatabaseTypeByURL("jdbc:mysqlx://localhost:3306/test").getName(), is("MySQL"));
+ assertThat(DatabaseTypeRegistry.getDatabaseTypeByURL("jdbc:mysqlx://localhost:3306/test").getName(), is("MySQL"));
}
@Test
public void assertGetDatabaseTypeSQL92() {
- assertThat(DatabaseTypes.getDatabaseTypeByURL("jdbc:sqlite:test").getName(), is("SQL92"));
+ assertThat(DatabaseTypeRegistry.getDatabaseTypeByURL("jdbc:sqlite:test").getName(), is("SQL92"));
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/datasource/DataSourcesMetaDataTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/datasource/DataSourcesMetaDataTest.java
index 82f8633..ce3ed1e 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/datasource/DataSourcesMetaDataTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/datasource/DataSourcesMetaDataTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.metadata.model.datasource;
import org.apache.shardingsphere.infra.config.DatabaseAccessConfiguration;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import java.util.Collection;
@@ -38,7 +38,7 @@ public final class DataSourcesMetaDataTest {
Map<String, DatabaseAccessConfiguration> databaseAccessConfigurationMap = new HashMap<>(2, 1);
databaseAccessConfigurationMap.put("ds_0", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3306/db_0", "test"));
databaseAccessConfigurationMap.put("ds_1", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3307/db_1", "test"));
- DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypes.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
+ DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
Collection<String> allInstanceDataSourceNames = dataSourcesMetaData.getAllInstanceDataSourceNames();
assertNotNull(allInstanceDataSourceNames);
assertThat(allInstanceDataSourceNames.size(), is(2));
@@ -50,7 +50,7 @@ public final class DataSourcesMetaDataTest {
Map<String, DatabaseAccessConfiguration> databaseAccessConfigurationMap = new HashMap<>(2, 1);
databaseAccessConfigurationMap.put("ds_0", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3306/db_0", "test"));
databaseAccessConfigurationMap.put("ds_1", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3306/db_1", "test"));
- DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypes.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
+ DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
Collection<String> allInstanceDataSourceNames = dataSourcesMetaData.getAllInstanceDataSourceNames();
assertNotNull(allInstanceDataSourceNames);
assertThat(allInstanceDataSourceNames.size(), is(1));
@@ -62,7 +62,7 @@ public final class DataSourcesMetaDataTest {
Map<String, DatabaseAccessConfiguration> databaseAccessConfigurationMap = new HashMap<>(2, 1);
databaseAccessConfigurationMap.put("ds_0", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3306/db_0", "test"));
databaseAccessConfigurationMap.put("ds_1", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3306/db_1", "test"));
- DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypes.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
+ DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
assertThat(dataSourcesMetaData.getDataSourceMetaData("ds_0").getCatalog(), is("db_0"));
}
@@ -71,7 +71,7 @@ public final class DataSourcesMetaDataTest {
Map<String, DatabaseAccessConfiguration> databaseAccessConfigurationMap = new HashMap<>(2, 1);
databaseAccessConfigurationMap.put("ds_0", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3306/db_0", "test"));
databaseAccessConfigurationMap.put("ds_1", new DatabaseAccessConfiguration("jdbc:mysql://127.0.0.1:3306/db_1", "test"));
- DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypes.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
+ DataSourcesMetaData dataSourcesMetaData = new DataSourcesMetaData(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), databaseAccessConfigurationMap);
assertNull(dataSourcesMetaData.getDataSourceMetaData("ds_0").getSchema());
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/MetaDataConnectionAdapterTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/MetaDataConnectionAdapterTest.java
index ddf6c12..022ef0b 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/MetaDataConnectionAdapterTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/MetaDataConnectionAdapterTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.metadata.model.physical.jdbc;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -39,7 +39,7 @@ public final class MetaDataConnectionAdapterTest {
private static final String TEST_SCHEMA = "schema";
- private final DatabaseType databaseType = DatabaseTypes.getTrunkDatabaseType("MySQL");
+ private final DatabaseType databaseType = DatabaseTypeRegistry.getTrunkDatabaseType("MySQL");
@Mock
private Connection connection;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/handler/DatabaseMetaDataDialectHandlerFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/handler/DatabaseMetaDataDialectHandlerFactoryTest.java
index d21059d..ba782cd 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/handler/DatabaseMetaDataDialectHandlerFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/jdbc/handler/DatabaseMetaDataDialectHandlerFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.infra.metadata.model.physical.jdbc.handler;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
@@ -29,7 +29,7 @@ public final class DatabaseMetaDataDialectHandlerFactoryTest {
@Test
public void assertFindHandler() {
- assertTrue(DatabaseMetaDataDialectHandlerFactory.findHandler(DatabaseTypes.getTrunkDatabaseType("Oracle")).isPresent());
- assertTrue(DatabaseMetaDataDialectHandlerFactory.findHandler(DatabaseTypes.getTrunkDatabaseType("MySQL")).isPresent());
+ assertTrue(DatabaseMetaDataDialectHandlerFactory.findHandler(DatabaseTypeRegistry.getTrunkDatabaseType("Oracle")).isPresent());
+ assertTrue(DatabaseMetaDataDialectHandlerFactory.findHandler(DatabaseTypeRegistry.getTrunkDatabaseType("MySQL")).isPresent());
}
}
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/column/ColumnMetaDataLoaderTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/column/ColumnMetaDataLoaderTest.java
index 8e6e303..40b2b36 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/column/ColumnMetaDataLoaderTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/column/ColumnMetaDataLoaderTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.metadata.model.physical.model.column;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -47,7 +47,7 @@ public final class ColumnMetaDataLoaderTest {
private static final String TEST_TABLE = "table";
- private final DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("MySQL");
+ private final DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("MySQL");
@Mock
private Connection connection;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/schema/SchemaMetaDataLoaderTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/schema/SchemaMetaDataLoaderTest.java
index 2276c37..9026853 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/schema/SchemaMetaDataLoaderTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/schema/SchemaMetaDataLoaderTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.metadata.model.physical.model.schema;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -46,7 +46,7 @@ public final class SchemaMetaDataLoaderTest {
private static final String VIEW_TYPE = "VIEW";
- private final DatabaseType databaseType = DatabaseTypes.getTrunkDatabaseType("Oracle");
+ private final DatabaseType databaseType = DatabaseTypeRegistry.getTrunkDatabaseType("Oracle");
@Mock
private DataSource dataSource;
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/table/TableMetaDataLoaderTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/table/TableMetaDataLoaderTest.java
index 9ea1271..dd22146 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/table/TableMetaDataLoaderTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/metadata/model/physical/model/table/TableMetaDataLoaderTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.metadata.model.physical.model.table;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.metadata.model.physical.model.column.PhysicalColumnMetaData;
import org.apache.shardingsphere.infra.metadata.model.physical.model.index.PhysicalIndexMetaData;
import org.junit.Before;
@@ -52,7 +52,7 @@ public final class TableMetaDataLoaderTest {
private static final String TEST_TABLE = "table";
- private final DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("MySQL");
+ private final DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("MySQL");
@Mock
private DataSource dataSource;
diff --git a/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/SchemaContextsBuilderTest.java b/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/SchemaContextsBuilderTest.java
index 3077b99..d214924 100644
--- a/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/SchemaContextsBuilderTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/SchemaContextsBuilderTest.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKe
import org.apache.shardingsphere.infra.context.fixture.FixtureRule;
import org.apache.shardingsphere.infra.context.fixture.FixtureRuleConfiguration;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.jdbc.test.MockedDataSource;
import org.hamcrest.CoreMatchers;
import org.junit.Test;
@@ -41,7 +41,7 @@ public final class SchemaContextsBuilderTest {
@Test
public void assertBuildWithoutConfiguration() throws SQLException {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("FixtureDB");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("FixtureDB");
SchemaContexts actual = new SchemaContextsBuilder(databaseType, Collections.emptyMap(), Collections.emptyMap(), null).build();
assertThat(actual.getDatabaseType(), CoreMatchers.is(databaseType));
assertTrue(actual.getSchemas().isEmpty());
@@ -52,7 +52,7 @@ public final class SchemaContextsBuilderTest {
@Test
public void assertBuildWithConfigurationsButWithoutDataSource() throws SQLException {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("FixtureDB");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("FixtureDB");
Properties props = new Properties();
props.setProperty(ConfigurationPropertyKey.EXECUTOR_SIZE.getKey(), "1");
SchemaContexts actual = new SchemaContextsBuilder(databaseType, Collections.singletonMap("logic_db", Collections.emptyMap()),
@@ -68,7 +68,7 @@ public final class SchemaContextsBuilderTest {
@Test
public void assertBuildWithConfigurationsAndDataSources() throws SQLException {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("FixtureDB");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("FixtureDB");
Properties props = new Properties();
props.setProperty(ConfigurationPropertyKey.EXECUTOR_SIZE.getKey(), "1");
SchemaContexts actual = new SchemaContextsBuilder(databaseType, Collections.singletonMap("logic_db", Collections.singletonMap("ds", new MockedDataSource())),
diff --git a/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/impl/StandardSchemaContextsTest.java b/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/impl/StandardSchemaContextsTest.java
index eb64635..12d592c 100644
--- a/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/impl/StandardSchemaContextsTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-context/src/test/java/org/apache/shardingsphere/infra/context/schema/impl/StandardSchemaContextsTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.infra.context.schema.impl;
import org.apache.shardingsphere.infra.auth.Authentication;
import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.kernel.ExecutorKernel;
import org.apache.shardingsphere.infra.schema.ShardingSphereSchema;
import org.junit.Test;
@@ -47,7 +47,7 @@ public final class StandardSchemaContextsTest {
ExecutorKernel executorKernel = mock(ExecutorKernel.class);
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
StandardSchemaContexts standardSchemaContexts = new StandardSchemaContexts(
- Collections.singletonMap("logic_db", schema), executorKernel, new Authentication(), new ConfigurationProperties(new Properties()), DatabaseTypes.getTrunkDatabaseType("SQL92"));
+ Collections.singletonMap("logic_db", schema), executorKernel, new Authentication(), new ConfigurationProperties(new Properties()), DatabaseTypeRegistry.getTrunkDatabaseType("SQL92"));
standardSchemaContexts.close();
verify(executorKernel).close();
}
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/jdbc/executor/impl/DefaultSQLExecutorCallbackTest.java b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/jdbc/executor/impl/DefaultSQLExecutorCallbackTest.java
index e355c02..392fb3f 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/jdbc/executor/impl/DefaultSQLExecutorCallbackTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/jdbc/executor/impl/DefaultSQLExecutorCallbackTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.infra.executor.sql.jdbc.executor.impl;
import org.apache.shardingsphere.infra.database.metadata.DataSourceMetaData;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.ConnectionMode;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.context.SQLUnit;
@@ -71,7 +71,7 @@ public final class DefaultSQLExecutorCallbackTest {
@SuppressWarnings("unchecked")
@Test
public void assertExecute() throws SQLException, NoSuchFieldException, IllegalAccessException {
- SQLExecutorCallback<?> sqlExecutorCallback = new DefaultSQLExecutorCallback<Integer>(DatabaseTypes.getActualDatabaseType("MySQL"), true) {
+ SQLExecutorCallback<?> sqlExecutorCallback = new DefaultSQLExecutorCallback<Integer>(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), true) {
@Override
protected Integer executeSQL(final String sql, final Statement statement, final ConnectionMode connectionMode) throws SQLException {
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dcl/GeneralDCLIT.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dcl/GeneralDCLIT.java
index ca4d298..5341d1b 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dcl/GeneralDCLIT.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dcl/GeneralDCLIT.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.dbtest.cases.assertion.dcl.DCLIntegrateTestCase
import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLCaseType;
import org.apache.shardingsphere.dbtest.engine.SQLType;
import org.apache.shardingsphere.dbtest.engine.util.IntegrateTestParameters;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import org.junit.runners.Parameterized.Parameters;
@@ -36,7 +36,7 @@ public final class GeneralDCLIT extends BaseDCLIT {
public GeneralDCLIT(final String path, final DCLIntegrateTestCaseAssertion assertion, final String ruleType,
final String databaseType, final SQLCaseType caseType, final String sql) throws IOException, JAXBException, SQLException, ParseException {
- super(path, assertion, ruleType, DatabaseTypes.getActualDatabaseType(databaseType), caseType, sql);
+ super(path, assertion, ruleType, DatabaseTypeRegistry.getActualDatabaseType(databaseType), caseType, sql);
}
@Parameters(name = "{2} -> {3} -> {4} -> {5}")
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/ddl/GeneralDDLIT.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/ddl/GeneralDDLIT.java
index 8bdef80..23063af 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/ddl/GeneralDDLIT.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/ddl/GeneralDDLIT.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.dbtest.cases.assertion.ddl.DDLIntegrateTestCase
import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLCaseType;
import org.apache.shardingsphere.dbtest.engine.SQLType;
import org.apache.shardingsphere.dbtest.engine.util.IntegrateTestParameters;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import org.junit.runners.Parameterized.Parameters;
@@ -40,7 +40,7 @@ public final class GeneralDDLIT extends BaseDDLIT {
public GeneralDDLIT(final String path, final DDLIntegrateTestCaseAssertion assertion, final String ruleType,
final String databaseType, final SQLCaseType caseType, final String sql) throws IOException, JAXBException, SQLException, ParseException {
- super(path, assertion, ruleType, DatabaseTypes.getActualDatabaseType(databaseType), caseType, sql);
+ super(path, assertion, ruleType, DatabaseTypeRegistry.getActualDatabaseType(databaseType), caseType, sql);
this.assertion = assertion;
}
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/BatchDMLIT.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/BatchDMLIT.java
index 0398289..cfc0b8c 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/BatchDMLIT.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/BatchDMLIT.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLValue;
import org.apache.shardingsphere.dbtest.engine.BatchIT;
import org.apache.shardingsphere.dbtest.engine.SQLType;
import org.apache.shardingsphere.dbtest.engine.util.IntegrateTestParameters;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import org.junit.runners.Parameterized.Parameters;
@@ -44,7 +44,7 @@ public final class BatchDMLIT extends BatchIT {
public BatchDMLIT(final IntegrateTestCase integrateTestCase,
final String ruleType, final String databaseType, final String sql) throws IOException, JAXBException, SQLException {
- super(integrateTestCase, ruleType, DatabaseTypes.getActualDatabaseType(databaseType), sql);
+ super(integrateTestCase, ruleType, DatabaseTypeRegistry.getActualDatabaseType(databaseType), sql);
this.integrateTestCase = integrateTestCase;
}
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/GeneralDMLIT.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/GeneralDMLIT.java
index 14f445d..fd201eb 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/GeneralDMLIT.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dml/GeneralDMLIT.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLCaseType;
import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLValue;
import org.apache.shardingsphere.dbtest.engine.SQLType;
import org.apache.shardingsphere.dbtest.engine.util.IntegrateTestParameters;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@@ -47,7 +47,7 @@ public final class GeneralDMLIT extends BaseDMLIT {
public GeneralDMLIT(final String path, final DMLIntegrateTestCaseAssertion assertion, final String ruleType,
final String databaseType, final SQLCaseType caseType, final String sql) throws IOException, JAXBException, SQLException, ParseException {
- super(path, assertion, ruleType, DatabaseTypes.getActualDatabaseType(databaseType), caseType, sql);
+ super(path, assertion, ruleType, DatabaseTypeRegistry.getActualDatabaseType(databaseType), caseType, sql);
this.assertion = assertion;
}
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dql/GeneralDQLIT.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dql/GeneralDQLIT.java
index 5df5315..2a6afd5 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dql/GeneralDQLIT.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/dql/GeneralDQLIT.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLValue;
import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLCaseType;
import org.apache.shardingsphere.dbtest.engine.SQLType;
import org.apache.shardingsphere.dbtest.engine.util.IntegrateTestParameters;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import org.junit.runners.Parameterized.Parameters;
@@ -44,7 +44,7 @@ public final class GeneralDQLIT extends BaseDQLIT {
public GeneralDQLIT(final String path, final DQLIntegrateTestCaseAssertion assertion, final String ruleType,
final String databaseType, final SQLCaseType caseType, final String sql) throws IOException, JAXBException, SQLException, ParseException {
- super(path, assertion, ruleType, DatabaseTypes.getActualDatabaseType(databaseType), caseType, sql);
+ super(path, assertion, ruleType, DatabaseTypeRegistry.getActualDatabaseType(databaseType), caseType, sql);
this.assertion = assertion;
}
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/util/IntegrateTestParameters.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/util/IntegrateTestParameters.java
index c811c9f..84d813e 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/util/IntegrateTestParameters.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/engine/util/IntegrateTestParameters.java
@@ -31,7 +31,7 @@ import org.apache.shardingsphere.dbtest.cases.assertion.root.SQLCaseType;
import org.apache.shardingsphere.dbtest.engine.SQLType;
import org.apache.shardingsphere.dbtest.env.IntegrateTestEnvironment;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Test;
import java.util.Arrays;
@@ -141,7 +141,7 @@ public final class IntegrateTestParameters {
private static Collection<DatabaseType> getDatabaseTypes(final String databaseTypes) {
String candidates = Strings.isNullOrEmpty(databaseTypes) ? "H2,MySQL,Oracle,SQLServer,PostgreSQL" : databaseTypes;
- return Splitter.on(',').trimResults().splitToList(candidates).stream().map(DatabaseTypes::getActualDatabaseType).collect(Collectors.toList());
+ return Splitter.on(',').trimResults().splitToList(candidates).stream().map(DatabaseTypeRegistry::getActualDatabaseType).collect(Collectors.toList());
}
private static void printTestPlan(final Map<DatabaseType, Collection<Object[]>> availableCases, final Map<DatabaseType, Collection<Object[]>> disabledCases, final long factor) {
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/IntegrateTestEnvironment.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/IntegrateTestEnvironment.java
index 5566b89..fd3aa19 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/IntegrateTestEnvironment.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/IntegrateTestEnvironment.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.dbtest.env;
import com.google.common.base.Splitter;
import lombok.Getter;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.dbtest.env.datasource.DatabaseEnvironment;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
@@ -60,7 +60,7 @@ public final class IntegrateTestEnvironment {
ruleTypes = Splitter.on(",").trimResults().splitToList(prop.getProperty("rule.types"));
databaseTypes = new LinkedList<>();
for (String each : prop.getProperty("databases", "H2").split(",")) {
- databaseTypes.add(DatabaseTypes.getActualDatabaseType(each.trim()));
+ databaseTypes.add(DatabaseTypeRegistry.getActualDatabaseType(each.trim()));
}
databaseEnvironments = new HashMap<>(databaseTypes.size(), 1);
for (DatabaseType each : databaseTypes) {
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/authority/AuthoritySQLSet.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/authority/AuthoritySQLSet.java
index 8041fdd..326bddd 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/authority/AuthoritySQLSet.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/authority/AuthoritySQLSet.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.dbtest.env.authority;
import com.google.common.base.Splitter;
import lombok.Setter;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -72,6 +72,6 @@ public final class AuthoritySQLSet {
}
private Collection<DatabaseType> getDatabaseTypes() {
- return Splitter.on(",").trimResults().splitToList(databaseTypes).stream().map(DatabaseTypes::getActualDatabaseType).collect(Collectors.toList());
+ return Splitter.on(",").trimResults().splitToList(databaseTypes).stream().map(DatabaseTypeRegistry::getActualDatabaseType).collect(Collectors.toList());
}
}
diff --git a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java
index 01510f4..434126e 100644
--- a/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java
+++ b/shardingsphere-integration-test/shardingsphere-test-suite/src/test/java/org/apache/shardingsphere/dbtest/env/dataset/DataSetEnvironmentManager.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.dbtest.cases.dataset.metadata.DataSetColumn;
import org.apache.shardingsphere.dbtest.cases.dataset.metadata.DataSetMetadata;
import org.apache.shardingsphere.dbtest.cases.dataset.row.DataSetRow;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.infra.executor.kernel.impl.ShardingSphereExecutorService;
import org.apache.shardingsphere.sharding.algorithm.sharding.inline.InlineExpressionParser;
@@ -100,7 +100,7 @@ public final class DataSetEnvironmentManager {
}
String insertSQL;
try (Connection connection = dataSourceMap.get(dataNode.getDataSourceName()).getConnection()) {
- insertSQL = generateInsertSQL(generateTableName(dataNode.getTableName(), DatabaseTypes.getDatabaseTypeByURL(connection.getMetaData().getURL())), dataSetMetadata.getColumns());
+ insertSQL = generateInsertSQL(generateTableName(dataNode.getTableName(), DatabaseTypeRegistry.getDatabaseTypeByURL(connection.getMetaData().getURL())), dataSetMetadata.getColumns());
}
insertTasks.add(new InsertTask(dataSourceMap.get(dataNode.getDataSourceName()), insertSQL, sqlValueGroups));
}
@@ -217,7 +217,7 @@ public final class DataSetEnvironmentManager {
public Void call() throws SQLException {
try (Connection connection = dataSource.getConnection()) {
for (String each : tableNames) {
- String tableName = generateTableName(each, DatabaseTypes.getDatabaseTypeByURL(connection.getMetaData().getURL()));
+ String tableName = generateTableName(each, DatabaseTypeRegistry.getDatabaseTypeByURL(connection.getMetaData().getURL()));
try (PreparedStatement preparedStatement = connection.prepareStatement(String.format("DELETE FROM %s", tableName))) {
preparedStatement.execute();
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSource.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSource.java
index c4d80b8..926a7e8 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSource.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSource.java
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
import org.apache.shardingsphere.infra.context.schema.SchemaContextsBuilder;
import org.apache.shardingsphere.infra.database.DefaultSchema;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.transaction.ShardingTransactionManagerEngine;
import org.apache.shardingsphere.transaction.context.TransactionContexts;
import org.apache.shardingsphere.transaction.context.impl.StandardTransactionContexts;
@@ -74,7 +74,7 @@ public final class ShardingSphereDataSource extends AbstractUnsupportedOperation
return ((ShardingSphereDataSource) dataSource).schemaContexts.getDatabaseType();
}
try (Connection connection = dataSource.getConnection()) {
- return DatabaseTypes.getDatabaseTypeByURL(connection.getMetaData().getURL());
+ return DatabaseTypeRegistry.getDatabaseTypeByURL(connection.getMetaData().getURL());
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
index ec968c1..79ac648 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSpherePreparedStatement.java
@@ -37,7 +37,7 @@ import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementConte
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.context.kernel.KernelProcessor;
import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.infra.executor.kernel.InputGroup;
import org.apache.shardingsphere.infra.executor.sql.ExecutorConstant;
@@ -138,7 +138,7 @@ public final class ShardingSpherePreparedStatement extends AbstractPreparedState
this.sql = sql;
statements = new ArrayList<>();
parameterSets = new ArrayList<>();
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(schemaContexts.getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypeRegistry.getTrunkDatabaseTypeName(schemaContexts.getDatabaseType()));
sqlStatement = sqlParserEngine.parse(sql, true);
parameterMetaData = new ShardingSphereParameterMetaData(sqlStatement);
statementOption = returnGeneratedKeys ? new StatementOption(true) : new StatementOption(resultSetType, resultSetConcurrency, resultSetHoldability);
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
index 15789ff..378e0b3 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
@@ -35,7 +35,7 @@ import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.context.kernel.KernelProcessor;
import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.infra.executor.kernel.InputGroup;
import org.apache.shardingsphere.infra.executor.sql.ExecutorConstant;
@@ -306,7 +306,7 @@ public final class ShardingSphereStatement extends AbstractStatementAdapter {
private LogicSQL createLogicSQL(final String sql) {
PhysicalSchemaMetaData schemaMetaData = schemaContexts.getDefaultSchema().getMetaData().getSchemaMetaData().getSchemaMetaData();
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(schemaContexts.getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypeRegistry.getTrunkDatabaseTypeName(schemaContexts.getDatabaseType()));
SQLStatement sqlStatement = sqlParserEngine.parse(sql, false);
SQLStatementContext<?> sqlStatementContext = SQLStatementContextFactory.newInstance(schemaMetaData, Collections.emptyList(), sqlStatement);
return new LogicSQL(sqlStatementContext, sql, Collections.emptyList());
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/base/AbstractSQLTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/base/AbstractSQLTest.java
index bd425d5..5633759 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/base/AbstractSQLTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/base/AbstractSQLTest.java
@@ -21,7 +21,7 @@ import com.google.common.collect.Sets;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.driver.common.env.DatabaseEnvironment;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.h2.tools.RunScript;
import org.junit.BeforeClass;
@@ -41,7 +41,7 @@ public abstract class AbstractSQLTest {
private static final List<String> DB_NAMES = Arrays.asList("jdbc_0", "jdbc_1", "encrypt", "test_primary_ds", "test_replica_ds");
- private static final Set<DatabaseType> DATABASE_TYPES = Sets.newHashSet(DatabaseTypes.getActualDatabaseType("H2"));
+ private static final Set<DatabaseType> DATABASE_TYPES = Sets.newHashSet(DatabaseTypeRegistry.getActualDatabaseType("H2"));
private static final Map<DatabaseType, Map<String, DataSource>> DATABASE_TYPE_MAP = new HashMap<>();
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/env/DatabaseEnvironment.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/env/DatabaseEnvironment.java
index 0aeb2f0..444ba79 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/env/DatabaseEnvironment.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/common/env/DatabaseEnvironment.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.driver.common.env;
import lombok.Getter;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import java.util.HashMap;
@@ -55,7 +55,7 @@ public final class DatabaseEnvironment {
}
private void fillH2() {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("H2");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("H2");
DRIVER_CLASS_NAME.put(databaseType, "org.h2.Driver");
URL.put(databaseType, "jdbc:h2:mem:%s;DATABASE_TO_UPPER=false;MODE=MySQL");
USERNAME.put(databaseType, "sa");
@@ -64,7 +64,7 @@ public final class DatabaseEnvironment {
}
private void fillMySQL() {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("MySQL");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("MySQL");
DRIVER_CLASS_NAME.put(databaseType, "com.mysql.jdbc.Driver");
URL.put(databaseType, "jdbc:mysql://db.mysql:3306/%s?serverTimezone=UTC&useSSL=false");
USERNAME.put(databaseType, "root");
@@ -73,7 +73,7 @@ public final class DatabaseEnvironment {
}
private void fillPostgreSQL() {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("PostgreSQL");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL");
DRIVER_CLASS_NAME.put(databaseType, "org.postgresql.Driver");
URL.put(databaseType, "jdbc:postgresql://db.psql:5432/%s");
USERNAME.put(databaseType, "postgres");
@@ -82,7 +82,7 @@ public final class DatabaseEnvironment {
}
private void fillSQLServer() {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("SQLServer");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("SQLServer");
DRIVER_CLASS_NAME.put(databaseType, "com.microsoft.sqlserver.jdbc.SQLServerDriver");
URL.put(databaseType, "jdbc:sqlserver://db.mssql:1433;DatabaseName=%s");
USERNAME.put(databaseType, "sa");
@@ -91,7 +91,7 @@ public final class DatabaseEnvironment {
}
private void fillOracle() {
- DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("Oracle");
+ DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("Oracle");
DRIVER_CLASS_NAME.put(databaseType, "oracle.jdbc.driver.OracleDriver");
URL.put(databaseType, "jdbc:oracle:thin:@db.oracle:1521/test");
USERNAME.put(databaseType, "jdbc");
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/AbstractBaseExecutorTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/AbstractBaseExecutorTest.java
index e78c6d8..7c27d921 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/AbstractBaseExecutorTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/executor/AbstractBaseExecutorTest.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.infra.config.properties.ConfigurationProperties
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
import org.apache.shardingsphere.infra.context.schema.impl.StandardSchemaContexts;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.kernel.ExecutorKernel;
import org.apache.shardingsphere.infra.executor.sql.resourced.jdbc.executor.ExecutorExceptionHandler;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
@@ -68,7 +68,7 @@ public abstract class AbstractBaseExecutorTest {
SchemaContexts schemaContexts = mock(StandardSchemaContexts.class, RETURNS_DEEP_STUBS);
when(schemaContexts.getExecutorKernel()).thenReturn(executorKernel);
when(schemaContexts.getProps()).thenReturn(createConfigurationProperties());
- when(schemaContexts.getDatabaseType()).thenReturn(DatabaseTypes.getActualDatabaseType("H2"));
+ when(schemaContexts.getDatabaseType()).thenReturn(DatabaseTypeRegistry.getActualDatabaseType("H2"));
ShardingRule shardingRule = mockShardingRule();
when(schemaContexts.getDefaultSchema().getRules()).thenReturn(Collections.singletonList(shardingRule));
TransactionContexts transactionContexts = mock(TransactionContexts.class);
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java
index 8279048..554ebf2 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetAdapterTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.driver.jdbc.adapter;
import org.apache.shardingsphere.driver.common.base.AbstractShardingSphereDataSourceForShardingTest;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection;
import org.apache.shardingsphere.driver.jdbc.util.JDBCTestSQL;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
@@ -56,7 +56,7 @@ public final class ResultSetAdapterTest extends AbstractShardingSphereDataSource
shardingSphereConnections.add(connection);
Statement statement = connection.createStatement();
statements.add(statement);
- resultSets.put(DatabaseTypes.getActualDatabaseType("H2"), statement.executeQuery(JDBCTestSQL.SELECT_GROUP_BY_USER_ID_SQL));
+ resultSets.put(DatabaseTypeRegistry.getActualDatabaseType("H2"), statement.executeQuery(JDBCTestSQL.SELECT_GROUP_BY_USER_ID_SQL));
}
@After
@@ -83,7 +83,7 @@ public final class ResultSetAdapterTest extends AbstractShardingSphereDataSource
private void assertClose(final AbstractResultSetAdapter actual, final DatabaseType type) throws SQLException {
assertTrue(actual.isClosed());
assertThat(actual.getResultSets().size(), is(4));
- if (DatabaseTypes.getActualDatabaseType("Oracle") != type) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("Oracle") != type) {
for (ResultSet each : actual.getResultSets()) {
assertTrue(each.isClosed());
}
@@ -105,7 +105,7 @@ public final class ResultSetAdapterTest extends AbstractShardingSphereDataSource
each.getValue().setFetchDirection(ResultSet.FETCH_REVERSE);
} catch (final SQLException ignored) {
}
- if (each.getKey() == DatabaseTypes.getActualDatabaseType("MySQL") || each.getKey() == DatabaseTypes.getActualDatabaseType("PostgreSQL")) {
+ if (each.getKey() == DatabaseTypeRegistry.getActualDatabaseType("MySQL") || each.getKey() == DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL")) {
assertFetchDirection((AbstractResultSetAdapter) each.getValue(), ResultSet.FETCH_REVERSE, each.getKey());
}
}
@@ -114,18 +114,18 @@ public final class ResultSetAdapterTest extends AbstractShardingSphereDataSource
private void assertFetchDirection(final AbstractResultSetAdapter actual, final int fetchDirection, final DatabaseType type) throws SQLException {
// H2 do not implement getFetchDirection
assertThat(actual.getFetchDirection(), is(
- DatabaseTypes.getActualDatabaseType("H2") == type || DatabaseTypes.getActualDatabaseType("PostgreSQL") == type ? ResultSet.FETCH_FORWARD : fetchDirection));
+ DatabaseTypeRegistry.getActualDatabaseType("H2") == type || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == type ? ResultSet.FETCH_FORWARD : fetchDirection));
assertThat(actual.getResultSets().size(), is(4));
for (ResultSet each : actual.getResultSets()) {
assertThat(each.getFetchDirection(), is(
- DatabaseTypes.getActualDatabaseType("H2") == type || DatabaseTypes.getActualDatabaseType("PostgreSQL") == type ? ResultSet.FETCH_FORWARD : fetchDirection));
+ DatabaseTypeRegistry.getActualDatabaseType("H2") == type || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == type ? ResultSet.FETCH_FORWARD : fetchDirection));
}
}
@Test
public void assertSetFetchSize() throws SQLException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
assertThat(each.getValue().getFetchSize(), is(0));
}
each.getValue().setFetchSize(100);
@@ -135,10 +135,10 @@ public final class ResultSetAdapterTest extends AbstractShardingSphereDataSource
private void assertFetchSize(final AbstractResultSetAdapter actual, final DatabaseType type) throws SQLException {
// H2 do not implement getFetchSize
- assertThat(actual.getFetchSize(), is(DatabaseTypes.getActualDatabaseType("H2") == type ? 0 : 100));
+ assertThat(actual.getFetchSize(), is(DatabaseTypeRegistry.getActualDatabaseType("H2") == type ? 0 : 100));
assertThat(actual.getResultSets().size(), is(4));
for (ResultSet each : actual.getResultSets()) {
- assertThat(each.getFetchSize(), is(DatabaseTypes.getActualDatabaseType("H2") == type ? 0 : 100));
+ assertThat(each.getFetchSize(), is(DatabaseTypeRegistry.getActualDatabaseType("H2") == type ? 0 : 100));
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetGetterAdapterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetGetterAdapterTest.java
index 59ae406..ef60062 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetGetterAdapterTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/ResultSetGetterAdapterTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.driver.jdbc.adapter;
import org.apache.shardingsphere.driver.common.base.AbstractShardingSphereDataSourceForShardingTest;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection;
import org.apache.shardingsphere.driver.jdbc.util.JDBCTestSQL;
@@ -63,7 +63,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
statements.add(statement);
ResultSet resultSet = statement.executeQuery(JDBCTestSQL.SELECT_ORDER_BY_USER_ID_SQL);
resultSet.next();
- resultSets.put(DatabaseTypes.getActualDatabaseType("H2"), resultSet);
+ resultSets.put(DatabaseTypeRegistry.getActualDatabaseType("H2"), resultSet);
}
@After
@@ -346,7 +346,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
try {
each.getValue().getTimestamp(1);
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
continue;
}
fail("Expected an SQLException to be thrown");
@@ -361,7 +361,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
try {
each.getValue().getTimestamp(columnName);
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
continue;
}
fail("Expected an SQLException to be thrown");
@@ -376,7 +376,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
try {
each.getValue().getTimestamp(1, Calendar.getInstance());
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
continue;
}
fail("Expected an SQLException to be thrown");
@@ -391,7 +391,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
try {
each.getValue().getTimestamp(columnName, Calendar.getInstance());
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
continue;
}
fail("Expected an SQLException to be thrown");
@@ -404,7 +404,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetAsciiStreamForColumnIndex() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
byte[] b = new byte[1];
each.getValue().getAsciiStream(1).read(b);
assertThat(new String(b), is("1"));
@@ -415,7 +415,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetAsciiStreamForColumnLabel() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
byte[] b = new byte[1];
each.getValue().getAsciiStream(columnName).read(b);
assertThat(new String(b), is("1"));
@@ -427,11 +427,11 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetUnicodeStreamForColumnIndex() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("Oracle") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("Oracle") == each.getKey()) {
continue;
}
byte[] b = new byte[1];
- if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey() || DatabaseTypes.getActualDatabaseType("SQLServer") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("H2") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("SQLServer") == each.getKey()) {
try {
each.getValue().getUnicodeStream(1).read(b);
} catch (final ShardingSphereException ignored) {
@@ -447,11 +447,11 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetUnicodeStreamForColumnLabel() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("Oracle") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("Oracle") == each.getKey()) {
continue;
}
byte[] b = new byte[1];
- if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey() || DatabaseTypes.getActualDatabaseType("SQLServer") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("H2") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("SQLServer") == each.getKey()) {
try {
each.getValue().getUnicodeStream(columnName).read(b);
} catch (final ShardingSphereException ignored) {
@@ -466,7 +466,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetBinaryStreamForColumnIndex() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
assertTrue(each.getValue().getBinaryStream(1).read() != -1);
}
}
@@ -475,7 +475,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetBinaryStreamForColumnLabel() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
assertTrue(each.getValue().getBinaryStream(columnName).read() != -1);
}
}
@@ -484,7 +484,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetCharacterStreamForColumnIndex() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
char[] c = new char[1];
each.getValue().getCharacterStream(1).read(c);
assertThat(c[0], is('1'));
@@ -495,7 +495,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetCharacterStreamForColumnLabel() throws SQLException, IOException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypes.getActualDatabaseType("PostgreSQL") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("MySQL") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL") == each.getKey()) {
char[] c = new char[1];
each.getValue().getCharacterStream(columnName).read(c);
assertThat(c[0], is('1'));
@@ -506,7 +506,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetBlobForColumnIndex() throws SQLException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("H2") == each.getKey()) {
try {
assertTrue(each.getValue().getBlob(1).length() > 0);
fail("Expected an SQLException to be thrown");
@@ -521,7 +521,7 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetBlobForColumnLabel() throws SQLException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("H2") == each.getKey()) {
try {
assertTrue(each.getValue().getBlob(columnName).length() > 0);
fail("Expected an SQLException to be thrown");
@@ -588,10 +588,10 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetSQLXMLForColumnIndex() throws SQLException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("Oracle") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("Oracle") == each.getKey()) {
continue;
}
- if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey() || DatabaseTypes.getActualDatabaseType("SQLServer") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("H2") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("SQLServer") == each.getKey()) {
try {
each.getValue().getSQLXML(1);
fail("Expected an SQLException to be thrown");
@@ -608,10 +608,10 @@ public final class ResultSetGetterAdapterTest extends AbstractShardingSphereData
@Test
public void assertGetSQLXMLForColumnLabel() throws SQLException {
for (Entry<DatabaseType, ResultSet> each : resultSets.entrySet()) {
- if (DatabaseTypes.getActualDatabaseType("Oracle") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("Oracle") == each.getKey()) {
continue;
}
- if (DatabaseTypes.getActualDatabaseType("H2") == each.getKey() || DatabaseTypes.getActualDatabaseType("SQLServer") == each.getKey()) {
+ if (DatabaseTypeRegistry.getActualDatabaseType("H2") == each.getKey() || DatabaseTypeRegistry.getActualDatabaseType("SQLServer") == each.getKey()) {
try {
each.getValue().getSQLXML(columnName);
fail("Expected an SQLException to be thrown");
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/StatementAdapterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/StatementAdapterTest.java
index a44661d..7c97a3f 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/StatementAdapterTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/adapter/StatementAdapterTest.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePrepar
import org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement;
import org.apache.shardingsphere.driver.jdbc.util.JDBCTestSQL;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -60,7 +60,7 @@ public final class StatementAdapterTest extends AbstractShardingSphereDataSource
public void init() {
ShardingSphereConnection connection = getShardingSphereDataSource().getConnection();
shardingSphereConnections.add(connection);
- statements.put(DatabaseTypes.getActualDatabaseType("H2"), connection.createStatement());
+ statements.put(DatabaseTypeRegistry.getActualDatabaseType("H2"), connection.createStatement());
}
@After
@@ -264,7 +264,7 @@ public final class StatementAdapterTest extends AbstractShardingSphereDataSource
for (Entry<DatabaseType, Statement> each : statements.entrySet()) {
each.getValue().executeQuery(sql);
each.getValue().setMaxFieldSize(10);
- assertThat(each.getValue().getMaxFieldSize(), is(DatabaseTypes.getActualDatabaseType("H2") == each.getKey() ? 0 : 10));
+ assertThat(each.getValue().getMaxFieldSize(), is(DatabaseTypeRegistry.getActualDatabaseType("H2") == each.getKey() ? 0 : 10));
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java
index d8a2c12..1a7111c 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/connection/ShardingSphereConnectionTest.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.driver.jdbc.core.fixture.XAShardingTransactionM
import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
import org.apache.shardingsphere.infra.schema.ShardingSphereSchema;
import org.apache.shardingsphere.infra.context.schema.impl.StandardSchemaContexts;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
import org.apache.shardingsphere.sharding.api.config.rule.ShardingTableRuleConfiguration;
import org.apache.shardingsphere.transaction.ShardingTransactionManagerEngine;
@@ -79,7 +79,7 @@ public final class ShardingSphereConnectionTest {
public void setUp() {
schemaContexts = mock(StandardSchemaContexts.class, RETURNS_DEEP_STUBS);
ShardingSphereSchema schema = mock(ShardingSphereSchema.class);
- when(schemaContexts.getDatabaseType()).thenReturn(DatabaseTypes.getActualDatabaseType("H2"));
+ when(schemaContexts.getDatabaseType()).thenReturn(DatabaseTypeRegistry.getActualDatabaseType("H2"));
when(schemaContexts.getDefaultSchema()).thenReturn(schema);
transactionContexts = mock(TransactionContexts.class);
when(transactionContexts.getDefaultTransactionManagerEngine()).thenReturn(new ShardingTransactionManagerEngine());
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSourceTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSourceTest.java
index 7cc8b21..1f484dc 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSourceTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/datasource/ShardingSphereDataSourceTest.java
@@ -21,7 +21,7 @@ import com.google.common.base.Joiner;
import org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection;
import org.apache.shardingsphere.driver.jdbc.core.fixture.XAShardingTransactionManagerFixture;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.database.type.dialect.H2DatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
import org.apache.shardingsphere.sharding.api.config.ShardingRuleConfiguration;
@@ -63,8 +63,8 @@ public final class ShardingSphereDataSourceTest {
@Test(expected = IllegalStateException.class)
public void assertGetDatabaseProductNameWhenDataBaseProductNameDifferent() throws SQLException {
- DataSource dataSource1 = mockDataSource(DatabaseTypes.getActualDatabaseType("MySQL"));
- DataSource dataSource2 = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
+ DataSource dataSource1 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
+ DataSource dataSource2 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
Map<String, DataSource> dataSourceMap = new HashMap<>(2, 1);
dataSourceMap.put("ds1", dataSource1);
dataSourceMap.put("ds2", dataSource2);
@@ -73,9 +73,9 @@ public final class ShardingSphereDataSourceTest {
@Test
public void assertGetDatabaseProductName() throws SQLException {
- DataSource dataSource1 = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
- DataSource dataSource2 = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
- DataSource dataSource3 = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
+ DataSource dataSource1 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
+ DataSource dataSource2 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
+ DataSource dataSource3 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
Map<String, DataSource> dataSourceMap = new HashMap<>(3, 1);
dataSourceMap.put("ds1", dataSource1);
dataSourceMap.put("ds2", dataSource2);
@@ -85,10 +85,10 @@ public final class ShardingSphereDataSourceTest {
@Test
public void assertGetDatabaseProductNameForPrimaryReplicaReplication() throws SQLException {
- DataSource dataSource1 = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
- DataSource primaryDataSource = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
- DataSource replicaDataSource = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
- DataSource dataSource3 = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
+ DataSource dataSource1 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
+ DataSource primaryDataSource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
+ DataSource replicaDataSource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
+ DataSource dataSource3 = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
Map<String, DataSource> dataSourceMap = new HashMap<>(4, 1);
dataSourceMap.put("ds1", dataSource1);
dataSourceMap.put("primaryDataSource", primaryDataSource);
@@ -140,7 +140,7 @@ public final class ShardingSphereDataSourceTest {
@Test
public void assertGetConnection() throws SQLException {
- DataSource dataSource = mockDataSource(DatabaseTypes.getActualDatabaseType("H2"));
+ DataSource dataSource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"));
Map<String, DataSource> dataSourceMap = new HashMap<>(1, 1);
dataSourceMap.put("ds", dataSource);
assertThat(createShardingSphereDataSource(dataSourceMap).getConnection().getConnection("ds"), is(dataSource.getConnection()));
@@ -148,7 +148,7 @@ public final class ShardingSphereDataSourceTest {
@Test
public void assertGetXaConnection() throws SQLException {
- DataSource dataSource = mockDataSource(DatabaseTypes.getActualDatabaseType("MySQL"));
+ DataSource dataSource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
Map<String, DataSource> dataSourceMap = new HashMap<>(1, 1);
dataSourceMap.put("ds", dataSource);
TransactionTypeHolder.set(TransactionType.XA);
@@ -160,7 +160,7 @@ public final class ShardingSphereDataSourceTest {
@Test
public void assertGetXaConnectionThenGetLocalConnection() throws SQLException {
- DataSource dataSource = mockDataSource(DatabaseTypes.getActualDatabaseType("MySQL"));
+ DataSource dataSource = mockDataSource(DatabaseTypeRegistry.getActualDatabaseType("MySQL"));
Map<String, DataSource> dataSourceMap = new HashMap<>(1, 1);
dataSourceMap.put("ds", dataSource);
TransactionTypeHolder.set(TransactionType.XA);
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptPreparedStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptPreparedStatementTest.java
index 8e336b1..7e0c425 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptPreparedStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptPreparedStatementTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.driver.jdbc.core.statement;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.driver.common.base.AbstractShardingSphereDataSourceForEncryptTest;
import org.junit.Test;
@@ -170,7 +170,7 @@ public final class EncryptPreparedStatementTest extends AbstractShardingSphereDa
}
private void assertResultSet(final int resultSetCount, final int id, final Object pwd, final Object assistPwd) throws SQLException {
- try (Connection conn = getDatabaseTypeMap().get(DatabaseTypes.getActualDatabaseType("H2")).get("encrypt").getConnection();
+ try (Connection conn = getDatabaseTypeMap().get(DatabaseTypeRegistry.getActualDatabaseType("H2")).get("encrypt").getConnection();
Statement stmt = conn.createStatement()) {
ResultSet resultSet = stmt.executeQuery(SELECT_ALL_SQL);
int count = 1;
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java
index 360ad4f..614e6f9 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/EncryptStatementTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.driver.jdbc.core.statement;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKey;
import org.apache.shardingsphere.driver.common.base.AbstractShardingSphereDataSourceForEncryptTest;
import org.junit.Test;
@@ -168,7 +168,7 @@ public final class EncryptStatementTest extends AbstractShardingSphereDataSource
}
private void assertResultSet(final int resultSetCount, final int id, final Object pwd, final Object plain) throws SQLException {
- try (Connection conn = getDatabaseTypeMap().get(DatabaseTypes.getActualDatabaseType("H2")).get("encrypt").getConnection();
+ try (Connection conn = getDatabaseTypeMap().get(DatabaseTypeRegistry.getActualDatabaseType("H2")).get("encrypt").getConnection();
Statement stmt = conn.createStatement()) {
ResultSet resultSet = stmt.executeQuery(SELECT_SQL_TO_ASSERT);
int count = 1;
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowPreparedStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowPreparedStatementTest.java
index a8741ff..05ccce2 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowPreparedStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowPreparedStatementTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.driver.jdbc.core.statement;
import org.apache.shardingsphere.driver.common.base.AbstractShardingSphereDataSourceForShadowTest;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -136,7 +136,7 @@ public final class ShadowPreparedStatementTest extends AbstractShardingSphereDat
}
private void assertResultSet(final boolean isShadow, final int resultSetCount, final Object cipherPwd) throws SQLException {
- Map<String, DataSource> dataMaps = getDatabaseTypeMap().get(DatabaseTypes.getActualDatabaseType("H2"));
+ Map<String, DataSource> dataMaps = getDatabaseTypeMap().get(DatabaseTypeRegistry.getActualDatabaseType("H2"));
DataSource dataSource = isShadow ? dataMaps.get("jdbc_1") : dataMaps.get("jdbc_0");
try (Statement statement = dataSource.getConnection().createStatement()) {
ResultSet resultSet = statement.executeQuery(SELECT_SQL);
@@ -150,7 +150,7 @@ public final class ShadowPreparedStatementTest extends AbstractShardingSphereDat
}
private void assertResultSet(final boolean isShadow, final int id, final int resultSetCount, final Object cipherPwd) throws SQLException {
- Map<String, DataSource> dataMaps = getDatabaseTypeMap().get(DatabaseTypes.getActualDatabaseType("H2"));
+ Map<String, DataSource> dataMaps = getDatabaseTypeMap().get(DatabaseTypeRegistry.getActualDatabaseType("H2"));
DataSource dataSource = isShadow ? dataMaps.get("jdbc_1") : dataMaps.get("jdbc_0");
try (PreparedStatement statement = dataSource.getConnection().prepareStatement(SELECT_SQL_BY_ID)) {
statement.setObject(1, id);
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowStatementTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowStatementTest.java
index 37d3bb7..0ba056e 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowStatementTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShadowStatementTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.driver.jdbc.core.statement;
import org.apache.shardingsphere.driver.common.base.AbstractShardingSphereDataSourceForShadowTest;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.After;
import org.junit.Test;
@@ -86,7 +86,7 @@ public final class ShadowStatementTest extends AbstractShardingSphereDataSourceF
}
private void assertResultSet(final boolean isShadow, final int resultSetCount, final Object cipherPwd) throws SQLException {
- Map<String, DataSource> dataMaps = getDatabaseTypeMap().get(DatabaseTypes.getActualDatabaseType("H2"));
+ Map<String, DataSource> dataMaps = getDatabaseTypeMap().get(DatabaseTypeRegistry.getActualDatabaseType("H2"));
DataSource dataSource = isShadow ? dataMaps.get("jdbc_1") : dataMaps.get("jdbc_0");
try (Statement statement = dataSource.getConnection().createStatement()) {
ResultSet resultSet = statement.executeQuery(SELECT_SQL);
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-governance/src/main/java/org/apache/shardingsphere/driver/governance/internal/datasource/GovernanceShardingSphereDataSource.java b/shardingsphere-jdbc/shardingsphere-jdbc-governance/src/main/java/org/apache/shardingsphere/driver/governance/internal/datasource/GovernanceShardingSphereDataSource.java
index d42af42..90bda00 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-governance/src/main/java/org/apache/shardingsphere/driver/governance/internal/datasource/GovernanceShardingSphereDataSource.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-governance/src/main/java/org/apache/shardingsphere/driver/governance/internal/datasource/GovernanceShardingSphereDataSource.java
@@ -34,7 +34,7 @@ import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
import org.apache.shardingsphere.infra.context.schema.SchemaContextsBuilder;
import org.apache.shardingsphere.infra.database.DefaultSchema;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.transaction.ShardingTransactionManagerEngine;
import org.apache.shardingsphere.transaction.context.TransactionContexts;
import org.apache.shardingsphere.transaction.context.impl.StandardTransactionContexts;
@@ -108,7 +108,7 @@ public final class GovernanceShardingSphereDataSource extends AbstractUnsupporte
private DatabaseType createDatabaseType(final DataSource dataSource) throws SQLException {
try (Connection connection = dataSource.getConnection()) {
- return DatabaseTypes.getDatabaseTypeByURL(connection.getMetaData().getURL());
+ return DatabaseTypeRegistry.getDatabaseTypeByURL(connection.getMetaData().getURL());
}
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandler.java
index b5b7148..25d2b57 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/sctl/explain/ShardingCTLExplainBackendHandler.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.binder.LogicSQL;
import org.apache.shardingsphere.infra.binder.SQLStatementContextFactory;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.context.kernel.KernelProcessor;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.context.ExecutionUnit;
import org.apache.shardingsphere.infra.executor.sql.raw.execute.result.query.QueryHeader;
import org.apache.shardingsphere.infra.metadata.model.physical.model.schema.PhysicalSchemaMetaData;
@@ -85,7 +85,8 @@ public final class ShardingCTLExplainBackendHandler implements TextProtocolBacke
private LogicSQL createLogicSQL(final ShardingSphereSchema schema, final ShardingCTLExplainStatement explainStatement) {
PhysicalSchemaMetaData schemaMetaData = schema.getMetaData().getSchemaMetaData().getSchemaMetaData();
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(
+ DatabaseTypeRegistry.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
SQLStatement sqlStatement = sqlParserEngine.parse(explainStatement.getSql(), false);
SQLStatementContext<?> sqlStatementContext = SQLStatementContextFactory.newInstance(schemaMetaData, Collections.emptyList(), sqlStatement);
return new LogicSQL(sqlStatementContext, explainStatement.getSql(), Collections.emptyList());
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/TextProtocolBackendHandlerFactoryTest.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/TextProtocolBackendHandlerFactoryTest.java
index dcf935b..f569a06 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/TextProtocolBackendHandlerFactoryTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/TextProtocolBackendHandlerFactoryTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.backend;
import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.backend.text.TextProtocolBackendHandler;
@@ -54,7 +54,7 @@ import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public final class TextProtocolBackendHandlerFactoryTest {
- private final DatabaseType databaseType = DatabaseTypes.getActualDatabaseType("MySQL");
+ private final DatabaseType databaseType = DatabaseTypeRegistry.getActualDatabaseType("MySQL");
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private BackendConnection backendConnection;
diff --git a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/impl/AbstractBootstrapInitializer.java b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/impl/AbstractBootstrapInitializer.java
index ff56c45..6f258b1 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/impl/AbstractBootstrapInitializer.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/java/org/apache/shardingsphere/proxy/initializer/impl/AbstractBootstrapInitializer.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.infra.config.properties.ConfigurationPropertyKe
import org.apache.shardingsphere.infra.context.schema.SchemaContexts;
import org.apache.shardingsphere.infra.context.schema.SchemaContextsBuilder;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
import org.apache.shardingsphere.infra.schema.ShardingSphereSchema;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.factory.JDBCRawBackendDataSourceFactory;
@@ -81,7 +81,7 @@ public abstract class AbstractBootstrapInitializer implements BootstrapInitializ
private static DatabaseType getDatabaseType(final Map<String, Map<String, DataSourceParameter>> schemaDataSources) {
String databaseTypeName = JDBCDriverURLRecognizerEngine.getJDBCDriverURLRecognizer(schemaDataSources.values().iterator().next().values().iterator().next().getUrl()).getDatabaseType();
- return DatabaseTypes.getActualDatabaseType(databaseTypeName);
+ return DatabaseTypeRegistry.getActualDatabaseType(databaseTypeName);
}
private static Map<String, Map<String, DataSource>> createDataSourcesMap(final Map<String, Map<String, DataSourceParameter>> schemaDataSources) {
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactory.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactory.java
index ca9554c..f5eb6c0 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactory.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactory.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.proxy.frontend.protocol;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.proxy.frontend.spi.DatabaseProtocolFrontendEngine;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
@@ -42,7 +42,7 @@ public final class DatabaseProtocolFrontendEngineFactory {
*/
public static DatabaseProtocolFrontendEngine newInstance(final DatabaseType databaseType) {
for (DatabaseProtocolFrontendEngine each : ShardingSphereServiceLoader.newServiceInstances(DatabaseProtocolFrontendEngine.class)) {
- if (DatabaseTypes.getActualDatabaseType(each.getDatabaseType()).getName().equals(databaseType.getName())) {
+ if (DatabaseTypeRegistry.getActualDatabaseType(each.getDatabaseType()).getName().equals(databaseType.getName())) {
return each;
}
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactoryTest.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactoryTest.java
index a49f96d..6adfdbf 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactoryTest.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/test/java/org/apache/shardingsphere/proxy/frontend/protocol/DatabaseProtocolFrontendEngineFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.proxy.frontend.protocol;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.proxy.frontend.fixture.DatabaseProtocolFrontendEngineFixture;
import org.apache.shardingsphere.proxy.frontend.fixture.FixtureDatabaseType;
import org.apache.shardingsphere.proxy.frontend.spi.DatabaseProtocolFrontendEngine;
@@ -30,7 +30,7 @@ public final class DatabaseProtocolFrontendEngineFactoryTest {
@Test(expected = UnsupportedOperationException.class)
public void assertNewInstanceWhenUnsupported() {
- DatabaseProtocolFrontendEngineFactory.newInstance(DatabaseTypes.getActualDatabaseType("Oracle"));
+ DatabaseProtocolFrontendEngineFactory.newInstance(DatabaseTypeRegistry.getActualDatabaseType("Oracle"));
}
@Test
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutor.java
index 671d00e..a610437 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/execute/MySQLComStmtExecuteExecutor.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.db.protocol.mysql.packet.MySQLPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.binary.execute.MySQLBinaryResultSetRowPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.binary.execute.MySQLComStmtExecutePacket;
import org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine;
import org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngineFactory;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -57,7 +57,8 @@ public final class MySQLComStmtExecuteExecutor implements QueryCommandExecutor {
private int currentSequenceId;
public MySQLComStmtExecuteExecutor(final MySQLComStmtExecutePacket packet, final BackendConnection backendConnection) {
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(
+ DatabaseTypeRegistry.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
SQLStatement sqlStatement = sqlParserEngine.parse(packet.getSql(), true);
databaseCommunicationEngine = DatabaseCommunicationEngineFactory.getInstance().newBinaryProtocolInstance(sqlStatement, packet.getSql(), packet.getParameters(), backendConnection);
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
index 0bef4a8..2e1550b 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/binary/prepare/MySQLComStmtPrepareExecutor.java
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.binary.p
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.binary.prepare.MySQLComStmtPreparePacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLEofPacket;
import org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.frontend.command.executor.CommandExecutor;
import org.apache.shardingsphere.proxy.frontend.exception.UnsupportedPreparedStatementException;
@@ -50,7 +50,8 @@ public final class MySQLComStmtPrepareExecutor implements CommandExecutor {
@Override
public Collection<DatabasePacket<?>> execute() {
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(
+ DatabaseTypeRegistry.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
SQLStatement sqlStatement = sqlParserEngine.parse(packet.getSql(), true);
if (!MySQLComStmtPrepareChecker.isStatementAllowed(sqlStatement)) {
throw new UnsupportedPreparedStatementException();
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/fieldlist/MySQLComFieldListPacketExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/fieldlist/MySQLComFieldListPacketExecutor.java
index 0ce2ba3..8feb8a6 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/fieldlist/MySQLComFieldListPacketExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/fieldlist/MySQLComFieldListPacketExecutor.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.MySQLCol
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.text.fieldlist.MySQLComFieldListPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.generic.MySQLEofPacket;
import org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine;
import org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngineFactory;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -54,7 +54,8 @@ public final class MySQLComFieldListPacketExecutor implements CommandExecutor {
this.packet = packet;
schemaName = backendConnection.getSchemaName();
String sql = String.format(SQL, packet.getTable(), schemaName);
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(
+ DatabaseTypeRegistry.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
SQLStatement sqlStatement = sqlParserEngine.parse(sql, false);
databaseCommunicationEngine = DatabaseCommunicationEngineFactory.getInstance().newTextProtocolInstance(sqlStatement, sql, backendConnection);
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutor.java
index 3bd9aa0..317ae5f 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-mysql/src/main/java/org/apache/shardingsphere/proxy/frontend/mysql/command/query/text/query/MySQLComQueryPacketExecutor.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.db.protocol.mysql.packet.MySQLPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.text.MySQLTextResultSetRowPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.text.query.MySQLComQueryPacket;
import org.apache.shardingsphere.db.protocol.packet.DatabasePacket;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.backend.exception.CircuitBreakException;
@@ -51,7 +51,7 @@ public final class MySQLComQueryPacketExecutor implements QueryCommandExecutor {
private int currentSequenceId;
public MySQLComQueryPacketExecutor(final MySQLComQueryPacket packet, final BackendConnection backendConnection) {
- textProtocolBackendHandler = TextProtocolBackendHandlerFactory.newInstance(DatabaseTypes.getActualDatabaseType("MySQL"), packet.getSql(), backendConnection);
+ textProtocolBackendHandler = TextProtocolBackendHandlerFactory.newInstance(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), packet.getSql(), backendConnection);
}
@Override
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
index 3faefb5..ed42fdc 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/bind/PostgreSQLComBindExecutor.java
@@ -29,7 +29,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bin
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.text.PostgreSQLDataRowPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLCommandCompletePacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLErrorResponsePacket;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.raw.execute.result.query.QueryHeader;
import org.apache.shardingsphere.infra.schema.ShardingSphereSchema;
@@ -71,7 +71,8 @@ public final class PostgreSQLComBindExecutor implements QueryCommandExecutor {
this.packet = packet;
ShardingSphereSchema schema = ProxyContext.getInstance().getSchema(backendConnection.getSchemaName());
if (null != packet.getSql() && null != schema) {
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(
+ DatabaseTypeRegistry.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
SQLStatement sqlStatement = sqlParserEngine.parse(packet.getSql(), true);
databaseCommunicationEngine =
DatabaseCommunicationEngineFactory.getInstance().newBinaryProtocolInstance(sqlStatement, packet.getSql(), packet.getParameters(), backendConnection);
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java
index 9de4a3f..9bcdb74 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/binary/parse/PostgreSQLComParseExecutor.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.bin
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.ConnectionScopeBinaryStatementRegistry;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse.PostgreSQLComParsePacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.binary.parse.PostgreSQLParseCompletePacket;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.proxy.frontend.command.executor.CommandExecutor;
@@ -49,7 +49,8 @@ public final class PostgreSQLComParseExecutor implements CommandExecutor {
@Override
public Collection<DatabasePacket<?>> execute() {
if (!packet.getSql().isEmpty()) {
- ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(DatabaseTypes.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
+ ShardingSphereSQLParserEngine sqlParserEngine = new ShardingSphereSQLParserEngine(
+ DatabaseTypeRegistry.getTrunkDatabaseTypeName(ProxyContext.getInstance().getSchemaContexts().getDatabaseType()));
SQLStatement sqlStatement = sqlParserEngine.parse(packet.getSql(), true);
binaryStatementRegistry.register(packet.getStatementId(), packet.getSql(), sqlStatement.getParameterCount(), packet.getBinaryStatementParameterTypes());
}
diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java
index 1decd1d..a8e7d80 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/text/PostgreSQLComQueryExecutor.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.tex
import org.apache.shardingsphere.db.protocol.postgresql.packet.command.query.text.PostgreSQLDataRowPacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLCommandCompletePacket;
import org.apache.shardingsphere.db.protocol.postgresql.packet.generic.PostgreSQLErrorResponsePacket;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.sql.QueryResult;
import org.apache.shardingsphere.infra.executor.sql.raw.execute.result.query.QueryHeader;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.connection.BackendConnection;
@@ -58,7 +58,7 @@ public final class PostgreSQLComQueryExecutor implements QueryCommandExecutor {
private volatile ResponseType responseType;
public PostgreSQLComQueryExecutor(final PostgreSQLComQueryPacket comQueryPacket, final BackendConnection backendConnection) {
- textProtocolBackendHandler = TextProtocolBackendHandlerFactory.newInstance(DatabaseTypes.getActualDatabaseType("PostgreSQL"), comQueryPacket.getSql(), backendConnection);
+ textProtocolBackendHandler = TextProtocolBackendHandlerFactory.newInstance(DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL"), comQueryPacket.getSql(), backendConnection);
}
@Override
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/JDBCScalingDataSourceConfiguration.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/JDBCScalingDataSourceConfiguration.java
index d545a1d..51268ac 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/JDBCScalingDataSourceConfiguration.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/JDBCScalingDataSourceConfiguration.java
@@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
/**
* JDBC scaling data source configuration.
@@ -49,7 +49,7 @@ public final class JDBCScalingDataSourceConfiguration implements ScalingDataSour
@Override
public DatabaseType getDatabaseType() {
if (null == databaseType) {
- databaseType = DatabaseTypes.getDatabaseTypeByURL(jdbcUrl);
+ databaseType = DatabaseTypeRegistry.getDatabaseTypeByURL(jdbcUrl);
}
return databaseType;
}
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/ShardingSphereJDBCScalingDataSourceConfiguration.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/ShardingSphereJDBCScalingDataSourceConfiguration.java
index fd3bbd3..efd3fc5 100644
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/ShardingSphereJDBCScalingDataSourceConfiguration.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/config/ShardingSphereJDBCScalingDataSourceConfiguration.java
@@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.scaling.core.utils.ConfigurationYamlConverter;
/**
@@ -47,7 +47,8 @@ public final class ShardingSphereJDBCScalingDataSourceConfiguration implements S
@Override
public DatabaseType getDatabaseType() {
if (null == databaseType) {
- databaseType = DatabaseTypes.getDatabaseTypeByURL(ConfigurationYamlConverter.loadDataSourceConfigurations(dataSource).values().iterator().next().getProps().get("jdbcUrl").toString());
+ databaseType = DatabaseTypeRegistry.getDatabaseTypeByURL(
+ ConfigurationYamlConverter.loadDataSourceConfigurations(dataSource).values().iterator().next().getProps().get("jdbcUrl").toString());
}
return databaseType;
}
diff --git a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/metadata/MetaDataManager.java b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/metadata/MetaDataManager.java
index 80eff3d..ac92eea 100755
--- a/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/metadata/MetaDataManager.java
+++ b/shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/metadata/MetaDataManager.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.scaling.core.metadata;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.metadata.model.physical.model.table.PhysicalTableMetaData;
import org.apache.shardingsphere.infra.metadata.model.physical.model.table.PhysicalTableMetaDataLoader;
@@ -46,7 +46,7 @@ public final class MetaDataManager {
public PhysicalTableMetaData getTableMetaData(final String tableName) {
if (!tableMetaDataMap.containsKey(tableName)) {
try {
- PhysicalTableMetaDataLoader.load(dataSource, tableName, DatabaseTypes.getActualDatabaseType("MySQL")).ifPresent(tableMetaData -> tableMetaDataMap.put(tableName, tableMetaData));
+ PhysicalTableMetaDataLoader.load(dataSource, tableName, DatabaseTypeRegistry.getActualDatabaseType("MySQL")).ifPresent(tableMetaData -> tableMetaDataMap.put(tableName, tableMetaData));
} catch (final SQLException ex) {
throw new RuntimeException(String.format("Load metaData for table %s failed", tableName), ex);
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
index 7470229..3dfc8e5 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/sql/loader/SQLCasesLoader.java
@@ -157,10 +157,10 @@ public final class SQLCasesLoader {
}
private static Collection<String> getDatabaseTypes(final String databaseTypes) {
- return Strings.isNullOrEmpty(databaseTypes) ? getALlDatabaseTypes() : Splitter.on(',').trimResults().splitToList(databaseTypes);
+ return Strings.isNullOrEmpty(databaseTypes) ? getAllDatabaseTypes() : Splitter.on(',').trimResults().splitToList(databaseTypes);
}
- private static Collection<String> getALlDatabaseTypes() {
+ private static Collection<String> getAllDatabaseTypes() {
return Arrays.asList("H2", "MySQL", "PostgreSQL", "Oracle", "SQLServer", "SQL92");
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactory.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactory.java
index dfd1adb..2be781f 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactory.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/main/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactory.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.transaction.xa.jta.datasource.properties;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import java.util.HashMap;
@@ -36,7 +36,7 @@ public final class XADataSourceDefinitionFactory {
static {
for (XADataSourceDefinition each : ServiceLoader.load(XADataSourceDefinition.class)) {
- XA_DATA_SOURCE_DEFINITIONS.put(DatabaseTypes.getActualDatabaseType(each.getDatabaseType()), each);
+ XA_DATA_SOURCE_DEFINITIONS.put(DatabaseTypeRegistry.getActualDatabaseType(each.getDatabaseType()), each);
}
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/XAShardingTransactionManagerTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/XAShardingTransactionManagerTest.java
index 87c8507..9860e99 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/XAShardingTransactionManagerTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/XAShardingTransactionManagerTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.transaction.xa;
import com.atomikos.jdbc.AtomikosDataSourceBean;
import com.zaxxer.hikari.HikariDataSource;
import lombok.SneakyThrows;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
import org.apache.shardingsphere.transaction.core.ResourceDataSource;
import org.apache.shardingsphere.transaction.core.TransactionType;
@@ -68,8 +68,8 @@ public final class XAShardingTransactionManagerTest {
@Before
public void setUp() {
ReflectiveUtil.setProperty(xaShardingTransactionManager, "xaTransactionManager", xaTransactionManager);
- Collection<ResourceDataSource> resourceDataSources = createResourceDataSources(DatabaseTypes.getActualDatabaseType("H2"));
- xaShardingTransactionManager.init(DatabaseTypes.getActualDatabaseType("H2"), resourceDataSources);
+ Collection<ResourceDataSource> resourceDataSources = createResourceDataSources(DatabaseTypeRegistry.getActualDatabaseType("H2"));
+ xaShardingTransactionManager.init(DatabaseTypeRegistry.getActualDatabaseType("H2"), resourceDataSources);
verify(xaTransactionManager).init();
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/XAConnectionFactoryTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/XAConnectionFactoryTest.java
index 6bb4f91..dfb5ab2 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/XAConnectionFactoryTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/XAConnectionFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.transaction.xa.jta.connection;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.h2.jdbcx.JdbcXAConnection;
import org.junit.Ignore;
import org.junit.Test;
@@ -45,33 +45,33 @@ public final class XAConnectionFactoryTest {
@Test(expected = Exception.class)
// TODO assert fail
public void assertCreateMySQLXAConnection() {
- XAConnectionFactory.createXAConnection(DatabaseTypes.getActualDatabaseType("MySQL"), xaDataSource, connection);
+ XAConnectionFactory.createXAConnection(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), xaDataSource, connection);
}
@Test(expected = Exception.class)
public void assertCreateMariaDBXAConnection() {
- assertThat(XAConnectionFactory.createXAConnection(DatabaseTypes.getActualDatabaseType("MariaDB"), xaDataSource, connection), instanceOf(MariaXaConnection.class));
+ assertThat(XAConnectionFactory.createXAConnection(DatabaseTypeRegistry.getActualDatabaseType("MariaDB"), xaDataSource, connection), instanceOf(MariaXaConnection.class));
}
@Test
public void assertCreatePostgreSQLXAConnection() {
- assertThat(XAConnectionFactory.createXAConnection(DatabaseTypes.getActualDatabaseType("PostgreSQL"), xaDataSource, connection), instanceOf(PGXAConnection.class));
+ assertThat(XAConnectionFactory.createXAConnection(DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL"), xaDataSource, connection), instanceOf(PGXAConnection.class));
}
@Test
public void assertCreateH2XAConnection() {
- assertThat(XAConnectionFactory.createXAConnection(DatabaseTypes.getActualDatabaseType("H2"), xaDataSource, connection), instanceOf(JdbcXAConnection.class));
+ assertThat(XAConnectionFactory.createXAConnection(DatabaseTypeRegistry.getActualDatabaseType("H2"), xaDataSource, connection), instanceOf(JdbcXAConnection.class));
}
@Test
@Ignore("oracle jdbc driver is not import because of the limitations of license")
public void assertCreateOracleXAConnection() throws ClassNotFoundException {
Class<?> clazz = Class.forName("oracle.jdbc.xa.client.OracleXAConnection");
- assertThat(XAConnectionFactory.createXAConnection(DatabaseTypes.getActualDatabaseType("Oracle"), xaDataSource, connection), instanceOf(clazz));
+ assertThat(XAConnectionFactory.createXAConnection(DatabaseTypeRegistry.getActualDatabaseType("Oracle"), xaDataSource, connection), instanceOf(clazz));
}
@Test(expected = UnsupportedOperationException.class)
public void assertCreateUnknownXAConnectionThrowsUnsupportedOperationException() {
- XAConnectionFactory.createXAConnection(DatabaseTypes.getActualDatabaseType("SQL92"), xaDataSource, connection);
+ XAConnectionFactory.createXAConnection(DatabaseTypeRegistry.getActualDatabaseType("SQL92"), xaDataSource, connection);
}
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MariaDBXAConnectionWrapperTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MariaDBXAConnectionWrapperTest.java
index 1e6ffe7..33e19a5 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MariaDBXAConnectionWrapperTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MariaDBXAConnectionWrapperTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.transaction.xa.jta.connection.dialect;
import com.zaxxer.hikari.HikariDataSource;
import org.apache.shardingsphere.transaction.xa.fixture.DataSourceUtils;
import org.apache.shardingsphere.transaction.xa.jta.datasource.XADataSourceFactory;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -51,8 +51,8 @@ public final class MariaDBXAConnectionWrapperTest {
@Before
public void setUp() throws SQLException, ClassNotFoundException {
Connection connection = (Connection) mock(Class.forName("org.mariadb.jdbc.MariaDbConnection"));
- DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypes.getActualDatabaseType("MariaDB"), "ds1");
- xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("MariaDB"), dataSource);
+ DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypeRegistry.getActualDatabaseType("MariaDB"), "ds1");
+ xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("MariaDB"), dataSource);
when(this.connection.unwrap(any())).thenReturn(connection);
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MySQLXAConnectionWrapperTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MySQLXAConnectionWrapperTest.java
index fca84d0..00096c4 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MySQLXAConnectionWrapperTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/MySQLXAConnectionWrapperTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.transaction.xa.jta.connection.dialect;
import com.zaxxer.hikari.HikariDataSource;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.transaction.xa.fixture.DataSourceUtils;
import org.apache.shardingsphere.transaction.xa.jta.datasource.XADataSourceFactory;
import org.junit.Before;
@@ -51,8 +51,8 @@ public final class MySQLXAConnectionWrapperTest {
@Before
public void setUp() throws SQLException, ClassNotFoundException {
Connection connection = (Connection) mock(Class.forName("com.mysql.jdbc.Connection"));
- DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypes.getActualDatabaseType("MySQL"), "ds1");
- xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("MySQL"), dataSource);
+ DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypeRegistry.getActualDatabaseType("MySQL"), "ds1");
+ xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), dataSource);
when(this.connection.unwrap(any())).thenReturn(connection);
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OracleXAConnectionWrapperTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OracleXAConnectionWrapperTest.java
index 6a05efc..0993bcf 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OracleXAConnectionWrapperTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/OracleXAConnectionWrapperTest.java
@@ -21,7 +21,7 @@ import com.zaxxer.hikari.HikariDataSource;
import lombok.SneakyThrows;
import org.apache.shardingsphere.transaction.xa.fixture.DataSourceUtils;
import org.apache.shardingsphere.transaction.xa.jta.datasource.XADataSourceFactory;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
@@ -59,8 +59,8 @@ public final class OracleXAConnectionWrapperTest {
@Ignore("oracle jdbc driver is not import because of the limitations of license")
public void setUp() throws SQLException {
Connection connection = (Connection) mock(Class.forName("oracle.jdbc.internal.OracleConnection"));
- DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypes.getActualDatabaseType("Oracle"), "ds1");
- xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("Oracle"), dataSource);
+ DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypeRegistry.getActualDatabaseType("Oracle"), "ds1");
+ xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("Oracle"), dataSource);
when(this.connection.unwrap(any())).thenReturn(connection);
Method getVersionNumberMethod = connection.getClass().getDeclaredMethod("getVersionNumber");
when(getVersionNumberMethod.invoke(connection)).thenReturn(MINIMUM_VERSION_OF_XA_SUPPORTED);
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/PostgreSQLXAConnectionWrapperTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/PostgreSQLXAConnectionWrapperTest.java
index 570783c..2a922a3 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/PostgreSQLXAConnectionWrapperTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/connection/dialect/PostgreSQLXAConnectionWrapperTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.transaction.xa.jta.connection.dialect;
import com.zaxxer.hikari.HikariDataSource;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.transaction.xa.fixture.DataSourceUtils;
import org.apache.shardingsphere.transaction.xa.jta.datasource.XADataSourceFactory;
import org.junit.Before;
@@ -52,8 +52,8 @@ public final class PostgreSQLXAConnectionWrapperTest {
@Before
public void setUp() throws SQLException, ClassNotFoundException {
BaseConnection connection = (BaseConnection) mock(Class.forName("org.postgresql.core.BaseConnection"));
- DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypes.getActualDatabaseType("PostgreSQL"), "ds1");
- xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("PostgreSQL"), dataSource);
+ DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL"), "ds1");
+ xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL"), dataSource);
when(this.connection.unwrap(any())).thenReturn(connection);
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java
index e290a43..fec5273 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XADataSourceFactoryTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.transaction.xa.jta.datasource;
import com.microsoft.sqlserver.jdbc.SQLServerXADataSource;
import com.zaxxer.hikari.HikariDataSource;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.h2.jdbcx.JdbcDataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,26 +42,26 @@ public final class XADataSourceFactoryTest {
@Test
public void assertCreateH2XADataSource() {
- XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("H2"), dataSource);
+ XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("H2"), dataSource);
assertThat(xaDataSource, instanceOf(JdbcDataSource.class));
}
@Test
public void assertCreateMariaDBXADataSource() {
- XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("MariaDB"), dataSource);
+ XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("MariaDB"), dataSource);
assertThat(xaDataSource, instanceOf(MariaDbDataSource.class));
}
@Test
public void assertCreatePGXADataSource() {
when(dataSource.getJdbcUrl()).thenReturn("jdbc:postgresql://localhost:5432/db1");
- XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("PostgreSQL"), dataSource);
+ XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL"), dataSource);
assertThat(xaDataSource, instanceOf(PGXADataSource.class));
}
@Test
public void assertCreateMSXADataSource() {
- XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypes.getActualDatabaseType("SQLServer"), dataSource);
+ XADataSource xaDataSource = XADataSourceFactory.build(DatabaseTypeRegistry.getActualDatabaseType("SQLServer"), dataSource);
assertThat(xaDataSource, instanceOf(SQLServerXADataSource.class));
}
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java
index f1f1344..782ad91 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/XATransactionDataSourceTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.transaction.xa.jta.datasource;
import com.atomikos.jdbc.AtomikosDataSourceBean;
import com.zaxxer.hikari.HikariDataSource;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.transaction.xa.fixture.DataSourceUtils;
import org.apache.shardingsphere.transaction.xa.spi.SingleXAResource;
import org.apache.shardingsphere.transaction.xa.spi.XATransactionManager;
@@ -65,8 +65,8 @@ public final class XATransactionDataSourceTest {
@Test
public void assertGetAtomikosConnection() throws SQLException, RollbackException, SystemException {
- DataSource dataSource = DataSourceUtils.build(AtomikosDataSourceBean.class, DatabaseTypes.getActualDatabaseType("H2"), "ds1");
- XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypes.getActualDatabaseType("H2"), "ds1", dataSource, xaTransactionManager);
+ DataSource dataSource = DataSourceUtils.build(AtomikosDataSourceBean.class, DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds1");
+ XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds1", dataSource, xaTransactionManager);
try (Connection ignored = transactionDataSource.getConnection()) {
verify(xaTransactionManager, times(0)).getTransactionManager();
}
@@ -74,8 +74,8 @@ public final class XATransactionDataSourceTest {
@Test
public void assertGetHikariConnection() throws SQLException, RollbackException, SystemException {
- DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypes.getActualDatabaseType("H2"), "ds1");
- XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypes.getActualDatabaseType("H2"), "ds1", dataSource, xaTransactionManager);
+ DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds1");
+ XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds1", dataSource, xaTransactionManager);
try (Connection ignored = transactionDataSource.getConnection()) {
verify(transaction).enlistResource(any(SingleXAResource.class));
verify(transaction).registerSynchronization(any(Synchronization.class));
@@ -88,8 +88,8 @@ public final class XATransactionDataSourceTest {
@Test
public void assertCloseAtomikosDataSourceBean() {
- DataSource dataSource = DataSourceUtils.build(AtomikosDataSourceBean.class, DatabaseTypes.getActualDatabaseType("H2"), "ds11");
- XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypes.getActualDatabaseType("H2"), "ds11", dataSource, xaTransactionManager);
+ DataSource dataSource = DataSourceUtils.build(AtomikosDataSourceBean.class, DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds11");
+ XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds11", dataSource, xaTransactionManager);
transactionDataSource.close();
verify(xaTransactionManager, times(0)).removeRecoveryResource(anyString(), any(XADataSource.class));
@@ -97,8 +97,8 @@ public final class XATransactionDataSourceTest {
@Test
public void assertCloseHikariDataSource() {
- DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypes.getActualDatabaseType("H2"), "ds1");
- XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypes.getActualDatabaseType("H2"), "ds1", dataSource, xaTransactionManager);
+ DataSource dataSource = DataSourceUtils.build(HikariDataSource.class, DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds1");
+ XATransactionDataSource transactionDataSource = new XATransactionDataSource(DatabaseTypeRegistry.getActualDatabaseType("H2"), "ds1", dataSource, xaTransactionManager);
transactionDataSource.close();
verify(xaTransactionManager).removeRecoveryResource(anyString(), any(XADataSource.class));
diff --git a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java
index fcf9742..7786781 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-2pc/shardingsphere-transaction-xa/shardingsphere-transaction-xa-core/src/test/java/org/apache/shardingsphere/transaction/xa/jta/datasource/properties/XADataSourceDefinitionFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.transaction.xa.jta.datasource.properties;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.H2XADataSourceDefinition;
import org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.MariaDBXADataSourceDefinition;
import org.apache.shardingsphere.transaction.xa.jta.datasource.properties.dialect.MySQLXADataSourceDefinition;
@@ -33,31 +33,31 @@ public final class XADataSourceDefinitionFactoryTest {
@Test
public void assertCreateXAPropertiesForH2() {
- assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypes.getActualDatabaseType("H2")), instanceOf(H2XADataSourceDefinition.class));
+ assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("H2")), instanceOf(H2XADataSourceDefinition.class));
}
@Test
public void assertCreateXAPropertiesForMySQL() {
- assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypes.getActualDatabaseType("MySQL")), instanceOf(MySQLXADataSourceDefinition.class));
+ assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("MySQL")), instanceOf(MySQLXADataSourceDefinition.class));
}
@Test
public void assertCreateXAPropertiesForMariaDB() {
- assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypes.getActualDatabaseType("MariaDB")), instanceOf(MariaDBXADataSourceDefinition.class));
+ assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("MariaDB")), instanceOf(MariaDBXADataSourceDefinition.class));
}
@Test
public void assertCreateXAPropertiesForPostgreSQL() {
- assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypes.getActualDatabaseType("PostgreSQL")), instanceOf(PostgreSQLXADataSourceDefinition.class));
+ assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("PostgreSQL")), instanceOf(PostgreSQLXADataSourceDefinition.class));
}
@Test
public void assertCreateXAPropertiesForOracle() {
- assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypes.getActualDatabaseType("Oracle")), instanceOf(OracleXADataSourceDefinition.class));
+ assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("Oracle")), instanceOf(OracleXADataSourceDefinition.class));
}
@Test
public void assertCreateXAPropertiesForSQLServer() {
- assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypes.getActualDatabaseType("SQLServer")), instanceOf(SQLServerXADataSourceDefinition.class));
+ assertThat(XADataSourceDefinitionFactory.getXADataSourceDefinition(DatabaseTypeRegistry.getActualDatabaseType("SQLServer")), instanceOf(SQLServerXADataSourceDefinition.class));
}
}
diff --git a/shardingsphere-transaction/shardingsphere-transaction-base/shardingsphere-transaction-base-seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingTransactionManagerTest.java b/shardingsphere-transaction/shardingsphere-transaction-base/shardingsphere-transaction-base-seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingTransactionManagerTest.java
index b7f1d03..c8947bd 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-base/shardingsphere-transaction-base-seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingTransactionManagerTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-base/shardingsphere-transaction-base-seata-at/src/test/java/org/apache/shardingsphere/transaction/base/seata/at/SeataATShardingTransactionManagerTest.java
@@ -34,7 +34,7 @@ import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.shardingsphere.transaction.base.seata.at.fixture.MockSeataServer;
import org.apache.shardingsphere.transaction.core.ResourceDataSource;
import org.apache.shardingsphere.transaction.core.TransactionType;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.infra.executor.kernel.ExecutorDataMap;
import org.junit.After;
import org.junit.AfterClass;
@@ -90,7 +90,7 @@ public final class SeataATShardingTransactionManagerTest {
@Before
public void setUp() {
- seataATShardingTransactionManager.init(DatabaseTypes.getActualDatabaseType("MySQL"), getResourceDataSources());
+ seataATShardingTransactionManager.init(DatabaseTypeRegistry.getActualDatabaseType("MySQL"), getResourceDataSources());
}
@After
diff --git a/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngineTest.java b/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngineTest.java
index b7665fb..c2b2c68 100644
--- a/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngineTest.java
+++ b/shardingsphere-transaction/shardingsphere-transaction-core/src/test/java/org/apache/shardingsphere/transaction/ShardingTransactionManagerEngineTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.transaction;
-import org.apache.shardingsphere.infra.database.type.DatabaseTypes;
+import org.apache.shardingsphere.infra.database.type.DatabaseTypeRegistry;
import org.apache.shardingsphere.transaction.core.TransactionType;
import org.apache.shardingsphere.transaction.core.fixture.ShardingTransactionManagerFixture;
import org.junit.Test;
@@ -44,7 +44,7 @@ public final class ShardingTransactionManagerEngineTest {
Runnable caller = mock(Runnable.class);
ShardingTransactionManagerFixture shardingTransactionManager = (ShardingTransactionManagerFixture) shardingTransactionManagerEngine.getTransactionManager(TransactionType.XA);
shardingTransactionManager.setCaller(caller);
- shardingTransactionManagerEngine.init(DatabaseTypes.getActualDatabaseType("H2"), mock(Map.class));
+ shardingTransactionManagerEngine.init(DatabaseTypeRegistry.getActualDatabaseType("H2"), mock(Map.class));
verify(caller).run();
}
}