This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new a801141 Improve test coverage for shadow. (#13543)
a801141 is described below
commit a801141691c9ebf0e2caeb8c32d9185b5a2fd59e
Author: gin <[email protected]>
AuthorDate: Wed Nov 10 21:29:55 2021 +0800
Improve test coverage for shadow. (#13543)
---
.../shadow/hint/SimpleHintShadowAlgorithmTest.java | 6 +
.../shadow/route/ShadowSQLRouterTest.java | 129 +++++++++++++++++++++
.../route/engine/ShadowRouteEngineFactoryTest.java | 39 ++++++-
.../ShadowNonDMLStatementRoutingEngineTest.java | 113 ++++++++++++++++++
.../config/YamlShadowRuleConfigurationTest.java | 32 +++++
...orithmProviderConfigurationYamlSwapperTest.java | 5 +-
.../ShadowRuleConfigurationYamlSwapperTest.java | 3 +-
...urationsForYamlShadowRuleConfigurationTest.java | 2 +-
...adowDataSourceConfigurationYamlSwapperTest.java | 3 +-
.../ShadowTableConfigurationYamlSwapperTest.java | 3 +-
10 files changed, 322 insertions(+), 13 deletions(-)
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java
index 5bfc3ac..4d9f515 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/algorithm/shadow/hint/SimpleHintShadowAlgorithmTest.java
@@ -49,6 +49,7 @@ public final class SimpleHintShadowAlgorithmTest {
}
private void assertFalseCase() {
+ assertThat(shadowAlgorithm.isShadow(createShadowTableNames(), new
PreciseHintShadowValue<>("t_auto", ShadowOperationType.INSERT,
"/*shadow:true*/")), is(false));
assertThat(shadowAlgorithm.isShadow(createShadowTableNames(),
createNoteShadowValue("/**/")), is(false));
assertThat(shadowAlgorithm.isShadow(createShadowTableNames(),
createNoteShadowValue("/*")), is(false));
assertThat(shadowAlgorithm.isShadow(createShadowTableNames(),
createNoteShadowValue("aaa = bbb")), is(false));
@@ -72,4 +73,9 @@ public final class SimpleHintShadowAlgorithmTest {
shadowTableNames.add("t_order");
return shadowTableNames;
}
+
+ @Test
+ public void assertGetType() {
+ assertThat(shadowAlgorithm.getType(), is("SIMPLE_HINT"));
+ }
}
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/ShadowSQLRouterTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/ShadowSQLRouterTest.java
new file mode 100644
index 0000000..5dcb04d
--- /dev/null
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/ShadowSQLRouterTest.java
@@ -0,0 +1,129 @@
+/*
+ * 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.shadow.route;
+
+import org.apache.shardingsphere.infra.binder.LogicSQL;
+import
org.apache.shardingsphere.infra.config.properties.ConfigurationProperties;
+import org.apache.shardingsphere.infra.metadata.ShardingSphereMetaData;
+import org.apache.shardingsphere.infra.route.context.RouteContext;
+import org.apache.shardingsphere.infra.route.context.RouteMapper;
+import org.apache.shardingsphere.infra.route.context.RouteUnit;
+import
org.apache.shardingsphere.shadow.algorithm.config.AlgorithmProvidedShadowRuleConfiguration;
+import
org.apache.shardingsphere.shadow.algorithm.shadow.column.ColumnRegexMatchShadowAlgorithm;
+import
org.apache.shardingsphere.shadow.api.config.datasource.ShadowDataSourceConfiguration;
+import
org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
+import org.apache.shardingsphere.shadow.constant.ShadowOrder;
+import org.apache.shardingsphere.shadow.rule.ShadowRule;
+import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class ShadowSQLRouterTest {
+
+ private ShadowSQLRouter router;
+
+ @Before
+ public void init() {
+ router = new ShadowSQLRouter();
+ }
+
+ @Test
+ public void assertCreateRouteContext() {
+ RouteContext routeContext =
router.createRouteContext(mock(LogicSQL.class),
mock(ShardingSphereMetaData.class), mock(ShadowRule.class),
mock(ConfigurationProperties.class));
+ assertNotNull(routeContext);
+ }
+
+ @Test
+ public void assertDecorateRouteContext() {
+ router.decorateRouteContext(createRouteContext(),
mock(LogicSQL.class), mock(ShardingSphereMetaData.class), new
ShadowRule(createAlgorithmProvidedShadowRuleConfiguration()),
+ mock(ConfigurationProperties.class));
+ }
+
+ private AlgorithmProvidedShadowRuleConfiguration
createAlgorithmProvidedShadowRuleConfiguration() {
+ AlgorithmProvidedShadowRuleConfiguration result = new
AlgorithmProvidedShadowRuleConfiguration();
+ result.setEnable(false);
+ result.setDataSources(createDataSources());
+ result.setTables(createTables());
+ result.setShadowAlgorithms(createShadowAlgorithms());
+ return result;
+ }
+
+ private Map<String, ShadowAlgorithm> createShadowAlgorithms() {
+ Map<String, ShadowAlgorithm> result = new LinkedHashMap<>();
+ result.put("user-id-insert-regex-algorithm",
createColumnShadowAlgorithm());
+ return result;
+ }
+
+ private ShadowAlgorithm createColumnShadowAlgorithm() {
+ final ColumnRegexMatchShadowAlgorithm columnRegexMatchShadowAlgorithm
= new ColumnRegexMatchShadowAlgorithm();
+ Properties properties = new Properties();
+ properties.setProperty("column", "user_id");
+ properties.setProperty("operation", "insert");
+ properties.setProperty("regex", "[1]");
+ columnRegexMatchShadowAlgorithm.setProps(properties);
+ columnRegexMatchShadowAlgorithm.init();
+ return columnRegexMatchShadowAlgorithm;
+ }
+
+ private Map<String, ShadowTableConfiguration> createTables() {
+ Map<String, ShadowTableConfiguration> result = new LinkedHashMap<>();
+ Collection<String> shadowAlgorithmNames = new LinkedList<>();
+ shadowAlgorithmNames.add("user-id-insert-regex-algorithm");
+ result.put("t_order", new
ShadowTableConfiguration(Collections.singletonList("shadow-data-source"),
shadowAlgorithmNames));
+ return result;
+ }
+
+ private Map<String, ShadowDataSourceConfiguration> createDataSources() {
+ Map<String, ShadowDataSourceConfiguration> result = new
LinkedHashMap<>();
+ result.put("shadow-data-source", new
ShadowDataSourceConfiguration("ds", "ds_shadow"));
+ return result;
+ }
+
+ private RouteContext createRouteContext() {
+ RouteContext result = mock(RouteContext.class);
+ Collection<RouteUnit> routeUnits = new LinkedList<>();
+ Collection<RouteMapper> tableRouteMappers = new LinkedList<>();
+ tableRouteMappers.add(new RouteMapper("t_order", "t_order"));
+ routeUnits.add(new RouteUnit(new RouteMapper("shadow-data-source",
"shadow-data-source"), tableRouteMappers));
+ when(result.getRouteUnits()).thenReturn(routeUnits);
+ return result;
+ }
+
+ @Test
+ public void assertGetOrder() {
+ assertThat(router.getOrder(), is(ShadowOrder.ORDER));
+ }
+
+ @Test
+ public void getTypeClass() {
+ assertThat(router.getTypeClass() == ShadowRule.class, is(true));
+ }
+}
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/ShadowRouteEngineFactoryTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/ShadowRouteEngineFactoryTest.java
index afbc37e..ad3bbd8 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/ShadowRouteEngineFactoryTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/ShadowRouteEngineFactoryTest.java
@@ -20,9 +20,18 @@ package org.apache.shardingsphere.shadow.route.engine;
import com.google.common.collect.Lists;
import org.apache.shardingsphere.infra.binder.LogicSQL;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import
org.apache.shardingsphere.infra.binder.statement.dml.DeleteStatementContext;
import
org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
+import
org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
+import
org.apache.shardingsphere.infra.binder.statement.dml.UpdateStatementContext;
+import
org.apache.shardingsphere.shadow.route.engine.dml.ShadowDeleteStatementRoutingEngine;
import
org.apache.shardingsphere.shadow.route.engine.dml.ShadowInsertStatementRoutingEngine;
+import
org.apache.shardingsphere.shadow.route.engine.dml.ShadowSelectStatementRoutingEngine;
+import
org.apache.shardingsphere.shadow.route.engine.dml.ShadowUpdateStatementRoutingEngine;
+import
org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DeleteStatement;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement;
+import
org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
+import
org.apache.shardingsphere.sql.parser.sql.common.statement.dml.UpdateStatement;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
@@ -34,13 +43,37 @@ public final class ShadowRouteEngineFactoryTest {
@Test
public void assertNewInstance() {
- ShadowRouteEngine shadowRouteEngine =
ShadowRouteEngineFactory.newInstance(new LogicSQL(createSqlStatementContext(),
"", Lists.newArrayList()));
- assertThat(shadowRouteEngine instanceof
ShadowInsertStatementRoutingEngine, is(true));
+ ShadowRouteEngine shadowInsertRouteEngine =
ShadowRouteEngineFactory.newInstance(new
LogicSQL(createInsertSqlStatementContext(), "", Lists.newArrayList()));
+ assertThat(shadowInsertRouteEngine instanceof
ShadowInsertStatementRoutingEngine, is(true));
+ ShadowRouteEngine shadowUpdateRouteEngine =
ShadowRouteEngineFactory.newInstance(new
LogicSQL(createUpdateSqlStatementContext(), "", Lists.newArrayList()));
+ assertThat(shadowUpdateRouteEngine instanceof
ShadowUpdateStatementRoutingEngine, is(true));
+ ShadowRouteEngine shadowDeleteRouteEngine =
ShadowRouteEngineFactory.newInstance(new
LogicSQL(createDeleteSqlStatementContext(), "", Lists.newArrayList()));
+ assertThat(shadowDeleteRouteEngine instanceof
ShadowDeleteStatementRoutingEngine, is(true));
+ ShadowRouteEngine shadowSelectRouteEngine =
ShadowRouteEngineFactory.newInstance(new
LogicSQL(createSelectSqlStatementContext(), "", Lists.newArrayList()));
+ assertThat(shadowSelectRouteEngine instanceof
ShadowSelectStatementRoutingEngine, is(true));
}
- private SQLStatementContext<InsertStatement> createSqlStatementContext() {
+ private SQLStatementContext<InsertStatement>
createInsertSqlStatementContext() {
InsertStatementContext result = mock(InsertStatementContext.class);
when(result.getSqlStatement()).thenReturn(mock(InsertStatement.class));
return result;
}
+
+ private SQLStatementContext<UpdateStatement>
createUpdateSqlStatementContext() {
+ UpdateStatementContext result = mock(UpdateStatementContext.class);
+ when(result.getSqlStatement()).thenReturn(mock(UpdateStatement.class));
+ return result;
+ }
+
+ private SQLStatementContext<DeleteStatement>
createDeleteSqlStatementContext() {
+ DeleteStatementContext result = mock(DeleteStatementContext.class);
+ when(result.getSqlStatement()).thenReturn(mock(DeleteStatement.class));
+ return result;
+ }
+
+ private SQLStatementContext<SelectStatement>
createSelectSqlStatementContext() {
+ SelectStatementContext result = mock(SelectStatementContext.class);
+ when(result.getSqlStatement()).thenReturn(mock(SelectStatement.class));
+ return result;
+ }
}
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/impl/ShadowNonDMLStatementRoutingEngineTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/impl/ShadowNonDMLStatementRoutingEngineTest.java
new file mode 100644
index 0000000..3a66c4c
--- /dev/null
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/route/engine/impl/ShadowNonDMLStatementRoutingEngineTest.java
@@ -0,0 +1,113 @@
+/*
+ * 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.shadow.route.engine.impl;
+
+import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import
org.apache.shardingsphere.infra.binder.statement.ddl.CreateTableStatementContext;
+import org.apache.shardingsphere.infra.route.context.RouteContext;
+import org.apache.shardingsphere.infra.route.context.RouteMapper;
+import org.apache.shardingsphere.infra.route.context.RouteUnit;
+import
org.apache.shardingsphere.shadow.algorithm.config.AlgorithmProvidedShadowRuleConfiguration;
+import
org.apache.shardingsphere.shadow.algorithm.shadow.hint.SimpleHintShadowAlgorithm;
+import
org.apache.shardingsphere.shadow.api.config.datasource.ShadowDataSourceConfiguration;
+import
org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
+import org.apache.shardingsphere.shadow.rule.ShadowRule;
+import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
+import
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.CommentSegment;
+import
org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.ddl.MySQLCreateTableStatement;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Properties;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class ShadowNonDMLStatementRoutingEngineTest {
+
+ private ShadowNonDMLStatementRoutingEngine shadowRouteEngine;
+
+ @Before
+ public void init() {
+ shadowRouteEngine = new
ShadowNonDMLStatementRoutingEngine(createSQLStatementContext());
+ }
+
+ private SQLStatementContext<?> createSQLStatementContext() {
+ CreateTableStatementContext result =
mock(CreateTableStatementContext.class);
+ MySQLCreateTableStatement mySQLCreateTableStatement = new
MySQLCreateTableStatement();
+ Collection<CommentSegment> commentSegments = new LinkedList<>();
+ commentSegments.add(new CommentSegment("/*shadow:true*/", 0, 20));
+ mySQLCreateTableStatement.setCommentSegments(commentSegments);
+ when(result.getSqlStatement()).thenReturn(mySQLCreateTableStatement);
+ return result;
+ }
+
+ @Test
+ public void assertRoute() {
+ shadowRouteEngine.route(createRouteContext(), new
ShadowRule(createAlgorithmProvidedShadowRuleConfiguration()));
+ }
+
+ private RouteContext createRouteContext() {
+ RouteContext result = mock(RouteContext.class);
+ Collection<RouteUnit> routeUnits = new LinkedList<>();
+ Collection<RouteMapper> tableRouteMappers = new LinkedList<>();
+ tableRouteMappers.add(new RouteMapper("t_order", "t_order"));
+ routeUnits.add(new RouteUnit(new RouteMapper("ds", "ds"),
tableRouteMappers));
+ when(result.getRouteUnits()).thenReturn(routeUnits);
+ return result;
+ }
+
+ private AlgorithmProvidedShadowRuleConfiguration
createAlgorithmProvidedShadowRuleConfiguration() {
+ AlgorithmProvidedShadowRuleConfiguration result = new
AlgorithmProvidedShadowRuleConfiguration();
+ result.setEnable(true);
+ result.setDataSources(createDataSources());
+ result.setTables(createTables());
+ result.setShadowAlgorithms(createShadowAlgorithms());
+ return result;
+ }
+
+ private Map<String, ShadowDataSourceConfiguration> createDataSources() {
+ Map<String, ShadowDataSourceConfiguration> result = new
LinkedHashMap<>();
+ result.put("shadow-data-source", new
ShadowDataSourceConfiguration("ds", "ds_shadow"));
+ return result;
+ }
+
+ private Map<String, ShadowTableConfiguration> createTables() {
+ Map<String, ShadowTableConfiguration> result = new LinkedHashMap<>();
+ Collection<String> shadowAlgorithmNames = new LinkedList<>();
+ shadowAlgorithmNames.add("simple-hint-algorithm");
+ result.put("t_order", new
ShadowTableConfiguration(Collections.singletonList("shadow-data-source"),
shadowAlgorithmNames));
+ return result;
+ }
+
+ private Map<String, ShadowAlgorithm> createShadowAlgorithms() {
+ final Map<String, ShadowAlgorithm> result = new LinkedHashMap<>();
+ SimpleHintShadowAlgorithm simpleHintShadowAlgorithm = new
SimpleHintShadowAlgorithm();
+ Properties properties = new Properties();
+ properties.setProperty("shadow", "true");
+ simpleHintShadowAlgorithm.setProps(properties);
+ simpleHintShadowAlgorithm.init();
+ result.put("simple-hint-algorithm", simpleHintShadowAlgorithm);
+ return result;
+ }
+}
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/config/YamlShadowRuleConfigurationTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/config/YamlShadowRuleConfigurationTest.java
new file mode 100644
index 0000000..fd797b3
--- /dev/null
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/config/YamlShadowRuleConfigurationTest.java
@@ -0,0 +1,32 @@
+/*
+ * 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.shadow.yaml.config;
+
+import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public final class YamlShadowRuleConfigurationTest {
+
+ @Test
+ public void assertGetRuleConfigurationType() {
+ assertThat(new
YamlShadowRuleConfiguration().getRuleConfigurationType() ==
ShadowRuleConfiguration.class, is(true));
+ }
+}
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/ShadowRuleAlgorithmProviderConfigurationYamlSwapperTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleAlgorithmProviderConfigurationYamlSwapperTest.java
similarity index 97%
rename from
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/ShadowRuleAlgorithmProviderConfigurationYamlSwapperTest.java
rename to
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleAlgorithmProviderConfigurationYamlSwapperTest.java
index 7c74ec7..f889b2e 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/ShadowRuleAlgorithmProviderConfigurationYamlSwapperTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleAlgorithmProviderConfigurationYamlSwapperTest.java
@@ -15,18 +15,17 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.shadow.swapper;
+package org.apache.shardingsphere.shadow.yaml.swapper;
import
org.apache.shardingsphere.infra.yaml.config.pojo.algorithm.YamlShardingSphereAlgorithmConfiguration;
-import
org.apache.shardingsphere.shadow.algorithm.shadow.column.ColumnRegexMatchShadowAlgorithm;
import
org.apache.shardingsphere.shadow.algorithm.config.AlgorithmProvidedShadowRuleConfiguration;
+import
org.apache.shardingsphere.shadow.algorithm.shadow.column.ColumnRegexMatchShadowAlgorithm;
import
org.apache.shardingsphere.shadow.api.config.datasource.ShadowDataSourceConfiguration;
import
org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
import org.apache.shardingsphere.shadow.spi.ShadowAlgorithm;
import
org.apache.shardingsphere.shadow.yaml.config.YamlShadowRuleConfiguration;
import
org.apache.shardingsphere.shadow.yaml.config.datasource.YamlShadowDataSourceConfiguration;
import
org.apache.shardingsphere.shadow.yaml.config.table.YamlShadowTableConfiguration;
-import
org.apache.shardingsphere.shadow.yaml.swapper.ShadowRuleAlgorithmProviderConfigurationYamlSwapper;
import org.junit.Before;
import org.junit.Test;
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/ShadowRuleConfigurationYamlSwapperTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleConfigurationYamlSwapperTest.java
similarity index 94%
rename from
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/ShadowRuleConfigurationYamlSwapperTest.java
rename to
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleConfigurationYamlSwapperTest.java
index 0ef6a08..fbafa5e 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/ShadowRuleConfigurationYamlSwapperTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/ShadowRuleConfigurationYamlSwapperTest.java
@@ -15,11 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.shadow.swapper;
+package org.apache.shardingsphere.shadow.yaml.swapper;
import org.apache.shardingsphere.shadow.api.config.ShadowRuleConfiguration;
import
org.apache.shardingsphere.shadow.yaml.config.YamlShadowRuleConfiguration;
-import
org.apache.shardingsphere.shadow.yaml.swapper.ShadowRuleConfigurationYamlSwapper;
import org.junit.Before;
import org.junit.Test;
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/YamlRootRuleConfigurationsForYamlShadowRuleConfigurationTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/YamlRootRuleConfigurationsForYamlShadowRuleConfigurationTest.java
similarity index 97%
rename from
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/YamlRootRuleConfigurationsForYamlShadowRuleConfigurationTest.java
rename to
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/YamlRootRuleConfigurationsForYamlShadowRuleConfigurationTest.java
index 443810d..d729258 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/YamlRootRuleConfigurationsForYamlShadowRuleConfigurationTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/YamlRootRuleConfigurationsForYamlShadowRuleConfigurationTest.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.shadow.swapper;
+package org.apache.shardingsphere.shadow.yaml.swapper;
import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration;
import org.apache.shardingsphere.infra.yaml.engine.YamlEngine;
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/datasource/ShadowDataSourceConfigurationYamlSwapperTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/datasource/ShadowDataSourceConfigurationYamlSwapperTest.java
similarity index 93%
rename from
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/datasource/ShadowDataSourceConfigurationYamlSwapperTest.java
rename to
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/datasource/ShadowDataSourceConfigurationYamlSwapperTest.java
index 97a54cd..026906f 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/datasource/ShadowDataSourceConfigurationYamlSwapperTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/datasource/ShadowDataSourceConfigurationYamlSwapperTest.java
@@ -15,11 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.shadow.swapper.datasource;
+package org.apache.shardingsphere.shadow.yaml.swapper.datasource;
import
org.apache.shardingsphere.shadow.api.config.datasource.ShadowDataSourceConfiguration;
import
org.apache.shardingsphere.shadow.yaml.config.datasource.YamlShadowDataSourceConfiguration;
-import
org.apache.shardingsphere.shadow.yaml.swapper.datasource.ShadowDataSourceConfigurationYamlSwapper;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
similarity index 94%
rename from
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
rename to
shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
index 450bfe3..f28a861 100644
---
a/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
+++
b/shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/test/java/org/apache/shardingsphere/shadow/yaml/swapper/table/ShadowTableConfigurationYamlSwapperTest.java
@@ -15,11 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.shadow.swapper.table;
+package org.apache.shardingsphere.shadow.yaml.swapper.table;
import
org.apache.shardingsphere.shadow.api.config.table.ShadowTableConfiguration;
import
org.apache.shardingsphere.shadow.yaml.config.table.YamlShadowTableConfiguration;
-import
org.apache.shardingsphere.shadow.yaml.swapper.table.ShadowTableConfigurationYamlSwapper;
import org.junit.Test;
import java.util.Arrays;