This is an automated email from the ASF dual-hosted git repository.
sunnianjun 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 1da4d706220 Simplify ShowRulesStatementAssert (#21301)
1da4d706220 is described below
commit 1da4d706220459308d89548712341812f5687137
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Oct 1 18:18:34 2022 +0800
Simplify ShowRulesStatementAssert (#21301)
* use `-` for xml attribute and tag name
* Simplipify ShowRulesStatementAssert
---
.../infra/hint/SQLHintExtractor.java | 19 +--
.../infra/hint/SQLHintExtractorTest.java | 12 +-
.../distsql/rql/impl/ShowRulesStatementAssert.java | 165 +++------------------
.../CountDatabaseDiscoveryRuleStatementAssert.java | 51 -------
.../impl/rule/CountEncryptRuleStatementAssert.java | 51 -------
...CountReadwriteSplittingRuleStatementAssert.java | 51 -------
.../impl/rule/CountShadowRuleStatementAssert.java | 51 -------
.../rule/CountShardingRuleStatementAssert.java | 51 -------
.../rule/CountSingleTableRuleStatementAssert.java | 51 -------
.../ShowDatabaseDiscoveryRulesStatementAssert.java | 51 -------
...ShowDefaultShardingStrategyStatementAssert.java | 51 -------
.../impl/rule/ShowEncryptRulesStatementAssert.java | 51 -------
...ShowReadwriteSplittingRulesStatementAssert.java | 51 -------
.../rule/ShowRulesUsedResourceStatementAssert.java | 57 -------
.../rule/ShowShadowAlgorithmsStatementAssert.java | 51 -------
.../impl/rule/ShowShadowRulesStatementAssert.java | 51 -------
.../rule/ShowShadowTableRulesStatementAssert.java | 51 -------
.../ShowShardingAlgorithmsStatementAssert.java | 51 -------
.../rule/ShowShardingAuditorsStatementAssert.java | 51 -------
...owShardingBindingTableRulesStatementAssert.java | 51 -------
...ShardingBroadcastTableRulesStatementAssert.java | 51 -------
.../ShowShardingKeyGeneratorsStatementAssert.java | 46 ------
.../ShowShardingTableNodesStatementAssert.java | 54 -------
.../ShowShardingTableRulesStatementAssert.java | 51 -------
...dingTableRulesUsedAlgorithmStatementAssert.java | 61 --------
...ardingTableRulesUsedAuditorStatementAssert.java | 61 --------
...gTableRulesUsedKeyGeneratorStatementAssert.java | 61 --------
.../rule/ShowSingleTableRulesStatementAssert.java | 51 -------
.../impl/rule/ShowSingleTableStatementAssert.java | 51 -------
...howUnusedShardingAlgorithmsStatementAssert.java | 51 -------
.../ShowUnusedShardingAuditorsStatementAssert.java | 51 -------
...UnusedShardingKeyGeneratorsStatementAssert.java | 51 -------
.../src/main/resources/case/rql/show.xml | 108 +++++++-------
33 files changed, 87 insertions(+), 1730 deletions(-)
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
index ac960899de8..82643dbe64b 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/hint/SQLHintExtractor.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.infra.hint;
-import com.google.common.base.Joiner;
import lombok.Getter;
import
org.apache.shardingsphere.sql.parser.sql.common.segment.generic.CommentSegment;
import
org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
@@ -93,11 +92,10 @@ public final class SQLHintExtractor {
* @return sharding database value
*/
public int getHintShardingDatabaseValue(final String tableName) {
- String key = Joiner.on(".").join(tableName.toUpperCase(),
SQLHintPropertiesKey.SHARDING_DATABASE_VALUE_KEY.getKey());
- if (sqlHintProperties.getProps().containsKey(key)) {
- return
Integer.valueOf(sqlHintProperties.getProps().getProperty(key));
- }
- return
sqlHintProperties.getValue(SQLHintPropertiesKey.SHARDING_DATABASE_VALUE_KEY);
+ String key = String.join(".", tableName.toUpperCase(),
SQLHintPropertiesKey.SHARDING_DATABASE_VALUE_KEY.getKey());
+ return sqlHintProperties.getProps().containsKey(key)
+ ?
Integer.parseInt(sqlHintProperties.getProps().getProperty(key))
+ :
sqlHintProperties.getValue(SQLHintPropertiesKey.SHARDING_DATABASE_VALUE_KEY);
}
/**
@@ -116,10 +114,9 @@ public final class SQLHintExtractor {
* @return sharding table value
*/
public int getHintShardingTableValue(final String tableName) {
- String key = Joiner.on(".").join(tableName.toUpperCase(),
SQLHintPropertiesKey.SHARDING_TABLE_VALUE_KEY.getKey());
- if (sqlHintProperties.getProps().containsKey(key)) {
- return
Integer.valueOf(sqlHintProperties.getProps().getProperty(key));
- }
- return
sqlHintProperties.getValue(SQLHintPropertiesKey.SHARDING_TABLE_VALUE_KEY);
+ String key = String.join(".", tableName.toUpperCase(),
SQLHintPropertiesKey.SHARDING_TABLE_VALUE_KEY.getKey());
+ return sqlHintProperties.getProps().containsKey(key)
+ ?
Integer.parseInt(sqlHintProperties.getProps().getProperty(key))
+ :
sqlHintProperties.getValue(SQLHintPropertiesKey.SHARDING_TABLE_VALUE_KEY);
}
}
diff --git
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/SQLHintExtractorTest.java
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/SQLHintExtractorTest.java
index 9df5436063e..e50bd2ceb56 100644
---
a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/SQLHintExtractorTest.java
+++
b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/hint/SQLHintExtractorTest.java
@@ -60,31 +60,27 @@ public final class SQLHintExtractorTest {
public void assertSQLHintShardingDatabaseValue() {
AbstractSQLStatement statement = mock(AbstractSQLStatement.class);
when(statement.getCommentSegments()).thenReturn(Collections.singletonList(new
CommentSegment("/* SHARDINGSPHERE_HINT: SHARDING_DATABASE_VALUE=100 */", 0,
0)));
- int actual = new
SQLHintExtractor(statement).getHintShardingDatabaseValue();
- assertThat(actual, is(100));
+ assertThat(new
SQLHintExtractor(statement).getHintShardingDatabaseValue(), is(100));
}
@Test
public void assertSQLHintShardingDatabaseValueWithTableName() {
AbstractSQLStatement statement = mock(AbstractSQLStatement.class);
when(statement.getCommentSegments()).thenReturn(Collections.singletonList(new
CommentSegment("/* SHARDINGSPHERE_HINT: t_order.SHARDING_DATABASE_VALUE=10 */",
0, 0)));
- int actual = new
SQLHintExtractor(statement).getHintShardingDatabaseValue("t_order");
- assertThat(actual, is(10));
+ assertThat(new
SQLHintExtractor(statement).getHintShardingDatabaseValue("t_order"), is(10));
}
@Test
public void assertSQLHintShardingTableValue() {
AbstractSQLStatement statement = mock(AbstractSQLStatement.class);
when(statement.getCommentSegments()).thenReturn(Collections.singletonList(new
CommentSegment("/* SHARDINGSPHERE_HINT: SHARDING_TABLE_VALUE=100 */", 0, 0)));
- int actual = new
SQLHintExtractor(statement).getHintShardingTableValue();
- assertThat(actual, is(100));
+ assertThat(new
SQLHintExtractor(statement).getHintShardingTableValue(), is(100));
}
@Test
public void assertSQLHintShardingTableValueWithTableName() {
AbstractSQLStatement statement = mock(AbstractSQLStatement.class);
when(statement.getCommentSegments()).thenReturn(Collections.singletonList(new
CommentSegment("/* SHARDINGSPHERE_HINT: t_order.SHARDING_TABLE_VALUE=10 */", 0,
0)));
- int actual = new
SQLHintExtractor(statement).getHintShardingTableValue("t_order");
- assertThat(actual, is(10));
+ assertThat(new
SQLHintExtractor(statement).getHintShardingTableValue("t_order"), is(10));
}
}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
index 512e0e0c915..0f325349fa5 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/ShowRulesStatementAssert.java
@@ -19,164 +19,41 @@ package
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statemen
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.CountDatabaseDiscoveryRuleStatement;
-import
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.ShowDatabaseDiscoveryHeartbeatsStatement;
-import
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.ShowDatabaseDiscoveryRulesStatement;
-import
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.ShowDatabaseDiscoveryTypesStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountSingleTableRuleStatement;
import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesUsedResourceStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowSingleTableRulesStatement;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowSingleTableStatement;
-import
org.apache.shardingsphere.encrypt.distsql.parser.statement.CountEncryptRuleStatement;
-import
org.apache.shardingsphere.encrypt.distsql.parser.statement.ShowEncryptRulesStatement;
-import
org.apache.shardingsphere.readwritesplitting.distsql.parser.statement.CountReadwriteSplittingRuleStatement;
-import
org.apache.shardingsphere.readwritesplitting.distsql.parser.statement.ShowReadwriteSplittingRulesStatement;
-import
org.apache.shardingsphere.shadow.distsql.parser.statement.CountShadowRuleStatement;
-import
org.apache.shardingsphere.shadow.distsql.parser.statement.ShowShadowAlgorithmsStatement;
-import
org.apache.shardingsphere.shadow.distsql.parser.statement.ShowShadowRulesStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.CountShardingRuleStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowDefaultShardingStrategyStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingAlgorithmsStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingBindingTableRulesStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingBroadcastTableRulesStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingKeyGeneratorsStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableNodesStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesUsedAlgorithmStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesUsedAuditorStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesUsedKeyGeneratorStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingAlgorithmsStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingAuditorsStatement;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingKeyGeneratorsStatement;
import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountDatabaseDiscoveryRuleStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountEncryptRuleStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountReadwriteSplittingRuleStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountShadowRuleStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountShardingRuleStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.CountSingleTableRuleStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowDatabaseDiscoveryRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowDefaultShardingStrategyStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowEncryptRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowReadwriteSplittingRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowRulesUsedResourceStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShadowAlgorithmsStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShadowRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingAlgorithmsStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingBindingTableRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingBroadcastTableRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingKeyGeneratorsStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingTableNodesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingTableRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingTableRulesUsedAlgorithmStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingTableRulesUsedAuditorStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowShardingTableRulesUsedKeyGeneratorStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowSingleTableRulesStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowSingleTableStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowUnusedShardingAlgorithmsStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowUnusedShardingAuditorsStatementAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule.ShowUnusedShardingKeyGeneratorsStatementAssert;
+import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
+import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.DatabaseContainedTestCase;
import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.SQLParserTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountDatabaseDiscoveryRuleStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountEncryptRuleStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountReadwriteSplittingRuleStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountShadowRuleStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountShardingRuleStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountSingleTableRuleStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowDataBaseDiscoveryRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowDefaultShardingStrategyStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowEncryptRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowReadwriteSplittingRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowRulesUsedResourceStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShadowAlgorithmsStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShadowRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingAlgorithmsStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingBindingTableRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingBroadcastTableRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingKeyGeneratorsStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableNodesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesUsedAlgorithmStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesUsedAuditorStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesUsedKeyGeneratorStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowSingleTableRulesStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowSingleTableStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowUnusedShardingAlgorithmsStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowUnusedShardingAuditorsStatementTestCase;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowUnusedShardingKeyGeneratorsStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
/**
- * Show rule statement assert.
+ * Show rules statement assert.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShowRulesStatementAssert {
/**
- * Assert show rule statement is correct with expected parser result.
+ * Assert show rules statement is correct with expected parser result.
*
* @param assertContext assert context
- * @param actual actual show rule statement
- * @param expected expected show rule statement test case
+ * @param actual actual show rules statement
+ * @param expected expected show rules statement test case
*/
public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowRulesStatement actual, final SQLParserTestCase expected) {
- if (actual instanceof ShowDatabaseDiscoveryRulesStatement || actual
instanceof ShowDatabaseDiscoveryTypesStatement || actual instanceof
ShowDatabaseDiscoveryHeartbeatsStatement) {
- ShowDatabaseDiscoveryRulesStatementAssert.assertIs(assertContext,
actual, (ShowDataBaseDiscoveryRulesStatementTestCase) expected);
- } else if (actual instanceof ShowEncryptRulesStatement) {
- ShowEncryptRulesStatementAssert.assertIs(assertContext,
(ShowEncryptRulesStatement) actual, (ShowEncryptRulesStatementTestCase)
expected);
- } else if (actual instanceof ShowReadwriteSplittingRulesStatement) {
- ShowReadwriteSplittingRulesStatementAssert.assertIs(assertContext,
(ShowReadwriteSplittingRulesStatement) actual,
(ShowReadwriteSplittingRulesStatementTestCase) expected);
- } else if (actual instanceof ShowShardingBindingTableRulesStatement) {
-
ShowShardingBindingTableRulesStatementAssert.assertIs(assertContext,
(ShowShardingBindingTableRulesStatement) actual,
(ShowShardingBindingTableRulesStatementTestCase) expected);
- } else if (actual instanceof ShowShardingBroadcastTableRulesStatement)
{
-
ShowShardingBroadcastTableRulesStatementAssert.assertIs(assertContext,
(ShowShardingBroadcastTableRulesStatement) actual,
(ShowShardingBroadcastTableRulesStatementTestCase) expected);
- } else if (actual instanceof ShowShardingAlgorithmsStatement) {
- ShowShardingAlgorithmsStatementAssert.assertIs(assertContext,
(ShowShardingAlgorithmsStatement) actual,
(ShowShardingAlgorithmsStatementTestCase) expected);
- } else if (actual instanceof ShowShardingTableRulesStatement) {
- ShowShardingTableRulesStatementAssert.assertIs(assertContext,
(ShowShardingTableRulesStatement) actual,
(ShowShardingTableRulesStatementTestCase) expected);
- } else if (actual instanceof ShowShardingTableNodesStatement) {
- ShowShardingTableNodesStatementAssert.assertIs(assertContext,
(ShowShardingTableNodesStatement) actual,
(ShowShardingTableNodesStatementTestCase) expected);
- } else if (actual instanceof ShowShadowRulesStatement) {
- ShowShadowRulesStatementAssert.assertIs(assertContext,
(ShowShadowRulesStatement) actual, (ShowShadowRulesStatementTestCase) expected);
- } else if (actual instanceof ShowShadowAlgorithmsStatement) {
- ShowShadowAlgorithmsStatementAssert.assertIs(assertContext,
(ShowShadowAlgorithmsStatement) actual, (ShowShadowAlgorithmsStatementTestCase)
expected);
- } else if (actual instanceof ShowSingleTableStatement) {
- ShowSingleTableStatementAssert.assertIs(assertContext,
(ShowSingleTableStatement) actual, (ShowSingleTableStatementTestCase) expected);
- } else if (actual instanceof ShowSingleTableRulesStatement) {
- ShowSingleTableRulesStatementAssert.assertIs(assertContext,
(ShowSingleTableRulesStatement) actual, (ShowSingleTableRulesStatementTestCase)
expected);
- } else if (actual instanceof ShowShardingKeyGeneratorsStatement) {
- ShowShardingKeyGeneratorsStatementAssert.assertIs(assertContext,
(ShowShardingKeyGeneratorsStatement) actual,
(ShowShardingKeyGeneratorsStatementTestCase) expected);
- } else if (actual instanceof ShowDefaultShardingStrategyStatement) {
- ShowDefaultShardingStrategyStatementAssert.assertIs(assertContext,
(ShowDefaultShardingStrategyStatement) actual,
(ShowDefaultShardingStrategyStatementTestCase) expected);
- } else if (actual instanceof ShowUnusedShardingAlgorithmsStatement) {
-
ShowUnusedShardingAlgorithmsStatementAssert.assertIs(assertContext,
(ShowUnusedShardingAlgorithmsStatement) actual,
(ShowUnusedShardingAlgorithmsStatementTestCase) expected);
- } else if (actual instanceof ShowUnusedShardingKeyGeneratorsStatement)
{
-
ShowUnusedShardingKeyGeneratorsStatementAssert.assertIs(assertContext,
(ShowUnusedShardingKeyGeneratorsStatement) actual,
(ShowUnusedShardingKeyGeneratorsStatementTestCase) expected);
- } else if (actual instanceof ShowUnusedShardingAuditorsStatement) {
- ShowUnusedShardingAuditorsStatementAssert.assertIs(assertContext,
(ShowUnusedShardingAuditorsStatement) actual,
(ShowUnusedShardingAuditorsStatementTestCase) expected);
- } else if (actual instanceof ShowRulesUsedResourceStatement) {
- ShowRulesUsedResourceStatementAssert.assertIs(assertContext,
(ShowRulesUsedResourceStatement) actual,
(ShowRulesUsedResourceStatementTestCase) expected);
- } else if (actual instanceof
ShowShardingTableRulesUsedAlgorithmStatement) {
-
ShowShardingTableRulesUsedAlgorithmStatementAssert.assertIs(assertContext,
(ShowShardingTableRulesUsedAlgorithmStatement) actual,
- (ShowShardingTableRulesUsedAlgorithmStatementTestCase)
expected);
- } else if (actual instanceof
ShowShardingTableRulesUsedKeyGeneratorStatement) {
-
ShowShardingTableRulesUsedKeyGeneratorStatementAssert.assertIs(assertContext,
(ShowShardingTableRulesUsedKeyGeneratorStatement) actual,
- (ShowShardingTableRulesUsedKeyGeneratorStatementTestCase)
expected);
- } else if (actual instanceof
ShowShardingTableRulesUsedAuditorStatement) {
-
ShowShardingTableRulesUsedAuditorStatementAssert.assertIs(assertContext,
(ShowShardingTableRulesUsedAuditorStatement) actual,
- (ShowShardingTableRulesUsedAuditorStatementTestCase)
expected);
- } else if (actual instanceof CountSingleTableRuleStatement) {
- CountSingleTableRuleStatementAssert.assertIs(assertContext,
(CountSingleTableRuleStatement) actual, (CountSingleTableRuleStatementTestCase)
expected);
- } else if (actual instanceof CountShardingRuleStatement) {
- CountShardingRuleStatementAssert.assertIs(assertContext,
(CountShardingRuleStatement) actual, (CountShardingRuleStatementTestCase)
expected);
- } else if (actual instanceof CountReadwriteSplittingRuleStatement) {
- CountReadwriteSplittingRuleStatementAssert.assertIs(assertContext,
(CountReadwriteSplittingRuleStatement) actual,
(CountReadwriteSplittingRuleStatementTestCase) expected);
- } else if (actual instanceof CountDatabaseDiscoveryRuleStatement) {
- CountDatabaseDiscoveryRuleStatementAssert.assertIs(assertContext,
(CountDatabaseDiscoveryRuleStatement) actual,
(CountDatabaseDiscoveryRuleStatementTestCase) expected);
- } else if (actual instanceof CountEncryptRuleStatement) {
- CountEncryptRuleStatementAssert.assertIs(assertContext,
(CountEncryptRuleStatement) actual, (CountEncryptRuleStatementTestCase)
expected);
- } else if (actual instanceof CountShadowRuleStatement) {
- CountShadowRuleStatementAssert.assertIs(assertContext,
(CountShadowRuleStatement) actual, (CountShadowRuleStatementTestCase) expected);
+ assertThat("Expected value should be DatabaseContainedTestCase",
expected, instanceOf(DatabaseContainedTestCase.class));
+ assertIs(assertContext, actual, (DatabaseContainedTestCase) expected);
+ }
+
+ private static void assertIs(final SQLCaseAssertContext assertContext,
final ShowRulesStatement actual, final DatabaseContainedTestCase expected) {
+ if (null == expected.getDatabase()) {
+ assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
+ DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
}
}
}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountDatabaseDiscoveryRuleStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountDatabaseDiscoveryRuleStatementAssert.java
deleted file mode 100644
index e0ed6c2ae74..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountDatabaseDiscoveryRuleStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.dbdiscovery.distsql.parser.statement.CountDatabaseDiscoveryRuleStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountDatabaseDiscoveryRuleStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Count database discovery rule statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class CountDatabaseDiscoveryRuleStatementAssert {
-
- /**
- * Assert count database discovery rule statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual count database discovery rule statement
- * @param expected expected count database discovery rule statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final CountDatabaseDiscoveryRuleStatement actual, final
CountDatabaseDiscoveryRuleStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountEncryptRuleStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountEncryptRuleStatementAssert.java
deleted file mode 100644
index 158d0bfd8b5..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountEncryptRuleStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.encrypt.distsql.parser.statement.CountEncryptRuleStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountEncryptRuleStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Count encrypt rule statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class CountEncryptRuleStatementAssert {
-
- /**
- * Assert count encrypt rule statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual count encrypt rule statement
- * @param expected expected count encrypt rule statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final CountEncryptRuleStatement actual, final CountEncryptRuleStatementTestCase
expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountReadwriteSplittingRuleStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountReadwriteSplittingRuleStatementAssert.java
deleted file mode 100644
index 17abebcff68..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountReadwriteSplittingRuleStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.readwritesplitting.distsql.parser.statement.CountReadwriteSplittingRuleStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountReadwriteSplittingRuleStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Count readwrite splitting rule statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class CountReadwriteSplittingRuleStatementAssert {
-
- /**
- * Assert count readwrite splitting rule statement is correct with
expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual count readwrite splitting rule statement
- * @param expected expected count readwrite splitting rule statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final CountReadwriteSplittingRuleStatement actual, final
CountReadwriteSplittingRuleStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountShadowRuleStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountShadowRuleStatementAssert.java
deleted file mode 100644
index f22ce2f781b..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountShadowRuleStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.shadow.distsql.parser.statement.CountShadowRuleStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountShadowRuleStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Count shadow rule statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class CountShadowRuleStatementAssert {
-
- /**
- * Assert count shadow rule statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual count shadow rule statement
- * @param expected expected count shadow rule statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final CountShadowRuleStatement actual, final CountShadowRuleStatementTestCase
expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountShardingRuleStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountShardingRuleStatementAssert.java
deleted file mode 100644
index 7a068bc569d..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountShardingRuleStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.CountShardingRuleStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountShardingRuleStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Count sharding rule statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class CountShardingRuleStatementAssert {
-
- /**
- * Assert count sharding rule statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual count sharding rule statement
- * @param expected expected count sharding rule statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final CountShardingRuleStatement actual, final
CountShardingRuleStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountSingleTableRuleStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountSingleTableRuleStatementAssert.java
deleted file mode 100644
index 4b8f57e9c3a..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/CountSingleTableRuleStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.CountSingleTableRuleStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.CountSingleTableRuleStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Count single table rule statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class CountSingleTableRuleStatementAssert {
-
- /**
- * Assert count single table rule statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual count single table rule statement
- * @param expected expected count single table rule statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final CountSingleTableRuleStatement actual, final
CountSingleTableRuleStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowDatabaseDiscoveryRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowDatabaseDiscoveryRulesStatementAssert.java
deleted file mode 100644
index ea296f8dd58..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowDatabaseDiscoveryRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowDataBaseDiscoveryRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show database discovery rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowDatabaseDiscoveryRulesStatementAssert {
-
- /**
- * Assert show database discovery rule statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show database discovery rules statement
- * @param expected expected show database discovery rules statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowRulesStatement actual, final
ShowDataBaseDiscoveryRulesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowDefaultShardingStrategyStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowDefaultShardingStrategyStatementAssert.java
deleted file mode 100644
index 82b9c20663b..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowDefaultShardingStrategyStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowDefaultShardingStrategyStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowDefaultShardingStrategyStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show default sharding strategy statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowDefaultShardingStrategyStatementAssert {
-
- /**
- * Assert show default sharding strategy statement is correct with
expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual show default sharding strategy statement
- * @param expected expected show default sharding strategy statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowDefaultShardingStrategyStatement actual, final
ShowDefaultShardingStrategyStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowEncryptRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowEncryptRulesStatementAssert.java
deleted file mode 100644
index 9b424292a72..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowEncryptRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.encrypt.distsql.parser.statement.ShowEncryptRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowEncryptRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * show encrypt rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowEncryptRulesStatementAssert {
-
- /**
- * Assert Show encrypt rule statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual show encrypt rules statement
- * @param expected expected show encrypt rules statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowEncryptRulesStatement actual, final ShowEncryptRulesStatementTestCase
expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowReadwriteSplittingRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowReadwriteSplittingRulesStatementAssert.java
deleted file mode 100644
index a0cce8724d2..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowReadwriteSplittingRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.readwritesplitting.distsql.parser.statement.ShowReadwriteSplittingRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowReadwriteSplittingRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show readwrite-splitting rule statement rules assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowReadwriteSplittingRulesStatementAssert {
-
- /**
- * Assert show readwrite-splitting rule statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show readwrite-splitting rules statement
- * @param expected expected show readwrite-splitting rules statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowReadwriteSplittingRulesStatement actual, final
ShowReadwriteSplittingRulesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowRulesUsedResourceStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowRulesUsedResourceStatementAssert.java
deleted file mode 100644
index a8b7600a7d8..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowRulesUsedResourceStatementAssert.java
+++ /dev/null
@@ -1,57 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import com.google.common.base.Strings;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesUsedResourceStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowRulesUsedResourceStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show rules used resource statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowRulesUsedResourceStatementAssert {
-
- /**
- * Assert show rules used resource statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show rules used resource statement
- * @param expected expected show rules used resource statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowRulesUsedResourceStatement actual, final
ShowRulesUsedResourceStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- if (Strings.isNullOrEmpty(expected.getResourceName())) {
- assertFalse(assertContext.getText("Actual resource should not
exist."), actual.getResourceName().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual resource should exist."),
actual.getResourceName().isPresent());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowAlgorithmsStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowAlgorithmsStatementAssert.java
deleted file mode 100644
index b7bd7dbdbad..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowAlgorithmsStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.shadow.distsql.parser.statement.ShowShadowAlgorithmsStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShadowAlgorithmsStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show shadow algorithms statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShadowAlgorithmsStatementAssert {
-
- /**
- * Assert show shadow algorithms statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual show shadow algorithms statement
- * @param expected expected show shadow algorithms statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShadowAlgorithmsStatement actual, final
ShowShadowAlgorithmsStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowRulesStatementAssert.java
deleted file mode 100644
index 69bbbb66ed4..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.shadow.distsql.parser.statement.ShowShadowRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShadowRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show shadow rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShadowRulesStatementAssert {
-
- /**
- * Assert show shadow rule statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual show shadow rules statement
- * @param expected expected show shadow rules statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShadowRulesStatement actual, final ShowShadowRulesStatementTestCase
expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowTableRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowTableRulesStatementAssert.java
deleted file mode 100644
index 1f017a7f115..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShadowTableRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.shadow.distsql.parser.statement.ShowShadowTableRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShadowTableRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show shadow table rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShadowTableRulesStatementAssert {
-
- /**
- * Assert show shadow table rules statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show shadow table rules statement
- * @param expected expected show shadow table rules statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShadowTableRulesStatement actual, final
ShowShadowTableRulesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingAlgorithmsStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingAlgorithmsStatementAssert.java
deleted file mode 100644
index 504b3adcc8f..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingAlgorithmsStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingAlgorithmsStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingAlgorithmsStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding algorithms statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingAlgorithmsStatementAssert {
-
- /**
- * Assert show sharding algorithms statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding algorithms statement
- * @param expected expected show sharding algorithms statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingAlgorithmsStatement actual, final
ShowShardingAlgorithmsStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingAuditorsStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingAuditorsStatementAssert.java
deleted file mode 100644
index cdbbb91cd71..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingAuditorsStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingAuditorsStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingAuditorsStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding audit algorithms statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingAuditorsStatementAssert {
-
- /**
- * Assert show sharding auditors statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding auditors statement
- * @param expected expected show sharding auditors statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingAuditorsStatement actual, final
ShowShardingAuditorsStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingBindingTableRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingBindingTableRulesStatementAssert.java
deleted file mode 100644
index de306074665..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingBindingTableRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingBindingTableRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingBindingTableRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding binding table rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingBindingTableRulesStatementAssert {
-
- /**
- * Assert show sharding binding table statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding binding table rules statement
- * @param expected expected show sharding binding table rules statement
test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingBindingTableRulesStatement actual, final
ShowShardingBindingTableRulesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingBroadcastTableRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingBroadcastTableRulesStatementAssert.java
deleted file mode 100644
index 92e91c8529d..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingBroadcastTableRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingBroadcastTableRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingBroadcastTableRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding broadcast table rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingBroadcastTableRulesStatementAssert {
-
- /**
- * Assert show sharding broadcast table rule statement is correct with
expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding broadcast table rules statement
- * @param expected expected show sharding broadcast table rules statement
test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingBroadcastTableRulesStatement actual, final
ShowShardingBroadcastTableRulesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingKeyGeneratorsStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingKeyGeneratorsStatementAssert.java
deleted file mode 100644
index 5d068bd5506..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingKeyGeneratorsStatementAssert.java
+++ /dev/null
@@ -1,46 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingKeyGeneratorsStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.distsql.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingKeyGeneratorsStatementTestCase;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding key generators statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingKeyGeneratorsStatementAssert {
-
- /**
- * Assert show sharding key generators statement is correct with expected
parser result.
- * @param assertContext assert context
- * @param actual actual show sharding key generators statement
- * @param expected expected show sharding key generators statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingKeyGeneratorsStatement actual,
- final
ShowShardingKeyGeneratorsStatementTestCase expected) {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableNodesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableNodesStatementAssert.java
deleted file mode 100644
index d6cd3d7e2b6..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableNodesStatementAssert.java
+++ /dev/null
@@ -1,54 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableNodesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableNodesStatementTestCase;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertFalse;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding table nodes statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingTableNodesStatementAssert {
-
- /**
- * Assert show sharding table nodes statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding table nodes statement
- * @param expected expected show sharding table nodes statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingTableNodesStatement actual, final
ShowShardingTableNodesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- assertThat(assertContext.getText("Table assertion error:"),
actual.getTableName(), is(expected.getTable()));
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesStatementAssert.java
deleted file mode 100644
index 1766cb15597..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding table rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingTableRulesStatementAssert {
-
- /**
- * Assert show database discovery rule statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show database discovery rules statement
- * @param expected expected show database discovery rules statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingTableRulesStatement actual, final
ShowShardingTableRulesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedAlgorithmStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedAlgorithmStatementAssert.java
deleted file mode 100644
index 9978495df42..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedAlgorithmStatementAssert.java
+++ /dev/null
@@ -1,61 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import com.google.common.base.Strings;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesUsedAlgorithmStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesUsedAlgorithmStatementTestCase;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertFalse;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding table rules used algorithm statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingTableRulesUsedAlgorithmStatementAssert {
-
- /**
- * Assert show sharding table rules used algorithm statement is correct
with expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding table rules used algorithm statement
- * @param expected expected show sharding table rules used algorithm
statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingTableRulesUsedAlgorithmStatement actual,
- final
ShowShardingTableRulesUsedAlgorithmStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- if (Strings.isNullOrEmpty(expected.getAlgorithmName())) {
- assertFalse(assertContext.getText("Actual algorithmName should not
exist."), actual.getShardingAlgorithmName().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual algorithmName should
exist."), actual.getShardingAlgorithmName().isPresent());
- assertThat(assertContext.getText("algorithmName assertion
error:"), actual.getShardingAlgorithmName().get(),
is(expected.getAlgorithmName()));
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedAuditorStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedAuditorStatementAssert.java
deleted file mode 100644
index ccea6ba6baa..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedAuditorStatementAssert.java
+++ /dev/null
@@ -1,61 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import com.google.common.base.Strings;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesUsedAuditorStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesUsedAuditorStatementTestCase;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding table rules used auditor statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingTableRulesUsedAuditorStatementAssert {
-
- /**
- * Assert show sharding table rules used auditor statement is correct with
expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding table rules used auditor statement
- * @param expected expected show sharding table rules used auditor
statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingTableRulesUsedAuditorStatement actual,
- final
ShowShardingTableRulesUsedAuditorStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- if (Strings.isNullOrEmpty(expected.getAuditor())) {
- assertFalse(assertContext.getText("Actual auditor should not
exist."), actual.getAuditorName().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual auditor should exist."),
actual.getAuditorName().isPresent());
- assertThat(assertContext.getText("Auditor assertion error:"),
actual.getAuditorName().get(), is(expected.getAuditor()));
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedKeyGeneratorStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedKeyGeneratorStatementAssert.java
deleted file mode 100644
index d22a0d68cac..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowShardingTableRulesUsedKeyGeneratorStatementAssert.java
+++ /dev/null
@@ -1,61 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import com.google.common.base.Strings;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowShardingTableRulesUsedKeyGeneratorStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowShardingTableRulesUsedKeyGeneratorStatementTestCase;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertFalse;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show sharding table rules used key generator statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowShardingTableRulesUsedKeyGeneratorStatementAssert {
-
- /**
- * Assert show sharding table rules used key generator statement is
correct with expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual show sharding table rules used key generator
statement
- * @param expected expected show sharding table rules used key generator
statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowShardingTableRulesUsedKeyGeneratorStatement actual,
- final
ShowShardingTableRulesUsedKeyGeneratorStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- if (Strings.isNullOrEmpty(expected.getKeyGenerator())) {
- assertFalse(assertContext.getText("Actual keyGenerator should not
exist."), actual.getKeyGeneratorName().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual keyGenerator should
exist."), actual.getKeyGeneratorName().isPresent());
- assertThat(assertContext.getText("KeyGenerator assertion error:"),
actual.getKeyGeneratorName().get(), is(expected.getKeyGenerator()));
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowSingleTableRulesStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowSingleTableRulesStatementAssert.java
deleted file mode 100644
index 77c102f8bd4..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowSingleTableRulesStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowSingleTableRulesStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowSingleTableRulesStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show single table rules statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowSingleTableRulesStatementAssert {
-
- /**
- * Assert show single table rules statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show single table rules statement
- * @param expected expected show single table rules statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowSingleTableRulesStatement actual, final
ShowSingleTableRulesStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowSingleTableStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowSingleTableStatementAssert.java
deleted file mode 100644
index b6834d61624..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowSingleTableStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowSingleTableStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowSingleTableStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show single table statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowSingleTableStatementAssert {
-
- /**
- * Assert show single table statement is correct with expected parser
result.
- *
- * @param assertContext assert context
- * @param actual actual show single table statement
- * @param expected expected show single table statement test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowSingleTableStatement actual, final ShowSingleTableStatementTestCase
expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingAlgorithmsStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingAlgorithmsStatementAssert.java
deleted file mode 100644
index e2d7ca16e06..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingAlgorithmsStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingAlgorithmsStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowUnusedShardingAlgorithmsStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show unused sharding algorithms statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowUnusedShardingAlgorithmsStatementAssert {
-
- /**
- * Assert show unused sharding algorithms statement is correct with
expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual show unused sharding algorithms statement
- * @param expected expected show unused sharding algorithms statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowUnusedShardingAlgorithmsStatement actual, final
ShowUnusedShardingAlgorithmsStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingAuditorsStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingAuditorsStatementAssert.java
deleted file mode 100644
index 77bc849a548..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingAuditorsStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingAuditorsStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowUnusedShardingAuditorsStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show unused sharding auditors statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowUnusedShardingAuditorsStatementAssert {
-
- /**
- * Assert show unused sharding auditors statement is correct with expected
parser result.
- *
- * @param assertContext assert context
- * @param actual actual show unused sharding auditors statement
- * @param expected expected show unused sharding auditors statement test
case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowUnusedShardingAuditorsStatement actual, final
ShowUnusedShardingAuditorsStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingKeyGeneratorsStatementAssert.java
b/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingKeyGeneratorsStatementAssert.java
deleted file mode 100644
index b2b101b1346..00000000000
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/asserts/statement/distsql/rql/impl/rule/ShowUnusedShardingKeyGeneratorsStatementAssert.java
+++ /dev/null
@@ -1,51 +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.test.sql.parser.parameterized.asserts.statement.distsql.rql.impl.rule;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.sharding.distsql.parser.statement.ShowUnusedShardingKeyGeneratorsStatement;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.SQLCaseAssertContext;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.asserts.segment.database.DatabaseAssert;
-import
org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql.ShowUnusedShardingKeyGeneratorsStatementTestCase;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Show unused sharding key generators statement assert.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ShowUnusedShardingKeyGeneratorsStatementAssert {
-
- /**
- * Assert show unused sharding key generators statement is correct with
expected parser result.
- *
- * @param assertContext assert context
- * @param actual actual show unused sharding key generators statement
- * @param expected expected show unused sharding key generators statement
test case
- */
- public static void assertIs(final SQLCaseAssertContext assertContext,
final ShowUnusedShardingKeyGeneratorsStatement actual, final
ShowUnusedShardingKeyGeneratorsStatementTestCase expected) {
- if (null == expected.getDatabase()) {
- assertFalse(assertContext.getText("Actual database should not
exist."), actual.getDatabase().isPresent());
- } else {
- assertTrue(assertContext.getText("Actual database should exist."),
actual.getDatabase().isPresent());
- DatabaseAssert.assertIs(assertContext, actual.getDatabase().get(),
expected.getDatabase());
- }
- }
-}
diff --git
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
index ad5c3b79f27..45f490ef1c3 100644
---
a/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
+++
b/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case/rql/show.xml
@@ -18,140 +18,140 @@
<sql-parser-test-cases>
<show-sharding-binding-table-rules
sql-case-id="show-sharding-binding-table-rules">
- <database name="sharding_db" start-index="39" stop-index="49"/>
+ <database name="sharding_db" start-index="39" stop-index="49" />
</show-sharding-binding-table-rules>
<show-sharding-broadcast-table-rules
sql-case-id="show-sharding-broadcast-table-rules">
- <database name="sharding_db" start-index="41" stop-index="51"/>
+ <database name="sharding_db" start-index="41" stop-index="51" />
</show-sharding-broadcast-table-rules>
<show-sharding-table-rules sql-case-id="show-sharding-table-rules">
- <database name="databaseName" start-index="31" stop-index="42"/>
+ <database name="databaseName" start-index="31" stop-index="42" />
</show-sharding-table-rules>
<show-sharding-table-rules sql-case-id="show-sharding-table-rule">
- <table name="t_order"/>
+ <table name="t_order" />
</show-sharding-table-rules>
<show-sharding-table-rules sql-case-id="show-sharding-table-rule-from">
- <table name="t_order"/>
- <database name="databaseName" start-index="38" stop-index="49"/>
+ <table name="t_order" />
+ <database name="databaseName" start-index="38" stop-index="49" />
</show-sharding-table-rules>
<show-sharding-algorithms sql-case-id="show-sharding-algorithms-from">
- <database name="databaseName" start-index="30" stop-index="41"/>
+ <database name="databaseName" start-index="30" stop-index="41" />
</show-sharding-algorithms>
-
+
<show-sharding-auditors sql-case-id="show-sharding-auditors-from">
- <database name="databaseName" start-index="28" stop-index="39"/>
+ <database name="databaseName" start-index="28" stop-index="39" />
</show-sharding-auditors>
<show-readwrite-splitting-rules
sql-case-id="show-readwrite-splitting-rules">
- <database name="readwrite_splitting_db" start-index="36"
stop-index="57"/>
+ <database name="readwrite_splitting_db" start-index="36"
stop-index="57" />
</show-readwrite-splitting-rules>
<show-db-discovery-rules sql-case-id="show-db-discovery-rules">
- <database name="db_discovery_db" start-index="29" stop-index="43"/>
+ <database name="db_discovery_db" start-index="29" stop-index="43" />
</show-db-discovery-rules>
-
+
<show-db-discovery-rules sql-case-id="show-db-discovery-types">
- <database name="db_discovery_db" start-index="29" stop-index="43"/>
+ <database name="db_discovery_db" start-index="29" stop-index="43" />
</show-db-discovery-rules>
-
+
<show-db-discovery-rules sql-case-id="show-db-discovery-heartbeats">
- <database name="db_discovery_db" start-index="34" stop-index="48"/>
+ <database name="db_discovery_db" start-index="34" stop-index="48" />
</show-db-discovery-rules>
<show-encrypt-rules sql-case-id="show-encrypt-rules">
- <database name="encrypt_db" start-index="24" stop-index="33"/>
+ <database name="encrypt_db" start-index="24" stop-index="33" />
</show-encrypt-rules>
<show-encrypt-rules sql-case-id="show-encrypt-table-rules">
- <database name="encrypt_db" start-index="39" stop-index="48"/>
+ <database name="encrypt_db" start-index="39" stop-index="48" />
</show-encrypt-rules>
-
+
<show-shadow-rules sql-case-id="show-shadow-rules">
- <database name="shadow_db" start-index="34" stop-index="42"/>
+ <database name="shadow_db" start-index="34" stop-index="42" />
</show-shadow-rules>
<show-shadow-table-rules sql-case-id="show-shadow-table-rules">
- <database name="shadow_db" start-index="28" stop-index="36"/>
+ <database name="shadow_db" start-index="29" stop-index="37" />
</show-shadow-table-rules>
-
+
<show-shadow-algorithms sql-case-id="show-shadow-algorithms">
- <database name="shadow_db" start-index="28" stop-index="36"/>
+ <database name="shadow_db" start-index="28" stop-index="36" />
</show-shadow-algorithms>
-
+
<show-single-table sql-case-id="show-single-table">
- <name name="t_order" start-index="19" stop-index="25"/>
- <database name="single_table_db" start-index="31" stop-index="45"/>
+ <name name="t_order" start-index="19" stop-index="25" />
+ <database name="single_table_db" start-index="31" stop-index="45" />
</show-single-table>
<show-single-table-rules sql-case-id="show-single-table-rules">
- <database name="single_table_db" start-index="29" stop-index="43"/>
+ <database name="single_table_db" start-index="29" stop-index="43" />
</show-single-table-rules>
-
+
<show-sharding-table-nodes sql-case-id="show-sharding-table-nodes"
table="t_order">
- <database name="sharding_db" start-index="39" stop-index="49"/>
+ <database name="sharding_db" start-index="39" stop-index="49" />
</show-sharding-table-nodes>
-
+
<show-sharding-key-generators sql-case-id="show-sharding-key-generators">
- <database name="sharding_db" start-index="34" stop-index="44"/>
+ <database name="sharding_db" start-index="34" stop-index="44" />
</show-sharding-key-generators>
<show-default-sharding-strategy
sql-case-id="show-default-sharding-strategy">
- <database name="sharding_db" start-index="36" stop-index="46"/>
+ <database name="sharding_db" start-index="36" stop-index="46" />
</show-default-sharding-strategy>
-
+
<show-unused-sharding-algorithms
sql-case-id="show-unused-sharding-algorithms">
- <database name="databaseName" start-index="37" stop-index="48"/>
+ <database name="databaseName" start-index="37" stop-index="48" />
</show-unused-sharding-algorithms>
<show-unused-sharding-key-generators
sql-case-id="show-unused-sharding-key-generators">
- <database name="databaseName" start-index="41" stop-index="52"/>
+ <database name="databaseName" start-index="41" stop-index="52" />
</show-unused-sharding-key-generators>
-
+
<show-unused-sharding-auditors sql-case-id="show-unused-sharding-auditors">
- <database name="databaseName" start-index="35" stop-index="46"/>
+ <database name="databaseName" start-index="35" stop-index="46" />
</show-unused-sharding-auditors>
-
+
<show-rules-used-resource sql-case-id="show-rules-used-resource"
resource-name="ds_0">
- <database name="databaseName" start-index="35" stop-index="46"/>
+ <database name="databaseName" start-index="35" stop-index="46" />
</show-rules-used-resource>
<show-sharding-table-rules-used-key-generator
sql-case-id="show-sharding-table-rules-used-key-generator"
key-generator="snowflake">
- <database name="sharding_db" start-index="60" stop-index="70"/>
+ <database name="sharding_db" start-index="60" stop-index="70" />
</show-sharding-table-rules-used-key-generator>
-
+
<show-sharding-table-rules-used-auditor
sql-case-id="show-sharding-table-rules-used-auditor" auditor="shardingKeyAudit">
- <database name="sharding_db" start-index="61" stop-index="71"/>
+ <database name="sharding_db" start-index="61" stop-index="71" />
</show-sharding-table-rules-used-auditor>
-
+
<show-sharding-table-rules-used-algorithm
sql-case-id="show-sharding-table-rules-used-algorithm"
algorithm-name="t_order_inline">
- <database name="sharding_db" start-index="61" stop-index="71"/>
+ <database name="sharding_db" start-index="61" stop-index="71" />
</show-sharding-table-rules-used-algorithm>
<count-single-table-rule sql-case-id="count-single-table-rule">
- <database name="db1" start-index="29" stop-index="31"/>
+ <database name="db1" start-index="29" stop-index="31" />
</count-single-table-rule>
-
+
<count-sharding-rule sql-case-id="count-sharding-rule">
- <database name="db1" start-index="25" stop-index="27"/>
+ <database name="db1" start-index="25" stop-index="27" />
</count-sharding-rule>
-
+
<count-readwrite-splitting-rule
sql-case-id="count-readwrite-splitting-rule">
- <database name="db1" start-index="36" stop-index="38"/>
+ <database name="db1" start-index="36" stop-index="38" />
</count-readwrite-splitting-rule>
-
+
<count-db-discovery-rule sql-case-id="count-db-discovery-rule">
- <database name="db1" start-index="29" stop-index="31"/>
+ <database name="db1" start-index="29" stop-index="31" />
</count-db-discovery-rule>
-
+
<count-encrypt-rule sql-case-id="count-encrypt-rule">
- <database name="db1" start-index="24" stop-index="26"/>
+ <database name="db1" start-index="24" stop-index="26" />
</count-encrypt-rule>
-
+
<count-shadow-rule sql-case-id="count-shadow-rule">
- <database name="db1" start-index="23" stop-index="25"/>
+ <database name="db1" start-index="23" stop-index="25" />
</count-shadow-rule>
</sql-parser-test-cases>