You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by yx...@apache.org on 2022/07/29 00:52:40 UTC

[shardingsphere] branch master updated: Move FixtureRule to test-fixture module (#19659)

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

yx9o 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 9b9b3deb8b2 Move FixtureRule to test-fixture module (#19659)
9b9b3deb8b2 is described below

commit 9b9b3deb8b2fd1317d3af98a236ca1cec63c1e0e
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Fri Jul 29 08:52:32 2022 +0800

    Move FixtureRule to test-fixture module (#19659)
    
    * Move FixtureRule to test-fixture module
    
    * Rename FixtureDatabaseRule
    
    * Move FixtureRule to test-fixture module
    
    * Move FixtureRule to test-fixture module
    
    * Rename MockedRule
    
    * Fix checkstyle
---
 .../shardingsphere/sharding/rule/ShardingRule.java | 10 +++---
 .../executor/check/SQLCheckerFactoryTest.java      |  5 +--
 .../executor/check/fixture/SQLCheckerFixture.java  | 16 +++++-----
 .../fixture/FixtureExecutionPrepareDecorator.java  |  9 +++---
 .../ExecutionPrepareDecoratorFactoryTest.java      |  4 +--
 .../shardingsphere-infra-rewrite/pom.xml           |  7 +++++
 .../SQLRewriteContextDecoratorFactoryTest.java     |  4 +--
 .../infra/rewrite/fixture/FixtureRule.java         | 36 ----------------------
 .../fixture/FixtureSQLRewriteContextDecorator.java |  9 +++---
 .../{FixtureRule.java => FixtureDatabaseRule.java} |  4 +--
 ...uilder.java => FixtureDatabaseRuleBuilder.java} |  8 ++---
 ...infra.rule.builder.database.DatabaseRuleBuilder |  2 +-
 .../repository/standalone/jdbc/JDBCRepository.java |  2 +-
 .../test/fixture/rule/MockedRule.java              |  9 ++++--
 14 files changed, 51 insertions(+), 74 deletions(-)

diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
index 452d693cc35..a9fdf39e32f 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
@@ -725,11 +725,6 @@ public final class ShardingRule implements DatabaseRule, DataNodeContainedRule,
         return actualDataNodes.stream().filter(each -> each.getDataSourceName().equalsIgnoreCase(catalog)).findFirst().map(DataNode::getTableName);
     }
     
-    @Override
-    public String getType() {
-        return ShardingRule.class.getSimpleName();
-    }
-    
     private boolean isJoinConditionContainsShardingColumns(final ShardingSphereSchema schema, final SelectStatementContext select,
                                                            final Collection<String> tableNames, final Collection<WhereSegment> whereSegments) {
         Collection<String> databaseJoinConditionTables = new HashSet<>(tableNames.size());
@@ -816,4 +811,9 @@ public final class ShardingRule implements DatabaseRule, DataNodeContainedRule,
         }
         return result;
     }
+    
+    @Override
+    public String getType() {
+        return ShardingRule.class.getSimpleName();
+    }
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/SQLCheckerFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/SQLCheckerFactoryTest.java
index 9c05853b9cd..c17df04105a 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/SQLCheckerFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/SQLCheckerFactoryTest.java
@@ -18,8 +18,8 @@
 package org.apache.shardingsphere.infra.executor.check;
 
 import org.apache.shardingsphere.infra.executor.check.fixture.SQLCheckerFixture;
-import org.apache.shardingsphere.infra.executor.sql.fixture.FixtureRule;
 import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
+import org.apache.shardingsphere.test.fixture.rule.MockedRule;
 import org.junit.Test;
 
 import java.util.Collections;
@@ -32,9 +32,10 @@ import static org.mockito.Mockito.mock;
 
 public final class SQLCheckerFactoryTest {
     
+    @SuppressWarnings("rawtypes")
     @Test
     public void assertGetInstance() {
-        FixtureRule rule = mock(FixtureRule.class);
+        MockedRule rule = mock(MockedRule.class);
         Map<ShardingSphereRule, SQLChecker> actual = SQLCheckerFactory.getInstance(Collections.singleton(rule));
         assertThat(actual.size(), is(1));
         assertThat(actual.get(rule), instanceOf(SQLCheckerFixture.class));
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/fixture/SQLCheckerFixture.java b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/fixture/SQLCheckerFixture.java
index 6b8eea0edb7..001c62fb073 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/fixture/SQLCheckerFixture.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/check/fixture/SQLCheckerFixture.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.infra.executor.check.fixture;
 import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
 import org.apache.shardingsphere.infra.check.SQLCheckResult;
 import org.apache.shardingsphere.infra.executor.check.SQLChecker;
-import org.apache.shardingsphere.infra.executor.sql.fixture.FixtureRule;
+import org.apache.shardingsphere.test.fixture.rule.MockedRule;
 import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
 import org.apache.shardingsphere.infra.metadata.user.Grantee;
 
@@ -28,26 +28,26 @@ import java.util.List;
 import java.util.Map;
 import java.util.function.BiPredicate;
 
-public final class SQLCheckerFixture implements SQLChecker<FixtureRule> {
+public final class SQLCheckerFixture implements SQLChecker<MockedRule> {
     
     @Override
-    public boolean check(final String databaseName, final Grantee grantee, final FixtureRule rule) {
+    public boolean check(final String databaseName, final Grantee grantee, final MockedRule rule) {
         return false;
     }
     
     @Override
     public SQLCheckResult check(final SQLStatementContext<?> sqlStatementContext, final List<Object> parameters, final Grantee grantee, final String currentDatabase,
-                                final Map<String, ShardingSphereDatabase> databases, final FixtureRule rule) {
+                                final Map<String, ShardingSphereDatabase> databases, final MockedRule rule) {
         return null;
     }
     
     @Override
-    public boolean check(final Grantee grantee, final FixtureRule rule) {
+    public boolean check(final Grantee grantee, final MockedRule rule) {
         return false;
     }
     
     @Override
-    public boolean check(final Grantee grantee, final BiPredicate<Object, Object> validator, final Object cipher, final FixtureRule rule) {
+    public boolean check(final Grantee grantee, final BiPredicate<Object, Object> validator, final Object cipher, final MockedRule rule) {
         return false;
     }
     
@@ -57,7 +57,7 @@ public final class SQLCheckerFixture implements SQLChecker<FixtureRule> {
     }
     
     @Override
-    public Class<FixtureRule> getTypeClass() {
-        return FixtureRule.class;
+    public Class<MockedRule> getTypeClass() {
+        return MockedRule.class;
     }
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/fixture/FixtureExecutionPrepareDecorator.java b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/fixture/FixtureExecutionPrepareDecorator.java
index 05c7d7749b4..b68d7368164 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/fixture/FixtureExecutionPrepareDecorator.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/fixture/FixtureExecutionPrepareDecorator.java
@@ -20,14 +20,15 @@ package org.apache.shardingsphere.infra.executor.sql.fixture;
 import org.apache.shardingsphere.infra.executor.kernel.model.ExecutionGroup;
 import org.apache.shardingsphere.infra.executor.sql.prepare.ExecutionPrepareDecorator;
 import org.apache.shardingsphere.infra.route.context.RouteContext;
+import org.apache.shardingsphere.test.fixture.rule.MockedRule;
 
 import java.util.Collection;
 import java.util.Collections;
 
-public final class FixtureExecutionPrepareDecorator implements ExecutionPrepareDecorator<Object, FixtureRule> {
+public final class FixtureExecutionPrepareDecorator implements ExecutionPrepareDecorator<Object, MockedRule> {
     
     @Override
-    public Collection<ExecutionGroup<Object>> decorate(final RouteContext routeContext, final FixtureRule rule, final Collection<ExecutionGroup<Object>> executionGroups) {
+    public Collection<ExecutionGroup<Object>> decorate(final RouteContext routeContext, final MockedRule rule, final Collection<ExecutionGroup<Object>> executionGroups) {
         return Collections.emptyList();
     }
     
@@ -37,7 +38,7 @@ public final class FixtureExecutionPrepareDecorator implements ExecutionPrepareD
     }
     
     @Override
-    public Class<FixtureRule> getTypeClass() {
-        return FixtureRule.class;
+    public Class<MockedRule> getTypeClass() {
+        return MockedRule.class;
     }
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/prepare/ExecutionPrepareDecoratorFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/prepare/ExecutionPrepareDecoratorFactoryTest.java
index cc0bebe2a7d..de607fcc716 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/prepare/ExecutionPrepareDecoratorFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/prepare/ExecutionPrepareDecoratorFactoryTest.java
@@ -18,7 +18,7 @@
 package org.apache.shardingsphere.infra.executor.sql.prepare;
 
 import org.apache.shardingsphere.infra.executor.sql.fixture.FixtureExecutionPrepareDecorator;
-import org.apache.shardingsphere.infra.executor.sql.fixture.FixtureRule;
+import org.apache.shardingsphere.test.fixture.rule.MockedRule;
 import org.junit.Test;
 
 import java.util.Collections;
@@ -30,7 +30,7 @@ public final class ExecutionPrepareDecoratorFactoryTest {
     
     @Test
     public void assertGetInstance() {
-        FixtureRule rule = new FixtureRule();
+        MockedRule rule = new MockedRule();
         assertThat(ExecutionPrepareDecoratorFactory.getInstance(Collections.singleton(rule)).get(rule), instanceOf(FixtureExecutionPrepareDecorator.class));
     }
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-rewrite/pom.xml b/shardingsphere-infra/shardingsphere-infra-rewrite/pom.xml
index e4c1d4ab0d4..7d46bd98544 100644
--- a/shardingsphere-infra/shardingsphere-infra-rewrite/pom.xml
+++ b/shardingsphere-infra/shardingsphere-infra-rewrite/pom.xml
@@ -43,5 +43,12 @@
             <artifactId>shardingsphere-sql-translator-native-provider</artifactId>
             <version>${project.version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.shardingsphere</groupId>
+            <artifactId>shardingsphere-test-fixture</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>
diff --git a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/context/SQLRewriteContextDecoratorFactoryTest.java b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/context/SQLRewriteContextDecoratorFactoryTest.java
index b62098ae970..e109903baf1 100644
--- a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/context/SQLRewriteContextDecoratorFactoryTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/context/SQLRewriteContextDecoratorFactoryTest.java
@@ -17,7 +17,7 @@
 
 package org.apache.shardingsphere.infra.rewrite.context;
 
-import org.apache.shardingsphere.infra.rewrite.fixture.FixtureRule;
+import org.apache.shardingsphere.test.fixture.rule.MockedRule;
 import org.apache.shardingsphere.infra.rewrite.fixture.FixtureSQLRewriteContextDecorator;
 import org.junit.Test;
 
@@ -30,7 +30,7 @@ public final class SQLRewriteContextDecoratorFactoryTest {
     
     @Test
     public void assertGetInstance() {
-        FixtureRule rule = new FixtureRule();
+        MockedRule rule = new MockedRule();
         assertThat(SQLRewriteContextDecoratorFactory.getInstance(Collections.singleton(rule)).get(rule), instanceOf(FixtureSQLRewriteContextDecorator.class));
     }
 }
diff --git a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/fixture/FixtureRule.java b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/fixture/FixtureRule.java
deleted file mode 100644
index 267f3514db3..00000000000
--- a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/fixture/FixtureRule.java
+++ /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.
- */
-
-package org.apache.shardingsphere.infra.rewrite.fixture;
-
-import org.apache.shardingsphere.infra.config.RuleConfiguration;
-import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
-
-import static org.mockito.Mockito.mock;
-
-public final class FixtureRule implements ShardingSphereRule {
-    
-    @Override
-    public RuleConfiguration getConfiguration() {
-        return mock(RuleConfiguration.class);
-    }
-    
-    @Override
-    public String getType() {
-        return FixtureRule.class.getSimpleName();
-    }
-}
diff --git a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/fixture/FixtureSQLRewriteContextDecorator.java b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/fixture/FixtureSQLRewriteContextDecorator.java
index c855ca6793e..47e4ab5666b 100644
--- a/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/fixture/FixtureSQLRewriteContextDecorator.java
+++ b/shardingsphere-infra/shardingsphere-infra-rewrite/src/test/java/org/apache/shardingsphere/infra/rewrite/fixture/FixtureSQLRewriteContextDecorator.java
@@ -17,15 +17,16 @@
 
 package org.apache.shardingsphere.infra.rewrite.fixture;
 
+import org.apache.shardingsphere.test.fixture.rule.MockedRule;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContext;
 import org.apache.shardingsphere.infra.rewrite.context.SQLRewriteContextDecorator;
 import org.apache.shardingsphere.infra.route.context.RouteContext;
 
-public final class FixtureSQLRewriteContextDecorator implements SQLRewriteContextDecorator<FixtureRule> {
+public final class FixtureSQLRewriteContextDecorator implements SQLRewriteContextDecorator<MockedRule> {
     
     @Override
-    public void decorate(final FixtureRule rule, final ConfigurationProperties props, final SQLRewriteContext sqlRewriteContext, final RouteContext routeContext) {
+    public void decorate(final MockedRule rule, final ConfigurationProperties props, final SQLRewriteContext sqlRewriteContext, final RouteContext routeContext) {
     }
     
     @Override
@@ -34,7 +35,7 @@ public final class FixtureSQLRewriteContextDecorator implements SQLRewriteContex
     }
     
     @Override
-    public Class<FixtureRule> getTypeClass() {
-        return FixtureRule.class;
+    public Class<MockedRule> getTypeClass() {
+        return MockedRule.class;
     }
 }
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRule.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureDatabaseRule.java
similarity index 90%
rename from shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRule.java
rename to shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureDatabaseRule.java
index 7fab44338e9..b99027d09a8 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRule.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureDatabaseRule.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.infra.rule.identifier.scope.DatabaseRule;
 
 import static org.mockito.Mockito.mock;
 
-public final class FixtureRule implements DatabaseRule {
+public final class FixtureDatabaseRule implements DatabaseRule {
     
     @Override
     public RuleConfiguration getConfiguration() {
@@ -31,6 +31,6 @@ public final class FixtureRule implements DatabaseRule {
     
     @Override
     public String getType() {
-        return FixtureRule.class.getSimpleName();
+        return FixtureDatabaseRule.class.getSimpleName();
     }
 }
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureDatabaseRuleBuilder.java
similarity index 76%
rename from shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java
rename to shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureDatabaseRuleBuilder.java
index 10c3f5c8739..207b11dbfbe 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureRuleBuilder.java
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/metadata/fixture/FixtureDatabaseRuleBuilder.java
@@ -25,12 +25,12 @@ import javax.sql.DataSource;
 import java.util.Collection;
 import java.util.Map;
 
-public final class FixtureRuleBuilder implements DatabaseRuleBuilder<FixtureRuleConfiguration> {
+public final class FixtureDatabaseRuleBuilder implements DatabaseRuleBuilder<FixtureRuleConfiguration> {
     
     @Override
-    public FixtureRule build(final FixtureRuleConfiguration config, final String databaseName,
-                             final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final InstanceContext instanceContext) {
-        return new FixtureRule();
+    public FixtureDatabaseRule build(final FixtureRuleConfiguration config, final String databaseName,
+                                     final Map<String, DataSource> dataSources, final Collection<ShardingSphereRule> builtRules, final InstanceContext instanceContext) {
+        return new FixtureDatabaseRule();
     }
     
     @Override
diff --git a/shardingsphere-mode/shardingsphere-mode-core/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.rule.builder.database.DatabaseRuleBuilder b/shardingsphere-mode/shardingsphere-mode-core/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.rule.builder.database.DatabaseRuleBuilder
index 14997bd9989..985f555e78a 100644
--- a/shardingsphere-mode/shardingsphere-mode-core/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.rule.builder.database.DatabaseRuleBuilder
+++ b/shardingsphere-mode/shardingsphere-mode-core/src/test/resources/META-INF/services/org.apache.shardingsphere.infra.rule.builder.database.DatabaseRuleBuilder
@@ -15,4 +15,4 @@
 # limitations under the License.
 #
 
-org.apache.shardingsphere.mode.metadata.fixture.FixtureRuleBuilder
+org.apache.shardingsphere.mode.metadata.fixture.FixtureDatabaseRuleBuilder
diff --git a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/shardingsphere-standalone-mode-repository-provider/shardingsphere-standalone-mode-repository-jdbc/shardingsphere-standalone-mode-repository-jdbc-core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/ [...]
index ddaa342883b..720050c00b9 100644
--- a/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/shardingsphere-standalone-mode-repository-provider/shardingsphere-standalone-mode-repository-jdbc/shardingsphere-standalone-mode-repository-jdbc-core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
+++ b/shardingsphere-mode/shardingsphere-mode-type/shardingsphere-standalone-mode/shardingsphere-standalone-mode-repository/shardingsphere-standalone-mode-repository-provider/shardingsphere-standalone-mode-repository-jdbc/shardingsphere-standalone-mode-repository-jdbc-core/src/main/java/org/apache/shardingsphere/mode/repository/standalone/jdbc/JDBCRepository.java
@@ -84,7 +84,7 @@ public abstract class JDBCRepository implements StandalonePersistRepository {
                     resultChildren.add(childrenKey.substring(lastIndexOf + 1));
                 }
                 return new ArrayList<>(resultChildren);
-        }
+            }
         } catch (final SQLException ex) {
             log.error("Get children {} data by key: {} failed", getType(), key, ex);
         }
diff --git a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/fixture/FixtureRule.java b/shardingsphere-test/shardingsphere-test-fixture/src/main/java/org/apache/shardingsphere/test/fixture/rule/MockedRule.java
similarity index 85%
rename from shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/fixture/FixtureRule.java
rename to shardingsphere-test/shardingsphere-test-fixture/src/main/java/org/apache/shardingsphere/test/fixture/rule/MockedRule.java
index a302286be00..89e50490b9b 100644
--- a/shardingsphere-infra/shardingsphere-infra-executor/src/test/java/org/apache/shardingsphere/infra/executor/sql/fixture/FixtureRule.java
+++ b/shardingsphere-test/shardingsphere-test-fixture/src/main/java/org/apache/shardingsphere/test/fixture/rule/MockedRule.java
@@ -15,14 +15,17 @@
  * limitations under the License.
  */
 
-package org.apache.shardingsphere.infra.executor.sql.fixture;
+package org.apache.shardingsphere.test.fixture.rule;
 
 import org.apache.shardingsphere.infra.config.RuleConfiguration;
 import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
 
 import static org.mockito.Mockito.mock;
 
-public final class FixtureRule implements ShardingSphereRule {
+/**
+ * Mocked rule.
+ */
+public final class MockedRule implements ShardingSphereRule {
     
     @Override
     public RuleConfiguration getConfiguration() {
@@ -31,6 +34,6 @@ public final class FixtureRule implements ShardingSphereRule {
     
     @Override
     public String getType() {
-        return FixtureRule.class.getSimpleName();
+        return MockedRule.class.getSimpleName();
     }
 }