You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by wu...@apache.org on 2022/02/05 16:15:46 UTC
[shardingsphere] branch master updated: Simplify spring namespace test cases (#15253)
This is an automated email from the ASF dual-hosted git repository.
wuweijie 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 45e8369 Simplify spring namespace test cases (#15253)
45e8369 is described below
commit 45e8369d813f972638a7a223b5c96a1f7b2aa87d
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Feb 6 00:14:39 2022 +0800
Simplify spring namespace test cases (#15253)
* Refactor AbstractSpringNamespaceTest
* Simplify spring namespace test cases
* Refactor HikariDataSourcePropertiesSetter
---
.../boot/jndi/SpringBootJNDIDataSourceTest.java | 3 +-
.../namespace/AbstractSpringNamespaceTest.java | 81 ++++-----
...st.java => ClusterModeSpringNamespaceTest.java} | 4 +-
...est.java => MemoryModeSpringNamespaceTest.java} | 4 +-
.../SpringNamespaceWithEncryptForClusterTest.java | 91 ----------
...espaceWithReadwriteSplittingForClusterTest.java | 110 ------------
...hardingAndReadwriteSplittingForClusterTest.java | 75 --------
.../SpringNamespaceWithShardingForClusterTest.java | 189 ---------------------
...java => StandaloneModeSpringNamespaceTest.java} | 25 +--
...y.java => FixtureClusterPersistRepository.java} | 6 +-
.../keygen/IncrementKeyGenerateAlgorithm.java | 41 -----
.../DefaultComplexKeysShardingAlgorithm.java | 40 -----
.../sharding/DefaultHintShardingAlgorithm.java | 40 -----
.../StandardModuloDatabaseShardingAlgorithm.java | 60 -------
.../StandardModuloTableShardingAlgorithm.java | 60 -------
.../spring/namespace/util/EmbedTestingServer.java | 65 -------
.../spring/namespace/util/FieldValueUtil.java | 43 -----
...ter-application-context-readwrite-splitting.xml | 59 -------
...cation-context-sharding-readwrite-splitting.xml | 45 -----
.../rdb/cluster-application-context-sharding.xml | 92 ----------
.../META-INF/rdb/datasource/data-source.xml | 42 -----
.../datasource/readwrite-splitting-data-source.xml | 70 --------
.../namespace/encrypt-data-source-namespace.xml | 42 -----
.../readwrite-splitting-data-source-namespace.xml | 67 --------
.../namespace/sharding-data-source-namespace.xml | 130 --------------
.../sharding-readwrite-splitting-namespace.xml | 92 ----------
...ode.repository.cluster.ClusterPersistRepository | 19 +--
...hardingsphere.sharding.spi.KeyGenerateAlgorithm | 36 ----
...e.shardingsphere.sharding.spi.ShardingAlgorithm | 38 -----
.../conf/readwrite_splitting_conf.properties | 49 ------
.../src/test/resources/schema/dbtbl_0.sql | 37 ----
.../src/test/resources/schema/dbtbl_0_read_0.sql | 37 ----
.../src/test/resources/schema/dbtbl_0_read_1.sql | 37 ----
.../src/test/resources/schema/dbtbl_0_write.sql | 37 ----
.../src/test/resources/schema/dbtbl_1.sql | 36 ----
.../src/test/resources/schema/dbtbl_1_read_0.sql | 35 ----
.../src/test/resources/schema/dbtbl_1_read_1.sql | 35 ----
.../src/test/resources/schema/dbtbl_1_write.sql | 35 ----
.../cluster-application-context.xml} | 18 +-
.../resources/{ => spring}/conf/conf.properties | 12 --
.../spring/included/data-sources-context.xml | 0
.../spring/included/rules-context.xml | 2 +-
.../spring/memory-application-context.xml | 2 +-
.../spring/standalone-application-context.xml | 6 +-
.../impl/HikariDataSourcePropertiesSetter.java | 3 +-
45 files changed, 76 insertions(+), 1974 deletions(-)
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/jndi/SpringBootJNDIDataSourceTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/jndi/SpringBootJNDIDataSourceTest.java
index f0f9186..eec492a 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/jndi/SpringBootJNDIDataSourceTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-boot-starter/src/test/java/org/apache/shardingsphere/spring/boot/jndi/SpringBootJNDIDataSourceTest.java
@@ -18,7 +18,6 @@
package org.apache.shardingsphere.spring.boot.jndi;
import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
-import org.apache.shardingsphere.infra.database.DefaultSchema;
import org.apache.shardingsphere.spring.boot.jndi.fixture.InitialDataSourceInitialContextFactory;
import org.apache.shardingsphere.test.mock.MockedDataSource;
import org.junit.BeforeClass;
@@ -56,7 +55,7 @@ public class SpringBootJNDIDataSourceTest {
@Test
public void assertDataSources() {
- Map<String, DataSource> dataSources = dataSource.getContextManager().getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getResource().getDataSources();
+ Map<String, DataSource> dataSources = dataSource.getContextManager().getMetaDataContexts().getMetaData("foo_db").getResource().getDataSources();
assertThat(dataSources.size(), is(2));
assertTrue(dataSources.containsKey("ds0"));
assertTrue(dataSources.containsKey("ds1"));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/AbstractSpringNamespaceTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/AbstractSpringNamespaceTest.java
index d03ab2e..41f7bd4 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/AbstractSpringNamespaceTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/AbstractSpringNamespaceTest.java
@@ -49,11 +49,24 @@ public abstract class AbstractSpringNamespaceTest extends AbstractJUnit4SpringCo
@Test
public void assertShardingSphereDataSource() {
- assertDataSources();
- Collection<ShardingSphereRule> rules = dataSource.getContextManager().getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getRuleMetaData().getRules();
- Collection<ShardingSphereRule> globalRules = dataSource.getContextManager().getMetaDataContexts().getGlobalRuleMetaData().getRules();
- assertThat(rules.size(), is(4));
- for (ShardingSphereRule each : rules) {
+ assertDataSources(dataSource.getContextManager().getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getResource().getDataSources());
+ assertSchemaRules(dataSource.getContextManager().getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getRuleMetaData().getRules());
+ assertGlobalRules(dataSource.getContextManager().getMetaDataContexts().getGlobalRuleMetaData().getRules());
+ }
+
+ private void assertDataSources(final Map<String, DataSource> actual) {
+ assertThat(actual.size(), is(6));
+ assertTrue(actual.containsKey("ds_0_write"));
+ assertTrue(actual.containsKey("ds_0_read_0"));
+ assertTrue(actual.containsKey("ds_0_read_1"));
+ assertTrue(actual.containsKey("ds_1_write"));
+ assertTrue(actual.containsKey("ds_1_read_0"));
+ assertTrue(actual.containsKey("ds_1_read_1"));
+ }
+
+ private void assertSchemaRules(final Collection<ShardingSphereRule> actual) {
+ assertThat(actual.size(), is(4));
+ for (ShardingSphereRule each : actual) {
if (each instanceof ShardingRule) {
assertShardingRule((ShardingRule) each);
} else if (each instanceof ReadwriteSplittingRule) {
@@ -62,53 +75,45 @@ public abstract class AbstractSpringNamespaceTest extends AbstractJUnit4SpringCo
assertEncryptRule((EncryptRule) each);
}
}
- assertThat(globalRules.size(), is(4));
- for (ShardingSphereRule each : globalRules) {
- if (each instanceof SQLParserRule) {
- assertSQLParserRule((SQLParserRule) each);
- }
- }
}
- private void assertDataSources() {
- Map<String, DataSource> dataSources = dataSource.getContextManager().getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getResource().getDataSources();
- assertThat(dataSources.size(), is(6));
- assertTrue(dataSources.containsKey("ds_0_write"));
- assertTrue(dataSources.containsKey("ds_0_read_0"));
- assertTrue(dataSources.containsKey("ds_0_read_1"));
- assertTrue(dataSources.containsKey("ds_1_write"));
- assertTrue(dataSources.containsKey("ds_1_read_0"));
- assertTrue(dataSources.containsKey("ds_1_read_1"));
- }
-
- private void assertShardingRule(final ShardingRule rule) {
- assertThat(rule.getTableRules().size(), is(1));
- assertThat(rule.getTableRule("t_order").getActualDataNodes(), is(Arrays.asList(
+ private void assertShardingRule(final ShardingRule actual) {
+ assertThat(actual.getTableRules().size(), is(1));
+ assertThat(actual.getTableRule("t_order").getActualDataNodes(), is(Arrays.asList(
new DataNode("ds_0.t_order_0"), new DataNode("ds_0.t_order_1"), new DataNode("ds_0.t_order_2"), new DataNode("ds_0.t_order_3"),
new DataNode("ds_1.t_order_0"), new DataNode("ds_1.t_order_1"), new DataNode("ds_1.t_order_2"), new DataNode("ds_1.t_order_3"))));
}
- private void assertReadwriteSplittingRule(final ReadwriteSplittingRule rule) {
- assertTrue(rule.findDataSourceRule("ds_0").isPresent());
- Properties props = rule.findDataSourceRule("ds_0").get().getReadwriteSplittingType().getProps();
+ private void assertReadwriteSplittingRule(final ReadwriteSplittingRule actual) {
+ assertTrue(actual.findDataSourceRule("ds_0").isPresent());
+ Properties props = actual.findDataSourceRule("ds_0").get().getReadwriteSplittingType().getProps();
assertNotNull(props);
assertThat(props.getProperty("read-data-source-names"), is("ds_0_read_0, ds_0_read_1"));
- assertTrue(rule.findDataSourceRule("ds_1").isPresent());
- props = rule.findDataSourceRule("ds_1").get().getReadwriteSplittingType().getProps();
+ assertTrue(actual.findDataSourceRule("ds_1").isPresent());
+ props = actual.findDataSourceRule("ds_1").get().getReadwriteSplittingType().getProps();
assertNotNull(props);
assertThat(props.getProperty("read-data-source-names"), is("ds_1_read_0, ds_1_read_1"));
}
- private void assertEncryptRule(final EncryptRule rule) {
- assertThat(rule.getCipherColumn("t_order", "pwd"), is("pwd_cipher"));
- assertTrue(rule.findEncryptor("t_order", "pwd").isPresent());
- assertThat(rule.findEncryptor("t_order", "pwd").get().getProps().getProperty("aes-key-value"), is("123456"));
+ private void assertEncryptRule(final EncryptRule actual) {
+ assertThat(actual.getCipherColumn("t_order", "pwd"), is("pwd_cipher"));
+ assertTrue(actual.findEncryptor("t_order", "pwd").isPresent());
+ assertThat(actual.findEncryptor("t_order", "pwd").get().getProps().getProperty("aes-key-value"), is("123456"));
+ }
+
+ private void assertGlobalRules(final Collection<ShardingSphereRule> actual) {
+ assertThat(actual.size(), is(4));
+ for (ShardingSphereRule each : actual) {
+ if (each instanceof SQLParserRule) {
+ assertSQLParserRule((SQLParserRule) each);
+ }
+ }
}
- private void assertSQLParserRule(final SQLParserRule sqlParserRule) {
- assertThat(sqlParserRule.isSqlCommentParseEnabled(), is(true));
- assertCacheOption(sqlParserRule.getSqlStatementCache());
- assertCacheOption(sqlParserRule.getParseTreeCache());
+ private void assertSQLParserRule(final SQLParserRule actual) {
+ assertTrue(actual.isSqlCommentParseEnabled());
+ assertCacheOption(actual.getSqlStatementCache());
+ assertCacheOption(actual.getParseTreeCache());
}
private void assertCacheOption(final CacheOption cacheOption) {
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceForMemoryModeTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/ClusterModeSpringNamespaceTest.java
similarity index 83%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceForMemoryModeTest.java
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/ClusterModeSpringNamespaceTest.java
index e1e8b6e..712b229 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceForMemoryModeTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/ClusterModeSpringNamespaceTest.java
@@ -19,6 +19,6 @@ package org.apache.shardingsphere.spring.namespace;
import org.springframework.test.context.ContextConfiguration;
-@ContextConfiguration(locations = "classpath:META-INF/spring/memory-application-context.xml")
-public final class SpringNamespaceForMemoryModeTest extends AbstractSpringNamespaceTest {
+@ContextConfiguration(locations = "classpath:spring/cluster-application-context.xml")
+public final class ClusterModeSpringNamespaceTest extends AbstractSpringNamespaceTest {
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceForStandaloneModeTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/MemoryModeSpringNamespaceTest.java
similarity index 82%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceForStandaloneModeTest.java
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/MemoryModeSpringNamespaceTest.java
index c6f0d7c..1857100 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceForStandaloneModeTest.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/MemoryModeSpringNamespaceTest.java
@@ -19,6 +19,6 @@ package org.apache.shardingsphere.spring.namespace;
import org.springframework.test.context.ContextConfiguration;
-@ContextConfiguration(locations = "classpath:META-INF/spring/standalone-application-context.xml")
-public final class SpringNamespaceForStandaloneModeTest extends AbstractSpringNamespaceTest {
+@ContextConfiguration(locations = "classpath:spring/memory-application-context.xml")
+public final class MemoryModeSpringNamespaceTest extends AbstractSpringNamespaceTest {
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithEncryptForClusterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithEncryptForClusterTest.java
deleted file mode 100644
index 958e16c..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithEncryptForClusterTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace;
-
-import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
-import org.apache.shardingsphere.encrypt.api.config.EncryptRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.rule.EncryptColumnRuleConfiguration;
-import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
-import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
-import org.apache.shardingsphere.infra.database.DefaultSchema;
-import org.apache.shardingsphere.mode.manager.ContextManager;
-import org.apache.shardingsphere.spring.namespace.util.EmbedTestingServer;
-import org.apache.shardingsphere.spring.namespace.util.FieldValueUtil;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-@ContextConfiguration(locations = "classpath:META-INF/rdb/cluster-application-context-encrypt.xml")
-public final class SpringNamespaceWithEncryptForClusterTest extends AbstractJUnit4SpringContextTests {
-
- @BeforeClass
- public static void init() {
- EmbedTestingServer.start();
- }
-
- @Test
- public void assertEncryptDataSourceType() {
- assertNotNull(applicationContext.getBean("encryptDataSourceGovernance", ShardingSphereDataSource.class));
- assertEncryptRule(getEncryptRuleConfiguration());
- }
-
- private EncryptRuleConfiguration getEncryptRuleConfiguration() {
- ShardingSphereDataSource governanceDataSource = (ShardingSphereDataSource) applicationContext.getBean("encryptDataSourceGovernance");
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(governanceDataSource, "contextManager");
- return (EncryptRuleConfiguration) contextManager.getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getRuleMetaData().getConfigurations().iterator().next();
- }
-
- private void assertEncryptRule(final EncryptRuleConfiguration config) {
- assertThat(config.getEncryptors().size(), is(2));
- assertThat(config.getTables().size(), is(1));
- EncryptTableRuleConfiguration encryptTableRuleConfig = config.getTables().iterator().next();
- Iterator<EncryptColumnRuleConfiguration> encryptColumnRuleConfigs = encryptTableRuleConfig.getColumns().iterator();
- EncryptColumnRuleConfiguration userIdColumnRuleConfig = encryptColumnRuleConfigs.next();
- EncryptColumnRuleConfiguration orderIdColumnRuleConfig = encryptColumnRuleConfigs.next();
- assertThat(userIdColumnRuleConfig.getCipherColumn(), is("user_encrypt"));
- assertThat(orderIdColumnRuleConfig.getPlainColumn(), is("order_decrypt"));
- Map<String, ShardingSphereAlgorithmConfiguration> encryptAlgorithms = config.getEncryptors();
- assertThat(encryptAlgorithms.size(), is(2));
- assertThat(encryptAlgorithms.get("aes_encryptor").getType(), is("AES"));
- assertThat(encryptAlgorithms.get("aes_encryptor").getProps().getProperty("aes-key-value"), is("123456"));
- assertThat(encryptAlgorithms.get("md5_encryptor").getType(), is("MD5"));
- }
-
- @Test
- public void assertProperties() {
- boolean showSQL = getProperties("encryptDataSourceGovernance").getValue(ConfigurationPropertyKey.SQL_SHOW);
- assertTrue(showSQL);
- }
-
- private ConfigurationProperties getProperties(final String encryptDatasourceName) {
- ShardingSphereDataSource governanceDataSource = applicationContext.getBean(encryptDatasourceName, ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(governanceDataSource, "contextManager");
- return contextManager.getMetaDataContexts().getProps();
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithReadwriteSplittingForClusterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithReadwriteSplittingForClusterTest.java
deleted file mode 100644
index 1cacc49..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithReadwriteSplittingForClusterTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace;
-
-import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
-import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
-import org.apache.shardingsphere.infra.database.DefaultSchema;
-import org.apache.shardingsphere.mode.manager.ContextManager;
-import org.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.RandomReplicaLoadBalanceAlgorithm;
-import org.apache.shardingsphere.readwritesplitting.algorithm.loadbalance.RoundRobinReplicaLoadBalanceAlgorithm;
-import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingDataSourceRule;
-import org.apache.shardingsphere.readwritesplitting.rule.ReadwriteSplittingRule;
-import org.apache.shardingsphere.readwritesplitting.spi.ReplicaLoadBalanceAlgorithm;
-import org.apache.shardingsphere.spring.namespace.util.EmbedTestingServer;
-import org.apache.shardingsphere.spring.namespace.util.FieldValueUtil;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-
-import java.util.Optional;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-@ContextConfiguration(locations = "classpath:META-INF/rdb/cluster-application-context-readwrite-splitting.xml")
-public final class SpringNamespaceWithReadwriteSplittingForClusterTest extends AbstractJUnit4SpringContextTests {
-
- @BeforeClass
- public static void init() {
- EmbedTestingServer.start();
- }
-
- @Test
- public void assertReadwriteSplittingDataSourceType() {
- assertNotNull(applicationContext.getBean("defaultGovernanceDataSource", ShardingSphereDataSource.class));
- }
-
- @Test
- public void assertReadwriteSplittingDataSource() {
- Optional<ReadwriteSplittingRule> rule = getReadwriteSplittingRule("defaultGovernanceDataSource");
- assertTrue(rule.isPresent());
- Optional<ReadwriteSplittingDataSourceRule> dataSourceRule = rule.get().findDataSourceRule("default_dbtbl_0");
- assertTrue(dataSourceRule.isPresent());
- assertTrue(dataSourceRule.get().getReadDataSourceNames().contains("dbtbl_0_read_0"));
- assertTrue(dataSourceRule.get().getReadDataSourceNames().contains("dbtbl_0_read_1"));
- }
-
- @Test
- public void assertTypeReadwriteSplittingDataSource() {
- Optional<ReadwriteSplittingRule> randomRule = getReadwriteSplittingRule("randomGovernanceDataSource");
- assertTrue(randomRule.isPresent());
- Optional<ReadwriteSplittingDataSourceRule> randomDataSourceRule = randomRule.get().findDataSourceRule("random_dbtbl_0");
- assertTrue(randomDataSourceRule.isPresent());
- assertTrue(randomDataSourceRule.get().getLoadBalancer() instanceof RandomReplicaLoadBalanceAlgorithm);
- Optional<ReadwriteSplittingRule> roundRobinRule = getReadwriteSplittingRule("roundRobinGovernanceDataSource");
- assertTrue(roundRobinRule.isPresent());
- Optional<ReadwriteSplittingDataSourceRule> roundRobinDataSourceRule = roundRobinRule.get().findDataSourceRule("roundRobin_dbtbl_0");
- assertTrue(roundRobinDataSourceRule.isPresent());
- assertTrue(roundRobinDataSourceRule.get().getLoadBalancer() instanceof RoundRobinReplicaLoadBalanceAlgorithm);
- }
-
- @Test
- public void assertRefReadwriteSplittingDataSource() {
- ReplicaLoadBalanceAlgorithm randomLoadBalanceAlgorithm = applicationContext.getBean("randomLoadBalanceAlgorithm", ReplicaLoadBalanceAlgorithm.class);
- Optional<ReadwriteSplittingRule> rule = getReadwriteSplittingRule("refGovernanceDataSource");
- assertTrue(rule.isPresent());
- Optional<ReadwriteSplittingDataSourceRule> dataSourceRule = rule.get().findDataSourceRule("random_dbtbl_1");
- assertTrue(dataSourceRule.isPresent());
- // TODO load balance algorithm have been construct twice for SpringDatasource extends ReplicaQueryDatasource. just assert type for temp
- assertThat(dataSourceRule.get().getLoadBalancer().getType(), is(randomLoadBalanceAlgorithm.getType()));
- }
-
- private Optional<ReadwriteSplittingRule> getReadwriteSplittingRule(final String dataSourceName) {
- ShardingSphereDataSource dataSource = applicationContext.getBean(dataSourceName, ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(dataSource, "contextManager");
- return contextManager.getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getRuleMetaData().getRules().stream().filter(each
- -> each instanceof ReadwriteSplittingRule).map(each -> (ReadwriteSplittingRule) each).findFirst();
- }
-
- @Test
- public void assertProperties() {
- boolean showSQL = getProperties("defaultGovernanceDataSource").getValue(ConfigurationPropertyKey.SQL_SHOW);
- assertTrue(showSQL);
- }
-
- private ConfigurationProperties getProperties(final String dataSourceName) {
- ShardingSphereDataSource dataSource = applicationContext.getBean(dataSourceName, ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(dataSource, "contextManager");
- return contextManager.getMetaDataContexts().getProps();
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithShardingAndReadwriteSplittingForClusterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithShardingAndReadwriteSplittingForClu [...]
deleted file mode 100644
index 20ed2d7..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithShardingAndReadwriteSplittingForClusterTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace;
-
-import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
-import org.apache.shardingsphere.infra.database.DefaultSchema;
-import org.apache.shardingsphere.mode.manager.ContextManager;
-import org.apache.shardingsphere.sharding.rule.ShardingRule;
-import org.apache.shardingsphere.spring.namespace.util.EmbedTestingServer;
-import org.apache.shardingsphere.spring.namespace.util.FieldValueUtil;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-
-import javax.sql.DataSource;
-import java.util.Map;
-import java.util.Optional;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertThat;
-
-@ContextConfiguration(locations = "classpath:META-INF/rdb/cluster-application-context-sharding-readwrite-splitting.xml")
-public final class SpringNamespaceWithShardingAndReadwriteSplittingForClusterTest extends AbstractJUnit4SpringContextTests {
-
- @BeforeClass
- public static void init() {
- EmbedTestingServer.start();
- }
-
- @Test
- public void assertReadwriteSplittingShardingDataSourceByUserStrategy() {
- Map<String, DataSource> dataSourceMap = getDataSourceMap("dataSourceByUserStrategyGovernance");
- assertNotNull(dataSourceMap.get("dbtbl_write_0"));
- assertNotNull(dataSourceMap.get("dbtbl_0_read_0"));
- assertNotNull(dataSourceMap.get("dbtbl_0_read_1"));
- assertNotNull(dataSourceMap.get("dbtbl_write_1"));
- assertNotNull(dataSourceMap.get("dbtbl_1_read_0"));
- assertNotNull(dataSourceMap.get("dbtbl_1_read_1"));
- Optional<ShardingRule> shardingRule = getShardingRule("dataSourceByUserStrategyGovernance");
- assertTrue(shardingRule.isPresent());
- assertThat(shardingRule.get().getTableRules().size(), is(1));
- assertThat(shardingRule.get().getTableRules().values().iterator().next().getLogicTable(), is("t_order"));
- }
-
- private Map<String, DataSource> getDataSourceMap(final String dataSourceName) {
- ShardingSphereDataSource shardingSphereDataSource = applicationContext.getBean(dataSourceName, ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(shardingSphereDataSource, "contextManager");
- return contextManager.getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getResource().getDataSources();
- }
-
- private Optional<ShardingRule> getShardingRule(final String dataSourceName) {
- ShardingSphereDataSource shardingSphereDataSource = applicationContext.getBean(dataSourceName, ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(shardingSphereDataSource, "contextManager");
- return contextManager.getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getRuleMetaData().getRules().stream().filter(
- each -> each instanceof ShardingRule).map(each -> (ShardingRule) each).findFirst();
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithShardingForClusterTest.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithShardingForClusterTest.java
deleted file mode 100644
index 3a8ec31..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/SpringNamespaceWithShardingForClusterTest.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace;
-
-import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
-import org.apache.shardingsphere.infra.database.DefaultSchema;
-import org.apache.shardingsphere.infra.datanode.DataNode;
-import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
-import org.apache.shardingsphere.mode.manager.ContextManager;
-import org.apache.shardingsphere.sharding.rule.BindingTableRule;
-import org.apache.shardingsphere.sharding.rule.ShardingRule;
-import org.apache.shardingsphere.sharding.rule.TableRule;
-import org.apache.shardingsphere.spring.namespace.fixture.keygen.IncrementKeyGenerateAlgorithm;
-import org.apache.shardingsphere.spring.namespace.util.EmbedTestingServer;
-import org.apache.shardingsphere.spring.namespace.util.FieldValueUtil;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
-
-import javax.sql.DataSource;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-@ContextConfiguration(locations = "classpath:META-INF/rdb/cluster-application-context-sharding.xml")
-public final class SpringNamespaceWithShardingForClusterTest extends AbstractJUnit4SpringContextTests {
-
- @BeforeClass
- public static void init() {
- EmbedTestingServer.start();
- }
-
- @Test
- public void assertSimpleShardingSphereDataSource() {
- Map<String, DataSource> dataSourceMap = getDataSourceMap("simpleShardingGovernance");
- ShardingRule shardingRule = getShardingRule("simpleShardingGovernance");
- assertNotNull(dataSourceMap.get("dbtbl_0"));
- assertThat(shardingRule.getTableRules().size(), is(1));
- assertThat(shardingRule.getTableRules().values().iterator().next().getLogicTable(), is("t_order"));
- }
-
- @Test
- public void assertShardingRuleWithAttributesDataSource() {
- Map<String, DataSource> dataSourceMap = getDataSourceMap("shardingRuleWithAttributesDataSourceGovernance");
- ShardingRule shardingRule = getShardingRule("shardingRuleWithAttributesDataSourceGovernance");
- assertNotNull(dataSourceMap.get("dbtbl_0"));
- assertNotNull(dataSourceMap.get("dbtbl_1"));
- assertThat(shardingRule.getDefaultKeyGenerateAlgorithm().getClass().getName(), is(IncrementKeyGenerateAlgorithm.class.getName()));
- }
-
- @Test
- public void assertTableRuleWithAttributesDataSource() {
- ShardingRule shardingRule = getShardingRule("tableRuleWithAttributesDataSourceGovernance");
- assertThat(shardingRule.getTableRules().size(), is(1));
- TableRule tableRule = shardingRule.getTableRules().values().iterator().next();
- assertThat(tableRule.getLogicTable(), is("t_order"));
- assertThat(tableRule.getActualDataNodes().size(), is(8));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_0", "t_order_0")));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_0", "t_order_1")));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_0", "t_order_2")));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_0", "t_order_3")));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_1", "t_order_0")));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_1", "t_order_1")));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_1", "t_order_2")));
- assertTrue(tableRule.getActualDataNodes().contains(new DataNode("dbtbl_1", "t_order_3")));
- assertTrue(tableRule.getGenerateKeyColumn().isPresent());
- assertThat(tableRule.getGenerateKeyColumn().get(), is("order_id"));
- assertThat(tableRule.getKeyGeneratorName(), is("incrementAlgorithm"));
- }
-
- @Test
- public void assertMultiTableRulesDataSource() {
- ShardingRule shardingRule = getShardingRule("multiTableRulesDataSourceGovernance");
- assertThat(shardingRule.getTableRules().size(), is(2));
- Iterator<TableRule> tableRules = shardingRule.getTableRules().values().iterator();
- assertThat(tableRules.next().getLogicTable(), is("t_order"));
- assertThat(tableRules.next().getLogicTable(), is("t_order_item"));
- }
-
- @Test
- public void assertBindingTableRuleDatasource() {
- ShardingRule shardingRule = getShardingRule("bindingTableRuleDatasourceGovernance");
- assertThat(shardingRule.getBindingTableRules().size(), is(2));
- BindingTableRule bindingTableRule = shardingRule.getBindingTableRules().get("t_order");
- assertThat(bindingTableRule.getBindingActualTable("dbtbl_0", "t_order", "t_order_item", "t_order_item"), is("t_order"));
- assertThat(bindingTableRule.getBindingActualTable("dbtbl_1", "t_order", "t_order_item", "t_order_item"), is("t_order"));
- }
-
- @Test
- public void assertMultiBindingTableRulesDatasource() {
- ShardingRule shardingRule = getShardingRule("multiBindingTableRulesDatasourceGovernance");
- assertThat(shardingRule.getBindingTableRules().size(), is(4));
- BindingTableRule orderRule = shardingRule.getBindingTableRules().get("t_order");
- assertThat(orderRule.getBindingActualTable("dbtbl_0", "t_order", "t_order_item", "t_order_item"), is("t_order"));
- assertThat(orderRule.getBindingActualTable("dbtbl_1", "t_order", "t_order_item", "t_order_item"), is("t_order"));
- BindingTableRule userRule = shardingRule.getBindingTableRules().get("t_user");
- assertThat(userRule.getBindingActualTable("dbtbl_0", "t_user", "t_user_detail", "t_user_detail"), is("t_user"));
- assertThat(userRule.getBindingActualTable("dbtbl_1", "t_user", "t_user_detail", "t_user_detail"), is("t_user"));
- }
-
- @Test
- public void assertBroadcastTableRuleDatasource() {
- ShardingRule shardingRule = getShardingRule("broadcastTableRuleDatasourceGovernance");
- assertThat(shardingRule.getBroadcastTables().size(), is(1));
- assertThat(shardingRule.getBroadcastTables().iterator().next(), is("t_config"));
- }
-
- @Test
- public void assertMultiBroadcastTableRulesDatasource() {
- ShardingRule shardingRule = getShardingRule("multiBroadcastTableRulesDatasourceGovernance");
- assertThat(shardingRule.getBroadcastTables().size(), is(2));
- assertThat(new LinkedList<>(shardingRule.getBroadcastTables()).get(0), is("t_config1"));
- assertThat(new LinkedList<>(shardingRule.getBroadcastTables()).get(1), is("t_config2"));
- }
-
- @Test
- public void assertPropsDataSource() {
- ShardingSphereDataSource shardingSphereDataSource = applicationContext.getBean("propsDataSourceGovernance", ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(shardingSphereDataSource, "contextManager");
- assertTrue(contextManager.getMetaDataContexts().getProps().<Boolean>getValue(ConfigurationPropertyKey.SQL_SHOW));
- boolean showSql = contextManager.getMetaDataContexts().getProps().getValue(ConfigurationPropertyKey.SQL_SHOW);
- assertTrue(showSql);
- int executorSize = contextManager.getMetaDataContexts().getProps().getValue(ConfigurationPropertyKey.KERNEL_EXECUTOR_SIZE);
- assertThat(executorSize, is(10));
- }
-
- @Test
- public void assertShardingSphereDataSourceType() {
- assertTrue(applicationContext.getBean("simpleShardingGovernance") instanceof ShardingSphereDataSource);
- }
-
- @Test
- public void assertDefaultActualDataNodes() {
- ShardingSphereDataSource multiTableRulesDataSource = applicationContext.getBean("multiTableRulesDataSourceGovernance", ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(multiTableRulesDataSource, "contextManager");
- Iterator<ShardingSphereRule> iterator = contextManager.getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getRuleMetaData().getRules().iterator();
- ShardingRule shardingRule = (ShardingRule) iterator.next();
- assertThat(shardingRule.getTableRules().size(), is(2));
- Iterator<TableRule> tableRules = shardingRule.getTableRules().values().iterator();
- TableRule orderRule = tableRules.next();
- assertThat(orderRule.getActualDataNodes().size(), is(2));
- assertTrue(orderRule.getActualDataNodes().contains(new DataNode("dbtbl_0", "t_order")));
- assertTrue(orderRule.getActualDataNodes().contains(new DataNode("dbtbl_1", "t_order")));
- TableRule orderItemRule = tableRules.next();
- assertThat(orderItemRule.getActualDataNodes().size(), is(2));
- assertTrue(orderItemRule.getActualDataNodes().contains(new DataNode("dbtbl_0", "t_order_item")));
- assertTrue(orderItemRule.getActualDataNodes().contains(new DataNode("dbtbl_1", "t_order_item")));
- }
-
- @Test
- public void assertEmptyConfigurationShardingSphereDataSource() {
- assertTrue(applicationContext.getBean("emptyConfigurationDataSourceGovernance") instanceof ShardingSphereDataSource);
- }
-
- private Map<String, DataSource> getDataSourceMap(final String dataSourceName) {
- ShardingSphereDataSource shardingSphereDataSource = applicationContext.getBean(dataSourceName, ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(shardingSphereDataSource, "contextManager");
- return contextManager.getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getResource().getDataSources();
- }
-
- private ShardingRule getShardingRule(final String dataSourceName) {
- ShardingSphereDataSource shardingSphereDataSource = applicationContext.getBean(dataSourceName, ShardingSphereDataSource.class);
- ContextManager contextManager = (ContextManager) FieldValueUtil.getFieldValue(shardingSphereDataSource, "contextManager");
- Iterator<ShardingSphereRule> iterator = contextManager.getMetaDataContexts().getMetaData(DefaultSchema.LOGIC_NAME).getRuleMetaData().getRules().iterator();
- return (ShardingRule) iterator.next();
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/keygen/DecrementKeyGenerateAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/StandaloneModeSpringNamespaceTest.java
similarity index 58%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/keygen/DecrementKeyGenerateAlgorithm.java
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/StandaloneModeSpringNamespaceTest.java
index e9e490e..246a591 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/keygen/DecrementKeyGenerateAlgorithm.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/StandaloneModeSpringNamespaceTest.java
@@ -15,27 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.spring.namespace.fixture.keygen;
+package org.apache.shardingsphere.spring.namespace;
-import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm;
+import org.springframework.test.context.ContextConfiguration;
-import java.util.concurrent.atomic.AtomicInteger;
-
-public final class DecrementKeyGenerateAlgorithm implements KeyGenerateAlgorithm {
-
- private final AtomicInteger sequence = new AtomicInteger(100);
-
- @Override
- public void init() {
- }
-
- @Override
- public Comparable<?> generateKey() {
- return sequence.decrementAndGet();
- }
-
- @Override
- public String getType() {
- return "DECREMENT";
- }
+@ContextConfiguration(locations = "classpath:spring/standalone-application-context.xml")
+public final class StandaloneModeSpringNamespaceTest extends AbstractSpringNamespaceTest {
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/repository/TestClusterPersistRepository.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/FixtureClusterPersistRepository.java
similarity index 93%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/repository/TestClusterPersistRepository.java
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/FixtureClusterPersistRepository.java
index fd9f1e0..efa35a5 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/repository/TestClusterPersistRepository.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/FixtureClusterPersistRepository.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.spring.namespace.fixture.repository;
+package org.apache.shardingsphere.spring.namespace.fixture;
import org.apache.shardingsphere.infra.database.DefaultSchema;
import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
@@ -28,7 +28,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-public final class TestClusterPersistRepository implements ClusterPersistRepository {
+public final class FixtureClusterPersistRepository implements ClusterPersistRepository {
private final Map<String, String> registryData = new LinkedHashMap<>();
@@ -86,6 +86,6 @@ public final class TestClusterPersistRepository implements ClusterPersistReposit
@Override
public String getType() {
- return "TestRegistry";
+ return "Fixture";
}
}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/keygen/IncrementKeyGenerateAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/keygen/IncrementKeyGenerateAlgorithm.java
deleted file mode 100644
index 74097a6..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/keygen/IncrementKeyGenerateAlgorithm.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace.fixture.keygen;
-
-import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-public final class IncrementKeyGenerateAlgorithm implements KeyGenerateAlgorithm {
-
- private final AtomicInteger sequence = new AtomicInteger(100);
-
- @Override
- public void init() {
- }
-
- @Override
- public Comparable<?> generateKey() {
- return sequence.incrementAndGet();
- }
-
- @Override
- public String getType() {
- return "INCREMENT";
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/DefaultComplexKeysShardingAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/DefaultComplexKeysShardingAlgorithm.java
deleted file mode 100644
index 9e997c5..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/DefaultComplexKeysShardingAlgorithm.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace.fixture.sharding;
-
-import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardingAlgorithm;
-import org.apache.shardingsphere.sharding.api.sharding.complex.ComplexKeysShardingValue;
-
-import java.util.Collection;
-
-public final class DefaultComplexKeysShardingAlgorithm implements ComplexKeysShardingAlgorithm<Integer> {
-
- @Override
- public void init() {
- }
-
- @Override
- public Collection<String> doSharding(final Collection<String> availableTargetNames, final ComplexKeysShardingValue<Integer> shardingValue) {
- return availableTargetNames;
- }
-
- @Override
- public String getType() {
- return "COMPLEX_TEST";
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/DefaultHintShardingAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/DefaultHintShardingAlgorithm.java
deleted file mode 100644
index d0928d2..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/DefaultHintShardingAlgorithm.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace.fixture.sharding;
-
-import org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingAlgorithm;
-import org.apache.shardingsphere.sharding.api.sharding.hint.HintShardingValue;
-
-import java.util.Collection;
-
-public final class DefaultHintShardingAlgorithm implements HintShardingAlgorithm<Integer> {
-
- @Override
- public void init() {
- }
-
- @Override
- public Collection<String> doSharding(final Collection<String> availableTargetNames, final HintShardingValue<Integer> shardingValue) {
- return availableTargetNames;
- }
-
- @Override
- public String getType() {
- return "HINT_TEST";
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/StandardModuloDatabaseShardingAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/StandardModuloDatabaseShardingAlgorithm.java
deleted file mode 100644
index b77a1ad..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/StandardModuloDatabaseShardingAlgorithm.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace.fixture.sharding;
-
-import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-
-public final class StandardModuloDatabaseShardingAlgorithm implements StandardShardingAlgorithm<Integer> {
-
- @Override
- public void init() {
- }
-
- @Override
- public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Integer> shardingValue) {
- for (String each : availableTargetNames) {
- if (each.endsWith(String.valueOf(shardingValue.getValue() % 2))) {
- return each;
- }
- }
- throw new UnsupportedOperationException("");
- }
-
- @Override
- public Collection<String> doSharding(final Collection<String> availableTargetNames, final RangeShardingValue<Integer> shardingValue) {
- Collection<String> result = new LinkedHashSet<>(availableTargetNames.size());
- for (Integer i = shardingValue.getValueRange().lowerEndpoint(); i <= shardingValue.getValueRange().upperEndpoint(); i++) {
- for (String each : availableTargetNames) {
- if (each.endsWith(String.valueOf(i % 2))) {
- result.add(each);
- }
- }
- }
- return result;
- }
-
- @Override
- public String getType() {
- return "STANDARD_TEST_DB";
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/StandardModuloTableShardingAlgorithm.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/StandardModuloTableShardingAlgorithm.java
deleted file mode 100644
index bc243e8..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/fixture/sharding/StandardModuloTableShardingAlgorithm.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace.fixture.sharding;
-
-import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
-import org.apache.shardingsphere.sharding.api.sharding.standard.StandardShardingAlgorithm;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-
-public final class StandardModuloTableShardingAlgorithm implements StandardShardingAlgorithm<Integer> {
-
- @Override
- public void init() {
- }
-
- @Override
- public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Integer> shardingValue) {
- for (String each : availableTargetNames) {
- if (each.endsWith(String.valueOf(shardingValue.getValue() % 4))) {
- return each;
- }
- }
- throw new UnsupportedOperationException("");
- }
-
- @Override
- public Collection<String> doSharding(final Collection<String> availableTargetNames, final RangeShardingValue<Integer> shardingValue) {
- Collection<String> result = new LinkedHashSet<>(availableTargetNames.size());
- for (Integer i = shardingValue.getValueRange().lowerEndpoint(); i <= shardingValue.getValueRange().upperEndpoint(); i++) {
- for (String each : availableTargetNames) {
- if (each.endsWith(String.valueOf(i % 4))) {
- result.add(each);
- }
- }
- }
- return result;
- }
-
- @Override
- public String getType() {
- return "STANDARD_TEST_TBL";
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/util/EmbedTestingServer.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/util/EmbedTestingServer.java
deleted file mode 100644
index 03f46d5..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/util/EmbedTestingServer.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace.util;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.apache.curator.test.TestingServer;
-import org.apache.zookeeper.KeeperException.ConnectionLossException;
-import org.apache.zookeeper.KeeperException.NoNodeException;
-import org.apache.zookeeper.KeeperException.NodeExistsException;
-
-import java.io.File;
-import java.io.IOException;
-
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class EmbedTestingServer {
-
- private static final int PORT = 3182;
-
- private static volatile TestingServer testingServer;
-
- /**
- * Start embed zookeeper server.
- */
- public static void start() {
- if (null != testingServer) {
- return;
- }
- try {
- testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime())));
- // CHECKSTYLE:OFF
- } catch (final Exception ex) {
- // CHECKSTYLE:ON
- if (!isIgnoredException(ex)) {
- throw new RuntimeException(ex);
- }
- } finally {
- Runtime.getRuntime().addShutdownHook(new Thread(() -> {
- try {
- testingServer.close();
- } catch (final IOException ignored) {
- }
- }));
- }
- }
-
- private static boolean isIgnoredException(final Throwable cause) {
- return cause instanceof ConnectionLossException || cause instanceof NoNodeException || cause instanceof NodeExistsException;
- }
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/util/FieldValueUtil.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/util/FieldValueUtil.java
deleted file mode 100644
index b71819c..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/java/org/apache/shardingsphere/spring/namespace/util/FieldValueUtil.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.spring.namespace.util;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import lombok.SneakyThrows;
-
-import java.lang.reflect.Field;
-
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class FieldValueUtil {
-
- /**
- * Get field value.
- *
- * @param obj obj
- * @param fieldName field name
- * @return field value
- */
- @SneakyThrows(ReflectiveOperationException.class)
- public static Object getFieldValue(final Object obj, final String fieldName) {
- Field field = obj.getClass().getDeclaredField(fieldName);
- field.setAccessible(true);
- return field.get(obj);
- }
-
-}
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-readwrite-splitting.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-readwrite-splitting.xml
deleted file mode 100644
index bfa0b53..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-readwrite-splitting.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xmlns:cluster="http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource
- http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster
- http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster/repository.xsd
- ">
- <import resource="namespace/readwrite-splitting-data-source-namespace.xml" />
-
- <cluster:repository id="clusterRepository" type="TestRegistry" namespace="regCenter" server-lists="localhost:3182">
- <props>
- <prop key="max-retries">3</prop>
- <prop key="operation-timeout-milliseconds">1000</prop>
- </props>
- </cluster:repository>
-
- <shardingsphere:data-source id="defaultGovernanceDataSource" data-source-names="dbtbl_write_0, dbtbl_0_read_0, dbtbl_0_read_1" rule-refs="defaultreadQueryRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- <props>
- <prop key="sql-show">${sql_show}</prop>
- <prop key="kernel-executor-size">10</prop>
- <prop key="foo">bar</prop>
- </props>
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="randomGovernanceDataSource" data-source-names="dbtbl_write_0, dbtbl_0_read_0, dbtbl_0_read_1" rule-refs="randomreadQueryRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="roundRobinGovernanceDataSource" data-source-names="dbtbl_write_0, dbtbl_0_read_0, dbtbl_0_read_1" rule-refs="roundRobinreadQueryRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="refGovernanceDataSource" data-source-names="dbtbl_write_1, dbtbl_1_read_0, dbtbl_1_read_1" rule-refs="refreadQueryRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-sharding-readwrite-splitting.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-sharding-readwrite-splitting.xml
deleted file mode 100644
index fe503bf..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-sharding-readwrite-splitting.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xmlns:cluster="http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource
- http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster
- http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster/repository.xsd">
- <import resource="namespace/sharding-readwrite-splitting-namespace.xml" />
-
- <cluster:repository id="clusterRepository" type="TestRegistry" namespace="regCenter" server-lists="localhost:3182">
- <props>
- <prop key="max-retries">3</prop>
- <prop key="operation-timeout-milliseconds">1000</prop>
- </props>
- </cluster:repository>
-
- <shardingsphere:data-source id="dataSourceByDefaultStrategyGovernance" data-source-names="dbtbl_write_0,dbtbl_0_read_0,dbtbl_0_read_1,dbtbl_write_1,dbtbl_1_read_0,dbtbl_1_read_1" rule-refs="readWriteSplittingShardingDataSourceByDefaultStrategyShardingRule, readWriteSplittingShardingDataSourceByDefaultStrategy">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="dataSourceByUserStrategyGovernance" data-source-names="dbtbl_write_0,dbtbl_0_read_0,dbtbl_0_read_1,dbtbl_write_1,dbtbl_1_read_0,dbtbl_1_read_1" rule-refs="readWriteSplittingShardingDataSourceByDefaultStrategyShardingRule, readWriteSplittingShardingDataSourceByUserStrategy">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-sharding.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-sharding.xml
deleted file mode 100644
index 1ae3f0a..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-sharding.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
- xmlns:cluster="http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/util
- https://www.springframework.org/schema/util/spring-util.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/datasource
- http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster
- http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster/repository.xsd
- ">
-
- <import resource="namespace/sharding-data-source-namespace.xml" />
-
- <util:properties id="instance-props">
- <prop key="max-retries">3</prop>
- <prop key="operation-timeout-milliseconds">1000</prop>
- </util:properties>
-
- <cluster:repository id="clusterRepository" type="TestRegistry" namespace="clusterPersistRepository" server-lists="localhost:3182">
- <props>
- <prop key="max-retries">3</prop>
- <prop key="operation-timeout-milliseconds">1000</prop>
- </props>
- </cluster:repository>
-
- <shardingsphere:data-source id="simpleShardingGovernance" data-source-names="dbtbl_0" rule-refs="simpleShardingDataSourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="shardingRuleWithAttributesDataSourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="shardingRuleWithAttributesDataSourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="multiTableRulesDataSourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="multiTableRulesDataSourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="tableRuleWithAttributesDataSourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="tableRuleWithAttributesDataSourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="bindingTableRuleDatasourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="bindingTableRuleDatasourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="multiBindingTableRulesDatasourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="multiBindingTableRulesDatasourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="broadcastTableRuleDatasourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="broadcastTableRuleDatasourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="multiBroadcastTableRulesDatasourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="multiBroadcastTableRulesDatasourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="propsDataSourceGovernance" data-source-names="dbtbl_0,dbtbl_1" rule-refs="propsDataSourceShardingRule">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- <props>
- <prop key="sql-show">${sql_show}</prop>
- <prop key="kernel-executor-size">10</prop>
- <prop key="foo">bar</prop>
- </props>
- </shardingsphere:data-source>
-
- <shardingsphere:data-source id="emptyConfigurationDataSourceGovernance">
- <shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
- </shardingsphere:data-source>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/datasource/data-source.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/datasource/data-source.xml
deleted file mode 100644
index 08e6378..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/datasource/data-source.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- ">
- <context:property-placeholder location="classpath:conf/conf.properties" ignore-unresolvable="true" />
-
- <bean id="dbtbl_0" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_0.driver}" />
- <property name="url" value="${dbtbl_0.url}" />
- <property name="username" value="${dbtbl_0.username}" />
- <property name="password" value="${dbtbl_0.password}" />
- </bean>
-
- <bean id="dbtbl_1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_1.driver}" />
- <property name="url" value="${dbtbl_1.url}" />
- <property name="username" value="${dbtbl_1.username}" />
- <property name="password" value="${dbtbl_1.password}" />
- </bean>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/datasource/readwrite-splitting-data-source.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/datasource/readwrite-splitting-data-source.xml
deleted file mode 100644
index b137866..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/datasource/readwrite-splitting-data-source.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns="http://www.springframework.org/schema/beans"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd
- ">
- <context:property-placeholder location="classpath:conf/readwrite_splitting_conf.properties" ignore-unresolvable="true" />
-
- <bean id="dbtbl_write_0" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_write_0.driver}"/>
- <property name="url" value="${dbtbl_write_0.url}" />
- <property name="username" value="${dbtbl_write_0.username}"/>
- <property name="password" value="${dbtbl_write_0.password}"/>
- </bean>
-
- <bean id="dbtbl_0_read_0" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_0_read_0.driver}"/>
- <property name="url" value="${dbtbl_0_read_0.url}" />
- <property name="username" value="${dbtbl_0_read_0.username}"/>
- <property name="password" value="${dbtbl_0_read_0.password}"/>
- </bean>
-
- <bean id="dbtbl_0_read_1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_0_read_1.driver}"/>
- <property name="url" value="${dbtbl_0_read_1.url}" />
- <property name="username" value="${dbtbl_0_read_1.username}"/>
- <property name="password" value="${dbtbl_0_read_1.password}"/>
- </bean>
-
- <bean id="dbtbl_write_1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_write_0.driver}"/>
- <property name="url" value="${dbtbl_write_1.url}" />
- <property name="username" value="${dbtbl_write_1.username}"/>
- <property name="password" value="${dbtbl_write_1.password}"/>
- </bean>
-
- <bean id="dbtbl_1_read_0" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_0_read_0.driver}"/>
- <property name="url" value="${dbtbl_1_read_0.url}" />
- <property name="username" value="${dbtbl_1_read_0.username}"/>
- <property name="password" value="${dbtbl_1_read_0.password}"/>
- </bean>
-
- <bean id="dbtbl_1_read_1" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
- <property name="driverClassName" value="${dbtbl_1_read_1.driver}"/>
- <property name="url" value="${dbtbl_1_read_1.url}" />
- <property name="username" value="${dbtbl_1_read_1.username}"/>
- <property name="password" value="${dbtbl_1_read_1.password}"/>
- </bean>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/encrypt-data-source-namespace.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/encrypt-data-source-namespace.xml
deleted file mode 100644
index adcdb96..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/encrypt-data-source-namespace.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:encrypt="http://shardingsphere.apache.org/schema/shardingsphere/encrypt"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/encrypt
- http://shardingsphere.apache.org/schema/shardingsphere/encrypt/encrypt.xsd
- ">
- <import resource="../datasource/data-source.xml" />
-
- <encrypt:encrypt-algorithm id="aes_encryptor" type="AES">
- <props>
- <prop key="aes-key-value">123456</prop>
- </props>
- </encrypt:encrypt-algorithm>
- <encrypt:encrypt-algorithm id="md5_encryptor" type="MD5" />
-
- <encrypt:rule id="encryptRule" query-with-cipher-column="false">
- <encrypt:table name="t_order">
- <encrypt:column logic-column="user_id" cipher-column="user_encrypt" plain-column="user_decrypt" encrypt-algorithm-ref="aes_encryptor" />
- <encrypt:column logic-column="order_id" cipher-column="order_encrypt" plain-column="order_decrypt" encrypt-algorithm-ref="md5_encryptor" />
- </encrypt:table>
- </encrypt:rule>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/readwrite-splitting-data-source-namespace.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/readwrite-splitting-data-source-namespace.xml
deleted file mode 100644
index e730ef7..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/readwrite-splitting-data-source-namespace.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:readwrite-splitting="http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting
- http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting/readwrite-splitting.xsd
- ">
- <import resource="../datasource/readwrite-splitting-data-source.xml" />
-
- <readwrite-splitting:load-balance-algorithm id="randomLoadBalanceAlgorithm" type="RANDOM" />
- <readwrite-splitting:load-balance-algorithm id="roundRobinLoadBalanceAlgorithm" type="ROUND_ROBIN" />
-
- <readwrite-splitting:rule id="defaultreadQueryRule">
- <readwrite-splitting:data-source-rule id="default_dbtbl_0" type="Static">
- <props>
- <prop key="write-data-source-name">dbtbl_write_0</prop>
- <prop key="read-data-source-names">dbtbl_0_read_0, dbtbl_0_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- </readwrite-splitting:rule>
-
- <readwrite-splitting:rule id="randomreadQueryRule">
- <readwrite-splitting:data-source-rule id="random_dbtbl_0" type="Static" load-balance-algorithm-ref="randomLoadBalanceAlgorithm">
- <props>
- <prop key="write-data-source-name">dbtbl_write_0</prop>
- <prop key="read-data-source-names">dbtbl_0_read_0, dbtbl_0_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- </readwrite-splitting:rule>
-
- <readwrite-splitting:rule id="roundRobinreadQueryRule">
- <readwrite-splitting:data-source-rule id="roundRobin_dbtbl_0" type="Static" load-balance-algorithm-ref="roundRobinLoadBalanceAlgorithm">
- <props>
- <prop key="write-data-source-name">dbtbl_write_0</prop>
- <prop key="read-data-source-names">dbtbl_0_read_0, dbtbl_0_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- </readwrite-splitting:rule>
-
- <readwrite-splitting:rule id="refreadQueryRule">
- <readwrite-splitting:data-source-rule id="random_dbtbl_1" type="Static" load-balance-algorithm-ref="randomLoadBalanceAlgorithm">
- <props>
- <prop key="write-data-source-name">dbtbl_write_1</prop>
- <prop key="read-data-source-names">dbtbl_1_read_0, dbtbl_1_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- </readwrite-splitting:rule>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/sharding-data-source-namespace.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/sharding-data-source-namespace.xml
deleted file mode 100644
index e49dc14..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/sharding-data-source-namespace.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sharding="http://shardingsphere.apache.org/schema/shardingsphere/sharding"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/sharding
- http://shardingsphere.apache.org/schema/shardingsphere/sharding/sharding.xsd
- ">
- <import resource="../datasource/data-source.xml" />
- <import resource="../datasource/readwrite-splitting-data-source.xml" />
-
- <sharding:sharding-algorithm id="standardModuloDatabaseShardingAlgorithm" type="STANDARD_TEST_DB"/>
- <sharding:sharding-algorithm id="standardModuloTableShardingAlgorithm" type="STANDARD_TEST_TBL"/>
- <sharding:sharding-algorithm id="defaultComplexKeysShardingAlgorithm" type="COMPLEX_TEST"/>
- <sharding:sharding-algorithm id="defaultHintShardingAlgorithm" type="HINT_TEST"/>
- <sharding:sharding-algorithm id="inlineStrategyShardingAlgorithm" type="INLINE">
- <props>
- <prop key="algorithm-expression">t_order_${order_id % 4}</prop>
- </props>
- </sharding:sharding-algorithm>
-
- <sharding:key-generate-algorithm id="incrementAlgorithm" type="INCREMENT" />
-
- <sharding:standard-strategy id="standardStrategy" sharding-column="user_id" algorithm-ref="standardModuloDatabaseShardingAlgorithm" />
- <sharding:complex-strategy id="complexStrategy" sharding-columns="order_id,user_id" algorithm-ref="defaultComplexKeysShardingAlgorithm" />
- <sharding:standard-strategy id="inlineStrategy" sharding-column="order_id" algorithm-ref="inlineStrategyShardingAlgorithm" />
- <sharding:hint-strategy id="hintStrategy" algorithm-ref="defaultHintShardingAlgorithm" />
- <sharding:none-strategy id="noneStrategy" />
-
- <sharding:key-generate-strategy id="keyGenerateStrategy" column="order_id" algorithm-ref="incrementAlgorithm" />
-
- <sharding:rule id="simpleShardingDataSourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- </sharding:table-rules>
- </sharding:rule>
-
- <sharding:rule id="shardingRuleWithAttributesDataSourceShardingRule" default-database-strategy-ref="standardStrategy" default-table-strategy-ref="inlineStrategy" default-key-generate-strategy-ref="keyGenerateStrategy">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- </sharding:table-rules>
- </sharding:rule>
-
- <sharding:rule id="tableRuleWithAttributesDataSourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" actual-data-nodes="dbtbl_${0..1}.t_order_${0..3}" database-strategy-ref="standardStrategy" table-strategy-ref="inlineStrategy" key-generate-strategy-ref="keyGenerateStrategy" />
- </sharding:table-rules>
- </sharding:rule>
-
- <sharding:rule id="multiTableRulesDataSourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- <sharding:table-rule logic-table="t_order_item" />
- </sharding:table-rules>
- </sharding:rule>
-
- <sharding:rule id="bindingTableRuleDatasourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- <sharding:table-rule logic-table="t_order_item" />
- </sharding:table-rules>
- <sharding:binding-table-rules>
- <sharding:binding-table-rule logic-tables="t_order, t_order_item" />
- </sharding:binding-table-rules>
- </sharding:rule>
-
- <sharding:rule id="multiBindingTableRulesDatasourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- <sharding:table-rule logic-table="t_order_item" />
- <sharding:table-rule logic-table="t_user" />
- <sharding:table-rule logic-table="t_user_detail" />
- </sharding:table-rules>
- <sharding:binding-table-rules>
- <sharding:binding-table-rule logic-tables="t_order, t_order_item" />
- <sharding:binding-table-rule logic-tables="t_user, t_user_detail" />
- </sharding:binding-table-rules>
- </sharding:rule>
-
- <sharding:rule id="broadcastTableRuleDatasourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- <sharding:table-rule logic-table="t_order_item" />
- </sharding:table-rules>
- <sharding:binding-table-rules>
- <sharding:binding-table-rule logic-tables="t_order, t_order_item" />
- </sharding:binding-table-rules>
- <sharding:broadcast-table-rules>
- <sharding:broadcast-table-rule table="t_config" />
- </sharding:broadcast-table-rules>
- </sharding:rule>
-
- <sharding:rule id="multiBroadcastTableRulesDatasourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- <sharding:table-rule logic-table="t_order_item" />
- </sharding:table-rules>
- <sharding:binding-table-rules>
- <sharding:binding-table-rule logic-tables="t_order, t_order_item" />
- </sharding:binding-table-rules>
- <sharding:broadcast-table-rules>
- <sharding:broadcast-table-rule table="t_config1" />
- <sharding:broadcast-table-rule table="t_config2" />
- </sharding:broadcast-table-rules>
- </sharding:rule>
-
- <sharding:rule id="propsDataSourceShardingRule">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" />
- </sharding:table-rules>
- </sharding:rule>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/sharding-readwrite-splitting-namespace.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/sharding-readwrite-splitting-namespace.xml
deleted file mode 100644
index ea4b741..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/namespace/sharding-readwrite-splitting-namespace.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sharding="http://shardingsphere.apache.org/schema/shardingsphere/sharding"
- xmlns:readwrite-splitting="http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/sharding
- http://shardingsphere.apache.org/schema/shardingsphere/sharding/sharding.xsd
- http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting
- http://shardingsphere.apache.org/schema/shardingsphere/readwrite-splitting/readwrite-splitting.xsd
- ">
- <import resource="../datasource/readwrite-splitting-data-source.xml" />
-
- <sharding:sharding-algorithm id="standardModuloDatabaseShardingAlgorithm" type="STANDARD_TEST_DB" />
- <sharding:sharding-algorithm id="standardModuloTableShardingAlgorithm" type="STANDARD_TEST_TBL" />
- <sharding:sharding-algorithm id="defaultComplexKeysShardingAlgorithm" type="COMPLEX_TEST" />
- <sharding:sharding-algorithm id="defaultHintShardingAlgorithm" type="HINT_TEST" />
- <sharding:sharding-algorithm id="inlineStrategyShardingAlgorithm" type="INLINE">
- <props>
- <prop key="algorithm-expression">t_order_${order_id % 4}</prop>
- </props>
- </sharding:sharding-algorithm>
-
- <sharding:key-generate-algorithm id="incrementAlgorithm" type="INCREMENT" />
-
- <sharding:standard-strategy id="standardStrategy" sharding-column="user_id" algorithm-ref="standardModuloDatabaseShardingAlgorithm" />
- <sharding:standard-strategy id="rangeStandardStrategy" sharding-column="order_id" algorithm-ref="standardModuloTableShardingAlgorithm" />
- <sharding:standard-strategy id="inlineStrategy" sharding-column="order_id" algorithm-ref="inlineStrategyShardingAlgorithm" />
- <sharding:hint-strategy id="hintStrategy" algorithm-ref="defaultHintShardingAlgorithm" />
- <sharding:none-strategy id="noneStrategy" />
-
- <sharding:key-generate-strategy id="keyGenerateStrategy" column="order_id" algorithm-ref="incrementAlgorithm" />
- <readwrite-splitting:load-balance-algorithm id="randomLoadBalanceAlgorithm" type="RANDOM" />
-
- <sharding:rule id="readWriteSplittingShardingDataSourceByDefaultStrategyShardingRule" default-key-generate-strategy-ref="keyGenerateStrategy">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" actual-data-nodes="dbtbl_${0..1}.t_order_${0..3}" database-strategy-ref="standardStrategy" table-strategy-ref="inlineStrategy" key-generate-strategy-ref="keyGenerateStrategy" />
- </sharding:table-rules>
- </sharding:rule>
- <readwrite-splitting:rule id="readWriteSplittingShardingDataSourceByDefaultStrategy">
- <readwrite-splitting:data-source-rule id="dbtbl_0" type="Static">
- <props>
- <prop key="write-data-source-name">dbtbl_write_0</prop>
- <prop key="read-data-source-names">dbtbl_0_read_0, dbtbl_0_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- <readwrite-splitting:data-source-rule id="dbtbl_1" type="Static">
- <props>
- <prop key="write-data-source-name">dbtbl_write_1</prop>
- <prop key="read-data-source-names">dbtbl_1_read_0, dbtbl_1_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- </readwrite-splitting:rule>
-
- <sharding:rule id="readWriteSplittingShardingDataSourceByUserStrategyShardingRule" default-key-generate-strategy-ref="keyGenerateStrategy">
- <sharding:table-rules>
- <sharding:table-rule logic-table="t_order" actual-data-nodes="dbtbl_${0..1}.t_order_${0..3}" database-strategy-ref="standardStrategy" table-strategy-ref="inlineStrategy" key-generate-strategy-ref="keyGenerateStrategy" />
- </sharding:table-rules>
- </sharding:rule>
- <readwrite-splitting:rule id="readWriteSplittingShardingDataSourceByUserStrategy">
- <readwrite-splitting:data-source-rule id="dbtbl_0" type="Static" load-balance-algorithm-ref="randomLoadBalanceAlgorithm">
- <props>
- <prop key="write-data-source-name">dbtbl_write_0</prop>
- <prop key="read-data-source-names">dbtbl_0_read_0, dbtbl_0_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- <readwrite-splitting:data-source-rule id="dbtbl_1" type="Static" load-balance-algorithm-ref="randomLoadBalanceAlgorithm">
- <props>
- <prop key="write-data-source-name">dbtbl_write_1</prop>
- <prop key="read-data-source-names">dbtbl_1_read_0, dbtbl_1_read_1</prop>
- </props>
- </readwrite-splitting:data-source-rule>
- </readwrite-splitting:rule>
-</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository
index e40e298..d88571c 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository
@@ -15,21 +15,4 @@
# limitations under the License.
#
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.spring.namespace.fixture.repository.TestClusterPersistRepository
+org.apache.shardingsphere.spring.namespace.fixture.FixtureClusterPersistRepository
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm
deleted file mode 100644
index 6eaf4b4..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.spring.namespace.fixture.keygen.DecrementKeyGenerateAlgorithm
-org.apache.shardingsphere.spring.namespace.fixture.keygen.IncrementKeyGenerateAlgorithm
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
deleted file mode 100644
index 1bf7a4b..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.sharding.spi.ShardingAlgorithm
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.spring.namespace.fixture.sharding.DefaultComplexKeysShardingAlgorithm
-org.apache.shardingsphere.spring.namespace.fixture.sharding.DefaultHintShardingAlgorithm
-org.apache.shardingsphere.spring.namespace.fixture.sharding.StandardModuloDatabaseShardingAlgorithm
-org.apache.shardingsphere.spring.namespace.fixture.sharding.StandardModuloTableShardingAlgorithm
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/conf/readwrite_splitting_conf.properties b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/conf/readwrite_splitting_conf.properties
deleted file mode 100644
index bd3315d..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/conf/readwrite_splitting_conf.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-dbtbl_write_0.driver=org.h2.Driver
-dbtbl_write_0.url=jdbc:h2:mem:dbtbl_write_0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_write_0.username=sa
-dbtbl_write_0.password=
-
-dbtbl_0_read_0.driver=org.h2.Driver
-dbtbl_0_read_0.url=jdbc:h2:mem:dbtbl_0_read_0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_0_read_0.username=sa
-dbtbl_0_read_0.password=
-
-dbtbl_0_read_1.driver=org.h2.Driver
-dbtbl_0_read_1.url=jdbc:h2:mem:dbtbl_0_read_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_0_read_1.username=sa
-dbtbl_0_read_1.password=
-
-
-dbtbl_write_1.driver=org.h2.Driver
-dbtbl_write_1.url=jdbc:h2:mem:dbtbl_write_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_write_1.username=sa
-dbtbl_write_1.password=
-
-dbtbl_1_read_0.driver=org.h2.Driver
-dbtbl_1_read_0.url=jdbc:h2:mem:dbtbl_1_read_0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_1_read_0.username=sa
-dbtbl_1_read_0.password=
-
-dbtbl_1_read_1.driver=org.h2.Driver
-dbtbl_1_read_1.url=jdbc:h2:mem:dbtbl_1_read_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_1_read_1.username=sa
-dbtbl_1_read_1.password=
-
-sql_show=true
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0.sql
deleted file mode 100644
index e9ec7b6..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_0`;
-CREATE SCHEMA `dbtbl_0`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-DROP TABLE IF EXISTS `t_config`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_config` (`id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_read_0.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_read_0.sql
deleted file mode 100644
index f0307d5..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_read_0.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_0_read_0`;
-CREATE SCHEMA `dbtbl_0_read_0`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-DROP TABLE IF EXISTS `t_config`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_config` (`id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_read_1.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_read_1.sql
deleted file mode 100644
index aacb304..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_read_1.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_0_read_1`;
-CREATE SCHEMA `dbtbl_0_read_1`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-DROP TABLE IF EXISTS `t_config`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_config` (`id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_write.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_write.sql
deleted file mode 100644
index c442b54..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_0_write.sql
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_write_0`;
-CREATE SCHEMA `dbtbl_write_0`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-DROP TABLE IF EXISTS `t_config`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_config` (`id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1.sql
deleted file mode 100644
index 9ae60ea..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1.sql
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_1`;
-CREATE SCHEMA `dbtbl_1`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-DROP TABLE IF EXISTS `t_config`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_read_0.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_read_0.sql
deleted file mode 100644
index 418e6e5..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_read_0.sql
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_1_read_0`;
-CREATE SCHEMA `dbtbl_1_read_0`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_read_1.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_read_1.sql
deleted file mode 100644
index 00e66c5..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_read_1.sql
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_1_read_1`;
-CREATE SCHEMA `dbtbl_1_read_1`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_write.sql b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_write.sql
deleted file mode 100644
index 26c91c9..0000000
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/schema/dbtbl_1_write.sql
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-DROP SCHEMA IF EXISTS `dbtbl_write_1`;
-CREATE SCHEMA `dbtbl_write_1`;
-DROP TABLE IF EXISTS `t_order_0`;
-DROP TABLE IF EXISTS `t_order_1`;
-DROP TABLE IF EXISTS `t_order_2`;
-DROP TABLE IF EXISTS `t_order_3`;
-DROP TABLE IF EXISTS `t_order_item_0`;
-DROP TABLE IF EXISTS `t_order_item_1`;
-DROP TABLE IF EXISTS `t_order_item_2`;
-DROP TABLE IF EXISTS `t_order_item_3`;
-CREATE TABLE `t_order_0` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_1` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_2` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_3` (`order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_id`));
-CREATE TABLE `t_order_item_0` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_1` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_2` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
-CREATE TABLE `t_order_item_3` (`order_item_id` INT NOT NULL, `order_id` INT NOT NULL, `user_id` INT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`order_item_id`));
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-encrypt.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/cluster-application-context.xml
similarity index 68%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-encrypt.xml
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/cluster-application-context.xml
index ecc0d81..9d197f0 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/rdb/cluster-application-context-encrypt.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/cluster-application-context.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
@@ -17,28 +18,37 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
xmlns:shardingsphere="http://shardingsphere.apache.org/schema/shardingsphere/datasource"
xmlns:cluster="http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context.xsd
http://shardingsphere.apache.org/schema/shardingsphere/datasource
http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster
http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/cluster/repository.xsd
">
- <import resource="namespace/encrypt-data-source-namespace.xml" />
+ <context:property-placeholder location="classpath:spring/conf/conf.properties" />
- <cluster:repository id="clusterRepository" type="TestRegistry" namespace="regCenter" server-lists="localhost:3182">
+ <import resource="included/data-sources-context.xml" />
+ <import resource="included/rules-context.xml" />
+
+ <cluster:repository id="clusterRepository" type="Fixture" namespace="regCenter" server-lists="localhost:3182">
<props>
<prop key="max-retries">3</prop>
<prop key="operation-timeout-milliseconds">1000</prop>
</props>
</cluster:repository>
- <shardingsphere:data-source id="encryptDataSourceGovernance" data-source-names="dbtbl_0" rule-refs="encryptRule">
+ <shardingsphere:data-source id="dataSource" data-source-names="ds_0_write,ds_0_read_0,ds_0_read_1,ds_1_write,ds_1_read_0,ds_1_read_1" rule-refs="shardingRule, readWriteSplittingRule, encryptRule, sqlParseRule">
<shardingsphere:mode type="Cluster" repository-ref="clusterRepository" />
<props>
- <prop key="sql-show">${sql_show}</prop>
+ <prop key="sql-show">false</prop>
+ <prop key="kernel-executor-size">${kernel-executor-size}</prop>
</props>
</shardingsphere:data-source>
+
+ <shardingsphere:tx-type-annotation-driven />
</beans>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/conf/conf.properties b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/conf/conf.properties
similarity index 72%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/conf/conf.properties
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/conf/conf.properties
index 64f493c..375d8d9 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/conf/conf.properties
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/conf/conf.properties
@@ -17,15 +17,3 @@
aes-key-value=123456
kernel-executor-size=10
-
-dbtbl_0.driver=org.h2.Driver
-dbtbl_0.url=jdbc:h2:mem:dbtbl_0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_0.username=sa
-dbtbl_0.password=
-
-dbtbl_1.driver=org.h2.Driver
-dbtbl_1.url=jdbc:h2:mem:dbtbl_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
-dbtbl_1.username=sa
-dbtbl_1.password=
-
-sql_show=true
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/included/data-sources-context.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/included/data-sources-context.xml
similarity index 100%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/included/data-sources-context.xml
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/included/data-sources-context.xml
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/included/rules-context.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/included/rules-context.xml
similarity index 99%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/included/rules-context.xml
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/included/rules-context.xml
index 1b2fdaf..c20c1ea 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/included/rules-context.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/included/rules-context.xml
@@ -79,7 +79,7 @@
</props>
</readwrite-splitting:data-source-rule>
</readwrite-splitting:rule>
-
+
<sql-parser:rule id="sqlParseRule" sql-comment-parse-enable="true" parse-tree-cache-ref="parseTreeCache" sql-statement-cache-ref="sqlStatementCache" />
<sql-parser:cache-option id="sqlStatementCache" initial-capacity="1024" maximum-size="1024" concurrency-level="4"/>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/memory-application-context.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/memory-application-context.xml
similarity index 96%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/memory-application-context.xml
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/memory-application-context.xml
index bba971a..ce31b92 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/memory-application-context.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/memory-application-context.xml
@@ -27,7 +27,7 @@
http://shardingsphere.apache.org/schema/shardingsphere/datasource
http://shardingsphere.apache.org/schema/shardingsphere/datasource/datasource.xsd
">
- <context:property-placeholder location="classpath:conf/conf.properties" />
+ <context:property-placeholder location="classpath:spring/conf/conf.properties" />
<import resource="included/data-sources-context.xml" />
<import resource="included/rules-context.xml" />
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/standalone-application-context.xml b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/standalone-application-context.xml
similarity index 91%
rename from shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/standalone-application-context.xml
rename to shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/standalone-application-context.xml
index 7b828ce..53328fc 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/META-INF/spring/standalone-application-context.xml
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-core-spring/shardingsphere-jdbc-core-spring-namespace/src/test/resources/spring/standalone-application-context.xml
@@ -30,19 +30,19 @@
http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/standalone
http://shardingsphere.apache.org/schema/shardingsphere/mode-repository/standalone/repository.xsd
">
- <context:property-placeholder location="classpath:conf/conf.properties" />
+ <context:property-placeholder location="classpath:spring/conf/conf.properties" />
<import resource="included/data-sources-context.xml" />
<import resource="included/rules-context.xml" />
- <standalone:repository id="local" type="File" >
+ <standalone:repository id="fileRepository" type="File" >
<props>
<prop key="path">target</prop>
</props>
</standalone:repository>
<shardingsphere:data-source id="dataSource" data-source-names="ds_0_write,ds_0_read_0,ds_0_read_1,ds_1_write,ds_1_read_0,ds_1_read_1" rule-refs="shardingRule, readWriteSplittingRule, encryptRule, sqlParseRule">
- <shardingsphere:mode type="Standalone" repository-ref="local" overwrite="true" />
+ <shardingsphere:mode type="Standalone" repository-ref="fileRepository" overwrite="true" />
<props>
<prop key="sql-show">false</prop>
<prop key="kernel-executor-size">${kernel-executor-size}</prop>
diff --git a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/prop/impl/HikariDataSourcePropertiesSetter.java b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/prop/impl/HikariDataSourcePropertiesSetter.java
index edcc9d0..af894c6 100644
--- a/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/prop/impl/HikariDataSourcePropertiesSetter.java
+++ b/shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/datasource/prop/impl/HikariDataSourcePropertiesSetter.java
@@ -38,8 +38,7 @@ public final class HikariDataSourcePropertiesSetter implements DataSourcePropert
Properties props = new Properties();
String dataSourcePropKey = prefix + dataSourceName.trim() + ".data-source-properties";
if (PropertyUtil.containPropertyPrefix(environment, dataSourcePropKey)) {
- Map<?, ?> datasourceProperties = PropertyUtil.handle(environment, dataSourcePropKey, Map.class);
- props.putAll(datasourceProperties);
+ props.putAll(PropertyUtil.handle(environment, dataSourcePropKey, Map.class));
Method method = dataSource.getClass().getMethod("setDataSourceProperties", Properties.class);
method.invoke(dataSource, props);
}