You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by du...@apache.org on 2022/11/13 10:54:33 UTC
[shardingsphere] branch master updated: add external and internal packages for parser test (#22145)
This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang 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 d85f4f21357 add external and internal packages for parser test (#22145)
d85f4f21357 is described below
commit d85f4f2135755c0666ff5ee282dd0ab552744d79
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Nov 13 18:54:27 2022 +0800
add external and internal packages for parser test (#22145)
---
.../parser/mysql/MySQLParserParameterizedTest.java | 39 -
.../UnsupportedMySQLParserParameterizedTest.java | 39 -
.../mysql/external/MySQLParserParameterizedIT.java | 6 +-
.../internal/MySQLParserParameterizedTest.java | 39 +
.../UnsupportedMySQLParserParameterizedTest.java | 39 +
.../OpenGaussParserParameterizedTest.java | 4 +-
...nsupportedOpenGaussParserParameterizedTest.java | 4 +-
.../oracle/OracleParserParameterizedTest.java | 4 +-
.../UnsupportedOracleParserParameterizedTest.java | 4 +-
.../PostgreSQLParserParameterizedTest.java | 39 -
...supportedPostgreSQLParserParameterizedTest.java | 39 -
.../external/PostgreSQLParserParameterizedIT.java | 6 +-
.../PostgreSQLParserParameterizedTest.java | 39 +
...supportedPostgreSQLParserParameterizedTest.java | 39 +
.../parser/sql92/SQL92ParserParameterizedTest.java | 4 +-
.../UnsupportedSQL92ParserParameterizedTest.java | 4 +-
.../SQLServerParserParameterizedTest.java | 4 +-
...nsupportedSQLServerParserParameterizedTest.java | 4 +-
.../SQLNodeConverterEngineParameterizedTest.java | 10 +-
.../external/engine/SQLParserParameterizedIT.java | 61 -
.../env/SQLParserExternalITEnvironment.java | 69 -
.../sql/parser/external/loader/SQLCaseLoader.java | 135 --
.../loader/strategy/SQLCaseLoadStrategy.java | 37 -
.../strategy/impl/GitHubSQLCaseLoadStrategy.java | 84 -
.../impl/LocalFileSQLCaseLoadStrategy.java | 37 -
.../loader/summary/AssertableFileSummary.java | 35 -
.../external/loader/summary/FileSummary.java | 33 -
.../external/result/SQLParseResultReporter.java | 34 -
.../result/SQLParseResultReporterCreator.java | 34 -
.../SQLParseResultReporterCreatorFactory.java | 44 -
.../result/type/csv/CsvSQLParseResultReporter.java | 67 -
.../type/csv/CsvSQLParseResultReporterCreator.java | 37 -
.../result/type/log/LogSQLParseResultReporter.java | 35 -
.../type/log/LogSQLParseResultReporterCreator.java | 37 -
.../external/engine/SQLParserParameterizedIT.java | 61 +
.../env/SQLParserExternalITEnvironment.java | 69 +
.../sql/parser/external/loader/SQLCaseLoader.java | 135 ++
.../loader/strategy/SQLCaseLoadStrategy.java | 37 +
.../strategy/impl/GitHubSQLCaseLoadStrategy.java | 84 +
.../impl/LocalFileSQLCaseLoadStrategy.java | 37 +
.../loader/summary/AssertableFileSummary.java | 35 +
.../external/loader/summary/FileSummary.java | 33 +
.../external/result/SQLParseResultReporter.java | 34 +
.../result/SQLParseResultReporterCreator.java | 34 +
.../SQLParseResultReporterCreatorFactory.java | 44 +
.../result/type/csv/CsvSQLParseResultReporter.java | 67 +
.../type/csv/CsvSQLParseResultReporterCreator.java | 37 +
.../result/type/log/LogSQLParseResultReporter.java | 35 +
.../type/log/LogSQLParseResultReporterCreator.java | 37 +
.../internal/asserts/SQLCaseAssertContext.java | 84 +
.../internal/asserts/segment/SQLSegmentAssert.java | 57 +
.../segment/assignment/AssignmentAssert.java | 58 +
.../segment/assignment/AssignmentValueAssert.java | 66 +
.../asserts/segment/charset/CharsetAssert.java | 56 +
.../asserts/segment/column/ColumnAssert.java | 76 +
.../segment/cursor/DirectionSegmentAssert.java | 68 +
.../asserts/segment/database/DatabaseAssert.java | 45 +
.../segment/definition/ColumnDefinitionAssert.java | 51 +
.../segment/definition/ColumnPositionAssert.java | 64 +
.../definition/ConstraintDefinitionAssert.java | 80 +
.../asserts/segment/distsql/AlgorithmAssert.java | 53 +
.../segment/distsql/AutoTableRuleAssert.java | 62 +
.../asserts/segment/distsql/DataSourceAssert.java | 68 +
.../asserts/segment/distsql/DatabaseAssert.java | 44 +
.../asserts/segment/distsql/PropertiesAssert.java | 54 +
.../asserts/segment/distsql/PropertyAssert.java | 53 +
.../asserts/segment/distsql/SQLSegmentAssert.java | 46 +
.../asserts/segment/distsql/TableRuleAssert.java | 71 +
.../segment/distsql/rdl/EncryptColumnAssert.java | 58 +
.../segment/distsql/rdl/EncryptRuleAssert.java | 74 +
.../distsql/rdl/ReadwriteSplittingRuleAssert.java | 63 +
.../segment/distsql/rdl/ShadowRuleAssert.java | 81 +
.../segment/distsql/rdl/ShardingAuditorAssert.java | 49 +
.../rdl/ShardingTableReferenceRuleAssert.java | 53 +
.../segment/expression/ExpressionAssert.java | 379 +++++
.../asserts/segment/generic/DataTypeAssert.java | 50 +
.../segment/generic/GrantLevelSegmentAssert.java | 53 +
.../segment/groupby/GroupByClauseAssert.java | 43 +
.../asserts/segment/having/HavingClauseAssert.java | 45 +
.../asserts/segment/index/IndexAssert.java | 57 +
.../asserts/segment/index/IndexTypeAssert.java | 57 +
.../segment/insert/InsertColumnsClauseAssert.java | 54 +
.../insert/InsertMultiTableElementAssert.java | 54 +
.../segment/insert/InsertValuesClauseAssert.java | 64 +
.../insert/OnDuplicateKeyColumnsAssert.java | 56 +
.../asserts/segment/limit/LimitClauseAssert.java | 81 +
.../asserts/segment/lock/LockClauseAssert.java | 69 +
.../asserts/segment/model/ModelClauseAssert.java | 109 ++
.../segment/orderby/OrderByClauseAssert.java | 42 +
.../asserts/segment/orderby/OrderByItemAssert.java | 118 ++
.../asserts/segment/output/OutputClauseAssert.java | 94 ++
.../asserts/segment/owner/OwnerAssert.java | 54 +
.../asserts/segment/packages/PackageAssert.java | 57 +
.../segment/parameter/ParameterMarkerAssert.java | 48 +
.../prepare/PrepareStatementQueryAssert.java | 90 ++
.../segment/projection/ProjectionAssert.java | 178 ++
.../asserts/segment/set/SetClauseAssert.java | 56 +
.../asserts/segment/show/ShowFilterAssert.java | 55 +
.../asserts/segment/table/TableAssert.java | 163 ++
.../internal/asserts/segment/type/TypeAssert.java | 57 +
.../asserts/segment/where/WhereClauseAssert.java | 45 +
.../asserts/segment/with/WithClauseAssert.java | 76 +
.../statement/AbstractSQLStatementAssert.java | 46 +
.../asserts/statement/SQLStatementAssert.java | 66 +
.../asserts/statement/comment/CommentAssert.java | 71 +
.../asserts/statement/dal/DALStatementAssert.java | 302 ++++
.../dal/impl/CacheIndexStatementAssert.java | 88 +
.../dal/impl/CheckTableStatementAssert.java | 43 +
.../statement/dal/impl/CloneStatementAssert.java | 56 +
.../statement/dal/impl/EmptyStatementAssert.java | 41 +
.../statement/dal/impl/ExplainStatementAssert.java | 81 +
.../statement/dal/impl/FlushStatementAssert.java | 51 +
.../dal/impl/InstallComponentStatementAssert.java | 57 +
.../dal/impl/InstallPluginStatementAssert.java | 45 +
.../statement/dal/impl/KillStatementAssert.java | 45 +
.../dal/impl/LoadIndexInfoStatementAssert.java | 78 +
.../MySQLAlterResourceGroupStatementAssert.java | 47 +
.../dal/impl/MySQLBinlogStatementAssert.java | 45 +
.../impl/MySQLChecksumTableStatementAssert.java | 47 +
.../MySQLCreateResourceGroupStatementAssert.java | 47 +
.../dal/impl/MySQLDelimiterStatementAssert.java | 45 +
.../MySQLDropResourceGroupStatementAssert.java | 47 +
.../impl/MySQLOptimizeTableStatementAssert.java | 47 +
.../dal/impl/MySQLRepairTableStatementAssert.java | 47 +
.../dal/impl/MySQLResetPersistStatementAssert.java | 48 +
.../dal/impl/MySQLResetStatementAssert.java | 79 +
.../impl/MySQLSetResourceGroupStatementAssert.java | 47 +
.../dal/impl/MySQLUseStatementAssert.java | 47 +
.../dal/impl/ResetParameterStatementAssert.java | 45 +
.../statement/dal/impl/RestartStatementAssert.java | 41 +
.../dal/impl/SetParameterStatementAssert.java | 58 +
.../dal/impl/ShowBinlogEventsStatementAssert.java | 60 +
.../dal/impl/ShowCharacterSetStatementAssert.java | 45 +
.../dal/impl/ShowCollationStatementAssert.java | 45 +
.../dal/impl/ShowColumnsStatementAssert.java | 53 +
.../dal/impl/ShowCreateTableStatementAssert.java | 41 +
.../dal/impl/ShowCreateTriggerStatementAssert.java | 47 +
.../dal/impl/ShowCreateUserStatementAssert.java | 47 +
.../dal/impl/ShowDatabasesStatementAssert.java | 45 +
.../dal/impl/ShowEventsStatementAssert.java | 51 +
.../impl/ShowFunctionStatusStatementAssert.java | 45 +
.../dal/impl/ShowIndexStatementAssert.java | 66 +
.../dal/impl/ShowOpenTablesStatementAssert.java | 51 +
.../dal/impl/ShowProcedureCodeStatementAssert.java | 43 +
.../impl/ShowProcedureStatusStatementAssert.java | 45 +
.../impl/ShowRelaylogEventsStatementAssert.java | 48 +
.../dal/impl/ShowReplicaStatusStatementAssert.java | 47 +
.../dal/impl/ShowReplicasStatementAssert.java | 41 +
.../dal/impl/ShowSlaveHostsStatementAssert.java | 41 +
.../dal/impl/ShowSlaveStatusStatementAssert.java | 47 +
.../statement/dal/impl/ShowStatementAssert.java | 45 +
.../dal/impl/ShowStatusStatementAssert.java | 45 +
.../dal/impl/ShowTableStatusStatementAssert.java | 51 +
.../dal/impl/ShowTablesStatementAssert.java | 51 +
.../dal/impl/ShowTriggersStatementAssert.java | 51 +
.../dal/impl/ShowVariablesStatementAssert.java | 45 +
.../dal/impl/ShutdownStatementAssert.java | 41 +
.../impl/UninstallComponentStatementAssert.java | 57 +
.../dal/impl/UninstallPluginStatementAssert.java | 45 +
.../asserts/statement/dcl/DCLStatementAssert.java | 132 ++
.../dcl/impl/AlterLoginStatementAssert.java | 54 +
.../dcl/impl/AlterRoleStatementAssert.java | 41 +
.../dcl/impl/AlterUserStatementAssert.java | 41 +
.../dcl/impl/CreateLoginStatementAssert.java | 54 +
.../dcl/impl/CreateRoleStatementAssert.java | 41 +
.../dcl/impl/CreateUserStatementAssert.java | 41 +
.../dcl/impl/DenyUserStatementAssert.java | 66 +
.../dcl/impl/DropLoginStatementAssert.java | 54 +
.../dcl/impl/DropRoleStatementAssert.java | 41 +
.../dcl/impl/DropUserStatementAssert.java | 41 +
.../statement/dcl/impl/GrantStatementAssert.java | 50 +
.../dcl/impl/ReassignOwnedStatementAssert.java | 41 +
.../dcl/impl/RenameUserStatementAssert.java | 41 +
.../statement/dcl/impl/RevokeStatementAssert.java | 50 +
.../dcl/impl/SetDefaultRoleStatementAssert.java | 41 +
.../dcl/impl/SetPasswordStatementAssert.java | 41 +
.../statement/dcl/impl/SetRoleStatementAssert.java | 41 +
.../dcl/impl/mysql/MySQLGrantStatementAssert.java | 53 +
.../dcl/impl/mysql/MySQLRevokeStatementAssert.java | 53 +
.../sqlserver/SQLServerGrantStatementAssert.java | 49 +
.../sqlserver/SQLServerRevokeStatementAssert.java | 49 +
.../sqlserver/SQLServerSetUserStatementAssert.java | 49 +
.../asserts/statement/ddl/DDLStatementAssert.java | 202 +++
.../ddl/impl/AlterIndexStatementAssert.java | 70 +
.../ddl/impl/AlterSessionStatementAssert.java | 41 +
.../ddl/impl/AlterSynonymStatementAssert.java | 41 +
.../ddl/impl/AlterSystemStatementAssert.java | 41 +
.../ddl/impl/AlterTableStatementAssert.java | 197 +++
.../ddl/impl/AlterViewStatementAssert.java | 75 +
.../statement/ddl/impl/AnalyzeStatementAssert.java | 57 +
.../impl/AssociateStatisticsStatementAssert.java | 127 ++
.../statement/ddl/impl/AuditStatementAssert.java | 41 +
.../statement/ddl/impl/CloseStatementAssert.java | 64 +
.../statement/ddl/impl/ClusterStatementAssert.java | 73 +
.../statement/ddl/impl/CommentStatementAssert.java | 81 +
.../ddl/impl/CreateIndexStatementAssert.java | 76 +
.../ddl/impl/CreateTableStatementAssert.java | 106 ++
.../ddl/impl/CreateViewStatementAssert.java | 74 +
.../statement/ddl/impl/CursorStatementAssert.java | 63 +
.../statement/ddl/impl/DeclareStatementAssert.java | 63 +
.../DisassociateStatisticsStatementAssert.java | 127 ++
.../ddl/impl/DropIndexStatementAssert.java | 75 +
.../ddl/impl/DropTableStatementAssert.java | 47 +
.../ddl/impl/DropViewStatementAssert.java | 47 +
.../statement/ddl/impl/FetchStatementAssert.java | 63 +
.../ddl/impl/FlashbackTableStatementAssert.java | 54 +
.../statement/ddl/impl/ListenStatementAssert.java | 42 +
.../statement/ddl/impl/MoveStatementAssert.java | 63 +
.../statement/ddl/impl/NoAuditStatementAssert.java | 41 +
.../ddl/impl/NotifyStmtStatementAssert.java | 38 +
.../statement/ddl/impl/PurgeStatementAssert.java | 57 +
.../impl/RefreshMatViewStmtStatementAssert.java | 41 +
.../statement/ddl/impl/ReindexStatementAssert.java | 41 +
.../ddl/impl/RenameTableStatementAssert.java | 59 +
.../ddl/impl/SecurityLabelStmtStatementAssert.java | 41 +
.../ddl/impl/TruncateStatementAssert.java | 47 +
.../ddl/impl/UnlistenStatementAssert.java | 38 +
.../statement/distsql/DistSQLStatementAssert.java | 58 +
.../statement/distsql/ral/RALStatementAssert.java | 62 +
.../distsql/ral/impl/HintRALStatementAssert.java | 52 +
.../ral/impl/QueryableRALStatementAssert.java | 113 ++
.../ral/impl/UpdatableRALStatementAssert.java | 102 ++
...ddShardingHintDatabaseValueStatementAssert.java | 53 +
.../AddShardingHintTableValueStatementAssert.java | 53 +
.../QueryableScalingRALStatementAssert.java | 68 +
.../UpdatableScalingRALStatementAssert.java | 95 ++
...howMigrationCheckAlgorithmsStatementAssert.java | 46 +
.../ShowMigrationCheckStatusStatementAssert.java | 60 +
.../query/ShowMigrationListStatementAssert.java | 46 +
...MigrationSourceStorageUnitsStatementAssert.java | 46 +
.../query/ShowMigrationStatusStatementAssert.java | 60 +
.../update/CheckMigrationStatementAssert.java | 72 +
.../update/CommitMigrationStatementAssert.java | 60 +
.../update/MigrateTableStatementAssert.java | 46 +
...rMigrationSourceStorageUnitStatementAssert.java | 73 +
.../update/RollbackMigrationStatementAssert.java | 60 +
.../update/StartMigrationCheckStatementAssert.java | 58 +
.../update/StartMigrationStatementAssert.java | 60 +
.../update/StopMigrationCheckStatementAssert.java | 58 +
.../update/StopMigrationStatementAssert.java | 60 +
...rMigrationSourceStorageUnitStatementAssert.java | 51 +
.../ConvertYamlConfigurationStatementAssert.java | 48 +
...ExportDatabaseConfigurationStatementAssert.java | 47 +
.../ShowAuthorityRuleStatementAssert.java | 46 +
.../ShowComputeNodeInfoStatementAssert.java | 46 +
.../ShowComputeNodeModeStatementAssert.java | 46 +
.../queryable/ShowComputeNodesStatementAssert.java | 46 +
.../queryable/ShowDistVariableStatementAssert.java | 49 +
.../ShowDistVariablesStatementAssert.java | 43 +
.../ShowSQLParserRuleStatementAssert.java | 46 +
.../ShowSQLTranslatorRuleStatementAssert.java | 46 +
...FromReadwriteSplittingRulesStatementAssert.java | 47 +
.../ShowTableMetadataStatementAssert.java | 52 +
.../queryable/ShowTrafficRulesStatementAssert.java | 52 +
.../ShowTransactionRuleStatementAssert.java | 49 +
.../updatable/AlterComputeNodeStatementAssert.java | 54 +
...eSplittingStorageUnitStatusStatementAssert.java | 66 +
.../AlterSQLParserRuleStatementAssert.java | 64 +
.../updatable/AlterTrafficRuleStatementAssert.java | 68 +
.../AlterTransactionRuleStatementAssert.java | 46 +
.../CreateTrafficRuleStatementAssert.java | 68 +
.../updatable/DropTrafficRuleStatementAssert.java | 54 +
...ImportDatabaseConfigurationStatementAssert.java | 51 +
.../updatable/LabelComputeNodeStatementAssert.java | 53 +
.../RefreshTableMetadataStatementAssert.java | 57 +
.../updatable/SetDistVariableStatementAssert.java | 38 +
.../UnlabelComputeNodeStatementAssert.java | 52 +
.../statement/distsql/rdl/RDLStatementAssert.java | 92 ++
.../rdl/alter/AlterRuleStatementAssert.java | 92 ++
.../rdl/alter/AlterStorageUnitStatementAssert.java | 72 +
...rDatabaseDiscoveryHeartbeatStatementAssert.java | 62 +
.../AlterDatabaseDiscoveryRuleStatementAssert.java | 84 +
.../AlterDatabaseDiscoveryTypeStatementAssert.java | 63 +
...AlterDefaultShadowAlgorithmStatementAssert.java | 58 +
...lterDefaultShardingStrategyStatementAssert.java | 59 +
.../impl/AlterEncryptRuleStatementAssert.java | 73 +
...AlterReadwriteSplittingRuleStatementAssert.java | 74 +
.../alter/impl/AlterShadowRuleStatementAssert.java | 70 +
.../impl/AlterShardingAuditorStatementAssert.java | 69 +
...ShardingTableReferenceRulesStatementAssert.java | 75 +
.../AlterShardingTableRuleStatementAssert.java | 98 ++
.../rdl/create/CreateRuleStatementAssert.java | 106 ++
.../create/RegisterStorageUnitStatementAssert.java | 72 +
.../CreateBroadcastTableRuleStatementAssert.java | 52 +
...eDatabaseDiscoveryHeartbeatStatementAssert.java | 62 +
...CreateDatabaseDiscoveryRuleStatementAssert.java | 83 +
...CreateDatabaseDiscoveryTypeStatementAssert.java | 63 +
...reateDefaultShadowAlgorithmStatementAssert.java | 58 +
...eateDefaultShardingStrategyStatementAssert.java | 59 +
.../impl/CreateEncryptRuleStatementAssert.java | 75 +
...reateReadwriteSplittingRuleStatementAssert.java | 75 +
.../impl/CreateShadowRuleStatementAssert.java | 70 +
.../impl/CreateShardingAuditorStatementAssert.java | 69 +
...eShardingTableReferenceRuleStatementAssert.java | 75 +
.../CreateShardingTableRuleStatementAssert.java | 98 ++
...faultSingleTableStorageUnitStatementAssert.java | 54 +
.../distsql/rdl/drop/DropRuleStatementAssert.java | 107 ++
.../drop/UnregisterStorageUnitStatementAssert.java | 52 +
.../DropBroadcastTableRuleStatementAssert.java | 53 +
...pDatabaseDiscoveryHeartbeatStatementAssert.java | 53 +
.../DropDatabaseDiscoveryRuleStatementAssert.java | 52 +
.../DropDatabaseDiscoveryTypeStatementAssert.java | 53 +
...DropDefaultShardingStrategyStatementAssert.java | 53 +
.../drop/impl/DropEncryptRuleStatementAssert.java | 52 +
.../DropReadwriteSplittingRuleStatementAssert.java | 53 +
.../impl/DropShadowAlgorithmStatementAssert.java | 53 +
.../drop/impl/DropShadowRuleStatementAssert.java | 53 +
.../impl/DropShardingAlgorithmStatementAssert.java | 51 +
.../impl/DropShardingAuditorStatementAssert.java | 51 +
.../DropShardingKeyGeneratorStatementAssert.java | 51 +
...ShardingTableReferenceRulesStatementAssert.java | 48 +
.../impl/DropShardingTableRuleStatementAssert.java | 56 +
.../statement/distsql/rql/RQLStatementAssert.java | 46 +
.../distsql/rql/impl/ShowRulesStatementAssert.java | 59 +
.../statement/distsql/rul/RULStatementAssert.java | 46 +
.../distsql/rul/impl/SQLRULStatementAssert.java | 57 +
.../rul/impl/sql/FormatSQLStatementAssert.java | 49 +
.../distsql/rul/impl/sql/ParseStatementAssert.java | 49 +
.../rul/impl/sql/PreviewStatementAssert.java | 49 +
.../asserts/statement/dml/DMLStatementAssert.java | 82 +
.../statement/dml/impl/CallStatementAssert.java | 96 ++
.../statement/dml/impl/CopyStatementAssert.java | 85 +
.../statement/dml/impl/DeleteStatementAssert.java | 140 ++
.../statement/dml/impl/DoStatementAssert.java | 72 +
.../statement/dml/impl/InsertStatementAssert.java | 167 ++
.../statement/dml/impl/MergeStatementAssert.java | 103 ++
.../statement/dml/impl/SelectStatementAssert.java | 204 +++
.../statement/dml/impl/UpdateStatementAssert.java | 103 ++
.../asserts/statement/tcl/TCLStatementAssert.java | 92 ++
.../tcl/impl/BeginTransactionStatementAssert.java | 41 +
.../statement/tcl/impl/CommitStatementAssert.java | 41 +
.../statement/tcl/impl/LockStatementAssert.java | 73 +
.../impl/PrepareTransactionStatementAssert.java | 41 +
.../tcl/impl/RollbackStatementAssert.java | 52 +
.../tcl/impl/SavepointStatementAssert.java | 45 +
.../tcl/impl/SetAutoCommitStatementAssert.java | 45 +
.../tcl/impl/SetConstraintsStatementAssert.java | 41 +
.../tcl/impl/SetTransactionStatementAssert.java | 41 +
.../statement/tcl/impl/UnlockStatementAssert.java | 41 +
.../asserts/value/IdentifierValueAssert.java | 52 +
.../engine/SQLParserParameterizedTest.java | 80 +
.../UnsupportedSQLParserParameterizedTest.java | 60 +
.../test/sql/parser/internal/jaxb/Case.java | 38 +
.../test/sql/parser/internal/jaxb/Cases.java | 24 +
.../sql/parser/internal/jaxb/CasesRegistry.java | 52 +
.../jaxb/cases/SQLParserTestCasesRegistry.java | 105 ++
.../cases/SQLParserTestCasesRegistryFactory.java | 40 +
.../jaxb/cases/domain/SQLParserTestCases.java | 1705 ++++++++++++++++++++
.../AbstractExpectedDelimiterSQLSegment.java | 37 +
.../AbstractExpectedIdentifierSQLSegment.java | 34 +
.../domain/segment/AbstractExpectedSQLSegment.java | 46 +
.../segment/ExpectedDelimiterSQLSegment.java | 38 +
.../segment/ExpectedIdentifierSQLSegment.java | 31 +
.../cases/domain/segment/ExpectedSQLSegment.java | 52 +
.../impl/assignment/ExpectedAssignment.java | 43 +
.../impl/assignment/ExpectedAssignmentValue.java | 56 +
.../impl/assignment/ExpectedValueAssign.java | 39 +
.../segment/impl/assignment/ExpectedVariable.java | 38 +
.../segment/impl/call/ExpectedCallParameter.java | 44 +
.../segment/impl/call/ExpectedProcedureName.java | 35 +
.../impl/call/ExpectedProcedureParameters.java | 37 +
.../segment/impl/charset/ExpectedCharsetName.java | 35 +
.../segment/impl/charset/ExpectedCollate.java | 35 +
.../segment/impl/clone/ExpectedDataDirectory.java | 33 +
.../segment/impl/clone/ExpectedInstance.java | 45 +
.../domain/segment/impl/column/ExpectedColumn.java | 37 +
.../segment/impl/column/ExpectedColumns.java | 37 +
.../segment/impl/comments/ExpectedComment.java | 35 +
.../segment/impl/component/ExpectedComponent.java | 28 +
.../segment/impl/cursor/ExpectedCursorName.java | 30 +
.../impl/cursor/ExpectedDirectionSegment.java | 38 +
.../definition/ExpectedAddColumnDefinition.java | 40 +
.../definition/ExpectedChangeColumnDefinition.java | 42 +
.../impl/definition/ExpectedColumnDefinition.java | 49 +
.../impl/definition/ExpectedColumnPosition.java | 36 +
.../definition/ExpectedConstraintDefinition.java | 52 +
.../definition/ExpectedConvertTableDefinition.java | 40 +
.../definition/ExpectedModifyColumnDefinition.java | 38 +
.../impl/definition/ExpectedRenameDefinition.java | 39 +
.../segment/impl/distsql/ExpectedAlgorithm.java | 39 +
.../impl/distsql/ExpectedAutoTableRule.java | 49 +
.../segment/impl/distsql/ExpectedCacheOption.java | 38 +
.../segment/impl/distsql/ExpectedDataSource.java | 54 +
.../segment/impl/distsql/ExpectedProperties.java | 36 +
.../segment/impl/distsql/ExpectedProperty.java | 38 +
.../impl/distsql/ExpectedSQLParserRule.java | 42 +
.../segment/impl/distsql/ExpectedTableRule.java | 50 +
.../impl/distsql/ral/ExpectedTrafficRule.java | 43 +
.../rdl/ExceptedReadwriteSplittingRule.java | 50 +
.../ExpectedDatabaseDiscoveryDefinitionRule.java | 48 +
.../rdl/ExpectedDatabaseDiscoveryHeartbeat.java | 40 +
.../distsql/rdl/ExpectedDatabaseDiscoveryType.java | 40 +
.../rdl/ExpectedDefaultShardingStrategy.java | 46 +
.../impl/distsql/rdl/ExpectedEncryptColumn.java | 49 +
.../impl/distsql/rdl/ExpectedEncryptRule.java | 40 +
.../impl/distsql/rdl/ExpectedShadowAlgorithm.java | 40 +
.../impl/distsql/rdl/ExpectedShadowRule.java | 60 +
.../impl/distsql/rdl/ExpectedShardingAuditor.java | 40 +
.../impl/distsql/rdl/ExpectedShardingStrategy.java | 40 +
.../rdl/ExpectedShardingTableReferenceRule.java | 35 +
.../impl/dostatement/ExpectedDoParameter.java | 44 +
.../impl/dostatement/ExpectedDoParameters.java | 37 +
.../impl/expr/ExpectedBetweenExpression.java | 44 +
.../expr/ExpectedBinaryOperationExpression.java | 41 +
.../impl/expr/ExpectedCollateExpression.java | 35 +
.../segment/impl/expr/ExpectedExistsSubquery.java | 39 +
.../segment/impl/expr/ExpectedExpression.java | 89 +
.../impl/expr/ExpectedExpressionSegment.java | 24 +
.../segment/impl/expr/ExpectedInExpression.java | 41 +
.../segment/impl/expr/ExpectedListExpression.java | 37 +
.../segment/impl/expr/ExpectedNotExpression.java | 35 +
.../complex/ExpectedBaseComplexExpression.java | 35 +
.../expr/complex/ExpectedCommonExpression.java | 34 +
.../complex/ExpectedComplexExpressionSegment.java | 33 +
.../expr/simple/ExpectedBaseSimpleExpression.java | 26 +
.../expr/simple/ExpectedLiteralExpression.java | 34 +
.../simple/ExpectedParameterMarkerExpression.java | 34 +
.../simple/ExpectedSimpleExpressionSegment.java | 26 +
.../segment/impl/expr/simple/ExpectedSubquery.java | 35 +
.../segment/impl/from/ExpectedFromSchema.java | 31 +
.../segment/impl/function/ExpectedFunction.java | 53 +
.../segment/impl/generic/ExpectedDataType.java | 35 +
.../domain/segment/impl/group/ExpectedGroup.java | 30 +
.../segment/impl/having/ExpectedHavingClause.java | 39 +
.../impl/index/ExpectedCacheTableIndex.java | 41 +
.../domain/segment/impl/index/ExpectedIndex.java | 36 +
.../segment/impl/index/ExpectedIndexType.java | 36 +
.../segment/impl/index/ExpectedLoadTableIndex.java | 44 +
.../segment/impl/index/ExpectedPartition.java | 26 +
.../impl/index/ExpectedPartitionDefinition.java | 41 +
.../impl/insert/ExpectedInsertColumnsClause.java | 36 +
.../insert/ExpectedInsertMultiTableElement.java | 36 +
.../segment/impl/insert/ExpectedInsertValue.java | 36 +
.../impl/insert/ExpectedInsertValuesClause.java | 35 +
.../impl/insert/ExpectedOnDuplicateKeyColumns.java | 36 +
.../segment/impl/like/ExpectedLikeClause.java | 38 +
.../segment/impl/limit/ExpectedLimitClause.java | 38 +
.../impl/limit/ExpectedPaginationValue.java | 38 +
.../segment/impl/lock/ExpectedLockClause.java | 42 +
.../domain/segment/impl/login/ExpectedLogin.java | 30 +
.../segment/impl/model/ExpectedModelClause.java | 49 +
.../impl/orderby/ExpectedOrderByClause.java | 53 +
.../impl/orderby/item/ExpectedOrderByItem.java | 35 +
.../item/impl/ExpectedColumnOrderByItem.java | 41 +
.../item/impl/ExpectedExpressionOrderByItem.java | 40 +
.../item/impl/ExpectedIndexOrderByItem.java | 35 +
.../segment/impl/output/ExpectedOutputClause.java | 42 +
.../segment/impl/output/ExpectedOutputColumn.java | 38 +
.../impl/output/ExpectedOutputTableColumn.java | 38 +
.../segment/impl/packages/ExpectedPackage.java | 36 +
.../domain/segment/impl/plugin/ExpectedPlugin.java | 28 +
.../impl/projection/ExpectedProjection.java | 23 +
.../impl/projection/ExpectedProjections.java | 94 ++
.../ExpectedAggregationDistinctProjection.java | 31 +
.../aggregation/ExpectedAggregationProjection.java | 46 +
.../impl/column/ExpectedColumnProjection.java | 38 +
.../expression/ExpectedExpressionProjection.java | 45 +
.../shorthand/ExpectedShorthandProjection.java | 34 +
.../impl/subquery/ExpectedSubqueryProjection.java | 47 +
.../projection/impl/top/ExpectedTopProjection.java | 37 +
.../impl/projection/impl/top/ExpectedTopValue.java | 38 +
.../impl/query/ExpectedPrepareStatementQuery.java | 48 +
.../impl/reset/ExpectedResetOptionSegment.java | 42 +
.../segment/impl/schema/ExpectedDatabase.java | 30 +
.../domain/segment/impl/set/ExpectedSetClause.java | 36 +
.../segment/impl/show/ExpectedShowFilter.java | 38 +
.../segment/impl/table/ExpectedJoinTable.java | 52 +
.../domain/segment/impl/table/ExpectedOwner.java | 35 +
.../segment/impl/table/ExpectedSimpleTable.java | 39 +
.../segment/impl/table/ExpectedSubqueryTable.java | 40 +
.../domain/segment/impl/table/ExpectedTable.java | 41 +
.../segment/impl/trigger/ExpectedTrigger.java | 31 +
.../domain/segment/impl/type/ExpectedType.java | 36 +
.../domain/segment/impl/union/ExpectedCombine.java | 40 +
.../domain/segment/impl/user/ExpectedUser.java | 35 +
.../segment/impl/where/ExpectedWhereClause.java | 39 +
.../segment/impl/window/ExpectedWindowClause.java | 34 +
.../ExpectedCommonTableExpressColumnsClause.java | 38 +
.../with/ExpectedCommonTableExpressionClause.java | 43 +
.../segment/impl/with/ExpectedWithClause.java | 37 +
.../domain/statement/CommonStatementTestCase.java | 38 +
.../statement/DatabaseContainedTestCase.java | 35 +
.../statement/DropRuleStatementTestCase.java | 33 +
.../cases/domain/statement/SQLParserTestCase.java | 58 +
.../dal/AlterResourceGroupStatementTestCase.java | 36 +
.../statement/dal/BinlogStatementTestCase.java | 35 +
.../statement/dal/CacheIndexStatementTestCase.java | 46 +
.../statement/dal/CheckTableStatementTestCase.java | 36 +
.../dal/ChecksumTableStatementTestCase.java | 36 +
.../statement/dal/CloneStatementTestCase.java | 40 +
.../dal/CreateResourceGroupStatementTestCase.java | 36 +
.../statement/dal/DelimiterStatementTestCase.java | 35 +
.../dal/DropResourceGroupStatementTestCase.java | 36 +
.../statement/dal/EmptyStatementTestCase.java | 26 +
.../statement/dal/ExplainStatementTestCase.java | 60 +
.../statement/dal/FlushStatementTestCase.java | 42 +
.../statement/dal/HelpStatementTestCase.java | 35 +
.../dal/InstallComponentStatementTestCase.java | 36 +
.../dal/InstallPluginStatementTestCase.java | 36 +
.../statement/dal/KillStatementTestCase.java | 35 +
.../dal/LoadIndexInfoStatementTestCase.java | 36 +
.../dal/OptimizeTableStatementTestCase.java | 36 +
.../dal/RepairTableStatementTestCase.java | 36 +
.../dal/ResetParameterStatementTestCase.java | 35 +
.../dal/ResetPersistStatementTestCase.java | 38 +
.../statement/dal/ResetStatementTestCase.java | 36 +
.../statement/dal/RestartStatementTestCase.java | 26 +
.../dal/SetParameterStatementTestCase.java | 36 +
.../dal/SetResourceGroupStatementTestCase.java | 36 +
.../dal/ShowBinlogEventsStatementTestCase.java | 40 +
.../dal/ShowCharacterSetStatementTestCase.java | 36 +
.../dal/ShowCollationStatementTestCase.java | 36 +
.../dal/ShowColumnsStatementTestCase.java | 44 +
.../dal/ShowCreateTableStatementTestCase.java | 36 +
.../dal/ShowCreateTriggerStatementTestCase.java | 36 +
.../dal/ShowCreateUserStatementTestCase.java | 36 +
.../dal/ShowDatabasesStatementTestCase.java | 36 +
.../statement/dal/ShowEventsStatementTestCase.java | 40 +
.../dal/ShowFunctionStatusStatementTestCase.java | 36 +
.../statement/dal/ShowIndexStatementTestCase.java | 40 +
.../dal/ShowOpenTablesStatementTestCase.java | 40 +
.../dal/ShowProcedureCodeStatementTestCase.java | 36 +
.../dal/ShowProcedureStatusStatementTestCase.java | 36 +
.../dal/ShowRelayLogEventsStatementTestCase.java | 38 +
.../dal/ShowReplicaStatusStatementTestCase.java | 35 +
.../dal/ShowReplicasStatementTestCase.java | 26 +
.../dal/ShowSlaveHostsStatementTestCase.java | 26 +
.../dal/ShowSlaveStatusStatementTestCase.java | 35 +
.../statement/dal/ShowStatementTestCase.java | 35 +
.../statement/dal/ShowStatusStatementTestCase.java | 36 +
.../dal/ShowTableStatusStatementTestCase.java | 40 +
.../statement/dal/ShowTablesStatementTestCase.java | 40 +
.../dal/ShowTriggersStatementTestCase.java | 40 +
.../dal/ShowVariablesStatementTestCase.java | 36 +
.../statement/dal/ShutdownStatementTestCase.java | 26 +
.../dal/UninstallComponentStatementTestCase.java | 36 +
.../dal/UninstallPluginStatementTestCase.java | 36 +
.../domain/statement/dal/UseStatementTestCase.java | 36 +
.../statement/dcl/AlterLoginStatementTestCase.java | 36 +
.../statement/dcl/AlterRoleStatementTestCase.java | 26 +
.../statement/dcl/AlterUserStatementTestCase.java | 26 +
.../dcl/CreateGroupStatementTestCase.java | 26 +
.../dcl/CreateLoginStatementTestCase.java | 36 +
.../statement/dcl/CreateRoleStatementTestCase.java | 26 +
.../statement/dcl/CreateUserStatementTestCase.java | 26 +
.../statement/dcl/DenyUserStatementTestCase.java | 42 +
.../statement/dcl/DropLoginStatementTestCase.java | 36 +
.../statement/dcl/DropRoleStatementTestCase.java | 26 +
.../statement/dcl/DropUserStatementTestCase.java | 26 +
.../statement/dcl/GrantStatementTestCase.java | 40 +
.../dcl/ReassignOwnedStatementTestCase.java | 26 +
.../statement/dcl/RenameUserStatementTestCase.java | 26 +
.../statement/dcl/RevertStatementTestCase.java | 26 +
.../statement/dcl/RevokeStatementTestCase.java | 40 +
.../dcl/SetDefaultRoleStatementTestCase.java | 26 +
.../dcl/SetPasswordStatementTestCase.java | 26 +
.../statement/dcl/SetRoleStatementTestCase.java | 26 +
.../statement/dcl/SetUserStatementTestCase.java | 33 +
.../ddl/AlterAggregateStatementTestCase.java | 26 +
.../ddl/AlterAnalyticViewStatementTestCase.java | 26 +
.../AlterAttributeDimensionStatementTestCase.java | 26 +
.../ddl/AlterAuditPolicyStatementTestCase.java | 26 +
.../ddl/AlterClusterStatementTestCase.java | 26 +
.../ddl/AlterCollationStatementTestCase.java | 26 +
.../ddl/AlterConversionStatementTestCase.java | 26 +
.../AlterDatabaseDictionaryStatementTestCase.java | 26 +
.../ddl/AlterDatabaseLinkStatementTestCase.java | 26 +
.../ddl/AlterDatabaseStatementTestCase.java | 26 +
.../ddl/AlterDefaultPrivilegesTestCase.java | 26 +
.../ddl/AlterDimensionStatementTestCase.java | 26 +
.../ddl/AlterDirectoryStatementTestCase.java | 26 +
.../ddl/AlterDiskgroupStatementTestCase.java | 26 +
.../ddl/AlterDomainStatementTestCase.java | 26 +
.../ddl/AlterExtensionStatementTestCase.java | 26 +
.../AlterFlashbackArchiveStatementTestCase.java | 26 +
.../ddl/AlterForeignDataWrapperTestCase.java | 26 +
.../statement/ddl/AlterForeignTableTestCase.java | 26 +
.../ddl/AlterFunctionStatementTestCase.java | 26 +
.../statement/ddl/AlterGroupStatementTestCase.java | 26 +
.../ddl/AlterHierarchyStatementTestCase.java | 26 +
.../statement/ddl/AlterIndexStatementTestCase.java | 40 +
.../ddl/AlterIndexTypeStatementTestCase.java | 26 +
.../AlterInmemoryJoinGroupStatementTestCase.java | 26 +
.../statement/ddl/AlterJavaStatementTestCase.java | 26 +
.../ddl/AlterLanguageStatementTestCase.java | 26 +
.../ddl/AlterLibraryStatementTestCase.java | 26 +
.../ddl/AlterLockdownProfileStatementTestCase.java | 26 +
.../AlterMaterializedViewLogStatementTestCase.java | 26 +
.../AlterMaterializedViewStatementTestCase.java | 26 +
.../AlterMaterializedZonemapStatementTestCase.java | 26 +
.../ddl/AlterOperatorStatementTestCase.java | 26 +
.../ddl/AlterOutlineStatementTestCase.java | 26 +
.../ddl/AlterPackageStatementTestCase.java | 26 +
.../AlterPluggableDatabaseStatementTestCase.java | 26 +
.../ddl/AlterPolicyStatementTestCase.java | 26 +
.../ddl/AlterProcedureStatementTestCase.java | 26 +
.../ddl/AlterPublicationStatementTestCase.java | 26 +
.../ddl/AlterRoutineStatementTestCase.java | 26 +
.../statement/ddl/AlterRuleStatementTestCase.java | 26 +
.../ddl/AlterSchemaStatementTestCase.java | 26 +
.../ddl/AlterSequenceStatementTestCase.java | 26 +
.../ddl/AlterServerStatementTestCase.java | 26 +
.../ddl/AlterServiceStatementTestCase.java | 26 +
.../ddl/AlterSessionStatementTestCase.java | 26 +
.../ddl/AlterStatisticsStatementTestCase.java | 26 +
.../ddl/AlterSubscriptionStatementTestCase.java | 26 +
.../ddl/AlterSynonymStatementTestCase.java | 26 +
.../ddl/AlterSystemStatementTestCase.java | 26 +
.../statement/ddl/AlterTableStatementTestCase.java | 65 +
.../ddl/AlterTextSearchStatementTestCase.java | 26 +
.../ddl/AlterTriggerStatementTestCase.java | 26 +
.../statement/ddl/AlterTypeStatementTestCase.java | 26 +
.../statement/ddl/AlterViewStatementTestCase.java | 47 +
.../statement/ddl/AnalyzeStatementTestCase.java | 40 +
.../ddl/AssociateStatisticsStatementTestCase.java | 62 +
.../statement/ddl/AuditStatementTestCase.java | 26 +
.../statement/ddl/CloseStatementTestCase.java | 40 +
.../statement/ddl/ClusterStatementTestCase.java | 40 +
.../statement/ddl/CommentStatementTestCase.java | 44 +
.../ddl/CreateAccessMethodStatementTestCase.java | 26 +
.../ddl/CreateAggregateStatementTestCase.java | 26 +
.../statement/ddl/CreateCastStatementTestCase.java | 26 +
.../ddl/CreateCollationStatementTestCase.java | 26 +
.../ddl/CreateContextStatementTestCase.java | 26 +
.../ddl/CreateControlFileStatementTestCase.java | 26 +
.../ddl/CreateConversionStatementTestCase.java | 26 +
.../ddl/CreateDatabaseLinkStatementTestCase.java | 26 +
.../ddl/CreateDatabaseStatementTestCase.java | 26 +
.../ddl/CreateDimensionStatementTestCase.java | 26 +
.../ddl/CreateDirectoryStatementTestCase.java | 26 +
.../ddl/CreateDiskgroupStatementTestCase.java | 26 +
.../ddl/CreateDomainStatementTestCase.java | 26 +
.../ddl/CreateEditionStatementTestCase.java | 26 +
.../ddl/CreateEventTriggerStatementTestCase.java | 26 +
.../ddl/CreateExtensionStatementTestCase.java | 26 +
.../CreateFlashbackArchiveStatementTestCase.java | 26 +
.../CreateForeignDataWrapperStatementTestCase.java | 26 +
.../ddl/CreateForeignTableStatementTestCase.java | 26 +
.../ddl/CreateFunctionStatementTestCase.java | 26 +
.../ddl/CreateIndexStatementTestCase.java | 44 +
.../CreateInmemoryJoinGroupStatementTestCase.java | 26 +
.../ddl/CreateLanguageStatementTestCase.java | 26 +
.../CreateLockdownProfileStatementTestCase.java | 26 +
.../CreateMaterializedViewStatementTestCase.java | 26 +
.../ddl/CreateOperatorStatementTestCase.java | 26 +
.../ddl/CreatePFileStatementTestCase.java | 26 +
.../ddl/CreatePolicyStatementTestCase.java | 26 +
.../ddl/CreateProcedureStatementTestCase.java | 26 +
.../ddl/CreatePublicationStatementTestCase.java | 26 +
.../ddl/CreateRestorePointStatementTestCase.java | 26 +
.../CreateRollbackSegmentStatementTestCase.java | 26 +
.../statement/ddl/CreateRuleStatementTestCase.java | 26 +
.../ddl/CreateSPFileStatementTestCase.java | 26 +
.../ddl/CreateSchemaStatementTestCase.java | 26 +
.../ddl/CreateSequenceStatementTestCase.java | 26 +
.../ddl/CreateServerStatementTestCase.java | 26 +
.../ddl/CreateServiceStatementTestCase.java | 26 +
.../ddl/CreateSynonymStatementTestCase.java | 26 +
.../ddl/CreateTableStatementTestCase.java | 54 +
.../ddl/CreateTablespaceStatementTestCase.java | 26 +
.../ddl/CreateTextSearchStatementTestCase.java | 26 +
.../ddl/CreateTriggerStatementTestCase.java | 26 +
.../statement/ddl/CreateTypeStatementTestCase.java | 26 +
.../statement/ddl/CreateViewStatementTestCase.java | 44 +
.../statement/ddl/CursorStatementTestCase.java | 40 +
.../statement/ddl/DeclareStatementTestCase.java | 40 +
.../DisassociateStatisticsStatementTestCase.java | 62 +
.../statement/ddl/DiscardStatementTestCase.java | 26 +
.../ddl/DropAccessMethodStatementTestCase.java | 26 +
.../ddl/DropAggregateStatementTestCase.java | 26 +
.../statement/ddl/DropCastStatementTestCase.java | 26 +
.../ddl/DropCollationStatementTestCase.java | 26 +
.../ddl/DropConversionStatementTestCase.java | 26 +
.../ddl/DropDatabaseLinkStatementTestCase.java | 26 +
.../ddl/DropDatabaseStatementTestCase.java | 26 +
.../ddl/DropDimensionStatementTestCase.java | 26 +
.../ddl/DropDirectoryStatementTestCase.java | 26 +
.../ddl/DropDiskgroupStatementTestCase.java | 26 +
.../statement/ddl/DropDomainStatementTestCase.java | 26 +
.../ddl/DropEditionStatementTestCase.java | 26 +
.../ddl/DropEventTriggerStatementTestCase.java | 26 +
.../ddl/DropExtensionStatementTestCase.java | 26 +
.../ddl/DropFlashbackArchiveStatementTestCase.java | 26 +
.../DropForeignDataWrapperStatementTestCase.java | 26 +
.../ddl/DropForeignTableStatementTestCase.java | 26 +
.../ddl/DropFunctionStatementTestCase.java | 26 +
.../statement/ddl/DropGroupStatementTestCase.java | 26 +
.../statement/ddl/DropIndexStatementTestCase.java | 42 +
.../ddl/DropIndexTypeStatementTestCase.java | 26 +
.../DropInmemoryJoinGroupStatementTestCase.java | 26 +
.../statement/ddl/DropJavaStatementTestCase.java | 26 +
.../ddl/DropLanguageStatementTestCase.java | 26 +
.../ddl/DropLibraryStatementTestCase.java | 26 +
.../ddl/DropLockdownProfileStatementTestCase.java | 26 +
.../DropMaterializedViewLogStatementTestCase.java | 26 +
.../ddl/DropMaterializedViewStatementTestCase.java | 26 +
.../DropMaterializedZonemapStatementTestCase.java | 26 +
.../ddl/DropOperatorClassStatementTestCase.java | 26 +
.../ddl/DropOperatorFamilyStatementTestCase.java | 26 +
.../ddl/DropOperatorStatementTestCase.java | 26 +
.../ddl/DropOutlineStatementTestCase.java | 26 +
.../statement/ddl/DropOwnedStatementTestCase.java | 26 +
.../ddl/DropPackageStatementTestCase.java | 26 +
.../DropPluggableDatabaseStatementTestCase.java | 26 +
.../statement/ddl/DropPolicyStatementTestCase.java | 26 +
.../ddl/DropProcedureStatementTestCase.java | 26 +
.../ddl/DropPublicationStatementTestCase.java | 26 +
.../ddl/DropRestorePointStatementTestCase.java | 26 +
.../ddl/DropRollbackSegmentStatementTestCase.java | 26 +
.../ddl/DropRoutineStatementTestCase.java | 26 +
.../statement/ddl/DropRuleStatementTestCase.java | 26 +
.../statement/ddl/DropSchemaStatementTestCase.java | 26 +
.../ddl/DropSequenceStatementTestCase.java | 26 +
.../statement/ddl/DropServerStatementTestCase.java | 26 +
.../ddl/DropServiceStatementTestCase.java | 26 +
.../ddl/DropStatisticsStatementTestCase.java | 26 +
.../ddl/DropSubscriptionStatementTestCase.java | 26 +
.../ddl/DropSynonymStatementTestCase.java | 26 +
.../statement/ddl/DropTableStatementTestCase.java | 36 +
.../ddl/DropTextSearchStatementTestCase.java | 26 +
.../ddl/DropTriggerStatementTestCase.java | 26 +
.../statement/ddl/DropTypeStatementTestCase.java | 26 +
.../statement/ddl/DropViewStatementTestCase.java | 38 +
.../statement/ddl/FetchStatementTestCase.java | 40 +
.../ddl/FlashbackDatabaseStatementTestCase.java | 26 +
.../ddl/FlashbackTableStatementTestCase.java | 39 +
.../statement/ddl/ListenStatementTestCase.java | 35 +
.../statement/ddl/MoveStatementTestCase.java | 40 +
.../statement/ddl/NoAuditStatementTestCase.java | 26 +
.../statement/ddl/NotifyStmtStatementTestCase.java | 26 +
.../statement/ddl/PreparedStatementTestCase.java | 26 +
.../statement/ddl/PurgeStatementTestCase.java | 40 +
.../ddl/RefreshMatViewStmtStatementTestCase.java | 26 +
.../statement/ddl/ReindexStatementTestCase.java | 26 +
.../statement/ddl/RenameStatementTestCase.java | 26 +
.../ddl/RenameTableStatementTestCase.java | 36 +
.../ddl/SecurityLabelStmtStatementTestCase.java | 26 +
.../statement/ddl/TruncateStatementTestCase.java | 36 +
.../statement/ddl/UnlistenStatementTestCase.java | 26 +
...ShardingHintDatabaseValueStatementTestCase.java | 38 +
...AddShardingHintTableValueStatementTestCase.java | 38 +
.../ral/AlterComputeNodeStatementTestCase.java | 41 +
...AlterLocalTransactionRuleStatementTestCase.java | 26 +
...plittingStorageUnitStatusStatementTestCase.java | 41 +
.../ral/AlterSQLParserRuleStatementTestCase.java | 34 +
.../ral/AlterTrafficRuleStatementTestCase.java | 36 +
.../AlterXATransactionRuleStatementTestCase.java | 26 +
.../distsql/ral/ApplyDistSQLStatementTestCase.java | 26 +
.../distsql/ral/ClearHintStatementTestCase.java | 26 +
...earReadwriteSplittingHintStatementTestCase.java | 26 +
.../ral/ClearShardingHintStatementTestCase.java | 26 +
.../ConvertYamlConfigurationStatementTestCase.java | 35 +
.../ral/CreateTrafficRuleStatementTestCase.java | 36 +
.../ral/DiscardDistSQLStatementTestCase.java | 26 +
.../ral/DropTrafficRuleStatementTestCase.java | 36 +
...portDatabaseConfigurationStatementTestCase.java | 26 +
...portDatabaseConfigurationStatementTestCase.java | 35 +
.../ral/LabelComputeNodeStatementTestCase.java | 43 +
.../ral/PrepareDistSQLStatementTestCase.java | 26 +
.../ral/RefreshTableMetadataStatementTestCase.java | 41 +
.../ral/SetDistVariableStatementTestCase.java | 26 +
...SetReadwriteSplittingHintStatementTestCase.java | 26 +
...ShardingHintDatabaseValueStatementTestCase.java | 26 +
.../ral/ShowAuthorityRuleStatementTestCase.java | 26 +
.../ral/ShowComputeNodeInfoStatementTestCase.java | 26 +
.../ral/ShowComputeNodeModeStatementTestCase.java | 26 +
.../ral/ShowComputeNodesStatementTestCase.java | 26 +
.../ral/ShowDistVariableStatementTestCase.java | 35 +
.../ral/ShowDistVariablesStatementTestCase.java | 26 +
.../ral/ShowMigrationListStatementTestCase.java | 26 +
...dwriteSplittingHintStatusStatementTestCase.java | 26 +
.../ral/ShowSQLParserRuleStatementTestCase.java | 26 +
.../ShowSQLTranslatorRuleStatementTestCase.java | 26 +
.../ShowShardingHintStatusStatementTestCase.java | 26 +
...omReadwriteSplittingRulesStatementTestCase.java | 26 +
.../ral/ShowTableMetadataStatementTestCase.java | 36 +
.../ral/ShowTrafficRulesStatementTestCase.java | 35 +
.../ral/ShowTransactionRuleStatementTestCase.java | 26 +
.../ral/UnlabelComputeNodeStatementTestCase.java | 40 +
.../migration/CheckMigrationStatementTestCase.java | 39 +
.../CommitMigrationStatementTestCase.java | 35 +
.../migration/MigrateTableStatementTestCase.java | 47 +
...igrationSourceStorageUnitStatementTestCase.java | 36 +
.../RollbackMigrationStatementTestCase.java | 35 +
...wMigrationCheckAlgorithmsStatementTestCase.java | 26 +
.../ShowMigrationCheckStatusStatementTestCase.java | 35 +
...grationSourceStorageUnitsStatementTestCase.java | 31 +
.../ShowMigrationStatusStatementTestCase.java | 41 +
.../StartMigrationCheckStatementTestCase.java | 33 +
.../migration/StartMigrationStatementTestCase.java | 35 +
.../StopMigrationCheckStatementTestCase.java | 33 +
.../migration/StopMigrationStatementTestCase.java | 35 +
...igrationSourceStorageUnitStatementTestCase.java | 35 +
...seDiscoveryDefinitionRuleStatementTestCase.java | 36 +
...atabaseDiscoveryHeartbeatStatementTestCase.java | 36 +
...lterDatabaseDiscoveryTypeStatementTestCase.java | 36 +
...erDefaultShardingStrategyStatementTestCase.java | 36 +
.../alter/AlterEncryptRuleStatementTestCase.java | 36 +
...terReadwriteSplittingRuleStatementTestCase.java | 36 +
.../alter/AlterShadowRuleStatementTestCase.java | 36 +
.../AlterShardingAuditorStatementTestCase.java | 36 +
...lterShardingAutoTableRuleStatementTestCase.java | 36 +
...ardingTableReferenceRulesStatementTestCase.java | 36 +
.../AlterShardingTableRuleStatementTestCase.java | 36 +
.../alter/AlterStorageUnitStatementTestCase.java | 36 +
...terDefaultShadowAlgorithmStatementTestCase.java | 36 +
.../CreateBroadcastTableRuleStatementTestCase.java | 37 +
...seDiscoveryDefinitionRuleStatementTestCase.java | 38 +
...atabaseDiscoveryHeartbeatStatementTestCase.java | 38 +
...eateDatabaseDiscoveryTypeStatementTestCase.java | 38 +
...ateDefaultShadowAlgorithmStatementTestCase.java | 38 +
...teDefaultShardingStrategyStatementTestCase.java | 36 +
.../create/CreateEncryptRuleStatementTestCase.java | 38 +
...ateReadwriteSplittingRuleStatementTestCase.java | 38 +
.../create/CreateShadowRuleStatementTestCase.java | 38 +
.../CreateShardingAuditorStatementTestCase.java | 38 +
...eateShardingAutoTableRuleStatementTestCase.java | 38 +
...hardingTableReferenceRuleStatementTestCase.java | 38 +
.../CreateShardingTableRuleStatementTestCase.java | 38 +
.../RegisterStorageUnitStatementTestCase.java | 38 +
...ultSingleTableStorageUnitStatementTestCase.java | 35 +
.../DropBroadcastTableRuleStatementTestCase.java | 37 +
...ataBaseDiscoveryHeartbeatStatementTestCase.java | 41 +
...DropDataBaseDiscoveryRuleStatementTestCase.java | 41 +
...DropDataBaseDiscoveryTypeStatementTestCase.java | 41 +
...opDefaultShardingStrategyStatementTestCase.java | 35 +
.../rdl/drop/DropEncryptRuleStatementTestCase.java | 41 +
...ropReadwriteSplittingRuleStatementTestCase.java | 37 +
.../drop/DropShadowAlgorithmStatementTestCase.java | 41 +
.../rdl/drop/DropShadowRuleStatementTestCase.java | 41 +
.../DropShardingAlgorithmStatementTestCase.java | 37 +
.../drop/DropShardingAuditorStatementTestCase.java | 35 +
.../DropShardingKeyGeneratorStatementTestCase.java | 35 +
...hardingTableReferenceRuleStatementTestCase.java | 37 +
.../DropShardingTableRuleStatementTestCase.java | 35 +
.../UnregisterStorageUnitStatementTestCase.java | 44 +
...ountDatabaseDiscoveryRuleStatementTestCase.java | 26 +
.../rql/CountEncryptRuleStatementTestCase.java | 26 +
...untReadwriteSplittingRuleStatementTestCase.java | 26 +
.../rql/CountShadowRuleStatementTestCase.java | 26 +
.../rql/CountShardingRuleStatementTestCase.java | 26 +
.../rql/CountSingleTableRuleStatementTestCase.java | 30 +
.../ShowBroadcastTableRulesStatementTestCase.java | 26 +
...howDataBaseDiscoveryRulesStatementTestCase.java | 26 +
...owDefaultShadowAlgorithmsStatementTestCase.java | 26 +
...owDefaultShardingStrategyStatementTestCase.java | 26 +
...ultSingleTableStorageUnitStatementTestCase.java | 30 +
.../rql/ShowEncryptRulesStatementTestCase.java | 35 +
...owReadwriteSplittingRulesStatementTestCase.java | 26 +
.../ShowRulesUsedStorageUnitStatementTestCase.java | 35 +
.../rql/ShowShadowAlgorithmsStatementTestCase.java | 26 +
.../rql/ShowShadowRulesStatementTestCase.java | 35 +
.../rql/ShowShadowTableRulesStatementTestCase.java | 26 +
.../ShowShardingAlgorithmsStatementTestCase.java | 26 +
.../rql/ShowShardingAuditorsStatementTestCase.java | 26 +
...ShowShardingKeyGeneratorsStatementTestCase.java | 26 +
.../ShowShardingTableNodesStatementTestCase.java | 35 +
...ardingTableReferenceRulesStatementTestCase.java | 26 +
.../ShowShardingTableRulesStatementTestCase.java | 35 +
...ngTableRulesUsedAlgorithmStatementTestCase.java | 35 +
...dingTableRulesUsedAuditorStatementTestCase.java | 35 +
...ableRulesUsedKeyGeneratorStatementTestCase.java | 35 +
.../rql/ShowSingleTableStatementTestCase.java | 35 +
...wUnusedShardingAlgorithmsStatementTestCase.java | 26 +
...howUnusedShardingAuditorsStatementTestCase.java | 26 +
...usedShardingKeyGeneratorsStatementTestCase.java | 26 +
.../distsql/rul/FormatSQLStatementTestCase.java | 35 +
.../distsql/rul/ParseStatementTestCase.java | 35 +
.../distsql/rul/PreviewStatementTestCase.java | 35 +
.../statement/dml/CallStatementTestCase.java | 40 +
.../statement/dml/CheckpointStatementTestCase.java | 26 +
.../statement/dml/CopyStatementTestCase.java | 44 +
.../statement/dml/DeleteStatementTestCase.java | 62 +
.../domain/statement/dml/DoStatementTestCase.java | 36 +
.../statement/dml/InsertStatementTestCase.java | 70 +
.../statement/dml/LockTableStatementTestCase.java | 26 +
.../statement/dml/MergeStatementTestCase.java | 49 +
.../statement/dml/SelectStatementTestCase.java | 83 +
.../statement/dml/TableStatementTestCase.java | 44 +
.../statement/dml/UpdateStatementTestCase.java | 52 +
.../tcl/BeginTransactionStatementTestCase.java | 26 +
.../statement/tcl/CommitStatementTestCase.java | 26 +
.../statement/tcl/LockStatementTestCase.java | 36 +
.../statement/tcl/PrepareTransactionTestCase.java | 26 +
.../statement/tcl/RollbackStatementTestCase.java | 35 +
.../statement/tcl/SavepointStatementTestCase.java | 35 +
.../tcl/SetAutoCommitStatementTestCase.java | 35 +
.../tcl/SetConstraintsStatementTestCase.java | 26 +
.../tcl/SetTransactionStatementTestCase.java | 26 +
.../statement/tcl/UnlockStatementTestCase.java | 26 +
.../cases/domain/statement/tcl/XATestCase.java | 26 +
.../parser/internal/jaxb/distsql/DistSQLCase.java | 34 +
.../parser/internal/jaxb/distsql/DistSQLCases.java | 37 +
.../jaxb/distsql/loader/DistSQLCasesLoader.java | 71 +
.../test/sql/parser/internal/jaxb/sql/SQLCase.java | 41 +
.../sql/parser/internal/jaxb/sql/SQLCaseType.java | 26 +
.../sql/parser/internal/jaxb/sql/SQLCases.java | 41 +
.../internal/jaxb/sql/loader/SQLCasesLoader.java | 171 ++
.../sql/loader/UnsupportedSQLCasesRegistry.java | 44 +
.../sql/parser/internal/loader/CasesLoader.java | 105 ++
.../parser/internal/loader/TestCaseFileLoader.java | 96 ++
.../asserts/SQLCaseAssertContext.java | 84 -
.../asserts/segment/SQLSegmentAssert.java | 57 -
.../segment/assignment/AssignmentAssert.java | 58 -
.../segment/assignment/AssignmentValueAssert.java | 66 -
.../asserts/segment/charset/CharsetAssert.java | 56 -
.../asserts/segment/column/ColumnAssert.java | 76 -
.../segment/cursor/DirectionSegmentAssert.java | 68 -
.../asserts/segment/database/DatabaseAssert.java | 45 -
.../segment/definition/ColumnDefinitionAssert.java | 51 -
.../segment/definition/ColumnPositionAssert.java | 64 -
.../definition/ConstraintDefinitionAssert.java | 80 -
.../asserts/segment/distsql/AlgorithmAssert.java | 53 -
.../segment/distsql/AutoTableRuleAssert.java | 62 -
.../asserts/segment/distsql/DataSourceAssert.java | 68 -
.../asserts/segment/distsql/DatabaseAssert.java | 44 -
.../asserts/segment/distsql/PropertiesAssert.java | 54 -
.../asserts/segment/distsql/PropertyAssert.java | 53 -
.../asserts/segment/distsql/SQLSegmentAssert.java | 46 -
.../asserts/segment/distsql/TableRuleAssert.java | 71 -
.../segment/distsql/rdl/EncryptColumnAssert.java | 58 -
.../segment/distsql/rdl/EncryptRuleAssert.java | 74 -
.../distsql/rdl/ReadwriteSplittingRuleAssert.java | 63 -
.../segment/distsql/rdl/ShadowRuleAssert.java | 81 -
.../segment/distsql/rdl/ShardingAuditorAssert.java | 49 -
.../rdl/ShardingTableReferenceRuleAssert.java | 53 -
.../segment/expression/ExpressionAssert.java | 379 -----
.../asserts/segment/generic/DataTypeAssert.java | 50 -
.../segment/generic/GrantLevelSegmentAssert.java | 53 -
.../segment/groupby/GroupByClauseAssert.java | 43 -
.../asserts/segment/having/HavingClauseAssert.java | 45 -
.../asserts/segment/index/IndexAssert.java | 57 -
.../asserts/segment/index/IndexTypeAssert.java | 57 -
.../segment/insert/InsertColumnsClauseAssert.java | 54 -
.../insert/InsertMultiTableElementAssert.java | 54 -
.../segment/insert/InsertValuesClauseAssert.java | 64 -
.../insert/OnDuplicateKeyColumnsAssert.java | 56 -
.../asserts/segment/limit/LimitClauseAssert.java | 81 -
.../asserts/segment/lock/LockClauseAssert.java | 69 -
.../asserts/segment/model/ModelClauseAssert.java | 109 --
.../segment/orderby/OrderByClauseAssert.java | 42 -
.../asserts/segment/orderby/OrderByItemAssert.java | 118 --
.../asserts/segment/output/OutputClauseAssert.java | 94 --
.../asserts/segment/owner/OwnerAssert.java | 54 -
.../asserts/segment/packages/PackageAssert.java | 57 -
.../segment/parameter/ParameterMarkerAssert.java | 48 -
.../prepare/PrepareStatementQueryAssert.java | 90 --
.../segment/projection/ProjectionAssert.java | 178 --
.../asserts/segment/set/SetClauseAssert.java | 56 -
.../asserts/segment/show/ShowFilterAssert.java | 55 -
.../asserts/segment/table/TableAssert.java | 163 --
.../asserts/segment/type/TypeAssert.java | 57 -
.../asserts/segment/where/WhereClauseAssert.java | 45 -
.../asserts/segment/with/WithClauseAssert.java | 76 -
.../statement/AbstractSQLStatementAssert.java | 46 -
.../asserts/statement/SQLStatementAssert.java | 66 -
.../asserts/statement/comment/CommentAssert.java | 71 -
.../asserts/statement/dal/DALStatementAssert.java | 302 ----
.../dal/impl/CacheIndexStatementAssert.java | 88 -
.../dal/impl/CheckTableStatementAssert.java | 43 -
.../statement/dal/impl/CloneStatementAssert.java | 56 -
.../statement/dal/impl/EmptyStatementAssert.java | 41 -
.../statement/dal/impl/ExplainStatementAssert.java | 81 -
.../statement/dal/impl/FlushStatementAssert.java | 51 -
.../dal/impl/InstallComponentStatementAssert.java | 57 -
.../dal/impl/InstallPluginStatementAssert.java | 45 -
.../statement/dal/impl/KillStatementAssert.java | 45 -
.../dal/impl/LoadIndexInfoStatementAssert.java | 78 -
.../MySQLAlterResourceGroupStatementAssert.java | 47 -
.../dal/impl/MySQLBinlogStatementAssert.java | 45 -
.../impl/MySQLChecksumTableStatementAssert.java | 47 -
.../MySQLCreateResourceGroupStatementAssert.java | 47 -
.../dal/impl/MySQLDelimiterStatementAssert.java | 45 -
.../MySQLDropResourceGroupStatementAssert.java | 47 -
.../impl/MySQLOptimizeTableStatementAssert.java | 47 -
.../dal/impl/MySQLRepairTableStatementAssert.java | 47 -
.../dal/impl/MySQLResetPersistStatementAssert.java | 48 -
.../dal/impl/MySQLResetStatementAssert.java | 79 -
.../impl/MySQLSetResourceGroupStatementAssert.java | 47 -
.../dal/impl/MySQLUseStatementAssert.java | 47 -
.../dal/impl/ResetParameterStatementAssert.java | 45 -
.../statement/dal/impl/RestartStatementAssert.java | 41 -
.../dal/impl/SetParameterStatementAssert.java | 58 -
.../dal/impl/ShowBinlogEventsStatementAssert.java | 60 -
.../dal/impl/ShowCharacterSetStatementAssert.java | 45 -
.../dal/impl/ShowCollationStatementAssert.java | 45 -
.../dal/impl/ShowColumnsStatementAssert.java | 53 -
.../dal/impl/ShowCreateTableStatementAssert.java | 41 -
.../dal/impl/ShowCreateTriggerStatementAssert.java | 47 -
.../dal/impl/ShowCreateUserStatementAssert.java | 47 -
.../dal/impl/ShowDatabasesStatementAssert.java | 45 -
.../dal/impl/ShowEventsStatementAssert.java | 51 -
.../impl/ShowFunctionStatusStatementAssert.java | 45 -
.../dal/impl/ShowIndexStatementAssert.java | 66 -
.../dal/impl/ShowOpenTablesStatementAssert.java | 51 -
.../dal/impl/ShowProcedureCodeStatementAssert.java | 43 -
.../impl/ShowProcedureStatusStatementAssert.java | 45 -
.../impl/ShowRelaylogEventsStatementAssert.java | 48 -
.../dal/impl/ShowReplicaStatusStatementAssert.java | 47 -
.../dal/impl/ShowReplicasStatementAssert.java | 41 -
.../dal/impl/ShowSlaveHostsStatementAssert.java | 41 -
.../dal/impl/ShowSlaveStatusStatementAssert.java | 47 -
.../statement/dal/impl/ShowStatementAssert.java | 45 -
.../dal/impl/ShowStatusStatementAssert.java | 45 -
.../dal/impl/ShowTableStatusStatementAssert.java | 51 -
.../dal/impl/ShowTablesStatementAssert.java | 51 -
.../dal/impl/ShowTriggersStatementAssert.java | 51 -
.../dal/impl/ShowVariablesStatementAssert.java | 45 -
.../dal/impl/ShutdownStatementAssert.java | 41 -
.../impl/UninstallComponentStatementAssert.java | 57 -
.../dal/impl/UninstallPluginStatementAssert.java | 45 -
.../asserts/statement/dcl/DCLStatementAssert.java | 132 --
.../dcl/impl/AlterLoginStatementAssert.java | 54 -
.../dcl/impl/AlterRoleStatementAssert.java | 41 -
.../dcl/impl/AlterUserStatementAssert.java | 41 -
.../dcl/impl/CreateLoginStatementAssert.java | 54 -
.../dcl/impl/CreateRoleStatementAssert.java | 41 -
.../dcl/impl/CreateUserStatementAssert.java | 41 -
.../dcl/impl/DenyUserStatementAssert.java | 66 -
.../dcl/impl/DropLoginStatementAssert.java | 54 -
.../dcl/impl/DropRoleStatementAssert.java | 41 -
.../dcl/impl/DropUserStatementAssert.java | 41 -
.../statement/dcl/impl/GrantStatementAssert.java | 50 -
.../dcl/impl/ReassignOwnedStatementAssert.java | 41 -
.../dcl/impl/RenameUserStatementAssert.java | 41 -
.../statement/dcl/impl/RevokeStatementAssert.java | 50 -
.../dcl/impl/SetDefaultRoleStatementAssert.java | 41 -
.../dcl/impl/SetPasswordStatementAssert.java | 41 -
.../statement/dcl/impl/SetRoleStatementAssert.java | 41 -
.../dcl/impl/mysql/MySQLGrantStatementAssert.java | 53 -
.../dcl/impl/mysql/MySQLRevokeStatementAssert.java | 53 -
.../sqlserver/SQLServerGrantStatementAssert.java | 49 -
.../sqlserver/SQLServerRevokeStatementAssert.java | 49 -
.../sqlserver/SQLServerSetUserStatementAssert.java | 49 -
.../asserts/statement/ddl/DDLStatementAssert.java | 202 ---
.../ddl/impl/AlterIndexStatementAssert.java | 70 -
.../ddl/impl/AlterSessionStatementAssert.java | 41 -
.../ddl/impl/AlterSynonymStatementAssert.java | 41 -
.../ddl/impl/AlterSystemStatementAssert.java | 41 -
.../ddl/impl/AlterTableStatementAssert.java | 197 ---
.../ddl/impl/AlterViewStatementAssert.java | 75 -
.../statement/ddl/impl/AnalyzeStatementAssert.java | 57 -
.../impl/AssociateStatisticsStatementAssert.java | 127 --
.../statement/ddl/impl/AuditStatementAssert.java | 41 -
.../statement/ddl/impl/CloseStatementAssert.java | 64 -
.../statement/ddl/impl/ClusterStatementAssert.java | 73 -
.../statement/ddl/impl/CommentStatementAssert.java | 81 -
.../ddl/impl/CreateIndexStatementAssert.java | 76 -
.../ddl/impl/CreateTableStatementAssert.java | 106 --
.../ddl/impl/CreateViewStatementAssert.java | 74 -
.../statement/ddl/impl/CursorStatementAssert.java | 63 -
.../statement/ddl/impl/DeclareStatementAssert.java | 63 -
.../DisassociateStatisticsStatementAssert.java | 127 --
.../ddl/impl/DropIndexStatementAssert.java | 75 -
.../ddl/impl/DropTableStatementAssert.java | 47 -
.../ddl/impl/DropViewStatementAssert.java | 47 -
.../statement/ddl/impl/FetchStatementAssert.java | 63 -
.../ddl/impl/FlashbackTableStatementAssert.java | 54 -
.../statement/ddl/impl/ListenStatementAssert.java | 42 -
.../statement/ddl/impl/MoveStatementAssert.java | 63 -
.../statement/ddl/impl/NoAuditStatementAssert.java | 41 -
.../ddl/impl/NotifyStmtStatementAssert.java | 38 -
.../statement/ddl/impl/PurgeStatementAssert.java | 57 -
.../impl/RefreshMatViewStmtStatementAssert.java | 41 -
.../statement/ddl/impl/ReindexStatementAssert.java | 41 -
.../ddl/impl/RenameTableStatementAssert.java | 59 -
.../ddl/impl/SecurityLabelStmtStatementAssert.java | 41 -
.../ddl/impl/TruncateStatementAssert.java | 47 -
.../ddl/impl/UnlistenStatementAssert.java | 38 -
.../statement/distsql/DistSQLStatementAssert.java | 58 -
.../statement/distsql/ral/RALStatementAssert.java | 62 -
.../distsql/ral/impl/HintRALStatementAssert.java | 52 -
.../ral/impl/QueryableRALStatementAssert.java | 113 --
.../ral/impl/UpdatableRALStatementAssert.java | 102 --
...ddShardingHintDatabaseValueStatementAssert.java | 53 -
.../AddShardingHintTableValueStatementAssert.java | 53 -
.../QueryableScalingRALStatementAssert.java | 68 -
.../UpdatableScalingRALStatementAssert.java | 95 --
...howMigrationCheckAlgorithmsStatementAssert.java | 46 -
.../ShowMigrationCheckStatusStatementAssert.java | 60 -
.../query/ShowMigrationListStatementAssert.java | 46 -
...MigrationSourceStorageUnitsStatementAssert.java | 46 -
.../query/ShowMigrationStatusStatementAssert.java | 60 -
.../update/CheckMigrationStatementAssert.java | 72 -
.../update/CommitMigrationStatementAssert.java | 60 -
.../update/MigrateTableStatementAssert.java | 46 -
...rMigrationSourceStorageUnitStatementAssert.java | 73 -
.../update/RollbackMigrationStatementAssert.java | 60 -
.../update/StartMigrationCheckStatementAssert.java | 58 -
.../update/StartMigrationStatementAssert.java | 60 -
.../update/StopMigrationCheckStatementAssert.java | 58 -
.../update/StopMigrationStatementAssert.java | 60 -
...rMigrationSourceStorageUnitStatementAssert.java | 51 -
.../ConvertYamlConfigurationStatementAssert.java | 48 -
...ExportDatabaseConfigurationStatementAssert.java | 47 -
.../ShowAuthorityRuleStatementAssert.java | 46 -
.../ShowComputeNodeInfoStatementAssert.java | 46 -
.../ShowComputeNodeModeStatementAssert.java | 46 -
.../queryable/ShowComputeNodesStatementAssert.java | 46 -
.../queryable/ShowDistVariableStatementAssert.java | 49 -
.../ShowDistVariablesStatementAssert.java | 43 -
.../ShowSQLParserRuleStatementAssert.java | 46 -
.../ShowSQLTranslatorRuleStatementAssert.java | 46 -
...FromReadwriteSplittingRulesStatementAssert.java | 47 -
.../ShowTableMetadataStatementAssert.java | 52 -
.../queryable/ShowTrafficRulesStatementAssert.java | 52 -
.../ShowTransactionRuleStatementAssert.java | 49 -
.../updatable/AlterComputeNodeStatementAssert.java | 54 -
...eSplittingStorageUnitStatusStatementAssert.java | 66 -
.../AlterSQLParserRuleStatementAssert.java | 64 -
.../updatable/AlterTrafficRuleStatementAssert.java | 68 -
.../AlterTransactionRuleStatementAssert.java | 46 -
.../CreateTrafficRuleStatementAssert.java | 68 -
.../updatable/DropTrafficRuleStatementAssert.java | 54 -
...ImportDatabaseConfigurationStatementAssert.java | 51 -
.../updatable/LabelComputeNodeStatementAssert.java | 53 -
.../RefreshTableMetadataStatementAssert.java | 57 -
.../updatable/SetDistVariableStatementAssert.java | 38 -
.../UnlabelComputeNodeStatementAssert.java | 52 -
.../statement/distsql/rdl/RDLStatementAssert.java | 92 --
.../rdl/alter/AlterRuleStatementAssert.java | 92 --
.../rdl/alter/AlterStorageUnitStatementAssert.java | 72 -
...rDatabaseDiscoveryHeartbeatStatementAssert.java | 62 -
.../AlterDatabaseDiscoveryRuleStatementAssert.java | 84 -
.../AlterDatabaseDiscoveryTypeStatementAssert.java | 63 -
...AlterDefaultShadowAlgorithmStatementAssert.java | 58 -
...lterDefaultShardingStrategyStatementAssert.java | 59 -
.../impl/AlterEncryptRuleStatementAssert.java | 73 -
...AlterReadwriteSplittingRuleStatementAssert.java | 74 -
.../alter/impl/AlterShadowRuleStatementAssert.java | 70 -
.../impl/AlterShardingAuditorStatementAssert.java | 69 -
...ShardingTableReferenceRulesStatementAssert.java | 75 -
.../AlterShardingTableRuleStatementAssert.java | 98 --
.../rdl/create/CreateRuleStatementAssert.java | 106 --
.../create/RegisterStorageUnitStatementAssert.java | 72 -
.../CreateBroadcastTableRuleStatementAssert.java | 52 -
...eDatabaseDiscoveryHeartbeatStatementAssert.java | 62 -
...CreateDatabaseDiscoveryRuleStatementAssert.java | 83 -
...CreateDatabaseDiscoveryTypeStatementAssert.java | 63 -
...reateDefaultShadowAlgorithmStatementAssert.java | 58 -
...eateDefaultShardingStrategyStatementAssert.java | 59 -
.../impl/CreateEncryptRuleStatementAssert.java | 75 -
...reateReadwriteSplittingRuleStatementAssert.java | 75 -
.../impl/CreateShadowRuleStatementAssert.java | 70 -
.../impl/CreateShardingAuditorStatementAssert.java | 69 -
...eShardingTableReferenceRuleStatementAssert.java | 75 -
.../CreateShardingTableRuleStatementAssert.java | 98 --
...faultSingleTableStorageUnitStatementAssert.java | 54 -
.../distsql/rdl/drop/DropRuleStatementAssert.java | 107 --
.../drop/UnregisterStorageUnitStatementAssert.java | 52 -
.../DropBroadcastTableRuleStatementAssert.java | 53 -
...pDatabaseDiscoveryHeartbeatStatementAssert.java | 53 -
.../DropDatabaseDiscoveryRuleStatementAssert.java | 52 -
.../DropDatabaseDiscoveryTypeStatementAssert.java | 53 -
...DropDefaultShardingStrategyStatementAssert.java | 53 -
.../drop/impl/DropEncryptRuleStatementAssert.java | 52 -
.../DropReadwriteSplittingRuleStatementAssert.java | 53 -
.../impl/DropShadowAlgorithmStatementAssert.java | 53 -
.../drop/impl/DropShadowRuleStatementAssert.java | 53 -
.../impl/DropShardingAlgorithmStatementAssert.java | 51 -
.../impl/DropShardingAuditorStatementAssert.java | 51 -
.../DropShardingKeyGeneratorStatementAssert.java | 51 -
...ShardingTableReferenceRulesStatementAssert.java | 48 -
.../impl/DropShardingTableRuleStatementAssert.java | 56 -
.../statement/distsql/rql/RQLStatementAssert.java | 46 -
.../distsql/rql/impl/ShowRulesStatementAssert.java | 59 -
.../statement/distsql/rul/RULStatementAssert.java | 46 -
.../distsql/rul/impl/SQLRULStatementAssert.java | 57 -
.../rul/impl/sql/FormatSQLStatementAssert.java | 49 -
.../distsql/rul/impl/sql/ParseStatementAssert.java | 49 -
.../rul/impl/sql/PreviewStatementAssert.java | 49 -
.../asserts/statement/dml/DMLStatementAssert.java | 82 -
.../statement/dml/impl/CallStatementAssert.java | 96 --
.../statement/dml/impl/CopyStatementAssert.java | 85 -
.../statement/dml/impl/DeleteStatementAssert.java | 140 --
.../statement/dml/impl/DoStatementAssert.java | 72 -
.../statement/dml/impl/InsertStatementAssert.java | 167 --
.../statement/dml/impl/MergeStatementAssert.java | 103 --
.../statement/dml/impl/SelectStatementAssert.java | 204 ---
.../statement/dml/impl/UpdateStatementAssert.java | 103 --
.../asserts/statement/tcl/TCLStatementAssert.java | 92 --
.../tcl/impl/BeginTransactionStatementAssert.java | 41 -
.../statement/tcl/impl/CommitStatementAssert.java | 41 -
.../statement/tcl/impl/LockStatementAssert.java | 73 -
.../impl/PrepareTransactionStatementAssert.java | 41 -
.../tcl/impl/RollbackStatementAssert.java | 52 -
.../tcl/impl/SavepointStatementAssert.java | 45 -
.../tcl/impl/SetAutoCommitStatementAssert.java | 45 -
.../tcl/impl/SetConstraintsStatementAssert.java | 41 -
.../tcl/impl/SetTransactionStatementAssert.java | 41 -
.../statement/tcl/impl/UnlockStatementAssert.java | 41 -
.../asserts/value/IdentifierValueAssert.java | 52 -
.../engine/SQLParserParameterizedTest.java | 80 -
.../UnsupportedSQLParserParameterizedTest.java | 60 -
.../test/sql/parser/parameterized/jaxb/Case.java | 38 -
.../test/sql/parser/parameterized/jaxb/Cases.java | 24 -
.../parser/parameterized/jaxb/CasesRegistry.java | 52 -
.../jaxb/cases/SQLParserTestCasesRegistry.java | 105 --
.../cases/SQLParserTestCasesRegistryFactory.java | 40 -
.../jaxb/cases/domain/SQLParserTestCases.java | 1705 --------------------
.../AbstractExpectedDelimiterSQLSegment.java | 37 -
.../AbstractExpectedIdentifierSQLSegment.java | 34 -
.../domain/segment/AbstractExpectedSQLSegment.java | 46 -
.../segment/ExpectedDelimiterSQLSegment.java | 38 -
.../segment/ExpectedIdentifierSQLSegment.java | 31 -
.../cases/domain/segment/ExpectedSQLSegment.java | 52 -
.../impl/assignment/ExpectedAssignment.java | 43 -
.../impl/assignment/ExpectedAssignmentValue.java | 56 -
.../impl/assignment/ExpectedValueAssign.java | 39 -
.../segment/impl/assignment/ExpectedVariable.java | 38 -
.../segment/impl/call/ExpectedCallParameter.java | 44 -
.../segment/impl/call/ExpectedProcedureName.java | 35 -
.../impl/call/ExpectedProcedureParameters.java | 37 -
.../segment/impl/charset/ExpectedCharsetName.java | 35 -
.../segment/impl/charset/ExpectedCollate.java | 35 -
.../segment/impl/clone/ExpectedDataDirectory.java | 33 -
.../segment/impl/clone/ExpectedInstance.java | 45 -
.../domain/segment/impl/column/ExpectedColumn.java | 37 -
.../segment/impl/column/ExpectedColumns.java | 37 -
.../segment/impl/comments/ExpectedComment.java | 35 -
.../segment/impl/component/ExpectedComponent.java | 28 -
.../segment/impl/cursor/ExpectedCursorName.java | 30 -
.../impl/cursor/ExpectedDirectionSegment.java | 38 -
.../definition/ExpectedAddColumnDefinition.java | 40 -
.../definition/ExpectedChangeColumnDefinition.java | 42 -
.../impl/definition/ExpectedColumnDefinition.java | 49 -
.../impl/definition/ExpectedColumnPosition.java | 36 -
.../definition/ExpectedConstraintDefinition.java | 52 -
.../definition/ExpectedConvertTableDefinition.java | 40 -
.../definition/ExpectedModifyColumnDefinition.java | 38 -
.../impl/definition/ExpectedRenameDefinition.java | 39 -
.../segment/impl/distsql/ExpectedAlgorithm.java | 39 -
.../impl/distsql/ExpectedAutoTableRule.java | 49 -
.../segment/impl/distsql/ExpectedCacheOption.java | 38 -
.../segment/impl/distsql/ExpectedDataSource.java | 54 -
.../segment/impl/distsql/ExpectedProperties.java | 36 -
.../segment/impl/distsql/ExpectedProperty.java | 38 -
.../impl/distsql/ExpectedSQLParserRule.java | 42 -
.../segment/impl/distsql/ExpectedTableRule.java | 50 -
.../impl/distsql/ral/ExpectedTrafficRule.java | 43 -
.../rdl/ExceptedReadwriteSplittingRule.java | 50 -
.../ExpectedDatabaseDiscoveryDefinitionRule.java | 48 -
.../rdl/ExpectedDatabaseDiscoveryHeartbeat.java | 40 -
.../distsql/rdl/ExpectedDatabaseDiscoveryType.java | 40 -
.../rdl/ExpectedDefaultShardingStrategy.java | 46 -
.../impl/distsql/rdl/ExpectedEncryptColumn.java | 49 -
.../impl/distsql/rdl/ExpectedEncryptRule.java | 40 -
.../impl/distsql/rdl/ExpectedShadowAlgorithm.java | 40 -
.../impl/distsql/rdl/ExpectedShadowRule.java | 60 -
.../impl/distsql/rdl/ExpectedShardingAuditor.java | 40 -
.../impl/distsql/rdl/ExpectedShardingStrategy.java | 40 -
.../rdl/ExpectedShardingTableReferenceRule.java | 35 -
.../impl/dostatement/ExpectedDoParameter.java | 44 -
.../impl/dostatement/ExpectedDoParameters.java | 37 -
.../impl/expr/ExpectedBetweenExpression.java | 44 -
.../expr/ExpectedBinaryOperationExpression.java | 41 -
.../impl/expr/ExpectedCollateExpression.java | 35 -
.../segment/impl/expr/ExpectedExistsSubquery.java | 39 -
.../segment/impl/expr/ExpectedExpression.java | 89 -
.../impl/expr/ExpectedExpressionSegment.java | 24 -
.../segment/impl/expr/ExpectedInExpression.java | 41 -
.../segment/impl/expr/ExpectedListExpression.java | 37 -
.../segment/impl/expr/ExpectedNotExpression.java | 35 -
.../complex/ExpectedBaseComplexExpression.java | 35 -
.../expr/complex/ExpectedCommonExpression.java | 34 -
.../complex/ExpectedComplexExpressionSegment.java | 33 -
.../expr/simple/ExpectedBaseSimpleExpression.java | 26 -
.../expr/simple/ExpectedLiteralExpression.java | 34 -
.../simple/ExpectedParameterMarkerExpression.java | 34 -
.../simple/ExpectedSimpleExpressionSegment.java | 26 -
.../segment/impl/expr/simple/ExpectedSubquery.java | 35 -
.../segment/impl/from/ExpectedFromSchema.java | 31 -
.../segment/impl/function/ExpectedFunction.java | 53 -
.../segment/impl/generic/ExpectedDataType.java | 35 -
.../domain/segment/impl/group/ExpectedGroup.java | 30 -
.../segment/impl/having/ExpectedHavingClause.java | 39 -
.../impl/index/ExpectedCacheTableIndex.java | 41 -
.../domain/segment/impl/index/ExpectedIndex.java | 36 -
.../segment/impl/index/ExpectedIndexType.java | 36 -
.../segment/impl/index/ExpectedLoadTableIndex.java | 44 -
.../segment/impl/index/ExpectedPartition.java | 26 -
.../impl/index/ExpectedPartitionDefinition.java | 41 -
.../impl/insert/ExpectedInsertColumnsClause.java | 36 -
.../insert/ExpectedInsertMultiTableElement.java | 36 -
.../segment/impl/insert/ExpectedInsertValue.java | 36 -
.../impl/insert/ExpectedInsertValuesClause.java | 35 -
.../impl/insert/ExpectedOnDuplicateKeyColumns.java | 36 -
.../segment/impl/like/ExpectedLikeClause.java | 38 -
.../segment/impl/limit/ExpectedLimitClause.java | 38 -
.../impl/limit/ExpectedPaginationValue.java | 38 -
.../segment/impl/lock/ExpectedLockClause.java | 42 -
.../domain/segment/impl/login/ExpectedLogin.java | 30 -
.../segment/impl/model/ExpectedModelClause.java | 49 -
.../impl/orderby/ExpectedOrderByClause.java | 53 -
.../impl/orderby/item/ExpectedOrderByItem.java | 35 -
.../item/impl/ExpectedColumnOrderByItem.java | 41 -
.../item/impl/ExpectedExpressionOrderByItem.java | 40 -
.../item/impl/ExpectedIndexOrderByItem.java | 35 -
.../segment/impl/output/ExpectedOutputClause.java | 42 -
.../segment/impl/output/ExpectedOutputColumn.java | 38 -
.../impl/output/ExpectedOutputTableColumn.java | 38 -
.../segment/impl/packages/ExpectedPackage.java | 36 -
.../domain/segment/impl/plugin/ExpectedPlugin.java | 28 -
.../impl/projection/ExpectedProjection.java | 23 -
.../impl/projection/ExpectedProjections.java | 94 --
.../ExpectedAggregationDistinctProjection.java | 31 -
.../aggregation/ExpectedAggregationProjection.java | 46 -
.../impl/column/ExpectedColumnProjection.java | 38 -
.../expression/ExpectedExpressionProjection.java | 45 -
.../shorthand/ExpectedShorthandProjection.java | 34 -
.../impl/subquery/ExpectedSubqueryProjection.java | 47 -
.../projection/impl/top/ExpectedTopProjection.java | 37 -
.../impl/projection/impl/top/ExpectedTopValue.java | 38 -
.../impl/query/ExpectedPrepareStatementQuery.java | 48 -
.../impl/reset/ExpectedResetOptionSegment.java | 42 -
.../segment/impl/schema/ExpectedDatabase.java | 30 -
.../domain/segment/impl/set/ExpectedSetClause.java | 36 -
.../segment/impl/show/ExpectedShowFilter.java | 38 -
.../segment/impl/table/ExpectedJoinTable.java | 52 -
.../domain/segment/impl/table/ExpectedOwner.java | 35 -
.../segment/impl/table/ExpectedSimpleTable.java | 39 -
.../segment/impl/table/ExpectedSubqueryTable.java | 40 -
.../domain/segment/impl/table/ExpectedTable.java | 41 -
.../segment/impl/trigger/ExpectedTrigger.java | 31 -
.../domain/segment/impl/type/ExpectedType.java | 36 -
.../domain/segment/impl/union/ExpectedCombine.java | 40 -
.../domain/segment/impl/user/ExpectedUser.java | 35 -
.../segment/impl/where/ExpectedWhereClause.java | 39 -
.../segment/impl/window/ExpectedWindowClause.java | 34 -
.../ExpectedCommonTableExpressColumnsClause.java | 38 -
.../with/ExpectedCommonTableExpressionClause.java | 43 -
.../segment/impl/with/ExpectedWithClause.java | 37 -
.../domain/statement/CommonStatementTestCase.java | 38 -
.../statement/DatabaseContainedTestCase.java | 35 -
.../statement/DropRuleStatementTestCase.java | 33 -
.../cases/domain/statement/SQLParserTestCase.java | 58 -
.../dal/AlterResourceGroupStatementTestCase.java | 36 -
.../statement/dal/BinlogStatementTestCase.java | 35 -
.../statement/dal/CacheIndexStatementTestCase.java | 46 -
.../statement/dal/CheckTableStatementTestCase.java | 36 -
.../dal/ChecksumTableStatementTestCase.java | 36 -
.../statement/dal/CloneStatementTestCase.java | 40 -
.../dal/CreateResourceGroupStatementTestCase.java | 36 -
.../statement/dal/DelimiterStatementTestCase.java | 35 -
.../dal/DropResourceGroupStatementTestCase.java | 36 -
.../statement/dal/EmptyStatementTestCase.java | 26 -
.../statement/dal/ExplainStatementTestCase.java | 60 -
.../statement/dal/FlushStatementTestCase.java | 42 -
.../statement/dal/HelpStatementTestCase.java | 35 -
.../dal/InstallComponentStatementTestCase.java | 36 -
.../dal/InstallPluginStatementTestCase.java | 36 -
.../statement/dal/KillStatementTestCase.java | 35 -
.../dal/LoadIndexInfoStatementTestCase.java | 36 -
.../dal/OptimizeTableStatementTestCase.java | 36 -
.../dal/RepairTableStatementTestCase.java | 36 -
.../dal/ResetParameterStatementTestCase.java | 35 -
.../dal/ResetPersistStatementTestCase.java | 38 -
.../statement/dal/ResetStatementTestCase.java | 36 -
.../statement/dal/RestartStatementTestCase.java | 26 -
.../dal/SetParameterStatementTestCase.java | 36 -
.../dal/SetResourceGroupStatementTestCase.java | 36 -
.../dal/ShowBinlogEventsStatementTestCase.java | 40 -
.../dal/ShowCharacterSetStatementTestCase.java | 36 -
.../dal/ShowCollationStatementTestCase.java | 36 -
.../dal/ShowColumnsStatementTestCase.java | 44 -
.../dal/ShowCreateTableStatementTestCase.java | 36 -
.../dal/ShowCreateTriggerStatementTestCase.java | 36 -
.../dal/ShowCreateUserStatementTestCase.java | 36 -
.../dal/ShowDatabasesStatementTestCase.java | 36 -
.../statement/dal/ShowEventsStatementTestCase.java | 40 -
.../dal/ShowFunctionStatusStatementTestCase.java | 36 -
.../statement/dal/ShowIndexStatementTestCase.java | 40 -
.../dal/ShowOpenTablesStatementTestCase.java | 40 -
.../dal/ShowProcedureCodeStatementTestCase.java | 36 -
.../dal/ShowProcedureStatusStatementTestCase.java | 36 -
.../dal/ShowRelayLogEventsStatementTestCase.java | 38 -
.../dal/ShowReplicaStatusStatementTestCase.java | 35 -
.../dal/ShowReplicasStatementTestCase.java | 26 -
.../dal/ShowSlaveHostsStatementTestCase.java | 26 -
.../dal/ShowSlaveStatusStatementTestCase.java | 35 -
.../statement/dal/ShowStatementTestCase.java | 35 -
.../statement/dal/ShowStatusStatementTestCase.java | 36 -
.../dal/ShowTableStatusStatementTestCase.java | 40 -
.../statement/dal/ShowTablesStatementTestCase.java | 40 -
.../dal/ShowTriggersStatementTestCase.java | 40 -
.../dal/ShowVariablesStatementTestCase.java | 36 -
.../statement/dal/ShutdownStatementTestCase.java | 26 -
.../dal/UninstallComponentStatementTestCase.java | 36 -
.../dal/UninstallPluginStatementTestCase.java | 36 -
.../domain/statement/dal/UseStatementTestCase.java | 36 -
.../statement/dcl/AlterLoginStatementTestCase.java | 36 -
.../statement/dcl/AlterRoleStatementTestCase.java | 26 -
.../statement/dcl/AlterUserStatementTestCase.java | 26 -
.../dcl/CreateGroupStatementTestCase.java | 26 -
.../dcl/CreateLoginStatementTestCase.java | 36 -
.../statement/dcl/CreateRoleStatementTestCase.java | 26 -
.../statement/dcl/CreateUserStatementTestCase.java | 26 -
.../statement/dcl/DenyUserStatementTestCase.java | 42 -
.../statement/dcl/DropLoginStatementTestCase.java | 36 -
.../statement/dcl/DropRoleStatementTestCase.java | 26 -
.../statement/dcl/DropUserStatementTestCase.java | 26 -
.../statement/dcl/GrantStatementTestCase.java | 40 -
.../dcl/ReassignOwnedStatementTestCase.java | 26 -
.../statement/dcl/RenameUserStatementTestCase.java | 26 -
.../statement/dcl/RevertStatementTestCase.java | 26 -
.../statement/dcl/RevokeStatementTestCase.java | 40 -
.../dcl/SetDefaultRoleStatementTestCase.java | 26 -
.../dcl/SetPasswordStatementTestCase.java | 26 -
.../statement/dcl/SetRoleStatementTestCase.java | 26 -
.../statement/dcl/SetUserStatementTestCase.java | 33 -
.../ddl/AlterAggregateStatementTestCase.java | 26 -
.../ddl/AlterAnalyticViewStatementTestCase.java | 26 -
.../AlterAttributeDimensionStatementTestCase.java | 26 -
.../ddl/AlterAuditPolicyStatementTestCase.java | 26 -
.../ddl/AlterClusterStatementTestCase.java | 26 -
.../ddl/AlterCollationStatementTestCase.java | 26 -
.../ddl/AlterConversionStatementTestCase.java | 26 -
.../AlterDatabaseDictionaryStatementTestCase.java | 26 -
.../ddl/AlterDatabaseLinkStatementTestCase.java | 26 -
.../ddl/AlterDatabaseStatementTestCase.java | 26 -
.../ddl/AlterDefaultPrivilegesTestCase.java | 26 -
.../ddl/AlterDimensionStatementTestCase.java | 26 -
.../ddl/AlterDirectoryStatementTestCase.java | 26 -
.../ddl/AlterDiskgroupStatementTestCase.java | 26 -
.../ddl/AlterDomainStatementTestCase.java | 26 -
.../ddl/AlterExtensionStatementTestCase.java | 26 -
.../AlterFlashbackArchiveStatementTestCase.java | 26 -
.../ddl/AlterForeignDataWrapperTestCase.java | 26 -
.../statement/ddl/AlterForeignTableTestCase.java | 26 -
.../ddl/AlterFunctionStatementTestCase.java | 26 -
.../statement/ddl/AlterGroupStatementTestCase.java | 26 -
.../ddl/AlterHierarchyStatementTestCase.java | 26 -
.../statement/ddl/AlterIndexStatementTestCase.java | 40 -
.../ddl/AlterIndexTypeStatementTestCase.java | 26 -
.../AlterInmemoryJoinGroupStatementTestCase.java | 26 -
.../statement/ddl/AlterJavaStatementTestCase.java | 26 -
.../ddl/AlterLanguageStatementTestCase.java | 26 -
.../ddl/AlterLibraryStatementTestCase.java | 26 -
.../ddl/AlterLockdownProfileStatementTestCase.java | 26 -
.../AlterMaterializedViewLogStatementTestCase.java | 26 -
.../AlterMaterializedViewStatementTestCase.java | 26 -
.../AlterMaterializedZonemapStatementTestCase.java | 26 -
.../ddl/AlterOperatorStatementTestCase.java | 26 -
.../ddl/AlterOutlineStatementTestCase.java | 26 -
.../ddl/AlterPackageStatementTestCase.java | 26 -
.../AlterPluggableDatabaseStatementTestCase.java | 26 -
.../ddl/AlterPolicyStatementTestCase.java | 26 -
.../ddl/AlterProcedureStatementTestCase.java | 26 -
.../ddl/AlterPublicationStatementTestCase.java | 26 -
.../ddl/AlterRoutineStatementTestCase.java | 26 -
.../statement/ddl/AlterRuleStatementTestCase.java | 26 -
.../ddl/AlterSchemaStatementTestCase.java | 26 -
.../ddl/AlterSequenceStatementTestCase.java | 26 -
.../ddl/AlterServerStatementTestCase.java | 26 -
.../ddl/AlterServiceStatementTestCase.java | 26 -
.../ddl/AlterSessionStatementTestCase.java | 26 -
.../ddl/AlterStatisticsStatementTestCase.java | 26 -
.../ddl/AlterSubscriptionStatementTestCase.java | 26 -
.../ddl/AlterSynonymStatementTestCase.java | 26 -
.../ddl/AlterSystemStatementTestCase.java | 26 -
.../statement/ddl/AlterTableStatementTestCase.java | 65 -
.../ddl/AlterTextSearchStatementTestCase.java | 26 -
.../ddl/AlterTriggerStatementTestCase.java | 26 -
.../statement/ddl/AlterTypeStatementTestCase.java | 26 -
.../statement/ddl/AlterViewStatementTestCase.java | 47 -
.../statement/ddl/AnalyzeStatementTestCase.java | 40 -
.../ddl/AssociateStatisticsStatementTestCase.java | 62 -
.../statement/ddl/AuditStatementTestCase.java | 26 -
.../statement/ddl/CloseStatementTestCase.java | 40 -
.../statement/ddl/ClusterStatementTestCase.java | 40 -
.../statement/ddl/CommentStatementTestCase.java | 44 -
.../ddl/CreateAccessMethodStatementTestCase.java | 26 -
.../ddl/CreateAggregateStatementTestCase.java | 26 -
.../statement/ddl/CreateCastStatementTestCase.java | 26 -
.../ddl/CreateCollationStatementTestCase.java | 26 -
.../ddl/CreateContextStatementTestCase.java | 26 -
.../ddl/CreateControlFileStatementTestCase.java | 26 -
.../ddl/CreateConversionStatementTestCase.java | 26 -
.../ddl/CreateDatabaseLinkStatementTestCase.java | 26 -
.../ddl/CreateDatabaseStatementTestCase.java | 26 -
.../ddl/CreateDimensionStatementTestCase.java | 26 -
.../ddl/CreateDirectoryStatementTestCase.java | 26 -
.../ddl/CreateDiskgroupStatementTestCase.java | 26 -
.../ddl/CreateDomainStatementTestCase.java | 26 -
.../ddl/CreateEditionStatementTestCase.java | 26 -
.../ddl/CreateEventTriggerStatementTestCase.java | 26 -
.../ddl/CreateExtensionStatementTestCase.java | 26 -
.../CreateFlashbackArchiveStatementTestCase.java | 26 -
.../CreateForeignDataWrapperStatementTestCase.java | 26 -
.../ddl/CreateForeignTableStatementTestCase.java | 26 -
.../ddl/CreateFunctionStatementTestCase.java | 26 -
.../ddl/CreateIndexStatementTestCase.java | 44 -
.../CreateInmemoryJoinGroupStatementTestCase.java | 26 -
.../ddl/CreateLanguageStatementTestCase.java | 26 -
.../CreateLockdownProfileStatementTestCase.java | 26 -
.../CreateMaterializedViewStatementTestCase.java | 26 -
.../ddl/CreateOperatorStatementTestCase.java | 26 -
.../ddl/CreatePFileStatementTestCase.java | 26 -
.../ddl/CreatePolicyStatementTestCase.java | 26 -
.../ddl/CreateProcedureStatementTestCase.java | 26 -
.../ddl/CreatePublicationStatementTestCase.java | 26 -
.../ddl/CreateRestorePointStatementTestCase.java | 26 -
.../CreateRollbackSegmentStatementTestCase.java | 26 -
.../statement/ddl/CreateRuleStatementTestCase.java | 26 -
.../ddl/CreateSPFileStatementTestCase.java | 26 -
.../ddl/CreateSchemaStatementTestCase.java | 26 -
.../ddl/CreateSequenceStatementTestCase.java | 26 -
.../ddl/CreateServerStatementTestCase.java | 26 -
.../ddl/CreateServiceStatementTestCase.java | 26 -
.../ddl/CreateSynonymStatementTestCase.java | 26 -
.../ddl/CreateTableStatementTestCase.java | 54 -
.../ddl/CreateTablespaceStatementTestCase.java | 26 -
.../ddl/CreateTextSearchStatementTestCase.java | 26 -
.../ddl/CreateTriggerStatementTestCase.java | 26 -
.../statement/ddl/CreateTypeStatementTestCase.java | 26 -
.../statement/ddl/CreateViewStatementTestCase.java | 44 -
.../statement/ddl/CursorStatementTestCase.java | 40 -
.../statement/ddl/DeclareStatementTestCase.java | 40 -
.../DisassociateStatisticsStatementTestCase.java | 62 -
.../statement/ddl/DiscardStatementTestCase.java | 26 -
.../ddl/DropAccessMethodStatementTestCase.java | 26 -
.../ddl/DropAggregateStatementTestCase.java | 26 -
.../statement/ddl/DropCastStatementTestCase.java | 26 -
.../ddl/DropCollationStatementTestCase.java | 26 -
.../ddl/DropConversionStatementTestCase.java | 26 -
.../ddl/DropDatabaseLinkStatementTestCase.java | 26 -
.../ddl/DropDatabaseStatementTestCase.java | 26 -
.../ddl/DropDimensionStatementTestCase.java | 26 -
.../ddl/DropDirectoryStatementTestCase.java | 26 -
.../ddl/DropDiskgroupStatementTestCase.java | 26 -
.../statement/ddl/DropDomainStatementTestCase.java | 26 -
.../ddl/DropEditionStatementTestCase.java | 26 -
.../ddl/DropEventTriggerStatementTestCase.java | 26 -
.../ddl/DropExtensionStatementTestCase.java | 26 -
.../ddl/DropFlashbackArchiveStatementTestCase.java | 26 -
.../DropForeignDataWrapperStatementTestCase.java | 26 -
.../ddl/DropForeignTableStatementTestCase.java | 26 -
.../ddl/DropFunctionStatementTestCase.java | 26 -
.../statement/ddl/DropGroupStatementTestCase.java | 26 -
.../statement/ddl/DropIndexStatementTestCase.java | 42 -
.../ddl/DropIndexTypeStatementTestCase.java | 26 -
.../DropInmemoryJoinGroupStatementTestCase.java | 26 -
.../statement/ddl/DropJavaStatementTestCase.java | 26 -
.../ddl/DropLanguageStatementTestCase.java | 26 -
.../ddl/DropLibraryStatementTestCase.java | 26 -
.../ddl/DropLockdownProfileStatementTestCase.java | 26 -
.../DropMaterializedViewLogStatementTestCase.java | 26 -
.../ddl/DropMaterializedViewStatementTestCase.java | 26 -
.../DropMaterializedZonemapStatementTestCase.java | 26 -
.../ddl/DropOperatorClassStatementTestCase.java | 26 -
.../ddl/DropOperatorFamilyStatementTestCase.java | 26 -
.../ddl/DropOperatorStatementTestCase.java | 26 -
.../ddl/DropOutlineStatementTestCase.java | 26 -
.../statement/ddl/DropOwnedStatementTestCase.java | 26 -
.../ddl/DropPackageStatementTestCase.java | 26 -
.../DropPluggableDatabaseStatementTestCase.java | 26 -
.../statement/ddl/DropPolicyStatementTestCase.java | 26 -
.../ddl/DropProcedureStatementTestCase.java | 26 -
.../ddl/DropPublicationStatementTestCase.java | 26 -
.../ddl/DropRestorePointStatementTestCase.java | 26 -
.../ddl/DropRollbackSegmentStatementTestCase.java | 26 -
.../ddl/DropRoutineStatementTestCase.java | 26 -
.../statement/ddl/DropRuleStatementTestCase.java | 26 -
.../statement/ddl/DropSchemaStatementTestCase.java | 26 -
.../ddl/DropSequenceStatementTestCase.java | 26 -
.../statement/ddl/DropServerStatementTestCase.java | 26 -
.../ddl/DropServiceStatementTestCase.java | 26 -
.../ddl/DropStatisticsStatementTestCase.java | 26 -
.../ddl/DropSubscriptionStatementTestCase.java | 26 -
.../ddl/DropSynonymStatementTestCase.java | 26 -
.../statement/ddl/DropTableStatementTestCase.java | 36 -
.../ddl/DropTextSearchStatementTestCase.java | 26 -
.../ddl/DropTriggerStatementTestCase.java | 26 -
.../statement/ddl/DropTypeStatementTestCase.java | 26 -
.../statement/ddl/DropViewStatementTestCase.java | 38 -
.../statement/ddl/FetchStatementTestCase.java | 40 -
.../ddl/FlashbackDatabaseStatementTestCase.java | 26 -
.../ddl/FlashbackTableStatementTestCase.java | 39 -
.../statement/ddl/ListenStatementTestCase.java | 35 -
.../statement/ddl/MoveStatementTestCase.java | 40 -
.../statement/ddl/NoAuditStatementTestCase.java | 26 -
.../statement/ddl/NotifyStmtStatementTestCase.java | 26 -
.../statement/ddl/PreparedStatementTestCase.java | 26 -
.../statement/ddl/PurgeStatementTestCase.java | 40 -
.../ddl/RefreshMatViewStmtStatementTestCase.java | 26 -
.../statement/ddl/ReindexStatementTestCase.java | 26 -
.../statement/ddl/RenameStatementTestCase.java | 26 -
.../ddl/RenameTableStatementTestCase.java | 36 -
.../ddl/SecurityLabelStmtStatementTestCase.java | 26 -
.../statement/ddl/TruncateStatementTestCase.java | 36 -
.../statement/ddl/UnlistenStatementTestCase.java | 26 -
...ShardingHintDatabaseValueStatementTestCase.java | 38 -
...AddShardingHintTableValueStatementTestCase.java | 38 -
.../ral/AlterComputeNodeStatementTestCase.java | 41 -
...AlterLocalTransactionRuleStatementTestCase.java | 26 -
...plittingStorageUnitStatusStatementTestCase.java | 41 -
.../ral/AlterSQLParserRuleStatementTestCase.java | 34 -
.../ral/AlterTrafficRuleStatementTestCase.java | 36 -
.../AlterXATransactionRuleStatementTestCase.java | 26 -
.../distsql/ral/ApplyDistSQLStatementTestCase.java | 26 -
.../distsql/ral/ClearHintStatementTestCase.java | 26 -
...earReadwriteSplittingHintStatementTestCase.java | 26 -
.../ral/ClearShardingHintStatementTestCase.java | 26 -
.../ConvertYamlConfigurationStatementTestCase.java | 35 -
.../ral/CreateTrafficRuleStatementTestCase.java | 36 -
.../ral/DiscardDistSQLStatementTestCase.java | 26 -
.../ral/DropTrafficRuleStatementTestCase.java | 36 -
...portDatabaseConfigurationStatementTestCase.java | 26 -
...portDatabaseConfigurationStatementTestCase.java | 35 -
.../ral/LabelComputeNodeStatementTestCase.java | 43 -
.../ral/PrepareDistSQLStatementTestCase.java | 26 -
.../ral/RefreshTableMetadataStatementTestCase.java | 41 -
.../ral/SetDistVariableStatementTestCase.java | 26 -
...SetReadwriteSplittingHintStatementTestCase.java | 26 -
...ShardingHintDatabaseValueStatementTestCase.java | 26 -
.../ral/ShowAuthorityRuleStatementTestCase.java | 26 -
.../ral/ShowComputeNodeInfoStatementTestCase.java | 26 -
.../ral/ShowComputeNodeModeStatementTestCase.java | 26 -
.../ral/ShowComputeNodesStatementTestCase.java | 26 -
.../ral/ShowDistVariableStatementTestCase.java | 35 -
.../ral/ShowDistVariablesStatementTestCase.java | 26 -
.../ral/ShowMigrationListStatementTestCase.java | 26 -
...dwriteSplittingHintStatusStatementTestCase.java | 26 -
.../ral/ShowSQLParserRuleStatementTestCase.java | 26 -
.../ShowSQLTranslatorRuleStatementTestCase.java | 26 -
.../ShowShardingHintStatusStatementTestCase.java | 26 -
...omReadwriteSplittingRulesStatementTestCase.java | 26 -
.../ral/ShowTableMetadataStatementTestCase.java | 36 -
.../ral/ShowTrafficRulesStatementTestCase.java | 35 -
.../ral/ShowTransactionRuleStatementTestCase.java | 26 -
.../ral/UnlabelComputeNodeStatementTestCase.java | 40 -
.../migration/CheckMigrationStatementTestCase.java | 39 -
.../CommitMigrationStatementTestCase.java | 35 -
.../migration/MigrateTableStatementTestCase.java | 47 -
...igrationSourceStorageUnitStatementTestCase.java | 36 -
.../RollbackMigrationStatementTestCase.java | 35 -
...wMigrationCheckAlgorithmsStatementTestCase.java | 26 -
.../ShowMigrationCheckStatusStatementTestCase.java | 35 -
...grationSourceStorageUnitsStatementTestCase.java | 31 -
.../ShowMigrationStatusStatementTestCase.java | 41 -
.../StartMigrationCheckStatementTestCase.java | 33 -
.../migration/StartMigrationStatementTestCase.java | 35 -
.../StopMigrationCheckStatementTestCase.java | 33 -
.../migration/StopMigrationStatementTestCase.java | 35 -
...igrationSourceStorageUnitStatementTestCase.java | 35 -
...seDiscoveryDefinitionRuleStatementTestCase.java | 36 -
...atabaseDiscoveryHeartbeatStatementTestCase.java | 36 -
...lterDatabaseDiscoveryTypeStatementTestCase.java | 36 -
...erDefaultShardingStrategyStatementTestCase.java | 36 -
.../alter/AlterEncryptRuleStatementTestCase.java | 36 -
...terReadwriteSplittingRuleStatementTestCase.java | 36 -
.../alter/AlterShadowRuleStatementTestCase.java | 36 -
.../AlterShardingAuditorStatementTestCase.java | 36 -
...lterShardingAutoTableRuleStatementTestCase.java | 36 -
...ardingTableReferenceRulesStatementTestCase.java | 36 -
.../AlterShardingTableRuleStatementTestCase.java | 36 -
.../alter/AlterStorageUnitStatementTestCase.java | 36 -
...terDefaultShadowAlgorithmStatementTestCase.java | 36 -
.../CreateBroadcastTableRuleStatementTestCase.java | 37 -
...seDiscoveryDefinitionRuleStatementTestCase.java | 38 -
...atabaseDiscoveryHeartbeatStatementTestCase.java | 38 -
...eateDatabaseDiscoveryTypeStatementTestCase.java | 38 -
...ateDefaultShadowAlgorithmStatementTestCase.java | 38 -
...teDefaultShardingStrategyStatementTestCase.java | 36 -
.../create/CreateEncryptRuleStatementTestCase.java | 38 -
...ateReadwriteSplittingRuleStatementTestCase.java | 38 -
.../create/CreateShadowRuleStatementTestCase.java | 38 -
.../CreateShardingAuditorStatementTestCase.java | 38 -
...eateShardingAutoTableRuleStatementTestCase.java | 38 -
...hardingTableReferenceRuleStatementTestCase.java | 38 -
.../CreateShardingTableRuleStatementTestCase.java | 38 -
.../RegisterStorageUnitStatementTestCase.java | 38 -
...ultSingleTableStorageUnitStatementTestCase.java | 35 -
.../DropBroadcastTableRuleStatementTestCase.java | 37 -
...ataBaseDiscoveryHeartbeatStatementTestCase.java | 41 -
...DropDataBaseDiscoveryRuleStatementTestCase.java | 41 -
...DropDataBaseDiscoveryTypeStatementTestCase.java | 41 -
...opDefaultShardingStrategyStatementTestCase.java | 35 -
.../rdl/drop/DropEncryptRuleStatementTestCase.java | 41 -
...ropReadwriteSplittingRuleStatementTestCase.java | 37 -
.../drop/DropShadowAlgorithmStatementTestCase.java | 41 -
.../rdl/drop/DropShadowRuleStatementTestCase.java | 41 -
.../DropShardingAlgorithmStatementTestCase.java | 37 -
.../drop/DropShardingAuditorStatementTestCase.java | 35 -
.../DropShardingKeyGeneratorStatementTestCase.java | 35 -
...hardingTableReferenceRuleStatementTestCase.java | 37 -
.../DropShardingTableRuleStatementTestCase.java | 35 -
.../UnregisterStorageUnitStatementTestCase.java | 44 -
...ountDatabaseDiscoveryRuleStatementTestCase.java | 26 -
.../rql/CountEncryptRuleStatementTestCase.java | 26 -
...untReadwriteSplittingRuleStatementTestCase.java | 26 -
.../rql/CountShadowRuleStatementTestCase.java | 26 -
.../rql/CountShardingRuleStatementTestCase.java | 26 -
.../rql/CountSingleTableRuleStatementTestCase.java | 30 -
.../ShowBroadcastTableRulesStatementTestCase.java | 26 -
...howDataBaseDiscoveryRulesStatementTestCase.java | 26 -
...owDefaultShadowAlgorithmsStatementTestCase.java | 26 -
...owDefaultShardingStrategyStatementTestCase.java | 26 -
...ultSingleTableStorageUnitStatementTestCase.java | 30 -
.../rql/ShowEncryptRulesStatementTestCase.java | 35 -
...owReadwriteSplittingRulesStatementTestCase.java | 26 -
.../ShowRulesUsedStorageUnitStatementTestCase.java | 35 -
.../rql/ShowShadowAlgorithmsStatementTestCase.java | 26 -
.../rql/ShowShadowRulesStatementTestCase.java | 35 -
.../rql/ShowShadowTableRulesStatementTestCase.java | 26 -
.../ShowShardingAlgorithmsStatementTestCase.java | 26 -
.../rql/ShowShardingAuditorsStatementTestCase.java | 26 -
...ShowShardingKeyGeneratorsStatementTestCase.java | 26 -
.../ShowShardingTableNodesStatementTestCase.java | 35 -
...ardingTableReferenceRulesStatementTestCase.java | 26 -
.../ShowShardingTableRulesStatementTestCase.java | 35 -
...ngTableRulesUsedAlgorithmStatementTestCase.java | 35 -
...dingTableRulesUsedAuditorStatementTestCase.java | 35 -
...ableRulesUsedKeyGeneratorStatementTestCase.java | 35 -
.../rql/ShowSingleTableStatementTestCase.java | 35 -
...wUnusedShardingAlgorithmsStatementTestCase.java | 26 -
...howUnusedShardingAuditorsStatementTestCase.java | 26 -
...usedShardingKeyGeneratorsStatementTestCase.java | 26 -
.../distsql/rul/FormatSQLStatementTestCase.java | 35 -
.../distsql/rul/ParseStatementTestCase.java | 35 -
.../distsql/rul/PreviewStatementTestCase.java | 35 -
.../statement/dml/CallStatementTestCase.java | 40 -
.../statement/dml/CheckpointStatementTestCase.java | 26 -
.../statement/dml/CopyStatementTestCase.java | 44 -
.../statement/dml/DeleteStatementTestCase.java | 62 -
.../domain/statement/dml/DoStatementTestCase.java | 36 -
.../statement/dml/InsertStatementTestCase.java | 70 -
.../statement/dml/LockTableStatementTestCase.java | 26 -
.../statement/dml/MergeStatementTestCase.java | 49 -
.../statement/dml/SelectStatementTestCase.java | 83 -
.../statement/dml/TableStatementTestCase.java | 44 -
.../statement/dml/UpdateStatementTestCase.java | 52 -
.../tcl/BeginTransactionStatementTestCase.java | 26 -
.../statement/tcl/CommitStatementTestCase.java | 26 -
.../statement/tcl/LockStatementTestCase.java | 36 -
.../statement/tcl/PrepareTransactionTestCase.java | 26 -
.../statement/tcl/RollbackStatementTestCase.java | 35 -
.../statement/tcl/SavepointStatementTestCase.java | 35 -
.../tcl/SetAutoCommitStatementTestCase.java | 35 -
.../tcl/SetConstraintsStatementTestCase.java | 26 -
.../tcl/SetTransactionStatementTestCase.java | 26 -
.../statement/tcl/UnlockStatementTestCase.java | 26 -
.../cases/domain/statement/tcl/XATestCase.java | 26 -
.../parameterized/jaxb/distsql/DistSQLCase.java | 34 -
.../parameterized/jaxb/distsql/DistSQLCases.java | 37 -
.../jaxb/distsql/loader/DistSQLCasesLoader.java | 71 -
.../sql/parser/parameterized/jaxb/sql/SQLCase.java | 41 -
.../parser/parameterized/jaxb/sql/SQLCaseType.java | 26 -
.../parser/parameterized/jaxb/sql/SQLCases.java | 41 -
.../jaxb/sql/loader/SQLCasesLoader.java | 171 --
.../sql/loader/UnsupportedSQLCasesRegistry.java | 44 -
.../parser/parameterized/loader/CasesLoader.java | 105 --
.../parameterized/loader/TestCaseFileLoader.java | 96 --
...r.external.result.SQLParseResultReporterCreator | 19 -
...r.external.result.SQLParseResultReporterCreator | 36 +
.../internal/DistSQLParserParameterizedTest.java | 61 +
.../DistSQLParserParameterizedTest.java | 61 -
1757 files changed, 40509 insertions(+), 40492 deletions(-)
diff --git a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/MySQLParserParameterizedTest.java b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/MySQLParserParameterizedTest.java
deleted file mode 100644
index 82649441193..00000000000
--- a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/MySQLParserParameterizedTest.java
+++ /dev/null
@@ -1,39 +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.sql.parser.mysql;
-
-import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.SQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized.Parameters;
-
-import java.util.Collection;
-
-@RunWith(ShardingSphereParallelTestParameterized.class)
-public final class MySQLParserParameterizedTest extends SQLParserParameterizedTest {
-
- public MySQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
- super(sqlCaseId, databaseType, sqlCaseType);
- }
-
- @Parameters(name = "{0} ({2}) -> {1}")
- public static Collection<Object[]> getTestParameters() {
- return SQLParserParameterizedTest.getTestParameters("MySQL", "H2");
- }
-}
diff --git a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/UnsupportedMySQLParserParameterizedTest.java b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/UnsupportedMySQLParserParameterizedTest.java
deleted file mode 100644
index 40c94c9e662..00000000000
--- a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/UnsupportedMySQLParserParameterizedTest.java
+++ /dev/null
@@ -1,39 +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.sql.parser.mysql;
-
-import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized.Parameters;
-
-import java.util.Collection;
-
-@RunWith(ShardingSphereParallelTestParameterized.class)
-public final class UnsupportedMySQLParserParameterizedTest extends UnsupportedSQLParserParameterizedTest {
-
- public UnsupportedMySQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
- super(sqlCaseId, databaseType, sqlCaseType);
- }
-
- @Parameters(name = "{0} ({2}) -> {1}")
- public static Collection<Object[]> getTestParameters() {
- return UnsupportedSQLParserParameterizedTest.getTestParameters("MySQL");
- }
-}
diff --git a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/external/MySQLParserParameterizedIT.java b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/external/MySQLParserParameterizedIT.java
index f027ab2c76f..b93a5169a92 100644
--- a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/external/MySQLParserParameterizedIT.java
+++ b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/external/MySQLParserParameterizedIT.java
@@ -17,9 +17,9 @@
package org.apache.shardingsphere.sql.parser.mysql.external;
-import org.apache.shardingsphere.test.integration.sql.parser.external.engine.SQLParserParameterizedIT;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.SQLCaseLoader;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.strategy.impl.GitHubSQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.sql.parser.external.engine.SQLParserParameterizedIT;
+import org.apache.shardingsphere.test.sql.parser.external.loader.SQLCaseLoader;
+import org.apache.shardingsphere.test.sql.parser.external.loader.strategy.impl.GitHubSQLCaseLoadStrategy;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/internal/MySQLParserParameterizedTest.java b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/internal/MySQLParserParameterizedTest.java
new file mode 100644
index 00000000000..02d0a884187
--- /dev/null
+++ b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/internal/MySQLParserParameterizedTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sql.parser.mysql.internal;
+
+import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.SQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Collection;
+
+@RunWith(ShardingSphereParallelTestParameterized.class)
+public final class MySQLParserParameterizedTest extends SQLParserParameterizedTest {
+
+ public MySQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
+ super(sqlCaseId, databaseType, sqlCaseType);
+ }
+
+ @Parameters(name = "{0} ({2}) -> {1}")
+ public static Collection<Object[]> getTestParameters() {
+ return SQLParserParameterizedTest.getTestParameters("MySQL", "H2");
+ }
+}
diff --git a/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/internal/UnsupportedMySQLParserParameterizedTest.java b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/internal/UnsupportedMySQLParserParameterizedTest.java
new file mode 100644
index 00000000000..16ffa0fc4d9
--- /dev/null
+++ b/sql-parser/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/internal/UnsupportedMySQLParserParameterizedTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sql.parser.mysql.internal;
+
+import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.UnsupportedSQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Collection;
+
+@RunWith(ShardingSphereParallelTestParameterized.class)
+public final class UnsupportedMySQLParserParameterizedTest extends UnsupportedSQLParserParameterizedTest {
+
+ public UnsupportedMySQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
+ super(sqlCaseId, databaseType, sqlCaseType);
+ }
+
+ @Parameters(name = "{0} ({2}) -> {1}")
+ public static Collection<Object[]> getTestParameters() {
+ return UnsupportedSQLParserParameterizedTest.getTestParameters("MySQL");
+ }
+}
diff --git a/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/OpenGaussParserParameterizedTest.java b/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/OpenGaussParserParameterizedTest.java
index cbda131bc7a..ebeaaea157e 100644
--- a/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/OpenGaussParserParameterizedTest.java
+++ b/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/OpenGaussParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.opengauss;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.SQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.SQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/UnsupportedOpenGaussParserParameterizedTest.java b/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/UnsupportedOpenGaussParserParameterizedTest.java
index 23f64773a9a..ace7158df83 100644
--- a/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/UnsupportedOpenGaussParserParameterizedTest.java
+++ b/sql-parser/dialect/opengauss/src/test/java/org/apache/shardingsphere/sql/parser/opengauss/UnsupportedOpenGaussParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.opengauss;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.UnsupportedSQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/OracleParserParameterizedTest.java b/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/OracleParserParameterizedTest.java
index c9b0f572086..e510eb0e9e7 100644
--- a/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/OracleParserParameterizedTest.java
+++ b/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/OracleParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.oracle;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.SQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.SQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/UnsupportedOracleParserParameterizedTest.java b/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/UnsupportedOracleParserParameterizedTest.java
index 0311e5321e3..43e744ebe11 100644
--- a/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/UnsupportedOracleParserParameterizedTest.java
+++ b/sql-parser/dialect/oracle/src/test/java/org/apache/shardingsphere/sql/parser/oracle/UnsupportedOracleParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.oracle;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.UnsupportedSQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/PostgreSQLParserParameterizedTest.java b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/PostgreSQLParserParameterizedTest.java
deleted file mode 100644
index f13037e52da..00000000000
--- a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/PostgreSQLParserParameterizedTest.java
+++ /dev/null
@@ -1,39 +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.sql.parser.postgresql;
-
-import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.SQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized.Parameters;
-
-import java.util.Collection;
-
-@RunWith(ShardingSphereParallelTestParameterized.class)
-public final class PostgreSQLParserParameterizedTest extends SQLParserParameterizedTest {
-
- public PostgreSQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
- super(sqlCaseId, databaseType, sqlCaseType);
- }
-
- @Parameters(name = "{0} ({2}) -> {1}")
- public static Collection<Object[]> getTestParameters() {
- return SQLParserParameterizedTest.getTestParameters("PostgreSQL");
- }
-}
diff --git a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/UnsupportedPostgreSQLParserParameterizedTest.java b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/UnsupportedPostgreSQLParserParameterizedTest.java
deleted file mode 100644
index 1eb910d9856..00000000000
--- a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/UnsupportedPostgreSQLParserParameterizedTest.java
+++ /dev/null
@@ -1,39 +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.sql.parser.postgresql;
-
-import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized.Parameters;
-
-import java.util.Collection;
-
-@RunWith(ShardingSphereParallelTestParameterized.class)
-public final class UnsupportedPostgreSQLParserParameterizedTest extends UnsupportedSQLParserParameterizedTest {
-
- public UnsupportedPostgreSQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
- super(sqlCaseId, databaseType, sqlCaseType);
- }
-
- @Parameters(name = "{0} ({2}) -> {1}")
- public static Collection<Object[]> getTestParameters() {
- return UnsupportedSQLParserParameterizedTest.getTestParameters("PostgreSQL");
- }
-}
diff --git a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/external/PostgreSQLParserParameterizedIT.java b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/external/PostgreSQLParserParameterizedIT.java
index c2ceeec0d92..f920cc435b3 100644
--- a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/external/PostgreSQLParserParameterizedIT.java
+++ b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/external/PostgreSQLParserParameterizedIT.java
@@ -17,9 +17,9 @@
package org.apache.shardingsphere.sql.parser.postgresql.external;
-import org.apache.shardingsphere.test.integration.sql.parser.external.engine.SQLParserParameterizedIT;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.SQLCaseLoader;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.strategy.impl.GitHubSQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.sql.parser.external.engine.SQLParserParameterizedIT;
+import org.apache.shardingsphere.test.sql.parser.external.loader.SQLCaseLoader;
+import org.apache.shardingsphere.test.sql.parser.external.loader.strategy.impl.GitHubSQLCaseLoadStrategy;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/internal/PostgreSQLParserParameterizedTest.java b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/internal/PostgreSQLParserParameterizedTest.java
new file mode 100644
index 00000000000..66e77fcd84b
--- /dev/null
+++ b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/internal/PostgreSQLParserParameterizedTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sql.parser.postgresql.internal;
+
+import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.SQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Collection;
+
+@RunWith(ShardingSphereParallelTestParameterized.class)
+public final class PostgreSQLParserParameterizedTest extends SQLParserParameterizedTest {
+
+ public PostgreSQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
+ super(sqlCaseId, databaseType, sqlCaseType);
+ }
+
+ @Parameters(name = "{0} ({2}) -> {1}")
+ public static Collection<Object[]> getTestParameters() {
+ return SQLParserParameterizedTest.getTestParameters("PostgreSQL");
+ }
+}
diff --git a/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/internal/UnsupportedPostgreSQLParserParameterizedTest.java b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/internal/UnsupportedPostgreSQLParserParameterizedTest.java
new file mode 100644
index 00000000000..3d3c1f893d0
--- /dev/null
+++ b/sql-parser/dialect/postgresql/src/test/java/org/apache/shardingsphere/sql/parser/postgresql/internal/UnsupportedPostgreSQLParserParameterizedTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.sql.parser.postgresql.internal;
+
+import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.UnsupportedSQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Collection;
+
+@RunWith(ShardingSphereParallelTestParameterized.class)
+public final class UnsupportedPostgreSQLParserParameterizedTest extends UnsupportedSQLParserParameterizedTest {
+
+ public UnsupportedPostgreSQLParserParameterizedTest(final String sqlCaseId, final String databaseType, final SQLCaseType sqlCaseType) {
+ super(sqlCaseId, databaseType, sqlCaseType);
+ }
+
+ @Parameters(name = "{0} ({2}) -> {1}")
+ public static Collection<Object[]> getTestParameters() {
+ return UnsupportedSQLParserParameterizedTest.getTestParameters("PostgreSQL");
+ }
+}
diff --git a/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/SQL92ParserParameterizedTest.java b/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/SQL92ParserParameterizedTest.java
index 1f1bcf79614..a12d61e4b7d 100644
--- a/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/SQL92ParserParameterizedTest.java
+++ b/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/SQL92ParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.sql92;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.SQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.SQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/UnsupportedSQL92ParserParameterizedTest.java b/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/UnsupportedSQL92ParserParameterizedTest.java
index 9ee80cec1aa..2a39ce5942c 100644
--- a/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/UnsupportedSQL92ParserParameterizedTest.java
+++ b/sql-parser/dialect/sql92/src/test/java/org/apache/shardingsphere/sql/parser/sql92/UnsupportedSQL92ParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.sql92;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.UnsupportedSQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/SQLServerParserParameterizedTest.java b/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/SQLServerParserParameterizedTest.java
index 4a2cdadb7dc..0e352ee051c 100644
--- a/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/SQLServerParserParameterizedTest.java
+++ b/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/SQLServerParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.sqlserver;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.SQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.SQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/UnsupportedSQLServerParserParameterizedTest.java b/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/UnsupportedSQLServerParserParameterizedTest.java
index 6461165d7ce..832e4d2fdcc 100644
--- a/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/UnsupportedSQLServerParserParameterizedTest.java
+++ b/sql-parser/dialect/sqlserver/src/test/java/org/apache/shardingsphere/sql/parser/sqlserver/UnsupportedSQLServerParserParameterizedTest.java
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.sql.parser.sqlserver;
import org.apache.shardingsphere.test.runner.ShardingSphereParallelTestParameterized;
-import org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.engine.UnsupportedSQLParserParameterizedTest;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized.Parameters;
diff --git a/test/optimize/src/test/java/org/apache/shardingsphere/infra/federation/converter/parameterized/engine/SQLNodeConverterEngineParameterizedTest.java b/test/optimize/src/test/java/org/apache/shardingsphere/infra/federation/converter/parameterized/engine/SQLNodeConverterEngineParameterizedTest.java
index 4a1c218b7a0..245fa4c9202 100644
--- a/test/optimize/src/test/java/org/apache/shardingsphere/infra/federation/converter/parameterized/engine/SQLNodeConverterEngineParameterizedTest.java
+++ b/test/optimize/src/test/java/org/apache/shardingsphere/infra/federation/converter/parameterized/engine/SQLNodeConverterEngineParameterizedTest.java
@@ -37,11 +37,11 @@ import org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import org.apache.shardingsphere.sqlfederation.optimizer.context.parser.dialect.OptimizerSQLDialectBuilderFactory;
import org.apache.shardingsphere.sqlfederation.optimizer.converter.SQLNodeConverterEngine;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.CasesRegistry;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.SQLParserTestCasesRegistry;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.SQLParserTestCasesRegistryFactory;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.SQLCaseType;
-import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.sql.loader.SQLCasesLoader;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.CasesRegistry;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.SQLParserTestCasesRegistry;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.SQLParserTestCasesRegistryFactory;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.loader.SQLCasesLoader;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/engine/SQLParserParameterizedIT.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/engine/SQLParserParameterizedIT.java
deleted file mode 100644
index ea30454a83a..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/engine/SQLParserParameterizedIT.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.integration.sql.parser.external.engine;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.infra.util.exception.external.ShardingSphereExternalException;
-import org.apache.shardingsphere.sql.parser.api.CacheOption;
-import org.apache.shardingsphere.sql.parser.api.SQLParserEngine;
-import org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine;
-import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporter;
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporterCreatorFactory;
-import org.junit.Test;
-
-import java.util.Properties;
-
-@Slf4j
-public abstract class SQLParserParameterizedIT {
-
- private final String sqlCaseId;
-
- private final String sql;
-
- private final String databaseType;
-
- private final SQLParseResultReporter resultReporter;
-
- public SQLParserParameterizedIT(final String sqlCaseId, final String sql, final String databaseType, final String reportType) {
- this.sqlCaseId = sqlCaseId;
- this.sql = sql;
- this.databaseType = databaseType;
- resultReporter = SQLParseResultReporterCreatorFactory.newInstance(reportType).create(databaseType);
- }
-
- @Test
- public final void assertParseSQL() {
- boolean isSuccess = true;
- try {
- ParseASTNode parseASTNode = new SQLParserEngine(databaseType, new CacheOption(128, 1024L)).parse(sql, false);
- new SQLVisitorEngine(databaseType, "STATEMENT", true, new Properties()).visit(parseASTNode);
- } catch (final ShardingSphereExternalException | ClassCastException | NullPointerException | IllegalArgumentException | IndexOutOfBoundsException ignore) {
- isSuccess = false;
- }
- resultReporter.printResult(sqlCaseId, databaseType, isSuccess, sql);
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/env/SQLParserExternalITEnvironment.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/env/SQLParserExternalITEnvironment.java
deleted file mode 100644
index 3db351584db..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/env/SQLParserExternalITEnvironment.java
+++ /dev/null
@@ -1,69 +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.integration.sql.parser.external.env;
-
-import lombok.Getter;
-import lombok.SneakyThrows;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * SQL parser external IT environment.
- */
-@Getter
-public final class SQLParserExternalITEnvironment {
-
- private static final SQLParserExternalITEnvironment INSTANCE = new SQLParserExternalITEnvironment();
-
- private final boolean sqlParserITEnabled;
-
- private final String resultPath;
-
- private final String resultProcessorType;
-
- private SQLParserExternalITEnvironment() {
- Properties props = loadProperties();
- sqlParserITEnabled = Boolean.parseBoolean(
- null == System.getProperty("sql.parser.external.it.enabled") ? props.get("sql.parser.external.it.enabled").toString() : System.getProperty("sql.parser.external.it.enabled"));
- resultPath = props.getOrDefault("sql.parser.external.it.report.path", "/tmp/").toString();
- resultProcessorType = props.getOrDefault("sql.parser.external.it.report.type", "LOG").toString();
- }
-
- /**
- * Get instance.
- *
- * @return got instance
- */
- public static SQLParserExternalITEnvironment getInstance() {
- return INSTANCE;
- }
-
- @SneakyThrows(IOException.class)
- private Properties loadProperties() {
- Properties result = new Properties();
- try (InputStream inputStream = SQLParserExternalITEnvironment.class.getClassLoader().getResourceAsStream("env/sql-parser-external-it-env.properties")) {
- result.load(inputStream);
- }
- for (String each : System.getProperties().stringPropertyNames()) {
- result.setProperty(each, System.getProperty(each));
- }
- return result;
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/SQLCaseLoader.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/SQLCaseLoader.java
deleted file mode 100644
index 71098051f13..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/SQLCaseLoader.java
+++ /dev/null
@@ -1,135 +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.integration.sql.parser.external.loader;
-
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.test.integration.sql.parser.external.env.SQLParserExternalITEnvironment;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.strategy.SQLCaseLoadStrategy;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.summary.FileSummary;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URI;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
-
-/**
- * SQL case loader.
- */
-@RequiredArgsConstructor
-@Slf4j
-public final class SQLCaseLoader {
-
- private final SQLCaseLoadStrategy loadStrategy;
-
- /**
- * Load SQL cases.
- *
- * @param sqlCaseURI SQL case URI
- * @param resultURI result URI
- *
- * @return loaded SQL cases
- */
- public Collection<Object[]> load(final URI sqlCaseURI, final URI resultURI) {
- if (!SQLParserExternalITEnvironment.getInstance().isSqlParserITEnabled()) {
- return Collections.emptyList();
- }
- Collection<Object[]> result = new LinkedList<>();
- Map<String, FileSummary> sqlCaseFileSummaries = loadStrategy.loadSQLCaseFileSummaries(sqlCaseURI).stream().collect(Collectors.toMap(FileSummary::getFileName, v -> v, (k, v) -> v));
- Map<String, FileSummary> resultFileSummaries = loadStrategy.loadSQLCaseFileSummaries(resultURI).stream().collect(Collectors.toMap(FileSummary::getFileName, v -> v, (k, v) -> v));
- for (Entry<String, FileSummary> entry : sqlCaseFileSummaries.entrySet()) {
- String fileName = entry.getKey();
- String sqlCaseFileContent = loadContent(URI.create(entry.getValue().getAccessURL()));
- String resultFileContent = resultFileSummaries.containsKey(fileName) ? loadContent(URI.create(resultFileSummaries.get(fileName).getAccessURL())) : "";
- result.addAll(createSQLCases(fileName, sqlCaseFileContent, resultFileContent));
- }
- if (result.isEmpty()) {
- result.add(new Object[]{"", ""});
- }
- return result;
- }
-
- private String loadContent(final URI uri) {
- try {
- InputStreamReader in = new InputStreamReader(uri.toURL().openStream());
- return new BufferedReader(in).lines().collect(Collectors.joining(System.lineSeparator()));
- } catch (final IOException ex) {
- log.warn("Load failed, reason is: ", ex);
- return "";
- }
- }
-
- private Collection<Object[]> createSQLCases(final String sqlCaseFileName, final String sqlCaseFileContent, final String resultFileContent) {
- Collection<Object[]> result = new LinkedList<>();
- String[] caseCaseLines = sqlCaseFileContent.split("\n");
- String[] resultLines = resultFileContent.split("\n");
- String completedSQL = "";
- int sqlCaseEnum = 1;
- int statementLines = 0;
- int resultIndex = 0;
- boolean inProcedure = false;
- for (String each : caseCaseLines) {
- inProcedure = isInProcedure(inProcedure, each.trim());
- completedSQL = getStatement(completedSQL, each.trim(), inProcedure);
- statementLines = completedSQL.isEmpty() ? 0 : statementLines + 1;
- if (completedSQL.contains(";") && !inProcedure) {
- resultIndex = searchResult(resultIndex, resultLines, completedSQL, statementLines);
- if (resultIndex >= resultLines.length || !resultLines[resultIndex].contains("ERROR")) {
- String sqlCaseId = sqlCaseFileName + sqlCaseEnum;
- result.add(new Object[]{sqlCaseId, completedSQL});
- sqlCaseEnum++;
- }
- completedSQL = "";
- statementLines = 0;
- }
- }
- return result;
- }
-
- private static boolean isInProcedure(final boolean inProcedure, final String statementLines) {
- if (statementLines.contains("{") && statementLines.contains("}")) {
- return inProcedure;
- }
- return (statementLines.contains("{") || statementLines.contains("}") || statementLines.contains("$$")) != inProcedure;
- }
-
- private static String getStatement(final String completedSQL, final String sqlLine, final boolean inProcedure) {
- return (sqlLine.isEmpty() || isComment(sqlLine)) && !inProcedure ? "" : completedSQL + sqlLine + " ";
- }
-
- private static boolean isComment(final String statement) {
- return statement.startsWith("#") || statement.startsWith("/") || statement.startsWith("--") || statement.startsWith(":") || statement.startsWith("\\");
- }
-
- private static int searchResult(final int resultIndex, final String[] resultLines, final String completedSQL, final int statementLines) {
- int index = resultIndex;
- while (index < resultLines.length && !completedSQL.startsWith(resultLines[index].trim())) {
- index++;
- }
- if (index != resultLines.length) {
- return index + statementLines;
- }
- return resultIndex;
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/SQLCaseLoadStrategy.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/SQLCaseLoadStrategy.java
deleted file mode 100644
index 8374780ab5d..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/SQLCaseLoadStrategy.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.integration.sql.parser.external.loader.strategy;
-
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.summary.FileSummary;
-
-import java.net.URI;
-import java.util.Collection;
-
-/**
- * SQL case load strategy.
- */
-public interface SQLCaseLoadStrategy {
-
- /**
- * Load SQL case file summaries.
- *
- * @param uri URL to be loaded
- * @return loaded SQL file summaries
- */
- Collection<FileSummary> loadSQLCaseFileSummaries(URI uri);
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/impl/GitHubSQLCaseLoadStrategy.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/impl/GitHubSQLCaseLoadStrategy.java
deleted file mode 100644
index 4a2d2ccfa60..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/impl/GitHubSQLCaseLoadStrategy.java
+++ /dev/null
@@ -1,84 +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.integration.sql.parser.external.loader.strategy.impl;
-
-import com.jayway.jsonpath.JsonPath;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.strategy.SQLCaseLoadStrategy;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.summary.FileSummary;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.URI;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * SQL case loader with GitHub.
- */
-@Slf4j
-public final class GitHubSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
-
- @Override
- public Collection<FileSummary> loadSQLCaseFileSummaries(final URI uri) {
- String content = loadContent(getGitHubApiUri(uri));
- if (content.isEmpty()) {
- return Collections.emptyList();
- }
- Collection<FileSummary> result = new LinkedList<>();
- List<String> fileNames = JsonPath.parse(content).read("$..name");
- List<String> folderTypes = JsonPath.parse(content).read("$..type");
- List<String> downloadURLs = JsonPath.parse(content).read("$..download_url");
- List<String> htmlURLs = JsonPath.parse(content).read("$..html_url");
- int length = JsonPath.parse(content).read("$.length()");
- for (int i = 0; i < length; i++) {
- String fileName = fileNames.get(i).split("\\.")[0];
- String folderType = folderTypes.get(i);
- String downloadURL = downloadURLs.get(i);
- String htmlURL = htmlURLs.get(i);
- if ("file".equals(folderType)) {
- result.add(new FileSummary(fileName, downloadURL));
- } else if ("dir".equals(folderType)) {
- result.addAll(loadSQLCaseFileSummaries(URI.create(htmlURL)));
- }
- }
- return result;
- }
-
- private URI getGitHubApiUri(final URI sqlCaseURI) {
- String[] patches = sqlCaseURI.toString().split("/", 8);
- String casesOwner = patches[3];
- String casesRepo = patches[4];
- String casesDirectory = patches[7];
- return URI.create(String.join("/", "https://api.github.com/repos", casesOwner, casesRepo, "contents", casesDirectory));
- }
-
- private String loadContent(final URI casesURI) {
- try {
- InputStreamReader in = new InputStreamReader(casesURI.toURL().openStream());
- return new BufferedReader(in).lines().collect(Collectors.joining(System.lineSeparator()));
- } catch (final IOException ex) {
- log.warn("Load failed, reason is: ", ex);
- return "";
- }
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/impl/LocalFileSQLCaseLoadStrategy.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/impl/LocalFileSQLCaseLoadStrategy.java
deleted file mode 100644
index b08eb1eda70..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/strategy/impl/LocalFileSQLCaseLoadStrategy.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.integration.sql.parser.external.loader.strategy.impl;
-
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.strategy.SQLCaseLoadStrategy;
-import org.apache.shardingsphere.test.integration.sql.parser.external.loader.summary.FileSummary;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * SQL case loader with local file.
- */
-public final class LocalFileSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
-
- @Override
- public Collection<FileSummary> loadSQLCaseFileSummaries(final URI uri) {
- // TODO
- return Collections.emptyList();
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/summary/AssertableFileSummary.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/summary/AssertableFileSummary.java
deleted file mode 100644
index 4d6c310d835..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/summary/AssertableFileSummary.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.integration.sql.parser.external.loader.summary;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-/**
- * Assertable file summary.
- */
-@RequiredArgsConstructor
-@Getter
-public final class AssertableFileSummary {
-
- private final String fileName;
-
- private final String sqlCaseFileAccessURL;
-
- private final String resultFileAccessURL;
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/summary/FileSummary.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/summary/FileSummary.java
deleted file mode 100644
index adb635ef20f..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/loader/summary/FileSummary.java
+++ /dev/null
@@ -1,33 +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.integration.sql.parser.external.loader.summary;
-
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-/**
- * File summary.
- */
-@RequiredArgsConstructor
-@Getter
-public final class FileSummary {
-
- private final String fileName;
-
- private final String accessURL;
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporter.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporter.java
deleted file mode 100644
index 3265614e4cd..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporter.java
+++ /dev/null
@@ -1,34 +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.integration.sql.parser.external.result;
-
-/**
- * SQL parse result reporter.
- */
-public interface SQLParseResultReporter {
-
- /**
- * Print result.
- *
- * @param sqlCaseId SQL case ID
- * @param databaseType database type
- * @param sql SQL
- * @param isSuccess whether success
- */
- void printResult(String sqlCaseId, String databaseType, boolean isSuccess, String sql);
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporterCreator.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporterCreator.java
deleted file mode 100644
index fba0e15e059..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporterCreator.java
+++ /dev/null
@@ -1,34 +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.integration.sql.parser.external.result;
-
-import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
-
-/**
- * SQL parse result reporter creator.
- */
-public interface SQLParseResultReporterCreator extends TypedSPI {
-
- /**
- * Create SQL parse result reporter.
- *
- * @param databaseType database type
- * @return created SQL parse result reporter
- */
- SQLParseResultReporter create(String databaseType);
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporterCreatorFactory.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporterCreatorFactory.java
deleted file mode 100644
index fd01cd3ecb1..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/SQLParseResultReporterCreatorFactory.java
+++ /dev/null
@@ -1,44 +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.integration.sql.parser.external.result;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
-import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry;
-
-/**
- * SQL parse result reporter creator factory.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class SQLParseResultReporterCreatorFactory {
-
- static {
- ShardingSphereServiceLoader.register(SQLParseResultReporterCreator.class);
- }
-
- /**
- * Create new instance of SQL parse result reporter creator.
- *
- * @param type type
- * @return new instance of SQL parse result reporter creator
- */
- public static SQLParseResultReporterCreator newInstance(final String type) {
- return TypedSPIRegistry.getRegisteredService(SQLParseResultReporterCreator.class, type);
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/csv/CsvSQLParseResultReporter.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/csv/CsvSQLParseResultReporter.java
deleted file mode 100644
index ddf5be068d7..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/csv/CsvSQLParseResultReporter.java
+++ /dev/null
@@ -1,67 +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.integration.sql.parser.external.result.type.csv;
-
-import org.apache.commons.csv.CSVFormat;
-import org.apache.commons.csv.CSVPrinter;
-import org.apache.shardingsphere.test.integration.sql.parser.external.env.SQLParserExternalITEnvironment;
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporter;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-/**
- * SQL parse result reporter for CSV.
- */
-public final class CsvSQLParseResultReporter implements SQLParseResultReporter {
-
- private final CSVPrinter printer;
-
- public CsvSQLParseResultReporter(final String databaseType) {
- try {
- File csvFile = new File(SQLParserExternalITEnvironment.getInstance().getResultPath() + databaseType + "-result.csv");
- printHeader(csvFile);
- printer = new CSVPrinter(new FileWriter(csvFile, true), CSVFormat.DEFAULT.builder().setSkipHeaderRecord(true).build());
- } catch (final IOException ex) {
- throw new RuntimeException("Create CSV file failed.", ex);
- }
- }
-
- private void printHeader(final File csvFile) {
- if (csvFile.exists()) {
- return;
- }
- try (CSVPrinter printer = new CSVPrinter(new FileWriter(csvFile), CSVFormat.DEFAULT.builder().setSkipHeaderRecord(false).build())) {
- printer.printRecord("SQLCaseId", "DatabaseType", "Result", "SQL");
- printer.flush();
- } catch (final IOException ex) {
- throw new RuntimeException("Create CSV file header failed.", ex);
- }
- }
-
- @Override
- public void printResult(final String sqlCaseId, final String databaseType, final boolean isSuccess, final String sql) {
- try {
- printer.printRecord(sqlCaseId, databaseType, isSuccess ? "success" : "failed", sql);
- printer.flush();
- } catch (final IOException ex) {
- throw new RuntimeException("Write CSV file failed.", ex);
- }
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/csv/CsvSQLParseResultReporterCreator.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/csv/CsvSQLParseResultReporterCreator.java
deleted file mode 100644
index 9209991e65a..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/csv/CsvSQLParseResultReporterCreator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.integration.sql.parser.external.result.type.csv;
-
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporter;
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporterCreator;
-
-/**
- * SQL parse result reporter creator for CSV.
- */
-public final class CsvSQLParseResultReporterCreator implements SQLParseResultReporterCreator {
-
- @Override
- public SQLParseResultReporter create(final String databaseType) {
- return new CsvSQLParseResultReporter(databaseType);
- }
-
- @Override
- public String getType() {
- return "CSV";
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/log/LogSQLParseResultReporter.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/log/LogSQLParseResultReporter.java
deleted file mode 100644
index 718f0df48a6..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/log/LogSQLParseResultReporter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.integration.sql.parser.external.result.type.log;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporter;
-
-/**
- * SQL parse result reporter for log.
- */
-@Slf4j
-public final class LogSQLParseResultReporter implements SQLParseResultReporter {
-
- @Override
- public void printResult(final String sqlCaseId, final String databaseType, final boolean isSuccess, final String sql) {
- if (!isSuccess) {
- log.warn("SQL parse failed. SQL Case ID is: {}, database type is: {}, SQL is: {}", sqlCaseId, databaseType, sql);
- }
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/log/LogSQLParseResultReporterCreator.java b/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/log/LogSQLParseResultReporterCreator.java
deleted file mode 100644
index 45fb83faa76..00000000000
--- a/test/parser/src/main/java/org/apache/shardingsphere/test/integration/sql/parser/external/result/type/log/LogSQLParseResultReporterCreator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.integration.sql.parser.external.result.type.log;
-
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporter;
-import org.apache.shardingsphere.test.integration.sql.parser.external.result.SQLParseResultReporterCreator;
-
-/**
- * SQL parse result reporter creator for log.
- */
-public final class LogSQLParseResultReporterCreator implements SQLParseResultReporterCreator {
-
- @Override
- public SQLParseResultReporter create(final String databaseType) {
- return new LogSQLParseResultReporter();
- }
-
- @Override
- public String getType() {
- return "LOG";
- }
-}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/engine/SQLParserParameterizedIT.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/engine/SQLParserParameterizedIT.java
new file mode 100644
index 00000000000..b3f84d76b8a
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/engine/SQLParserParameterizedIT.java
@@ -0,0 +1,61 @@
+/*
+ * 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.external.engine;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.infra.util.exception.external.ShardingSphereExternalException;
+import org.apache.shardingsphere.sql.parser.api.CacheOption;
+import org.apache.shardingsphere.sql.parser.api.SQLParserEngine;
+import org.apache.shardingsphere.sql.parser.api.SQLVisitorEngine;
+import org.apache.shardingsphere.sql.parser.core.ParseASTNode;
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporter;
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporterCreatorFactory;
+import org.junit.Test;
+
+import java.util.Properties;
+
+@Slf4j
+public abstract class SQLParserParameterizedIT {
+
+ private final String sqlCaseId;
+
+ private final String sql;
+
+ private final String databaseType;
+
+ private final SQLParseResultReporter resultReporter;
+
+ public SQLParserParameterizedIT(final String sqlCaseId, final String sql, final String databaseType, final String reportType) {
+ this.sqlCaseId = sqlCaseId;
+ this.sql = sql;
+ this.databaseType = databaseType;
+ resultReporter = SQLParseResultReporterCreatorFactory.newInstance(reportType).create(databaseType);
+ }
+
+ @Test
+ public final void assertParseSQL() {
+ boolean isSuccess = true;
+ try {
+ ParseASTNode parseASTNode = new SQLParserEngine(databaseType, new CacheOption(128, 1024L)).parse(sql, false);
+ new SQLVisitorEngine(databaseType, "STATEMENT", true, new Properties()).visit(parseASTNode);
+ } catch (final ShardingSphereExternalException | ClassCastException | NullPointerException | IllegalArgumentException | IndexOutOfBoundsException ignore) {
+ isSuccess = false;
+ }
+ resultReporter.printResult(sqlCaseId, databaseType, isSuccess, sql);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/env/SQLParserExternalITEnvironment.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/env/SQLParserExternalITEnvironment.java
new file mode 100644
index 00000000000..e03616eb046
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/env/SQLParserExternalITEnvironment.java
@@ -0,0 +1,69 @@
+/*
+ * 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.external.env;
+
+import lombok.Getter;
+import lombok.SneakyThrows;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * SQL parser external IT environment.
+ */
+@Getter
+public final class SQLParserExternalITEnvironment {
+
+ private static final SQLParserExternalITEnvironment INSTANCE = new SQLParserExternalITEnvironment();
+
+ private final boolean sqlParserITEnabled;
+
+ private final String resultPath;
+
+ private final String resultProcessorType;
+
+ private SQLParserExternalITEnvironment() {
+ Properties props = loadProperties();
+ sqlParserITEnabled = Boolean.parseBoolean(
+ null == System.getProperty("sql.parser.external.it.enabled") ? props.get("sql.parser.external.it.enabled").toString() : System.getProperty("sql.parser.external.it.enabled"));
+ resultPath = props.getOrDefault("sql.parser.external.it.report.path", "/tmp/").toString();
+ resultProcessorType = props.getOrDefault("sql.parser.external.it.report.type", "LOG").toString();
+ }
+
+ /**
+ * Get instance.
+ *
+ * @return got instance
+ */
+ public static SQLParserExternalITEnvironment getInstance() {
+ return INSTANCE;
+ }
+
+ @SneakyThrows(IOException.class)
+ private Properties loadProperties() {
+ Properties result = new Properties();
+ try (InputStream inputStream = SQLParserExternalITEnvironment.class.getClassLoader().getResourceAsStream("env/sql-parser-external-it-env.properties")) {
+ result.load(inputStream);
+ }
+ for (String each : System.getProperties().stringPropertyNames()) {
+ result.setProperty(each, System.getProperty(each));
+ }
+ return result;
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/SQLCaseLoader.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/SQLCaseLoader.java
new file mode 100644
index 00000000000..eeff339a236
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/SQLCaseLoader.java
@@ -0,0 +1,135 @@
+/*
+ * 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.external.loader;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.test.sql.parser.external.env.SQLParserExternalITEnvironment;
+import org.apache.shardingsphere.test.sql.parser.external.loader.strategy.SQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.sql.parser.external.loader.summary.FileSummary;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URI;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
+
+/**
+ * SQL case loader.
+ */
+@RequiredArgsConstructor
+@Slf4j
+public final class SQLCaseLoader {
+
+ private final SQLCaseLoadStrategy loadStrategy;
+
+ /**
+ * Load SQL cases.
+ *
+ * @param sqlCaseURI SQL case URI
+ * @param resultURI result URI
+ *
+ * @return loaded SQL cases
+ */
+ public Collection<Object[]> load(final URI sqlCaseURI, final URI resultURI) {
+ if (!SQLParserExternalITEnvironment.getInstance().isSqlParserITEnabled()) {
+ return Collections.emptyList();
+ }
+ Collection<Object[]> result = new LinkedList<>();
+ Map<String, FileSummary> sqlCaseFileSummaries = loadStrategy.loadSQLCaseFileSummaries(sqlCaseURI).stream().collect(Collectors.toMap(FileSummary::getFileName, v -> v, (k, v) -> v));
+ Map<String, FileSummary> resultFileSummaries = loadStrategy.loadSQLCaseFileSummaries(resultURI).stream().collect(Collectors.toMap(FileSummary::getFileName, v -> v, (k, v) -> v));
+ for (Entry<String, FileSummary> entry : sqlCaseFileSummaries.entrySet()) {
+ String fileName = entry.getKey();
+ String sqlCaseFileContent = loadContent(URI.create(entry.getValue().getAccessURL()));
+ String resultFileContent = resultFileSummaries.containsKey(fileName) ? loadContent(URI.create(resultFileSummaries.get(fileName).getAccessURL())) : "";
+ result.addAll(createSQLCases(fileName, sqlCaseFileContent, resultFileContent));
+ }
+ if (result.isEmpty()) {
+ result.add(new Object[]{"", ""});
+ }
+ return result;
+ }
+
+ private String loadContent(final URI uri) {
+ try {
+ InputStreamReader in = new InputStreamReader(uri.toURL().openStream());
+ return new BufferedReader(in).lines().collect(Collectors.joining(System.lineSeparator()));
+ } catch (final IOException ex) {
+ log.warn("Load failed, reason is: ", ex);
+ return "";
+ }
+ }
+
+ private Collection<Object[]> createSQLCases(final String sqlCaseFileName, final String sqlCaseFileContent, final String resultFileContent) {
+ Collection<Object[]> result = new LinkedList<>();
+ String[] caseCaseLines = sqlCaseFileContent.split("\n");
+ String[] resultLines = resultFileContent.split("\n");
+ String completedSQL = "";
+ int sqlCaseEnum = 1;
+ int statementLines = 0;
+ int resultIndex = 0;
+ boolean inProcedure = false;
+ for (String each : caseCaseLines) {
+ inProcedure = isInProcedure(inProcedure, each.trim());
+ completedSQL = getStatement(completedSQL, each.trim(), inProcedure);
+ statementLines = completedSQL.isEmpty() ? 0 : statementLines + 1;
+ if (completedSQL.contains(";") && !inProcedure) {
+ resultIndex = searchResult(resultIndex, resultLines, completedSQL, statementLines);
+ if (resultIndex >= resultLines.length || !resultLines[resultIndex].contains("ERROR")) {
+ String sqlCaseId = sqlCaseFileName + sqlCaseEnum;
+ result.add(new Object[]{sqlCaseId, completedSQL});
+ sqlCaseEnum++;
+ }
+ completedSQL = "";
+ statementLines = 0;
+ }
+ }
+ return result;
+ }
+
+ private static boolean isInProcedure(final boolean inProcedure, final String statementLines) {
+ if (statementLines.contains("{") && statementLines.contains("}")) {
+ return inProcedure;
+ }
+ return (statementLines.contains("{") || statementLines.contains("}") || statementLines.contains("$$")) != inProcedure;
+ }
+
+ private static String getStatement(final String completedSQL, final String sqlLine, final boolean inProcedure) {
+ return (sqlLine.isEmpty() || isComment(sqlLine)) && !inProcedure ? "" : completedSQL + sqlLine + " ";
+ }
+
+ private static boolean isComment(final String statement) {
+ return statement.startsWith("#") || statement.startsWith("/") || statement.startsWith("--") || statement.startsWith(":") || statement.startsWith("\\");
+ }
+
+ private static int searchResult(final int resultIndex, final String[] resultLines, final String completedSQL, final int statementLines) {
+ int index = resultIndex;
+ while (index < resultLines.length && !completedSQL.startsWith(resultLines[index].trim())) {
+ index++;
+ }
+ if (index != resultLines.length) {
+ return index + statementLines;
+ }
+ return resultIndex;
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/SQLCaseLoadStrategy.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/SQLCaseLoadStrategy.java
new file mode 100644
index 00000000000..a008b958844
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/SQLCaseLoadStrategy.java
@@ -0,0 +1,37 @@
+/*
+ * 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.external.loader.strategy;
+
+import org.apache.shardingsphere.test.sql.parser.external.loader.summary.FileSummary;
+
+import java.net.URI;
+import java.util.Collection;
+
+/**
+ * SQL case load strategy.
+ */
+public interface SQLCaseLoadStrategy {
+
+ /**
+ * Load SQL case file summaries.
+ *
+ * @param uri URL to be loaded
+ * @return loaded SQL file summaries
+ */
+ Collection<FileSummary> loadSQLCaseFileSummaries(URI uri);
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/impl/GitHubSQLCaseLoadStrategy.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/impl/GitHubSQLCaseLoadStrategy.java
new file mode 100644
index 00000000000..d693396b985
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/impl/GitHubSQLCaseLoadStrategy.java
@@ -0,0 +1,84 @@
+/*
+ * 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.external.loader.strategy.impl;
+
+import com.jayway.jsonpath.JsonPath;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.test.sql.parser.external.loader.strategy.SQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.sql.parser.external.loader.summary.FileSummary;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URI;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * SQL case loader with GitHub.
+ */
+@Slf4j
+public final class GitHubSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
+
+ @Override
+ public Collection<FileSummary> loadSQLCaseFileSummaries(final URI uri) {
+ String content = loadContent(getGitHubApiUri(uri));
+ if (content.isEmpty()) {
+ return Collections.emptyList();
+ }
+ Collection<FileSummary> result = new LinkedList<>();
+ List<String> fileNames = JsonPath.parse(content).read("$..name");
+ List<String> folderTypes = JsonPath.parse(content).read("$..type");
+ List<String> downloadURLs = JsonPath.parse(content).read("$..download_url");
+ List<String> htmlURLs = JsonPath.parse(content).read("$..html_url");
+ int length = JsonPath.parse(content).read("$.length()");
+ for (int i = 0; i < length; i++) {
+ String fileName = fileNames.get(i).split("\\.")[0];
+ String folderType = folderTypes.get(i);
+ String downloadURL = downloadURLs.get(i);
+ String htmlURL = htmlURLs.get(i);
+ if ("file".equals(folderType)) {
+ result.add(new FileSummary(fileName, downloadURL));
+ } else if ("dir".equals(folderType)) {
+ result.addAll(loadSQLCaseFileSummaries(URI.create(htmlURL)));
+ }
+ }
+ return result;
+ }
+
+ private URI getGitHubApiUri(final URI sqlCaseURI) {
+ String[] patches = sqlCaseURI.toString().split("/", 8);
+ String casesOwner = patches[3];
+ String casesRepo = patches[4];
+ String casesDirectory = patches[7];
+ return URI.create(String.join("/", "https://api.github.com/repos", casesOwner, casesRepo, "contents", casesDirectory));
+ }
+
+ private String loadContent(final URI casesURI) {
+ try {
+ InputStreamReader in = new InputStreamReader(casesURI.toURL().openStream());
+ return new BufferedReader(in).lines().collect(Collectors.joining(System.lineSeparator()));
+ } catch (final IOException ex) {
+ log.warn("Load failed, reason is: ", ex);
+ return "";
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/impl/LocalFileSQLCaseLoadStrategy.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/impl/LocalFileSQLCaseLoadStrategy.java
new file mode 100644
index 00000000000..8d75c68d58a
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/strategy/impl/LocalFileSQLCaseLoadStrategy.java
@@ -0,0 +1,37 @@
+/*
+ * 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.external.loader.strategy.impl;
+
+import org.apache.shardingsphere.test.sql.parser.external.loader.strategy.SQLCaseLoadStrategy;
+import org.apache.shardingsphere.test.sql.parser.external.loader.summary.FileSummary;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * SQL case loader with local file.
+ */
+public final class LocalFileSQLCaseLoadStrategy implements SQLCaseLoadStrategy {
+
+ @Override
+ public Collection<FileSummary> loadSQLCaseFileSummaries(final URI uri) {
+ // TODO
+ return Collections.emptyList();
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/summary/AssertableFileSummary.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/summary/AssertableFileSummary.java
new file mode 100644
index 00000000000..a2dcd562e8c
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/summary/AssertableFileSummary.java
@@ -0,0 +1,35 @@
+/*
+ * 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.external.loader.summary;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * Assertable file summary.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class AssertableFileSummary {
+
+ private final String fileName;
+
+ private final String sqlCaseFileAccessURL;
+
+ private final String resultFileAccessURL;
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/summary/FileSummary.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/summary/FileSummary.java
new file mode 100644
index 00000000000..f71e6abcf08
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/loader/summary/FileSummary.java
@@ -0,0 +1,33 @@
+/*
+ * 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.external.loader.summary;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * File summary.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class FileSummary {
+
+ private final String fileName;
+
+ private final String accessURL;
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporter.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporter.java
new file mode 100644
index 00000000000..daca36b1157
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporter.java
@@ -0,0 +1,34 @@
+/*
+ * 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.external.result;
+
+/**
+ * SQL parse result reporter.
+ */
+public interface SQLParseResultReporter {
+
+ /**
+ * Print result.
+ *
+ * @param sqlCaseId SQL case ID
+ * @param databaseType database type
+ * @param sql SQL
+ * @param isSuccess whether success
+ */
+ void printResult(String sqlCaseId, String databaseType, boolean isSuccess, String sql);
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporterCreator.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporterCreator.java
new file mode 100644
index 00000000000..f0e62efbf7c
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporterCreator.java
@@ -0,0 +1,34 @@
+/*
+ * 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.external.result;
+
+import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;
+
+/**
+ * SQL parse result reporter creator.
+ */
+public interface SQLParseResultReporterCreator extends TypedSPI {
+
+ /**
+ * Create SQL parse result reporter.
+ *
+ * @param databaseType database type
+ * @return created SQL parse result reporter
+ */
+ SQLParseResultReporter create(String databaseType);
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporterCreatorFactory.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporterCreatorFactory.java
new file mode 100644
index 00000000000..b1a2759893c
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/SQLParseResultReporterCreatorFactory.java
@@ -0,0 +1,44 @@
+/*
+ * 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.external.result;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.infra.util.spi.ShardingSphereServiceLoader;
+import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPIRegistry;
+
+/**
+ * SQL parse result reporter creator factory.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SQLParseResultReporterCreatorFactory {
+
+ static {
+ ShardingSphereServiceLoader.register(SQLParseResultReporterCreator.class);
+ }
+
+ /**
+ * Create new instance of SQL parse result reporter creator.
+ *
+ * @param type type
+ * @return new instance of SQL parse result reporter creator
+ */
+ public static SQLParseResultReporterCreator newInstance(final String type) {
+ return TypedSPIRegistry.getRegisteredService(SQLParseResultReporterCreator.class, type);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/csv/CsvSQLParseResultReporter.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/csv/CsvSQLParseResultReporter.java
new file mode 100644
index 00000000000..cec7b6e1268
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/csv/CsvSQLParseResultReporter.java
@@ -0,0 +1,67 @@
+/*
+ * 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.external.result.type.csv;
+
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.shardingsphere.test.sql.parser.external.env.SQLParserExternalITEnvironment;
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporter;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * SQL parse result reporter for CSV.
+ */
+public final class CsvSQLParseResultReporter implements SQLParseResultReporter {
+
+ private final CSVPrinter printer;
+
+ public CsvSQLParseResultReporter(final String databaseType) {
+ try {
+ File csvFile = new File(SQLParserExternalITEnvironment.getInstance().getResultPath() + databaseType + "-result.csv");
+ printHeader(csvFile);
+ printer = new CSVPrinter(new FileWriter(csvFile, true), CSVFormat.DEFAULT.builder().setSkipHeaderRecord(true).build());
+ } catch (final IOException ex) {
+ throw new RuntimeException("Create CSV file failed.", ex);
+ }
+ }
+
+ private void printHeader(final File csvFile) {
+ if (csvFile.exists()) {
+ return;
+ }
+ try (CSVPrinter printer = new CSVPrinter(new FileWriter(csvFile), CSVFormat.DEFAULT.builder().setSkipHeaderRecord(false).build())) {
+ printer.printRecord("SQLCaseId", "DatabaseType", "Result", "SQL");
+ printer.flush();
+ } catch (final IOException ex) {
+ throw new RuntimeException("Create CSV file header failed.", ex);
+ }
+ }
+
+ @Override
+ public void printResult(final String sqlCaseId, final String databaseType, final boolean isSuccess, final String sql) {
+ try {
+ printer.printRecord(sqlCaseId, databaseType, isSuccess ? "success" : "failed", sql);
+ printer.flush();
+ } catch (final IOException ex) {
+ throw new RuntimeException("Write CSV file failed.", ex);
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/csv/CsvSQLParseResultReporterCreator.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/csv/CsvSQLParseResultReporterCreator.java
new file mode 100644
index 00000000000..9b940a5b7b7
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/csv/CsvSQLParseResultReporterCreator.java
@@ -0,0 +1,37 @@
+/*
+ * 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.external.result.type.csv;
+
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporter;
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporterCreator;
+
+/**
+ * SQL parse result reporter creator for CSV.
+ */
+public final class CsvSQLParseResultReporterCreator implements SQLParseResultReporterCreator {
+
+ @Override
+ public SQLParseResultReporter create(final String databaseType) {
+ return new CsvSQLParseResultReporter(databaseType);
+ }
+
+ @Override
+ public String getType() {
+ return "CSV";
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/log/LogSQLParseResultReporter.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/log/LogSQLParseResultReporter.java
new file mode 100644
index 00000000000..f6fb5f9e720
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/log/LogSQLParseResultReporter.java
@@ -0,0 +1,35 @@
+/*
+ * 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.external.result.type.log;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporter;
+
+/**
+ * SQL parse result reporter for log.
+ */
+@Slf4j
+public final class LogSQLParseResultReporter implements SQLParseResultReporter {
+
+ @Override
+ public void printResult(final String sqlCaseId, final String databaseType, final boolean isSuccess, final String sql) {
+ if (!isSuccess) {
+ log.warn("SQL parse failed. SQL Case ID is: {}, database type is: {}, SQL is: {}", sqlCaseId, databaseType, sql);
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/log/LogSQLParseResultReporterCreator.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/log/LogSQLParseResultReporterCreator.java
new file mode 100644
index 00000000000..86d49571137
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/external/result/type/log/LogSQLParseResultReporterCreator.java
@@ -0,0 +1,37 @@
+/*
+ * 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.external.result.type.log;
+
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporter;
+import org.apache.shardingsphere.test.sql.parser.external.result.SQLParseResultReporterCreator;
+
+/**
+ * SQL parse result reporter creator for log.
+ */
+public final class LogSQLParseResultReporterCreator implements SQLParseResultReporterCreator {
+
+ @Override
+ public SQLParseResultReporter create(final String databaseType) {
+ return new LogSQLParseResultReporter();
+ }
+
+ @Override
+ public String getType() {
+ return "LOG";
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/SQLCaseAssertContext.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/SQLCaseAssertContext.java
new file mode 100644
index 00000000000..d60a04e8dde
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/SQLCaseAssertContext.java
@@ -0,0 +1,84 @@
+/*
+ * 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.internal.asserts;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.SQLParserTestCasesRegistry;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.SQLParserTestCasesRegistryFactory;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+import org.apache.shardingsphere.test.sql.parser.internal.loader.CasesLoader;
+
+import java.util.Collections;
+
+/**
+ * SQL case assert context.
+ */
+@RequiredArgsConstructor
+public final class SQLCaseAssertContext {
+
+ private static final SQLParserTestCasesRegistry SQL_PARSER_TEST_CASES_REGISTRY = SQLParserTestCasesRegistryFactory.getInstance().getRegistry();
+
+ private final CasesLoader casesLoader;
+
+ private final String sqlCaseId;
+
+ @Getter
+ private final SQLCaseType sqlCaseType;
+
+ private final String databaseType;
+
+ /**
+ * Get message text.
+ *
+ * @param failureMessage failure message
+ * @return message text
+ */
+ public String getText(final String failureMessage) {
+ StringBuilder result = new StringBuilder(System.lineSeparator());
+ appendSQLCaseId(result);
+ appendSQL(result);
+ appendFailureMessage(failureMessage, result);
+ return result.toString();
+ }
+
+ private void appendSQLCaseId(final StringBuilder builder) {
+ builder.append("SQL Case ID : ");
+ builder.append(sqlCaseId);
+ builder.append(System.lineSeparator());
+ }
+
+ private void appendSQL(final StringBuilder builder) {
+ builder.append("SQL : ");
+ if (SQLCaseType.Placeholder == sqlCaseType) {
+ builder.append(casesLoader.getCaseValue(sqlCaseId, sqlCaseType, Collections.emptyList(), databaseType));
+ builder.append(System.lineSeparator());
+ builder.append("SQL Params : ");
+ builder.append(SQL_PARSER_TEST_CASES_REGISTRY.get(sqlCaseId).getParameters());
+ builder.append(System.lineSeparator());
+ } else {
+ builder.append(casesLoader.getCaseValue(sqlCaseId, sqlCaseType, SQL_PARSER_TEST_CASES_REGISTRY.get(sqlCaseId).getParameters(), databaseType));
+ }
+ }
+
+ private void appendFailureMessage(final String failureMessage, final StringBuilder builder) {
+ builder.append(System.lineSeparator());
+ builder.append(failureMessage);
+ builder.append(System.lineSeparator());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/SQLSegmentAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/SQLSegmentAssert.java
new file mode 100644
index 00000000000..5cba089a25e
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/SQLSegmentAssert.java
@@ -0,0 +1,57 @@
+/*
+ * 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.internal.asserts.segment;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.ExpectedSQLSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * SQL segment assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SQLSegmentAssert {
+
+ /**
+ * Assert generic attributes of actual SQL segment are same with expected SQL segment.
+ *
+ * @param assertContext assert context
+ * @param actual actual SQL segment
+ * @param expected expected SQL segment
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final SQLSegment actual, final ExpectedSQLSegment expected) {
+ assertStartIndex(assertContext, actual, expected);
+ assertStopIndex(assertContext, actual, expected);
+ }
+
+ private static void assertStartIndex(final SQLCaseAssertContext assertContext, final SQLSegment actual, final ExpectedSQLSegment expected) {
+ int expectedStartIndex = SQLCaseType.Literal == assertContext.getSqlCaseType() && null != expected.getLiteralStartIndex() ? expected.getLiteralStartIndex() : expected.getStartIndex();
+ assertThat(assertContext.getText(String.format("`%s`'s start index assertion error: ", actual.getClass().getSimpleName())), actual.getStartIndex(), is(expectedStartIndex));
+ }
+
+ private static void assertStopIndex(final SQLCaseAssertContext assertContext, final SQLSegment actual, final ExpectedSQLSegment expected) {
+ int expectedStopIndex = SQLCaseType.Literal == assertContext.getSqlCaseType() && null != expected.getLiteralStopIndex() ? expected.getLiteralStopIndex() : expected.getStopIndex();
+ assertThat(assertContext.getText(String.format("`%s`'s stop index assertion error: ", actual.getClass().getSimpleName())), actual.getStopIndex(), is(expectedStopIndex));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/assignment/AssignmentAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/assignment/AssignmentAssert.java
new file mode 100644
index 00000000000..f11fd94ef29
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/assignment/AssignmentAssert.java
@@ -0,0 +1,58 @@
+/*
+ * 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.internal.asserts.segment.assignment;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.assignment.ExpectedAssignment;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Assignment assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class AssignmentAssert {
+
+ /**
+ * Assert actual assignment segment is correct with expected assignment.
+ *
+ * @param assertContext assert context
+ * @param actual actual assignment segment
+ * @param expected expected assignment
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final AssignmentSegment actual, final ExpectedAssignment expected) {
+ if (null == expected.getColumns()) {
+ ColumnAssert.assertIs(assertContext, actual.getColumns().get(0), expected.getColumn());
+ } else {
+ assertThat(assertContext.getText("Assignment columns size assertion error: "), actual.getColumns().size(), is(expected.getColumns().size()));
+ int count = 0;
+ for (ColumnSegment each : actual.getColumns()) {
+ ColumnAssert.assertIs(assertContext, each, expected.getColumns().get(count));
+ count++;
+ }
+ }
+ // TODO assert assign operator
+ AssignmentValueAssert.assertIs(assertContext, actual.getValue(), expected.getAssignmentValue());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/assignment/AssignmentValueAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/assignment/AssignmentValueAssert.java
new file mode 100644
index 00000000000..1d139e9cbcc
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/assignment/AssignmentValueAssert.java
@@ -0,0 +1,66 @@
+/*
+ * 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.internal.asserts.segment.assignment;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubqueryExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ExpressionProjectionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.assignment.ExpectedAssignmentValue;
+
+/**
+ * Assignment value assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class AssignmentValueAssert {
+
+ /**
+ * Assert actual expression segment is correct with expected assignment value.
+ *
+ * @param assertContext assert context
+ * @param actual actual expression segment
+ * @param expected expected assignment value
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ExpressionSegment actual, final ExpectedAssignmentValue expected) {
+ if (actual instanceof ParameterMarkerExpressionSegment) {
+ ExpressionAssert.assertParameterMarkerExpression(assertContext, (ParameterMarkerExpressionSegment) actual, expected.getParameterMarkerExpression());
+ } else if (actual instanceof LiteralExpressionSegment) {
+ ExpressionAssert.assertLiteralExpression(assertContext, (LiteralExpressionSegment) actual, expected.getLiteralExpression());
+ // FIXME should be CommonExpressionProjection, not ExpressionProjectionSegment
+ } else if (actual instanceof ExpressionProjectionSegment) {
+ ExpressionAssert.assertCommonExpression(assertContext, (ExpressionProjectionSegment) actual, expected.getCommonExpression());
+ } else if (actual instanceof ColumnSegment) {
+ ColumnAssert.assertIs(assertContext, (ColumnSegment) actual, expected.getColumn());
+ } else if (actual instanceof SubqueryExpressionSegment) {
+ ExpressionAssert.assertSubqueryExpression(assertContext, (SubqueryExpressionSegment) actual, expected.getSubquery());
+ } else if (actual instanceof FunctionSegment) {
+ ExpressionAssert.assertFunction(assertContext, (FunctionSegment) actual, expected.getFunction());
+ } else if (actual instanceof CommonExpressionSegment) {
+ ExpressionAssert.assertCommonExpression(assertContext, (CommonExpressionSegment) actual, expected.getCommonExpression());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/charset/CharsetAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/charset/CharsetAssert.java
new file mode 100644
index 00000000000..8df05389a1c
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/charset/CharsetAssert.java
@@ -0,0 +1,56 @@
+/*
+ * 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.internal.asserts.segment.charset;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.charset.CharsetNameSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.charset.ExpectedCharsetName;
+
+import java.util.Optional;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Charset assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CharsetAssert {
+
+ /**
+ * Assert actual charset name segment is correct with expected charset name.
+ *
+ * @param assertContext assert context
+ * @param actual actual charset name segment
+ * @param expected expected charset name
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final CharsetNameSegment actual, final ExpectedCharsetName expected) {
+ if (null == expected) {
+ assertFalse(assertContext.getText("Actual charset name should not exist."), Optional.ofNullable(actual).isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual charset name should exist."), Optional.ofNullable(actual).isPresent());
+ assertThat(assertContext.getText("charset name assertion error. "), actual.getName(), is(expected.getName()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/column/ColumnAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/column/ColumnAssert.java
new file mode 100644
index 00000000000..82004dce6fa
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/column/ColumnAssert.java
@@ -0,0 +1,76 @@
+/*
+ * 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.internal.asserts.segment.column;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.column.ExpectedColumn;
+
+import java.util.Collection;
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Column assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ColumnAssert {
+
+ /**
+ * Assert actual column segment is correct with expected column.
+ *
+ * @param assertContext assert context
+ * @param actual actual column segment
+ * @param expected expected column
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ColumnSegment actual, final ExpectedColumn expected) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getIdentifier(), expected, "Column");
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ /**
+ * Assert actual column segments is correct with expected columns.
+ *
+ * @param assertContext assert context
+ * @param actual actual columns
+ * @param expected expected columns
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final Collection<ColumnSegment> actual, final List<ExpectedColumn> expected) {
+ assertThat(assertContext.getText("Columns size assertion error: "), actual.size(), is(expected.size()));
+ int count = 0;
+ for (ColumnSegment each : actual) {
+ assertIs(assertContext, each, expected.get(count));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/cursor/DirectionSegmentAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/cursor/DirectionSegmentAssert.java
new file mode 100644
index 00000000000..6f8b12b00dc
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/cursor/DirectionSegmentAssert.java
@@ -0,0 +1,68 @@
+/*
+ * 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.internal.asserts.segment.cursor;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.cursor.DirectionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.cursor.ExpectedDirectionSegment;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Direction segment assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DirectionSegmentAssert {
+
+ /**
+ * Assert actual direction segment is correct with expected direction segment.
+ *
+ * @param assertContext assert context
+ * @param actual actual direction segment
+ * @param expected expected direction segment
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final DirectionSegment actual, final ExpectedDirectionSegment expected) {
+ assertDirectionType(assertContext, actual, expected);
+ assertCount(assertContext, actual, expected);
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertDirectionType(final SQLCaseAssertContext assertContext, final DirectionSegment actual, final ExpectedDirectionSegment expected) {
+ if (null == expected.getDirectionType()) {
+ assertFalse(assertContext.getText("Actual direction type should not exist."), actual.getDirectionType().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual direction type should exist."), actual.getDirectionType().isPresent());
+ assertThat(assertContext.getText("Direction type assertion error: "), actual.getDirectionType().get().name(), is(expected.getDirectionType()));
+ }
+ }
+
+ private static void assertCount(final SQLCaseAssertContext assertContext, final DirectionSegment actual, final ExpectedDirectionSegment expected) {
+ if (null == expected.getCount()) {
+ assertFalse(assertContext.getText("Actual count should not exist."), actual.getCount().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual count should exist."), actual.getCount().isPresent());
+ assertThat(assertContext.getText("Count assertion error: "), actual.getCount().get(), is(expected.getCount()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/database/DatabaseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/database/DatabaseAssert.java
new file mode 100644
index 00000000000..9357026fec0
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/database/DatabaseAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.asserts.segment.database;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.schema.ExpectedDatabase;
+
+/**
+ * Database assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DatabaseAssert {
+
+ /**
+ * Assert actual database segment is correct with expected database.
+ *
+ * @param assertContext assert context
+ * @param actual actual database segment
+ * @param expected expected database
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final DatabaseSegment actual, final ExpectedDatabase expected) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getIdentifier(), expected, "Database");
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ColumnDefinitionAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ColumnDefinitionAssert.java
new file mode 100644
index 00000000000..8b323003a4e
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ColumnDefinitionAssert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.internal.asserts.segment.definition;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.ColumnDefinitionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.definition.ExpectedColumnDefinition;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Column definition assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ColumnDefinitionAssert {
+
+ /**
+ * Assert actual column definition segment is correct with expected column definition.
+ *
+ * @param assertContext assert context
+ * @param actual actual column definition segment
+ * @param expected expected column definition
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ColumnDefinitionSegment actual, final ExpectedColumnDefinition expected) {
+ assertThat(assertContext.getText("Column definition name assertion error: "), actual.getColumnName().getIdentifier().getValue(), is(expected.getColumn().getName()));
+ assertThat(assertContext.getText("Column definition data type assertion error: "), actual.getDataType().getDataTypeName(), is(expected.getType()));
+ assertThat(assertContext.getText("Column definition primary key assertion error: "), actual.isPrimaryKey(), is(expected.isPrimaryKey()));
+ TableAssert.assertIs(assertContext, actual.getReferencedTables(), expected.getReferencedTables());
+ assertThat(assertContext.getText("Column definition start index assertion error: "), actual.getStartIndex(), is(expected.getStartIndex()));
+ assertThat(assertContext.getText("Column definition stop index assertion error: "), actual.getStopIndex(), is(expected.getStopIndex()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ColumnPositionAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ColumnPositionAssert.java
new file mode 100644
index 00000000000..ac692aaf5ef
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ColumnPositionAssert.java
@@ -0,0 +1,64 @@
+/*
+ * 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.internal.asserts.segment.definition;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.position.ColumnAfterPositionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.column.position.ColumnPositionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.definition.ExpectedColumnPosition;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Column position assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ColumnPositionAssert {
+
+ /**
+ * Assert actual column position segment is correct with expected column position.
+ *
+ * @param assertContext assert context
+ * @param actual actual column position segment
+ * @param expected expected column position
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ColumnPositionSegment actual, final ExpectedColumnPosition expected) {
+ String actualColumn = null;
+ if (null != actual.getColumnName()) {
+ actualColumn = actual.getColumnName().getQualifiedName();
+ }
+ String expectColumn = null;
+ if (null != expected.getColumn()) {
+ expectColumn = expected.getColumn().getName();
+ }
+ assertThat(assertContext.getText("Column change position name assertion error: "), actualColumn, is(expectColumn));
+ if (actual instanceof ColumnAfterPositionSegment) {
+ assertNotNull(assertContext.getText("Assignments should exist."), expected.getColumn());
+ assertThat(assertContext.getText("Column change position after name assertion error: "), actual.getColumnName().getIdentifier().getValue(), is(expected.getColumn().getName()));
+ } else {
+ assertNull(assertContext.getText("Assignments should not exist."), expected.getColumn());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ConstraintDefinitionAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ConstraintDefinitionAssert.java
new file mode 100644
index 00000000000..b1178b38460
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/definition/ConstraintDefinitionAssert.java
@@ -0,0 +1,80 @@
+/*
+ * 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.internal.asserts.segment.definition;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.constraint.ConstraintDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.definition.ExpectedConstraintDefinition;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Constraint definition assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ConstraintDefinitionAssert {
+
+ /**
+ * Assert actual constraint definition segment is correct with expected constraint definition.
+ *
+ * @param assertContext assert context
+ * @param actual actual constraint definition segment
+ * @param expected expected constraint definition
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ConstraintDefinitionSegment actual, final ExpectedConstraintDefinition expected) {
+ int count = 0;
+ for (ColumnSegment each : actual.getPrimaryKeyColumns()) {
+ ColumnAssert.assertIs(assertContext, each, expected.getPrimaryKeyColumns().get(count));
+ count++;
+ }
+ assertThat(assertContext.getText("Constraint definition index column size assertion error: "), actual.getIndexColumns().size(), is(expected.getIndexColumns().size()));
+ int indexCount = 0;
+ for (ColumnSegment each : actual.getIndexColumns()) {
+ ColumnAssert.assertIs(assertContext, each, expected.getIndexColumns().get(indexCount));
+ indexCount++;
+ }
+ if (null == expected.getConstraintName()) {
+ assertFalse(assertContext.getText("Actual constraint name should not exist."), actual.getConstraintName().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual constraint name should exist."), actual.getConstraintName().isPresent());
+ assertThat(assertContext.getText("Actual constraint name assertion error."), actual.getConstraintName().get().getIdentifier().getValue(), is(expected.getConstraintName()));
+ }
+ if (null == expected.getIndexName()) {
+ assertFalse(assertContext.getText("Actual index name should not exist."), actual.getIndexName().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual index name should exist."), actual.getIndexName().isPresent());
+ assertThat(assertContext.getText("Actual index name assertion error."), actual.getIndexName().get().getIndexName().getIdentifier().getValue(), is(expected.getIndexName()));
+ }
+ if (null == expected.getReferencedTable()) {
+ assertFalse(assertContext.getText("Actual referenced table should not exist."), actual.getReferencedTable().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual referenced table should exist."), actual.getReferencedTable().isPresent());
+ TableAssert.assertIs(assertContext, actual.getReferencedTable().get(), expected.getReferencedTable());
+ }
+ assertThat(assertContext.getText("Constraint definition start index assertion error: "), actual.getStartIndex(), is(expected.getStartIndex()));
+ assertThat(assertContext.getText("Constraint definition stop index assertion error: "), actual.getStopIndex(), is(expected.getStopIndex()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/AlgorithmAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/AlgorithmAssert.java
new file mode 100644
index 00000000000..4c2c4b1a005
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/AlgorithmAssert.java
@@ -0,0 +1,53 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.distsql.parser.segment.AlgorithmSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.ExpectedAlgorithm;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Algorithm assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class AlgorithmAssert {
+
+ /**
+ * Assert algorithm is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual algorithm
+ * @param expected expected algorithm test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final AlgorithmSegment actual, final ExpectedAlgorithm expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual algorithm should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual algorithm should exist."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s algorithm segment assertion error: ", actual.getClass().getSimpleName())), actual.getName(), is(expected.getName()));
+ PropertiesAssert.assertIs(assertContext, actual.getProps(), expected.getProps());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/AutoTableRuleAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/AutoTableRuleAssert.java
new file mode 100644
index 00000000000..501e4d88405
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/AutoTableRuleAssert.java
@@ -0,0 +1,62 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.AutoTableRuleSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.ExpectedAutoTableRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Auto table rule assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class AutoTableRuleAssert {
+
+ /**
+ * Assert auto table rule is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual auto table rule
+ * @param expected expected auto table rule test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final AutoTableRuleSegment actual, final ExpectedAutoTableRule expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual auto table rule should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual auto table rule should exist."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s auto table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getLogicTable(), is(expected.getName()));
+ assertThat(assertContext.getText(String.format("`%s`'s auto table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getDataSourceNodes(), is(expected.getDataSources()));
+ assertThat(assertContext.getText(String.format("`%s`'s auto table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getShardingColumn(), is(expected.getTableStrategyColumn()));
+ assertNotNull(assertContext.getText("key generate should exist."), actual.getKeyGenerateStrategySegment());
+ assertThat(assertContext.getText(String.format("`%s`'s auto table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getKeyGenerateStrategySegment().getKeyGenerateColumn(), is(expected.getKeyGenerateStrategyColumn()));
+ AlgorithmAssert.assertIs(assertContext, actual.getShardingAlgorithmSegment(), expected.getTableStrategy());
+ AlgorithmAssert.assertIs(assertContext, actual.getKeyGenerateStrategySegment().getKeyGenerateAlgorithmSegment(), expected.getKeyGenerateStrategy());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/DataSourceAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/DataSourceAssert.java
new file mode 100644
index 00000000000..0b9034efd9b
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/DataSourceAssert.java
@@ -0,0 +1,68 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.distsql.parser.segment.DataSourceSegment;
+import org.apache.shardingsphere.distsql.parser.segment.HostnameAndPortBasedDataSourceSegment;
+import org.apache.shardingsphere.distsql.parser.segment.URLBasedDataSourceSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.ExpectedDataSource;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Data source assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DataSourceAssert {
+
+ /**
+ * Assert data source is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual data source
+ * @param expected expected data source test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final DataSourceSegment actual, final ExpectedDataSource expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual dataSource should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual dataSource should exist."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s datasource segment assertion error: ", actual.getClass().getSimpleName())), actual.getName(), is(expected.getName()));
+ assertThat(assertContext.getText(String.format("`%s`'s datasource segment assertion error: ", actual.getClass().getSimpleName())), actual.getUser(), is(expected.getUser()));
+ assertThat(assertContext.getText(String.format("`%s`'s datasource segment assertion error: ", actual.getClass().getSimpleName())), actual.getPassword(), is(expected.getPassword()));
+ PropertiesAssert.assertIs(assertContext, actual.getProps(), expected.getProps());
+ if (actual instanceof URLBasedDataSourceSegment) {
+ assertThat(assertContext.getText(String.format("`%s`'s datasource segment assertion error: ",
+ actual.getClass().getSimpleName())), ((URLBasedDataSourceSegment) actual).getUrl(), is(expected.getUrl()));
+ }
+ if (actual instanceof HostnameAndPortBasedDataSourceSegment) {
+ HostnameAndPortBasedDataSourceSegment actualSegment = (HostnameAndPortBasedDataSourceSegment) actual;
+ assertThat(assertContext.getText(String.format("`%s`'s datasource segment assertion error: ",
+ actual.getClass().getSimpleName())), actualSegment.getHostname(), is(expected.getHostname()));
+ assertThat(assertContext.getText(String.format("`%s`'s datasource segment assertion error: ", actual.getClass().getSimpleName())), actualSegment.getPort(), is(expected.getPort()));
+ assertThat(assertContext.getText(String.format("`%s`'s datasource segment assertion error: ", actual.getClass().getSimpleName())), actualSegment.getDatabase(), is(expected.getDb()));
+ }
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/DatabaseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/DatabaseAssert.java
new file mode 100644
index 00000000000..a01ab0e7681
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/DatabaseAssert.java
@@ -0,0 +1,44 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.schema.ExpectedDatabase;
+
+/**
+ * Database assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DatabaseAssert {
+
+ /**
+ * Assert database is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual database
+ * @param expected expected database test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final DatabaseSegment actual, final ExpectedDatabase expected) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getIdentifier(), expected, "schema");
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/PropertiesAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/PropertiesAssert.java
new file mode 100644
index 00000000000..35ed681c116
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/PropertiesAssert.java
@@ -0,0 +1,54 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.ExpectedProperties;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.ExpectedProperty;
+
+import java.util.Properties;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Properties assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class PropertiesAssert {
+
+ /**
+ * Assert properties is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual properties
+ * @param expected expected properties test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final Properties actual, final ExpectedProperties expected) {
+ if (null == expected || null == expected.getProperties()) {
+ assertTrue(assertContext.getText("Actual properties should not exist."), actual.isEmpty());
+ } else {
+ assertNotNull(assertContext.getText("Actual properties should exist."), actual);
+ for (ExpectedProperty expectedProperty : expected.getProperties()) {
+ PropertyAssert.assertIs(assertContext, actual, expectedProperty);
+ }
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/PropertyAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/PropertyAssert.java
new file mode 100644
index 00000000000..2989638caab
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/PropertyAssert.java
@@ -0,0 +1,53 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.ExpectedProperty;
+
+import java.util.Properties;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Property assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class PropertyAssert {
+
+ /**
+ * Assert property is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual property
+ * @param expected expected property test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final Properties actual, final ExpectedProperty expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual properties should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual properties should exist."), actual);
+ assertThat(assertContext.getText("properties assertion error: "), actual.getProperty(expected.getKey()), is(expected.getValue()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/SQLSegmentAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/SQLSegmentAssert.java
new file mode 100644
index 00000000000..61d9f82c22e
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/SQLSegmentAssert.java
@@ -0,0 +1,46 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.ExpectedSQLSegment;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * SQL segment assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SQLSegmentAssert {
+
+ /**
+ * Assert generic attributes of actual SQL segment are same with expected SQL segment.
+ *
+ * @param assertContext assert context
+ * @param actual actual SQL segment
+ * @param expected expected SQL segment
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final SQLSegment actual, final ExpectedSQLSegment expected) {
+ assertThat(assertContext.getText(String.format("`%s`'s start index assertion error: ", actual.getClass().getSimpleName())), actual.getStartIndex(), is(expected.getStartIndex()));
+ assertThat(assertContext.getText(String.format("`%s`'s start index assertion error: ", actual.getClass().getSimpleName())), actual.getStopIndex(), is(expected.getStopIndex()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/TableRuleAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/TableRuleAssert.java
new file mode 100644
index 00000000000..50ee4347667
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/TableRuleAssert.java
@@ -0,0 +1,71 @@
+/*
+ * 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.internal.asserts.segment.distsql;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.TableRuleSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.ExpectedTableRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Table rule assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class TableRuleAssert {
+
+ /**
+ * Assert table rule is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual table rule
+ * @param expected expected table rule test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final TableRuleSegment actual, final ExpectedTableRule expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual table rule should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual table rule should exist."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getLogicTable(), is(expected.getName()));
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getDataSourceNodes(), is(expected.getDataNodes()));
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getTableStrategySegment().getShardingColumn(), is(expected.getTableStrategy().getShardingColumn()));
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getTableStrategySegment().getType(), is(expected.getTableStrategy().getType()));
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getTableStrategySegment().getAlgorithmSegment().getName(), is(expected.getTableStrategy().getAlgorithmSegment().getName()));
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getDatabaseStrategySegment().getShardingColumn(), is(expected.getDataStrategy().getShardingColumn()));
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getDatabaseStrategySegment().getType(), is(expected.getDataStrategy().getType()));
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getDatabaseStrategySegment().getAlgorithmSegment().getName(), is(expected.getDataStrategy().getAlgorithmSegment().getName()));
+ if (null != actual.getKeyGenerateStrategySegment()) {
+ assertThat(assertContext.getText(String.format("`%s`'s table rule segment assertion error: ", actual.getClass().getSimpleName())),
+ actual.getKeyGenerateStrategySegment().getKeyGenerateColumn(), is(expected.getKeyGenerateStrategyColumn()));
+ }
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/EncryptColumnAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/EncryptColumnAssert.java
new file mode 100644
index 00000000000..c9708b1b11c
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/EncryptColumnAssert.java
@@ -0,0 +1,58 @@
+/*
+ * 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.internal.asserts.segment.distsql.rdl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.encrypt.distsql.parser.segment.EncryptColumnSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.distsql.AlgorithmAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedEncryptColumn;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Encrypt column assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class EncryptColumnAssert {
+
+ /**
+ * Assert encrypt rule statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual encrypt column
+ * @param expected expected encrypt column test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final EncryptColumnSegment actual, final ExpectedEncryptColumn expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual encrypt column should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual encrypt column should exist."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s assertion error", actual.getClass().getSimpleName())), actual.getName(), is(expected.getName()));
+ assertThat(assertContext.getText(String.format("`%s`'s assertion error", actual.getClass().getSimpleName())), actual.getPlainColumn(), is(expected.getPlainColumn()));
+ assertThat(assertContext.getText(String.format("`%s`'s assertion error", actual.getClass().getSimpleName())), actual.getCipherColumn(), is(expected.getCipherColumn()));
+ assertThat(assertContext.getText(String.format("`%s`'s assertion error", actual.getClass().getSimpleName())), actual.getAssistedQueryColumn(), is(expected.getAssistedQueryColumn()));
+ AlgorithmAssert.assertIs(assertContext, actual.getEncryptor(), expected.getEncryptor());
+ AlgorithmAssert.assertIs(assertContext, actual.getAssistedQueryEncryptor(), expected.getAssistedQueryEncryptor());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/EncryptRuleAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/EncryptRuleAssert.java
new file mode 100644
index 00000000000..9619f558fec
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/EncryptRuleAssert.java
@@ -0,0 +1,74 @@
+/*
+ * 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.internal.asserts.segment.distsql.rdl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.encrypt.distsql.parser.segment.EncryptColumnSegment;
+import org.apache.shardingsphere.encrypt.distsql.parser.segment.EncryptRuleSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedEncryptColumn;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedEncryptRule;
+
+import java.util.Collection;
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Encrypt rule assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class EncryptRuleAssert {
+
+ /**
+ * Assert encrypt rule is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual encrypt rule
+ * @param expected expected encrypt rule test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final EncryptRuleSegment actual, final ExpectedEncryptRule expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual encrypt rule should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual encrypt rule should exist."), actual);
+ assertThat(assertContext.getText("encrypt rule assertion error: "), actual.getTableName(), is(expected.getName()));
+ assertThat(assertContext.getText("encrypt rule assertion error: "), actual.getQueryWithCipherColumn(), is(expected.getQueryWithCipherColumn()));
+ assertEncryptColumns(assertContext, actual.getColumns(), expected.getColumns());
+ }
+ }
+
+ private static void assertEncryptColumns(final SQLCaseAssertContext assertContext, final Collection<EncryptColumnSegment> actual, final List<ExpectedEncryptColumn> expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual encrypt column should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual encrypt column should exist."), actual);
+ assertThat(assertContext.getText(String.format("Actual encrypt column size should be %s , but it was %s", expected.size(), actual.size())), actual.size(), is(expected.size()));
+ int count = 0;
+ for (EncryptColumnSegment encryptColumnSegment : actual) {
+ ExpectedEncryptColumn expectedEncryptColumn = expected.get(count);
+ EncryptColumnAssert.assertIs(assertContext, encryptColumnSegment, expectedEncryptColumn);
+ count++;
+ }
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ReadwriteSplittingRuleAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ReadwriteSplittingRuleAssert.java
new file mode 100644
index 00000000000..62b734e8c26
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ReadwriteSplittingRuleAssert.java
@@ -0,0 +1,63 @@
+/*
+ * 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.internal.asserts.segment.distsql.rdl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.readwritesplitting.distsql.parser.segment.ReadwriteSplittingRuleSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.distsql.PropertiesAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExceptedReadwriteSplittingRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Readwrite splitting rule assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ReadwriteSplittingRuleAssert {
+
+ /**
+ * Assert readwrite splitting rule is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual readwrite splitting rule
+ * @param expected expected readwrite splitting rule test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ReadwriteSplittingRuleSegment actual, final ExceptedReadwriteSplittingRule expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual readwrite splitting rule should not exit."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual readwrite splitting rule should exit."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s readwrite splitting rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getName(), is(expected.getName()));
+ assertThat(assertContext.getText(String.format("`%s`'s readwrite splitting rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getAutoAwareResource(), is(expected.getAutoAwareResource()));
+ assertThat(assertContext.getText(String.format("`%s`'s readwrite splitting rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getWriteDataSource(), is(expected.getWriteDataSource()));
+ assertThat(assertContext.getText(String.format("`%s`'s readwrite splitting rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getReadDataSources(), is(expected.getReadDataSources()));
+ assertThat(assertContext.getText(String.format("`%s`'s readwrite splitting rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getLoadBalancer(), is(expected.getLoadBalancer()));
+ PropertiesAssert.assertIs(assertContext, actual.getProps(), expected.getProps());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShadowRuleAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShadowRuleAssert.java
new file mode 100644
index 00000000000..0b067b0f1f2
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShadowRuleAssert.java
@@ -0,0 +1,81 @@
+/*
+ * 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.internal.asserts.segment.distsql.rdl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowAlgorithmSegment;
+import org.apache.shardingsphere.shadow.distsql.parser.segment.ShadowRuleSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.distsql.AlgorithmAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedShadowAlgorithm;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedShadowRule;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedShadowRule.ExpectedShadowTableRule;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Shadow table rule assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ShadowRuleAssert {
+
+ /**
+ * Assert shadow rule is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual shadow rule
+ * @param expected expected shadow rule test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ShadowRuleSegment actual, final ExpectedShadowRule expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual shadow rule should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual shadow rule should exist."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s shadow rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getShadow(), is(expected.getShadow()));
+ assertThat(assertContext.getText(String.format("`%s`'s shadow rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getSource(), is(expected.getSource()));
+ assertThat(assertContext.getText(String.format("`%s`'s shadow rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getRuleName(), is(expected.getRuleName()));
+ for (ExpectedShadowTableRule each : expected.getShadowTableRules()) {
+ assertIsTableRules(assertContext, actual.getShadowTableRules().get(each.getTableName()), each.getAlgorithms());
+ }
+ }
+ }
+
+ private static void assertIsTableRules(final SQLCaseAssertContext assertContext, final Collection<ShadowAlgorithmSegment> actual,
+ final Collection<ExpectedShadowAlgorithm> expected) {
+ assertNotNull(actual);
+ Map<String, ShadowAlgorithmSegment> actualMap = actual.stream().collect(Collectors.toMap(ShadowAlgorithmSegment::getAlgorithmName, each -> each));
+ expected.forEach(each -> assertIsAlgorithmsSegment(assertContext, actualMap.get(each.getAlgorithmName()), each));
+ }
+
+ private static void assertIsAlgorithmsSegment(final SQLCaseAssertContext assertContext, final ShadowAlgorithmSegment actual,
+ final ExpectedShadowAlgorithm expected) {
+ assertNotNull(actual);
+ AlgorithmAssert.assertIs(assertContext, actual.getAlgorithmSegment(), expected.getAlgorithmSegment());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShardingAuditorAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShardingAuditorAssert.java
new file mode 100644
index 00000000000..0d82d5019cf
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShardingAuditorAssert.java
@@ -0,0 +1,49 @@
+/*
+ * 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.internal.asserts.segment.distsql.rdl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.ShardingAuditorSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.distsql.AlgorithmAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedShardingAuditor;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Sharding auditor assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ShardingAuditorAssert {
+
+ /**
+ * Assert sharding auditor is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual sharding auditor
+ * @param expected expected sharding auditor test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ShardingAuditorSegment actual, final ExpectedShardingAuditor expected) {
+ assertNotNull(assertContext.getText("Actual sharding auditor segment should exist."), actual.getAlgorithmSegment());
+ assertThat(actual.getAuditorName(), is(expected.getAuditorName()));
+ AlgorithmAssert.assertIs(assertContext, actual.getAlgorithmSegment(), expected.getAlgorithmSegment());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShardingTableReferenceRuleAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShardingTableReferenceRuleAssert.java
new file mode 100644
index 00000000000..6c99b209298
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/distsql/rdl/ShardingTableReferenceRuleAssert.java
@@ -0,0 +1,53 @@
+/*
+ * 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.internal.asserts.segment.distsql.rdl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sharding.distsql.parser.segment.TableReferenceRuleSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.distsql.rdl.ExpectedShardingTableReferenceRule;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Sharding table reference rule assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ShardingTableReferenceRuleAssert {
+
+ /**
+ * Assert sharding table reference rule is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual sharding table reference rule
+ * @param expected expected sharding table reference rule test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final TableReferenceRuleSegment actual, final ExpectedShardingTableReferenceRule expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual sharding table reference rule should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual sharding table reference rule should exist."), actual);
+ assertThat(assertContext.getText(String.format("`%s`'s sharding table reference rule segment assertion error: ",
+ actual.getClass().getSimpleName())), actual.getTableGroup(), is(expected.getTableGroups()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/expression/ExpressionAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/expression/ExpressionAssert.java
new file mode 100644
index 00000000000..fba7055956e
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/expression/ExpressionAssert.java
@@ -0,0 +1,379 @@
+/*
+ * 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.internal.asserts.segment.expression;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BetweenExpression;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.BinaryOperationExpression;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.CollateExpression;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExistsSubqueryExpression;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.FunctionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.InExpression;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ListExpression;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.NotExpression;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.ComplexExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.LiteralExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.simple.ParameterMarkerExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubqueryExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ExpressionProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DataTypeSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.generic.DataTypeAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.projection.ProjectionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedBetweenExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedBinaryOperationExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedCollateExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedExistsSubquery;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedInExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedListExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.ExpectedNotExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.complex.ExpectedCommonExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.simple.ExpectedLiteralExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.simple.ExpectedParameterMarkerExpression;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.expr.simple.ExpectedSubquery;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.function.ExpectedFunction;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+
+import java.util.Iterator;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Expression assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ExpressionAssert {
+
+ /**
+ * Assert parameter marker expression.
+ *
+ * @param assertContext assert context
+ * @param actual actual parameter marker expression segment
+ * @param expected expected parameter marker expression
+ */
+ public static void assertParameterMarkerExpression(final SQLCaseAssertContext assertContext,
+ final ParameterMarkerExpressionSegment actual, final ExpectedParameterMarkerExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual parameter marker expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual parameter marker expression should exist."), actual);
+ assertThat(assertContext.getText("Parameter marker index assertion error: "), actual.getParameterMarkerIndex(), is(expected.getParameterIndex()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert literal expression.
+ *
+ * @param assertContext assert context
+ * @param actual actual literal expression segment
+ * @param expected expected literal expression
+ */
+ public static void assertLiteralExpression(final SQLCaseAssertContext assertContext,
+ final LiteralExpressionSegment actual, final ExpectedLiteralExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual literal expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual literal expression should exist."), actual);
+ assertThat(assertContext.getText("Literal assertion error: "), actual.getLiterals().toString(), is(expected.getValue()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert common expression.
+ *
+ * @param assertContext assert context
+ * @param actual actual common expression segment
+ * @param expected expected common expression
+ */
+ public static void assertCommonExpression(final SQLCaseAssertContext assertContext,
+ final ComplexExpressionSegment actual, final ExpectedCommonExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual common expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual common expression should exist."), actual);
+ String expectedText = SQLCaseType.Literal == assertContext.getSqlCaseType() && null != expected.getLiteralText() ? expected.getLiteralText() : expected.getText();
+ assertThat(assertContext.getText("Common expression text assertion error: "), actual.getText(), is(expectedText));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert subquery expression.
+ *
+ * @param assertContext assert context
+ * @param actual actual subquery expression segment
+ * @param expected expected subquery expression
+ */
+ public static void assertSubqueryExpression(final SQLCaseAssertContext assertContext,
+ final SubqueryExpressionSegment actual, final ExpectedSubquery expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual subquery expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual subquery expression should exist."), actual);
+ assertSubquery(assertContext, actual.getSubquery(), expected);
+ }
+ }
+
+ /**
+ * Assert subquery.
+ *
+ * @param assertContext assert context
+ * @param actual actual subquery segment
+ * @param expected expected subquery expression
+ */
+ public static void assertSubquery(final SQLCaseAssertContext assertContext,
+ final SubquerySegment actual, final ExpectedSubquery expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual subquery should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual subquery should exist."), actual);
+ SelectStatementAssert.assertIs(assertContext, actual.getSelect(), expected.getSelectTestCases());
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert exists subquery expression.
+ *
+ * @param assertContext assert context
+ * @param actual actual exists subquery expression
+ * @param expected expected exists subquery expression
+ */
+ public static void assertExistsSubqueryExpression(final SQLCaseAssertContext assertContext,
+ final ExistsSubqueryExpression actual, final ExpectedExistsSubquery expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual exists subquery should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual exists subquery should exist."), actual);
+ assertSubquery(assertContext, actual.getSubquery(), expected.getSubquery());
+ assertThat(assertContext.getText("Exists subquery expression not value assert error."),
+ actual.isNot(), is(expected.isNot()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert binary operation expression.
+ * @param assertContext assert context
+ * @param actual actual binary operation expression
+ * @param expected expected binary operation expression
+ */
+ public static void assertBinaryOperationExpression(final SQLCaseAssertContext assertContext,
+ final BinaryOperationExpression actual, final ExpectedBinaryOperationExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual binary operation expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual binary operation expression should exist."), actual);
+ assertExpression(assertContext, actual.getLeft(), expected.getLeft());
+ assertThat(assertContext.getText("Binary operation expression operator assert error."),
+ actual.getOperator(), is(expected.getOperator()));
+ assertExpression(assertContext, actual.getRight(), expected.getRight());
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert in operation expression.
+ * @param assertContext assert context
+ * @param actual actual in operation expression
+ * @param expected expected in operation expression
+ */
+ public static void assertInExpression(final SQLCaseAssertContext assertContext,
+ final InExpression actual, final ExpectedInExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual in expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual in expression should exist."), actual);
+ assertExpression(assertContext, actual.getLeft(), expected.getLeft());
+ assertThat(assertContext.getText("In expression not value assert error."),
+ actual.isNot(), is(expected.isNot()));
+ assertExpression(assertContext, actual.getRight(), expected.getRight());
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert not operation expression.
+ * @param assertContext assert context
+ * @param actual actual not operation expression
+ * @param expected expected not operation expression
+ */
+ public static void assertNotExpression(final SQLCaseAssertContext assertContext,
+ final NotExpression actual, final ExpectedNotExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual not expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual not expression should exist."), actual);
+ assertExpression(assertContext, actual.getExpression(), expected.getExpr());
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert list operation expression.
+ * @param assertContext assert context
+ * @param actual actual list operation expression
+ * @param expected expected list operation expression
+ */
+ public static void assertListExpression(final SQLCaseAssertContext assertContext,
+ final ListExpression actual, final ExpectedListExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual list expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual list expression should exist."), actual);
+ assertThat(assertContext.getText("List expression item size assert error."),
+ actual.getItems().size(), is(expected.getItems().size()));
+ Iterator<ExpressionSegment> actualItems = actual.getItems().iterator();
+ Iterator<ExpectedExpression> expectedItems = expected.getItems().iterator();
+ while (actualItems.hasNext()) {
+ assertExpression(assertContext, actualItems.next(), expectedItems.next());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert between operation expression.
+ * @param assertContext assert context
+ * @param actual actual between operation expression
+ * @param expected expected between operation expression
+ */
+ public static void assertBetweenExpression(final SQLCaseAssertContext assertContext,
+ final BetweenExpression actual, final ExpectedBetweenExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual between expression should not exist."), actual);
+ } else {
+ assertNotNull(assertContext.getText("Actual between expression should exist."), actual);
+ assertExpression(assertContext, actual.getLeft(), expected.getLeft());
+ assertExpression(assertContext, actual.getBetweenExpr(), expected.getBetweenExpr());
+ assertExpression(assertContext, actual.getAndExpr(), expected.getAndExpr());
+ assertThat(assertContext.getText("Between expression not value assert error."),
+ actual.isNot(), is(expected.isNot()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert function.
+ *
+ * @param assertContext assert context
+ * @param actual actual function segment
+ * @param expected expected function segment
+ */
+ public static void assertFunction(final SQLCaseAssertContext assertContext, final FunctionSegment actual, final ExpectedFunction expected) {
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ assertThat(assertContext.getText("Function method name assertion error: "), actual.getFunctionName(), is(expected.getFunctionName()));
+ String expectedText = SQLCaseType.Literal == assertContext.getSqlCaseType() && null != expected.getLiteralText()
+ ? expected.getLiteralText()
+ : expected.getText();
+ assertThat(assertContext.getText("Function text name assertion error: "), actual.getText(), is(expectedText));
+ assertThat(assertContext.getText("Function parameter size assertion error: "), actual.getParameters().size(), is(expected.getParameters().size()));
+ Iterator<ExpectedExpression> expectedIterator = expected.getParameters().iterator();
+ Iterator<ExpressionSegment> actualIterator = actual.getParameters().iterator();
+ while (expectedIterator.hasNext()) {
+ ExpressionAssert.assertExpression(assertContext, actualIterator.next(), expectedIterator.next());
+ }
+ if (expected.getOwner() != null) {
+ OwnerAssert.assertIs(assertContext, actual.getOwner(), expected.getOwner());
+ }
+ }
+
+ /**
+ * Assert collate.
+ *
+ * @param assertContext assert context
+ * @param actual actual collate expression
+ * @param expected expected collate expression
+ */
+ public static void assertCollateExpression(final SQLCaseAssertContext assertContext, final CollateExpression actual, final ExpectedCollateExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual collate expression should not exist."), actual);
+ } else {
+ assertExpression(assertContext, actual.getCollateName(), expected.getCollateName());
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+ }
+
+ /**
+ * Assert expression by actual expression segment class type.
+ * @param assertContext assert context
+ * @param actual actual expression segment
+ * @param expected expected expression
+ *
+ * @throws UnsupportedOperationException When expression segment class type is not supported.
+ */
+ public static void assertExpression(final SQLCaseAssertContext assertContext,
+ final ExpressionSegment actual, final ExpectedExpression expected) {
+ if (null == expected) {
+ assertNull(assertContext.getText("Actual expression should not exist."), actual);
+ return;
+ }
+ assertNotNull(assertContext.getText("Actual expression should exist."), actual);
+ if (actual instanceof BinaryOperationExpression) {
+ assertBinaryOperationExpression(assertContext, (BinaryOperationExpression) actual, expected.getBinaryOperationExpression());
+ } else if (actual instanceof SubqueryExpressionSegment) {
+ assertSubqueryExpression(assertContext, (SubqueryExpressionSegment) actual, expected.getSubquery());
+ } else if (actual instanceof ColumnSegment) {
+ ColumnAssert.assertIs(assertContext, (ColumnSegment) actual, expected.getColumn());
+ } else if (actual instanceof DataTypeSegment) {
+ DataTypeAssert.assertIs(assertContext, (DataTypeSegment) actual, expected.getDataType());
+ } else if (actual instanceof LiteralExpressionSegment) {
+ assertLiteralExpression(assertContext, (LiteralExpressionSegment) actual, expected.getLiteralExpression());
+ } else if (actual instanceof ParameterMarkerExpressionSegment) {
+ assertParameterMarkerExpression(assertContext, (ParameterMarkerExpressionSegment) actual, expected.getParameterMarkerExpression());
+ } else if (actual instanceof ExistsSubqueryExpression) {
+ assertExistsSubqueryExpression(assertContext, (ExistsSubqueryExpression) actual, expected.getExistsSubquery());
+ } else if (actual instanceof CommonExpressionSegment) {
+ assertCommonExpression(assertContext, (ComplexExpressionSegment) actual, expected.getCommonExpression());
+ } else if (actual instanceof InExpression) {
+ assertInExpression(assertContext, (InExpression) actual, expected.getInExpression());
+ } else if (actual instanceof NotExpression) {
+ assertNotExpression(assertContext, (NotExpression) actual, expected.getNotExpression());
+ } else if (actual instanceof ListExpression) {
+ assertListExpression(assertContext, (ListExpression) actual, expected.getListExpression());
+ } else if (actual instanceof BetweenExpression) {
+ assertBetweenExpression(assertContext, (BetweenExpression) actual, expected.getBetweenExpression());
+ } else if (actual instanceof ExpressionProjectionSegment) {
+ ProjectionAssert.assertProjection(assertContext, (ExpressionProjectionSegment) actual, expected.getExpressionProjection());
+ } else if (actual instanceof AggregationProjectionSegment) {
+ ProjectionAssert.assertProjection(assertContext, (AggregationProjectionSegment) actual, expected.getAggregationProjection());
+ } else if (actual instanceof FunctionSegment) {
+ assertFunction(assertContext, (FunctionSegment) actual, expected.getFunction());
+ } else if (actual instanceof CollateExpression) {
+ assertCollateExpression(assertContext, (CollateExpression) actual, expected.getCollateExpression());
+ } else {
+ throw new UnsupportedOperationException(String.format("Unsupported expression: %s", actual.getClass().getName()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/generic/DataTypeAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/generic/DataTypeAssert.java
new file mode 100644
index 00000000000..41d1d4c89d5
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/generic/DataTypeAssert.java
@@ -0,0 +1,50 @@
+/*
+ * 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.internal.asserts.segment.generic;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DataTypeSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.generic.ExpectedDataType;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Data type assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DataTypeAssert {
+
+ /**
+ * Assert actual data type segment is correct with expected date type.
+ *
+ * @param assertContext assert context
+ * @param actual actual data type statement
+ * @param expected expected data type
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final DataTypeSegment actual, final ExpectedDataType expected) {
+ assertThat(assertContext.getText(String.format("%s name assertion error: ", "dataType")),
+ actual.getDataTypeName(), is(expected.getValue()));
+ assertThat(assertContext.getText(String.format("%s start index assertion error: ", "dataType")),
+ actual.getStartIndex(), is(expected.getStartIndex()));
+ assertThat(assertContext.getText(String.format("%s end index assertion error: ", "dataType")),
+ actual.getStopIndex(), is(expected.getStopIndex()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/generic/GrantLevelSegmentAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/generic/GrantLevelSegmentAssert.java
new file mode 100644
index 00000000000..cfa0b6b332f
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/generic/GrantLevelSegmentAssert.java
@@ -0,0 +1,53 @@
+/*
+ * 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.internal.asserts.segment.generic;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.GrantLevelSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.table.ExpectedSimpleTable;
+
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Grant level segment assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class GrantLevelSegmentAssert {
+
+ /**
+ * Assert MySQL grant statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual grant level statement
+ * @param expected expected grant statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final GrantLevelSegment actual, final List<ExpectedSimpleTable> expected) {
+ if (null == expected || expected.isEmpty()) {
+ assertNull(assertContext.getText("Actual table should not exist."), actual.getTableName());
+ } else {
+ assertThat(expected.size(), is(1));
+ assertThat(actual.getTableName(), is(expected.get(0).getName()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/groupby/GroupByClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/groupby/GroupByClauseAssert.java
new file mode 100644
index 00000000000..ac7b05e8464
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/groupby/GroupByClauseAssert.java
@@ -0,0 +1,43 @@
+/*
+ * 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.internal.asserts.segment.groupby;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.GroupBySegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.orderby.OrderByItemAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.ExpectedOrderByClause;
+
+/**
+ * Group by clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class GroupByClauseAssert {
+
+ /**
+ * Assert actual group by segment is correct with expected group by clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual group by segment
+ * @param expected expected group by clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final GroupBySegment actual, final ExpectedOrderByClause expected) {
+ OrderByItemAssert.assertIs(assertContext, actual.getGroupByItems(), expected, "Group by");
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/having/HavingClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/having/HavingClauseAssert.java
new file mode 100644
index 00000000000..4bcc12a6fea
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/having/HavingClauseAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.asserts.segment.having;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.HavingSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.having.ExpectedHavingClause;
+
+/**
+ * Having clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class HavingClauseAssert {
+
+ /**
+ * Assert actual having segment is correct with expected having clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual having segment
+ * @param expected expected having clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final HavingSegment actual, final ExpectedHavingClause expected) {
+ ExpressionAssert.assertExpression(assertContext, actual.getExpr(), expected.getExpr());
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/index/IndexAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/index/IndexAssert.java
new file mode 100644
index 00000000000..b41169fa427
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/index/IndexAssert.java
@@ -0,0 +1,57 @@
+/*
+ * 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.internal.asserts.segment.index;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.index.ExpectedIndex;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Index assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class IndexAssert {
+
+ /**
+ * Assert actual index segment is correct with expected index.
+ *
+ * @param assertContext assert context
+ * @param actual actual index segment
+ * @param expected expected index
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final IndexSegment actual, final ExpectedIndex expected) {
+ assertNotNull(assertContext.getText("Index should exist."), expected);
+ IdentifierValueAssert.assertIs(assertContext, actual.getIndexName().getIdentifier(), expected, "Index");
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/index/IndexTypeAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/index/IndexTypeAssert.java
new file mode 100644
index 00000000000..1c185a15dd2
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/index/IndexTypeAssert.java
@@ -0,0 +1,57 @@
+/*
+ * 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.internal.asserts.segment.index;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexTypeSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.index.ExpectedIndexType;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Index type assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class IndexTypeAssert {
+
+ /**
+ * Assert actual index type segment is correct with expected index type.
+ *
+ * @param assertContext assert context
+ * @param actual actual index type segment
+ * @param expected expected index type
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final IndexTypeSegment actual, final ExpectedIndexType expected) {
+ assertNotNull(assertContext.getText("IndexType should exist."), expected);
+ IdentifierValueAssert.assertIs(assertContext, actual.getIdentifier(), expected, "IndexType");
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertColumnsClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertColumnsClauseAssert.java
new file mode 100644
index 00000000000..903e393b946
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertColumnsClauseAssert.java
@@ -0,0 +1,54 @@
+/*
+ * 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.internal.asserts.segment.insert;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.InsertColumnsSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.insert.ExpectedInsertColumnsClause;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Insert column clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class InsertColumnsClauseAssert {
+
+ /**
+ * Assert actual insert columns segment is correct with expected insert columns clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual insert columns segment
+ * @param expected expected insert columns clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final InsertColumnsSegment actual, final ExpectedInsertColumnsClause expected) {
+ assertThat(assertContext.getText("Insert column size assertion error: "), actual.getColumns().size(), is(expected.getColumns().size()));
+ int count = 0;
+ for (ColumnSegment each : actual.getColumns()) {
+ ColumnAssert.assertIs(assertContext, each, expected.getColumns().get(count));
+ count++;
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertMultiTableElementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertMultiTableElementAssert.java
new file mode 100644
index 00000000000..c364be39235
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertMultiTableElementAssert.java
@@ -0,0 +1,54 @@
+/*
+ * 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.internal.asserts.segment.insert;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.InsertMultiTableElementSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.InsertStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.insert.ExpectedInsertMultiTableElement;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Insert multi table element assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class InsertMultiTableElementAssert {
+
+ /**
+ * Assert actual insert multi table element segment is correct with expected multi table element.
+ *
+ * @param assertContext assert context
+ * @param actual actual insert multi table element
+ * @param expected expected insert multi table element
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final InsertMultiTableElementSegment actual, final ExpectedInsertMultiTableElement expected) {
+ assertThat(assertContext.getText("Insert values size assertion error: "), actual.getInsertStatements().size(), is(expected.getInsertTestCases().size()));
+ int count = 0;
+ for (InsertStatement each : actual.getInsertStatements()) {
+ InsertStatementAssert.assertIs(assertContext, each, expected.getInsertTestCases().get(count));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertValuesClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertValuesClauseAssert.java
new file mode 100644
index 00000000000..236ebeaccb4
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/InsertValuesClauseAssert.java
@@ -0,0 +1,64 @@
+/*
+ * 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.internal.asserts.segment.insert;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.InsertValuesSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.assignment.AssignmentValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.insert.ExpectedInsertValue;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.insert.ExpectedInsertValuesClause;
+
+import java.util.Collection;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Insert values clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class InsertValuesClauseAssert {
+
+ /**
+ * Assert actual insert values segment is correct with expected insert values clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual insert values segment
+ * @param expected expected insert values clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final Collection<InsertValuesSegment> actual, final ExpectedInsertValuesClause expected) {
+ assertThat(assertContext.getText("Insert values size assertion error: "), actual.size(), is(expected.getValues().size()));
+ int count = 0;
+ for (InsertValuesSegment each : actual) {
+ assertInsertValues(assertContext, each, expected.getValues().get(count));
+ count++;
+ }
+ }
+
+ private static void assertInsertValues(final SQLCaseAssertContext assertContext, final InsertValuesSegment actual, final ExpectedInsertValue expected) {
+ assertThat(assertContext.getText("Insert assignment value size assertion error: "), actual.getValues().size(), is(expected.getAssignmentValues().size()));
+ int count = 0;
+ for (ExpressionSegment each : actual.getValues()) {
+ AssignmentValueAssert.assertIs(assertContext, each, expected.getAssignmentValues().get(count));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/OnDuplicateKeyColumnsAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/OnDuplicateKeyColumnsAssert.java
new file mode 100644
index 00000000000..9d145321f3d
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/insert/OnDuplicateKeyColumnsAssert.java
@@ -0,0 +1,56 @@
+/*
+ * 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.internal.asserts.segment.insert;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.OnDuplicateKeyColumnsSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.assignment.AssignmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.insert.ExpectedOnDuplicateKeyColumns;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * On duplicate key columns assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class OnDuplicateKeyColumnsAssert {
+
+ /**
+ * Assert actual on duplicate key columns segment is correct with expected on duplicate key columns.
+ *
+ * @param assertContext assert context
+ * @param actual actual on duplicate key columns segment
+ * @param expected expected on duplicate key columns
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final OnDuplicateKeyColumnsSegment actual, final ExpectedOnDuplicateKeyColumns expected) {
+ assertNotNull(assertContext.getText("On duplicate key columns should exist."), expected);
+ assertThat(assertContext.getText("On duplicate key columns size assertion error: "), actual.getColumns().size(), is(expected.getAssignments().size()));
+ int count = 0;
+ for (AssignmentSegment each : actual.getColumns()) {
+ AssignmentAssert.assertIs(assertContext, each, expected.getAssignments().get(count));
+ count++;
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/limit/LimitClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/limit/LimitClauseAssert.java
new file mode 100644
index 00000000000..68fef60a9b5
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/limit/LimitClauseAssert.java
@@ -0,0 +1,81 @@
+/*
+ * 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.internal.asserts.segment.limit;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.NumberLiteralPaginationValueSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.PaginationValueSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.ParameterMarkerPaginationValueSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.limit.ExpectedPaginationValue;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Limit clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class LimitClauseAssert {
+
+ /**
+ * Assert actual offset segment is correct with expected offset.
+ *
+ * @param assertContext assert context
+ * @param actual actual offset
+ * @param expected expected offset
+ */
+ public static void assertOffset(final SQLCaseAssertContext assertContext, final PaginationValueSegment actual, final ExpectedPaginationValue expected) {
+ if (null == actual) {
+ assertNull(assertContext.getText("Offset should not exist."), expected);
+ return;
+ }
+ if (actual instanceof ParameterMarkerPaginationValueSegment) {
+ assertThat(assertContext.getText("Offset index assertion error: "),
+ ((ParameterMarkerPaginationValueSegment) actual).getParameterIndex(), is(expected.getParameterIndex()));
+ } else {
+ assertThat(assertContext.getText("Offset value assertion error: "), ((NumberLiteralPaginationValueSegment) actual).getValue(), is(expected.getValue()));
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ /**
+ * Assert actual row count segment is correct with expected row count.
+ *
+ * @param assertContext assert context
+ * @param actual actual row count
+ * @param expected expected row count
+ */
+ public static void assertRowCount(final SQLCaseAssertContext assertContext, final PaginationValueSegment actual, final ExpectedPaginationValue expected) {
+ if (null == actual) {
+ assertNull(assertContext.getText("Row count should not exist."), expected);
+ return;
+ }
+ if (SQLCaseType.Placeholder == assertContext.getSqlCaseType()) {
+ assertThat(assertContext.getText("Row count index assertion error: "),
+ ((ParameterMarkerPaginationValueSegment) actual).getParameterIndex(), is(expected.getParameterIndex()));
+ } else {
+ assertThat(assertContext.getText("Row count value assertion error: "), ((NumberLiteralPaginationValueSegment) actual).getValue(), is(expected.getValue()));
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/lock/LockClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/lock/LockClauseAssert.java
new file mode 100644
index 00000000000..d8e9e79f914
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/lock/LockClauseAssert.java
@@ -0,0 +1,69 @@
+/*
+ * 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.internal.asserts.segment.lock;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.LockSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.column.ExpectedColumn;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.lock.ExpectedLockClause;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.table.ExpectedSimpleTable;
+
+import java.util.List;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Lock clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class LockClauseAssert {
+
+ /**
+ * Assert lock segment index and forTables.
+ * @param assertContext assert context
+ * @param actual actual lock
+ * @param expected expected lock
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final LockSegment actual, final ExpectedLockClause expected) {
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ List<SimpleTableSegment> actualTables = actual.getTables();
+ List<ColumnSegment> actualColumns = actual.getColumns();
+ List<ExpectedSimpleTable> expectedTables = expected.getTables();
+ List<ExpectedColumn> expectedColumns = expected.getColumns();
+ if (actualTables.isEmpty()) {
+ assertTrue(assertContext.getText("lock tables should not exist."), expectedTables.isEmpty());
+ }
+ TableAssert.assertIs(assertContext, actualTables, expectedTables);
+ if (actualColumns.isEmpty()) {
+ assertTrue(assertContext.getText("lock columns should not exist."), expectedColumns.isEmpty());
+ return;
+ }
+ int count = 0;
+ for (ColumnSegment each : actual.getColumns()) {
+ ColumnAssert.assertIs(assertContext, each, expected.getColumns().get(count));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/model/ModelClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/model/ModelClauseAssert.java
new file mode 100644
index 00000000000..f3db176ee5e
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/model/ModelClauseAssert.java
@@ -0,0 +1,109 @@
+/*
+ * 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.internal.asserts.segment.model;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.ModelSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.orderby.OrderByItemAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.column.ExpectedColumn;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.model.ExpectedModelClause;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.ExpectedOrderByClause;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dml.SelectStatementTestCase;
+
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Model clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ModelClauseAssert {
+
+ /**
+ * Assert actual model segment is correct with expected model clause.
+ * @param assertContext assert context
+ * @param actual actual model
+ * @param expected expected model
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ModelSegment actual, final ExpectedModelClause expected) {
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ if (null != expected.getReferenceModelSelect()) {
+ assertNotNull(assertContext.getText("Actual reference model select subquery should exist."), actual.getReferenceModelSelects());
+ assertThat(assertContext.getText("Actual reference model select subquery size assertion error: "), actual.getReferenceModelSelects().size(), is(expected.getReferenceModelSelect().size()));
+ assertReferenceModelSelectStatements(assertContext, actual.getReferenceModelSelects(), expected.getReferenceModelSelect());
+ }
+ if (null != expected.getOrderBySegments()) {
+ assertNotNull(assertContext.getText("Actual order by segments should exist."), actual.getOrderBySegments());
+ assertThat(assertContext.getText("Actual order by segments size assertion error: "), actual.getOrderBySegments().size(), is(expected.getOrderBySegments().size()));
+ assertOrderBySegments(assertContext, actual.getOrderBySegments(), expected.getOrderBySegments());
+ }
+ if (null != expected.getCellAssignmentColumns()) {
+ assertNotNull(assertContext.getText("Actual cell assignment columns should exist."), actual.getCellAssignmentColumns());
+ assertThat(assertContext.getText("Actual cell assignment columns assertion error: "), actual.getCellAssignmentColumns().size(), is(expected.getCellAssignmentColumns().size()));
+ assertCellAssignmentColumns(assertContext, actual.getCellAssignmentColumns(), expected.getCellAssignmentColumns());
+ }
+ if (null != expected.getCellAssignmentSelect()) {
+ assertNotNull(assertContext.getText("Actual cell assignment select subquery should exist."), actual.getCellAssignmentSelects());
+ assertThat(assertContext.getText("Actual cell assignment select size assertion error: "), actual.getCellAssignmentSelects().size(), is(expected.getCellAssignmentSelect().size()));
+ assertCellAssignmentSelectStatements(assertContext, actual.getCellAssignmentSelects(), expected.getCellAssignmentSelect());
+ }
+ }
+
+ private static void assertReferenceModelSelectStatements(final SQLCaseAssertContext assertContext, final List<SubquerySegment> actual, final List<SelectStatementTestCase> expected) {
+ int count = 0;
+ for (SubquerySegment each : actual) {
+ SelectStatementAssert.assertIs(assertContext, each.getSelect(), expected.get(count));
+ count++;
+ }
+ }
+
+ private static void assertOrderBySegments(final SQLCaseAssertContext assertContext, final List<OrderBySegment> actual, final List<ExpectedOrderByClause> expected) {
+ int count = 0;
+ for (OrderBySegment each : actual) {
+ OrderByItemAssert.assertIs(assertContext, each.getOrderByItems(), expected.get(count), "Order by");
+ count++;
+ }
+ }
+
+ private static void assertCellAssignmentColumns(final SQLCaseAssertContext assertContext, final List<ColumnSegment> actual, final List<ExpectedColumn> expected) {
+ int count = 0;
+ for (ColumnSegment each : actual) {
+ ColumnAssert.assertIs(assertContext, each, expected.get(count));
+ count++;
+ }
+ }
+
+ private static void assertCellAssignmentSelectStatements(final SQLCaseAssertContext assertContext, final List<SubquerySegment> actual, final List<SelectStatementTestCase> expected) {
+ int count = 0;
+ for (SubquerySegment each : actual) {
+ SelectStatementAssert.assertIs(assertContext, each.getSelect(), expected.get(count));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByClauseAssert.java
new file mode 100644
index 00000000000..213b2bd0e82
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByClauseAssert.java
@@ -0,0 +1,42 @@
+/*
+ * 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.internal.asserts.segment.orderby;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.ExpectedOrderByClause;
+
+/**
+ * Order by clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class OrderByClauseAssert {
+
+ /**
+ * Assert actual order by segment is correct with expected order by clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual order by segment
+ * @param expected expected order by clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final OrderBySegment actual, final ExpectedOrderByClause expected) {
+ OrderByItemAssert.assertIs(assertContext, actual.getOrderByItems(), expected, "Order by");
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByItemAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByItemAssert.java
new file mode 100644
index 00000000000..54b7e41580e
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/orderby/OrderByItemAssert.java
@@ -0,0 +1,118 @@
+/*
+ * 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.internal.asserts.segment.orderby;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ColumnOrderByItemSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.ExpressionOrderByItemSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.IndexOrderByItemSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item.OrderByItemSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.ExpectedOrderByClause;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.item.ExpectedOrderByItem;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.item.impl.ExpectedColumnOrderByItem;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.item.impl.ExpectedExpressionOrderByItem;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.orderby.item.impl.ExpectedIndexOrderByItem;
+
+import java.util.Collection;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Order by item assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class OrderByItemAssert {
+
+ /**
+ * Assert actual order by segment is correct with expected order by.
+ *
+ * @param assertContext assert context
+ * @param actual actual order by segments
+ * @param expected expected order by
+ * @param type type of assertion, should be Order by or Group by
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext,
+ final Collection<OrderByItemSegment> actual, final ExpectedOrderByClause expected, final String type) {
+ assertThat(assertContext.getText(String.format("%s items size assertion error: ", type)), actual.size(), is(expected.getItemSize()));
+ int count = 0;
+ for (OrderByItemSegment each : actual) {
+ if (each instanceof ColumnOrderByItemSegment) {
+ assertOrderInfo(assertContext, each, expected.getColumnItems().get(count), type);
+ assertColumnOrderByItem(assertContext, (ColumnOrderByItemSegment) each, expected.getColumnItems().get(count), type);
+ count++;
+ }
+ }
+ count = 0;
+ for (OrderByItemSegment each : actual) {
+ if (each instanceof IndexOrderByItemSegment) {
+ assertOrderInfo(assertContext, each, expected.getIndexItems().get(count), type);
+ assertIndexOrderByItem(assertContext, (IndexOrderByItemSegment) each, expected.getIndexItems().get(count), type);
+ count++;
+ }
+ }
+ count = 0;
+ for (OrderByItemSegment each : actual) {
+ if (each instanceof ExpressionOrderByItemSegment) {
+ assertOrderInfo(assertContext, each, expected.getExpressionItems().get(count), type);
+ assertExpressionOrderByItem(assertContext, (ExpressionOrderByItemSegment) each, expected.getExpressionItems().get(count), type);
+ count++;
+ }
+ }
+ }
+
+ private static void assertOrderInfo(final SQLCaseAssertContext assertContext, final OrderByItemSegment actual, final ExpectedOrderByItem expected, final String type) {
+ assertThat(assertContext.getText(String.format("%s item order direction assertion error: ", type)),
+ null != actual.getOrderDirection() ? actual.getOrderDirection().name() : actual.getNullOrderDirection().name(), is(expected.getOrderDirection()));
+ }
+
+ private static void assertColumnOrderByItem(final SQLCaseAssertContext assertContext,
+ final ColumnOrderByItemSegment actual, final ExpectedColumnOrderByItem expected, final String type) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getColumn().getIdentifier(), expected, String.format("%s item", type));
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getColumn().getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getColumn().getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getColumn().getOwner().get(), expected.getOwner());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertIndexOrderByItem(final SQLCaseAssertContext assertContext,
+ final IndexOrderByItemSegment actual, final ExpectedIndexOrderByItem expected, final String type) {
+ assertThat(assertContext.getText(String.format("%s item index assertion error: ", type)), actual.getColumnIndex(), is(expected.getIndex()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertExpressionOrderByItem(final SQLCaseAssertContext assertContext,
+ final ExpressionOrderByItemSegment actual, final ExpectedExpressionOrderByItem expected, final String type) {
+ assertThat(assertContext.getText(String.format("%s item expression assertion error: ", type)), actual.getExpression(), is(expected.getExpression()));
+ if (null != expected.getExpr()) {
+ ExpressionAssert.assertExpression(assertContext, actual.getExpr(), expected.getExpr());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/output/OutputClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/output/OutputClauseAssert.java
new file mode 100644
index 00000000000..ff60157eabd
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/output/OutputClauseAssert.java
@@ -0,0 +1,94 @@
+/*
+ * 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.internal.asserts.segment.output;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ColumnProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OutputSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.output.ExpectedOutputClause;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.column.ExpectedColumnProjection;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Output clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class OutputClauseAssert {
+
+ /**
+ * Assert actual output segment is correct with expected output clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual output segment
+ * @param expected expected output clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final OutputSegment actual, final ExpectedOutputClause expected) {
+ assertNotNull(assertContext.getText("Output clause should exist."), expected);
+ if (!actual.getOutputColumns().isEmpty()) {
+ assertOutputColumnsSegment(assertContext, actual, expected);
+ }
+ if (null != actual.getTableName()) {
+ assertOutputTableSegment(assertContext, actual, expected);
+ }
+ if (!actual.getTableColumns().isEmpty()) {
+ assertOutputTableColumnSegment(assertContext, actual, expected);
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertOutputColumnsSegment(final SQLCaseAssertContext assertContext, final OutputSegment actual, final ExpectedOutputClause expected) {
+ assertThat(assertContext.getText("Output columns size assertion error: "),
+ actual.getOutputColumns().size(), is(expected.getOutputColumns().getColumnProjections().size()));
+ int count = 0;
+ for (ColumnProjectionSegment each : actual.getOutputColumns()) {
+ assertOutputColumnSegment(assertContext, each, expected.getOutputColumns().getColumnProjections().get(count));
+ count++;
+ }
+ }
+
+ private static void assertOutputColumnSegment(final SQLCaseAssertContext assertContext, final ColumnProjectionSegment actual, final ExpectedColumnProjection expected) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getColumn().getIdentifier(), expected, "Output column");
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertOutputTableSegment(final SQLCaseAssertContext assertContext, final OutputSegment actual, final ExpectedOutputClause expected) {
+ assertThat(assertContext.getText("Output table name assertion error: "),
+ actual.getTableName().getIdentifier().getValue(), is(expected.getOutputTable().getName()));
+ SQLSegmentAssert.assertIs(assertContext, actual.getTableName(), expected.getOutputTable());
+ }
+
+ private static void assertOutputTableColumnSegment(final SQLCaseAssertContext assertContext, final OutputSegment actual, final ExpectedOutputClause expected) {
+ assertThat(assertContext.getText("Output table columns size assertion error: "),
+ actual.getTableColumns().size(), is(expected.getOutputTableColumns().getColumns().size()));
+ int count = 0;
+ for (ColumnSegment each : actual.getTableColumns()) {
+ assertThat(assertContext.getText("Output table column name assertion error: "),
+ each.getIdentifier().getValue(), is(expected.getOutputTableColumns().getColumns().get(count).getName()));
+ SQLSegmentAssert.assertIs(assertContext, each, expected.getOutputTableColumns().getColumns().get(count));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/owner/OwnerAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/owner/OwnerAssert.java
new file mode 100644
index 00000000000..ea0c9da867b
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/owner/OwnerAssert.java
@@ -0,0 +1,54 @@
+/*
+ * 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.internal.asserts.segment.owner;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.OwnerSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.table.ExpectedOwner;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Owner assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class OwnerAssert {
+
+ /**
+ * Assert actual owner segment is correct with expected owner.
+ *
+ * @param assertContext assert context
+ * @param actual actual owner segment
+ * @param expected expected owner
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final OwnerSegment actual, final ExpectedOwner expected) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getIdentifier(), expected, "Owner");
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/packages/PackageAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/packages/PackageAssert.java
new file mode 100644
index 00000000000..9c590f1fbc9
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/packages/PackageAssert.java
@@ -0,0 +1,57 @@
+/*
+ * 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.internal.asserts.segment.packages;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.packages.PackageSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.packages.ExpectedPackage;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Package assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class PackageAssert {
+
+ /**
+ * Assert actual package segment is correct with expected package.
+ *
+ * @param assertContext assert context
+ * @param actual actual package segment
+ * @param expected expected package
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final PackageSegment actual, final ExpectedPackage expected) {
+ assertNotNull(assertContext.getText("Package should exist."), expected);
+ IdentifierValueAssert.assertIs(assertContext, actual.getIdentifier(), expected, "Package");
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/parameter/ParameterMarkerAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/parameter/ParameterMarkerAssert.java
new file mode 100644
index 00000000000..797627fb34d
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/parameter/ParameterMarkerAssert.java
@@ -0,0 +1,48 @@
+/*
+ * 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.internal.asserts.segment.parameter;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Parameter marker assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ParameterMarkerAssert {
+
+ /**
+ * Assert parameter markers count.
+ *
+ * @param assertContext assert context
+ * @param actual actual parameter markers count
+ * @param expected expected parameter markers count
+ */
+ public static void assertCount(final SQLCaseAssertContext assertContext, final int actual, final int expected) {
+ if (SQLCaseType.Placeholder == assertContext.getSqlCaseType()) {
+ assertThat(assertContext.getText("Parameter markers count assertion error: "), actual, is(expected));
+ } else {
+ assertThat(assertContext.getText("Parameter markers count assertion error: "), actual, is(0));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/prepare/PrepareStatementQueryAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/prepare/PrepareStatementQueryAssert.java
new file mode 100644
index 00000000000..14c820a881a
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/prepare/PrepareStatementQueryAssert.java
@@ -0,0 +1,90 @@
+/*
+ * 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.internal.asserts.segment.prepare;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.prepare.PrepareStatementQuerySegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.DeleteStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.InsertStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.UpdateStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.query.ExpectedPrepareStatementQuery;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Prepare statement query assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class PrepareStatementQueryAssert {
+
+ /**
+ * Assert actual prepare statement query segment is correct with expected prepare statement query.
+ *
+ * @param assertContext assert context
+ * @param actual actual prepare statement query segment
+ * @param expected expected prepare statement query
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final PrepareStatementQuerySegment actual, final ExpectedPrepareStatementQuery expected) {
+ assertSelect(assertContext, actual, expected);
+ assertInsert(assertContext, actual, expected);
+ assertUpdate(assertContext, actual, expected);
+ assertDelete(assertContext, actual, expected);
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertSelect(final SQLCaseAssertContext assertContext, final PrepareStatementQuerySegment actual, final ExpectedPrepareStatementQuery expected) {
+ if (null == expected.getSelectClause()) {
+ assertFalse(assertContext.getText("Actual select statement should not exist."), actual.getSelect().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual select statement should exist."), actual.getSelect().isPresent());
+ SelectStatementAssert.assertIs(assertContext, actual.getSelect().get(), expected.getSelectClause());
+ }
+ }
+
+ private static void assertInsert(final SQLCaseAssertContext assertContext, final PrepareStatementQuerySegment actual, final ExpectedPrepareStatementQuery expected) {
+ if (null == expected.getInsertClause()) {
+ assertFalse(assertContext.getText("Actual insert statement should not exist."), actual.getInsert().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual insert statement should exist."), actual.getInsert().isPresent());
+ InsertStatementAssert.assertIs(assertContext, actual.getInsert().get(), expected.getInsertClause());
+ }
+ }
+
+ private static void assertUpdate(final SQLCaseAssertContext assertContext, final PrepareStatementQuerySegment actual, final ExpectedPrepareStatementQuery expected) {
+ if (null == expected.getUpdateClause()) {
+ assertFalse(assertContext.getText("Actual update statement should not exist."), actual.getUpdate().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual update statement should exist."), actual.getUpdate().isPresent());
+ UpdateStatementAssert.assertIs(assertContext, actual.getUpdate().get(), expected.getUpdateClause());
+ }
+ }
+
+ private static void assertDelete(final SQLCaseAssertContext assertContext, final PrepareStatementQuerySegment actual, final ExpectedPrepareStatementQuery expected) {
+ if (null == expected.getDeleteClause()) {
+ assertFalse(assertContext.getText("Actual delete statement should not exist."), actual.getDelete().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual delete statement should exist."), actual.getDelete().isPresent());
+ DeleteStatementAssert.assertIs(assertContext, actual.getDelete().get(), expected.getDeleteClause());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/projection/ProjectionAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/projection/ProjectionAssert.java
new file mode 100644
index 00000000000..11caa98c8de
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/projection/ProjectionAssert.java
@@ -0,0 +1,178 @@
+/*
+ * 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.internal.asserts.segment.projection;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationDistinctProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.AggregationProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ColumnProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ExpressionProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ProjectionsSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.ShorthandProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.item.SubqueryProjectionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.rownum.NumberLiteralRowNumberValueSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.rownum.ParameterMarkerRowNumberValueSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.pagination.top.TopProjectionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.ExpectedProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.ExpectedProjections;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.aggregation.ExpectedAggregationDistinctProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.aggregation.ExpectedAggregationProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.column.ExpectedColumnProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.expression.ExpectedExpressionProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.shorthand.ExpectedShorthandProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.subquery.ExpectedSubqueryProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.projection.impl.top.ExpectedTopProjection;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.sql.SQLCaseType;
+
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Projection assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ProjectionAssert {
+
+ /**
+ * Assert actual projections segment is correct with expected projections.
+ *
+ * @param assertContext assert context
+ * @param actual actual projection
+ * @param expected expected projections
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ProjectionsSegment actual, final ExpectedProjections expected) {
+ assertProjections(assertContext, actual, expected);
+ List<ExpectedProjection> expectedProjections = expected.getExpectedProjections();
+ int count = 0;
+ for (ProjectionSegment each : actual.getProjections()) {
+ assertProjection(assertContext, each, expectedProjections.get(count));
+ count++;
+ }
+ }
+
+ private static void assertProjections(final SQLCaseAssertContext assertContext, final ProjectionsSegment actual, final ExpectedProjections expected) {
+ assertThat(assertContext.getText("Projections size assertion error: "), actual.getProjections().size(), is(expected.getSize()));
+ assertThat(assertContext.getText("Projections distinct row assertion error: "), actual.isDistinctRow(), is(expected.isDistinctRow()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ /**
+ * Assert actual projection segment is correct with expected projection.
+ * @param assertContext assert context
+ * @param actual actual projection
+ * @param expected expected projection
+ */
+ public static void assertProjection(final SQLCaseAssertContext assertContext, final ProjectionSegment actual, final ExpectedProjection expected) {
+ if (actual instanceof ShorthandProjectionSegment) {
+ assertThat(assertContext.getText("Projection type assertion error: "), expected, instanceOf(ExpectedShorthandProjection.class));
+ assertShorthandProjection(assertContext, (ShorthandProjectionSegment) actual, (ExpectedShorthandProjection) expected);
+ } else if (actual instanceof ColumnProjectionSegment) {
+ assertThat(assertContext.getText("Projection type assertion error: "), expected, instanceOf(ExpectedColumnProjection.class));
+ assertColumnProjection(assertContext, (ColumnProjectionSegment) actual, (ExpectedColumnProjection) expected);
+ } else if (actual instanceof AggregationProjectionSegment) {
+ assertThat(assertContext.getText("Projection type assertion error: "), expected, instanceOf(ExpectedAggregationProjection.class));
+ assertAggregationProjection(assertContext, (AggregationProjectionSegment) actual, (ExpectedAggregationProjection) expected);
+ } else if (actual instanceof ExpressionProjectionSegment) {
+ assertThat(assertContext.getText("Projection type assertion error: "), expected, instanceOf(ExpectedExpressionProjection.class));
+ assertExpressionProjection(assertContext, (ExpressionProjectionSegment) actual, (ExpectedExpressionProjection) expected);
+ } else if (actual instanceof TopProjectionSegment) {
+ assertThat(assertContext.getText("Projection type assertion error: "), expected, instanceOf(ExpectedTopProjection.class));
+ assertTopProjection(assertContext, (TopProjectionSegment) actual, (ExpectedTopProjection) expected);
+ } else if (actual instanceof SubqueryProjectionSegment) {
+ assertThat(assertContext.getText("Projection type assertion error: "), expected, instanceOf(ExpectedSubqueryProjection.class));
+ assertSubqueryProjection(assertContext, (SubqueryProjectionSegment) actual, (ExpectedSubqueryProjection) expected);
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertSubqueryProjection(final SQLCaseAssertContext assertContext, final SubqueryProjectionSegment actual, final ExpectedSubqueryProjection expected) {
+ assertThat(assertContext.getText("Subquery projection alias assertion error: "), actual.getAlias().orElse(null), is(expected.getAlias()));
+ String expectedText = SQLCaseType.Literal == assertContext.getSqlCaseType() && null != expected.getLiteralText() ? expected.getLiteralText() : expected.getText();
+ assertThat(assertContext.getText("Subquery projection text assertion error: "), actual.getText(), is(expectedText));
+ SelectStatementAssert.assertIs(assertContext, actual.getSubquery().getSelect(), expected.getSubquery().getSelectTestCases());
+ }
+
+ private static void assertShorthandProjection(final SQLCaseAssertContext assertContext, final ShorthandProjectionSegment actual, final ExpectedShorthandProjection expected) {
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ }
+
+ private static void assertColumnProjection(final SQLCaseAssertContext assertContext, final ColumnProjectionSegment actual, final ExpectedColumnProjection expected) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getColumn().getIdentifier(), expected, "Column projection");
+ assertThat(assertContext.getText("Column projection alias assertion error: "), actual.getAlias().orElse(null), is(expected.getAlias()));
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getColumn().getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getColumn().getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getColumn().getOwner().get(), expected.getOwner());
+ }
+ }
+
+ private static void assertAggregationProjection(final SQLCaseAssertContext assertContext, final AggregationProjectionSegment actual, final ExpectedAggregationProjection expected) {
+ assertThat(assertContext.getText("Aggregation projection type assertion error: "), actual.getType().name(), is(expected.getType()));
+ assertThat(assertContext.getText("Aggregation projection inner expression assertion error: "), actual.getInnerExpression(), is(expected.getInnerExpression()));
+ assertThat(assertContext.getText("Aggregation projection alias assertion error: "), actual.getAlias().orElse(null), is(expected.getAlias()));
+ if (actual instanceof AggregationDistinctProjectionSegment) {
+ assertThat(assertContext.getText("Projection type assertion error: "), expected, instanceOf(ExpectedAggregationDistinctProjection.class));
+ assertThat(assertContext.getText("Aggregation projection alias assertion error: "),
+ ((AggregationDistinctProjectionSegment) actual).getDistinctExpression(), is(((ExpectedAggregationDistinctProjection) expected).getDistinctExpression()));
+ }
+ }
+
+ private static void assertExpressionProjection(final SQLCaseAssertContext assertContext, final ExpressionProjectionSegment actual, final ExpectedExpressionProjection expected) {
+ assertThat(assertContext.getText("Expression projection alias assertion error: "),
+ actual.getAlias().orElse(null), is(expected.getAlias()));
+ String expectedText = SQLCaseType.Literal == assertContext.getSqlCaseType() && null != expected.getLiteralText()
+ ? expected.getLiteralText()
+ : expected.getText();
+ assertThat(assertContext.getText("Expression projection text assertion error: "),
+ actual.getText(), is(expectedText));
+ if (expected.getExpr() != null) {
+ ExpressionAssert.assertExpression(assertContext, actual.getExpr(), expected.getExpr());
+ }
+ }
+
+ private static void assertTopProjection(final SQLCaseAssertContext assertContext, final TopProjectionSegment actual, final ExpectedTopProjection expected) {
+ if (actual.getTop() instanceof NumberLiteralRowNumberValueSegment) {
+ assertThat(assertContext.getText("Expression projection top value assertion error: "),
+ ((NumberLiteralRowNumberValueSegment) actual.getTop()).getValue(), is(expected.getTopValue().getValue()));
+ } else {
+ assertThat(assertContext.getText("Expression projection top parameter index assertion error: "),
+ ((ParameterMarkerRowNumberValueSegment) actual.getTop()).getParameterIndex(), is(expected.getTopValue().getParameterIndex()));
+ }
+ assertThat(assertContext.getText("Expression projection alias assertion error: "), actual.getAlias(), is(expected.getAlias()));
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/set/SetClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/set/SetClauseAssert.java
new file mode 100644
index 00000000000..e20e99571c3
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/set/SetClauseAssert.java
@@ -0,0 +1,56 @@
+/*
+ * 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.internal.asserts.segment.set;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.AssignmentSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.assignment.SetAssignmentSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.assignment.AssignmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.set.ExpectedSetClause;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Set clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SetClauseAssert {
+
+ /**
+ * Assert actual set assignment segment is correct with expected set assignment.
+ *
+ * @param assertContext assert context
+ * @param actual actual set assignment segment
+ * @param expected expected set clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final SetAssignmentSegment actual, final ExpectedSetClause expected) {
+ assertNotNull(assertContext.getText("Assignments should exist."), expected);
+ assertThat(assertContext.getText("Assignments size assertion error: "), actual.getAssignments().size(), is(expected.getAssignments().size()));
+ int count = 0;
+ for (AssignmentSegment each : actual.getAssignments()) {
+ AssignmentAssert.assertIs(assertContext, each, expected.getAssignments().get(count));
+ count++;
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/show/ShowFilterAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/show/ShowFilterAssert.java
new file mode 100644
index 00000000000..d8deedf9d59
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/show/ShowFilterAssert.java
@@ -0,0 +1,55 @@
+/*
+ * 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.internal.asserts.segment.show;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dal.ShowFilterSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.where.WhereClauseAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.show.ExpectedShowFilter;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Show filter assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ShowFilterAssert {
+
+ /**
+ * Assert actual show filter segment is correct with expected schema.
+ *
+ * @param assertContext assert context
+ * @param actual actual show filter segment
+ * @param expected expected show filter
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ShowFilterSegment actual, final ExpectedShowFilter expected) {
+ if (actual.getLike().isPresent()) {
+ assertThat(assertContext.getText("Show filter like segment pattern content assert error."),
+ actual.getLike().get().getPattern(), is(expected.getLike().getPattern()));
+ SQLSegmentAssert.assertIs(assertContext, actual.getLike().get(), expected.getLike());
+ }
+ if (actual.getWhere().isPresent()) {
+ WhereClauseAssert.assertIs(assertContext, actual.getWhere().get(), expected.getWhere());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/table/TableAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/table/TableAssert.java
new file mode 100644
index 00000000000..6c91717e489
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/table/TableAssert.java
@@ -0,0 +1,163 @@
+/*
+ * 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.internal.asserts.segment.table;
+
+import com.google.common.base.Strings;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.JoinTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.SubqueryTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.table.TableSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.impl.SelectStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.column.ExpectedColumn;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.table.ExpectedJoinTable;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.table.ExpectedSimpleTable;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.table.ExpectedSubqueryTable;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.table.ExpectedTable;
+
+import java.util.Collection;
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Table assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class TableAssert {
+
+ /**
+ * Assert actual table segments is correct with expected tables.
+ *
+ * @param assertContext assert context
+ * @param actual actual tables
+ * @param expected expected tables
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final TableSegment actual, final ExpectedTable expected) {
+ if (actual instanceof JoinTableSegment) {
+ assertIs(assertContext, (JoinTableSegment) actual, expected.getJoinTable());
+ } else if (actual instanceof SimpleTableSegment) {
+ assertIs(assertContext, (SimpleTableSegment) actual, expected.getSimpleTable());
+ } else if (actual instanceof SubqueryTableSegment) {
+ assertIs(assertContext, (SubqueryTableSegment) actual, expected.getSubqueryTable());
+ } else {
+ throw new UnsupportedOperationException(
+ String.format("Unsupported table segment type `%s`.", actual.getClass()));
+ }
+ }
+
+ /**
+ * Assert actual table segment is correct with expected table.
+ *
+ * @param assertContext assert context
+ * @param actual actual table
+ * @param expected expected table
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final SimpleTableSegment actual, final ExpectedSimpleTable expected) {
+ IdentifierValueAssert.assertIs(assertContext, actual.getTableName().getIdentifier(), expected, "Table");
+ assertThat(assertContext.getText("Table alias assertion error: "), actual.getAlias().orElse(null), is(expected.getAlias()));
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ /**
+ * Assert subquery expression.
+ *
+ * @param assertContext assert context
+ * @param actual actual subquery segment
+ * @param expected expected subquery expression
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final SubqueryTableSegment actual, final ExpectedSubqueryTable expected) {
+ SelectStatementAssert.assertIs(assertContext, actual.getSubquery().getSelect(), expected.getSubquery().getSelectTestCases());
+ assertThat(assertContext.getText("Table alias assertion error: "), actual.getAlias().orElse(null), is(expected.getAlias()));
+ }
+
+ /**
+ * Assert join table.
+ *
+ * @param assertContext assert context
+ * @param actual actual JoinTableSegment
+ * @param expected expected ExpectedJoinTable
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final JoinTableSegment actual, final ExpectedJoinTable expected) {
+ assertIs(assertContext, actual.getLeft(), expected.getLeft());
+ assertIs(assertContext, actual.getRight(), expected.getRight());
+ ExpressionAssert.assertExpression(assertContext, actual.getCondition(), expected.getOnCondition());
+ assertJoinType(assertContext, actual.getJoinType(), expected.getJoinType());
+ assertThat(assertContext.getText("Column size assertion error: "), actual.getUsing().size(), is(expected.getUsingColumns().size()));
+ int count = 0;
+ for (ExpectedColumn each : expected.getUsingColumns()) {
+ ColumnAssert.assertIs(assertContext, actual.getUsing().get(count), each);
+ count++;
+ }
+ }
+
+ /**
+ * Assert actual table segments is correct with expected tables.
+ *
+ * @param assertContext assert context
+ * @param actual actual tables
+ * @param expected expected tables
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final Collection<SimpleTableSegment> actual, final List<ExpectedSimpleTable> expected) {
+ assertThat(assertContext.getText("Tables size assertion error: "), actual.size(), is(expected.size()));
+ int count = 0;
+ for (SimpleTableSegment each : actual) {
+ assertIs(assertContext, each, expected.get(count));
+ count++;
+ }
+ }
+
+ /**
+ * Assert actual simple table segments with expected simple tables.
+ *
+ * @param assertContext assert context
+ * @param actualTables actual simple tables
+ * @param expectedTables expected simple tables
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final List<SimpleTableSegment> actualTables, final List<ExpectedSimpleTable> expectedTables) {
+ assertThat(assertContext.getText("tables size should be the same."),
+ actualTables.size(), is(expectedTables.size()));
+ for (int i = 0; i < actualTables.size(); i++) {
+ assertIs(assertContext, actualTables.get(i), expectedTables.get(i));
+ }
+ }
+
+ private static void assertJoinType(final SQLCaseAssertContext assertContext, final String actual, final String expected) {
+ if (Strings.isNullOrEmpty(expected)) {
+ assertTrue(assertContext.getText("Actual join-type should not exist."), Strings.isNullOrEmpty(actual));
+ } else {
+ assertThat(assertContext.getText("Actual join-type should exist."), actual, is(expected));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/type/TypeAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/type/TypeAssert.java
new file mode 100644
index 00000000000..03c2db7af1c
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/type/TypeAssert.java
@@ -0,0 +1,57 @@
+/*
+ * 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.internal.asserts.segment.type;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.type.TypeSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.owner.OwnerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.type.ExpectedType;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Type assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class TypeAssert {
+
+ /**
+ * Assert actual type segment is correct with expected type.
+ *
+ * @param assertContext assert context
+ * @param actual actual type segment
+ * @param expected expected type
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final TypeSegment actual, final ExpectedType expected) {
+ assertNotNull(assertContext.getText("Type should exist."), expected);
+ IdentifierValueAssert.assertIs(assertContext, actual.getIdentifier(), expected, "Type");
+ if (null == expected.getOwner()) {
+ assertFalse(assertContext.getText("Actual owner should not exist."), actual.getOwner().isPresent());
+ } else {
+ assertTrue(assertContext.getText("Actual owner should exist."), actual.getOwner().isPresent());
+ OwnerAssert.assertIs(assertContext, actual.getOwner().get(), expected.getOwner());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/where/WhereClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/where/WhereClauseAssert.java
new file mode 100644
index 00000000000..2b68132b096
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/where/WhereClauseAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.asserts.segment.where;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.predicate.WhereSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.where.ExpectedWhereClause;
+
+/**
+ * Where clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class WhereClauseAssert {
+
+ /**
+ * Assert actual where segment is correct with expected where clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual where segment
+ * @param expected expected where clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final WhereSegment actual, final ExpectedWhereClause expected) {
+ ExpressionAssert.assertExpression(assertContext, actual.getExpr(), expected.getExpr());
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/with/WithClauseAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/with/WithClauseAssert.java
new file mode 100644
index 00000000000..2b04c4b89b7
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/segment/with/WithClauseAssert.java
@@ -0,0 +1,76 @@
+/*
+ * 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.internal.asserts.segment.with;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonTableExpressionSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.WithSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.expression.ExpressionAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.with.ExpectedCommonTableExpressionClause;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.with.ExpectedWithClause;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * With clause assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class WithClauseAssert {
+
+ /**
+ * Assert actual with segment is correct with expected with clause.
+ *
+ * @param assertContext assert context
+ * @param actual actual with segment
+ * @param expected expected with clause
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final WithSegment actual, final ExpectedWithClause expected) {
+ assertNotNull(assertContext.getText("With clause should exist."), expected);
+ assertThat(assertContext.getText("With clause common table expressions size assertion error: "),
+ actual.getCommonTableExpressions().size(), is(expected.getCommonTableExpressions().size()));
+ int count = 0;
+ for (CommonTableExpressionSegment each : actual.getCommonTableExpressions()) {
+ assertCommonTableExpressionSegment(assertContext, each, expected.getCommonTableExpressions().get(count));
+ count++;
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+
+ private static void assertCommonTableExpressionSegment(final SQLCaseAssertContext assertContext, final CommonTableExpressionSegment actual, final ExpectedCommonTableExpressionClause expected) {
+ if (null != expected.getCommonTableExpressColumns()) {
+ assertThat(assertContext.getText("Common table expression column size assertion error: "), actual.getColumns().size(), is(expected.getCommonTableExpressColumns().getColumns().size()));
+ }
+ assertThat(assertContext.getText("Common table expression name assertion error: "), actual.getIdentifier().getValue(), is(expected.getName()));
+ int count = 0;
+ for (ColumnSegment each : actual.getColumns()) {
+ ColumnAssert.assertIs(assertContext, each, expected.getCommonTableExpressColumns().getColumns().get(count));
+ count++;
+ }
+ if (null != expected.getSubquery()) {
+ ExpressionAssert.assertSubquery(assertContext, actual.getSubquery(), expected.getSubquery());
+ }
+ SQLSegmentAssert.assertIs(assertContext, actual, expected);
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/AbstractSQLStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/AbstractSQLStatementAssert.java
new file mode 100644
index 00000000000..60850d60faf
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/AbstractSQLStatementAssert.java
@@ -0,0 +1,46 @@
+/*
+ * 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.internal.asserts.statement;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.distsql.parser.statement.DistSQLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.distsql.DistSQLStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.SQLParserTestCase;
+
+/**
+ * Abstract sql statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class AbstractSQLStatementAssert {
+
+ /**
+ * Assert abstract sql statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual abstract sql statement
+ * @param expected expected abstract sql statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final SQLStatement actual, final SQLParserTestCase expected) {
+ if (actual instanceof DistSQLStatement) {
+ DistSQLStatementAssert.assertIs(assertContext, (DistSQLStatement) actual, expected);
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/SQLStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/SQLStatementAssert.java
new file mode 100644
index 00000000000..1d587fb8ea8
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/SQLStatementAssert.java
@@ -0,0 +1,66 @@
+/*
+ * 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.internal.asserts.statement;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.DALStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dcl.DCLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DMLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.tcl.TCLStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.parameter.ParameterMarkerAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.comment.CommentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.DALStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dcl.DCLStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.ddl.DDLStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dml.DMLStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.tcl.TCLStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.SQLParserTestCase;
+
+/**
+ * SQL statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SQLStatementAssert {
+
+ /**
+ * Assert SQL statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual SQL statement
+ * @param expected expected parser result
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final SQLStatement actual, final SQLParserTestCase expected) {
+ ParameterMarkerAssert.assertCount(assertContext, actual.getParameterCount(), expected.getParameters().size());
+ CommentAssert.assertComment(assertContext, actual, expected);
+ if (actual instanceof DMLStatement) {
+ DMLStatementAssert.assertIs(assertContext, (DMLStatement) actual, expected);
+ } else if (actual instanceof DDLStatement) {
+ DDLStatementAssert.assertIs(assertContext, (DDLStatement) actual, expected);
+ } else if (actual instanceof TCLStatement) {
+ TCLStatementAssert.assertIs(assertContext, (TCLStatement) actual, expected);
+ } else if (actual instanceof DCLStatement) {
+ DCLStatementAssert.assertIs(assertContext, (DCLStatement) actual, expected);
+ } else if (actual instanceof DALStatement) {
+ DALStatementAssert.assertIs(assertContext, (DALStatement) actual, expected);
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/comment/CommentAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/comment/CommentAssert.java
new file mode 100644
index 00000000000..f20c46d3e73
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/comment/CommentAssert.java
@@ -0,0 +1,71 @@
+/*
+ * 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.internal.asserts.statement.comment;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.CommentSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.AbstractSQLStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.comments.ExpectedComment;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.SQLParserTestCase;
+
+import java.util.Iterator;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Comment assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CommentAssert {
+
+ /**
+ * Assert comment is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual sql statement
+ * @param expected expected statement test case
+ */
+ public static void assertComment(final SQLCaseAssertContext assertContext, final SQLStatement actual, final SQLParserTestCase expected) {
+ if (expected.getComments().isEmpty()) {
+ assertCommentIsEmpty(assertContext, actual);
+ } else {
+ assertCommentIsCorrect(assertContext, actual, expected);
+ }
+ }
+
+ private static void assertCommentIsEmpty(final SQLCaseAssertContext assertContext, final SQLStatement actual) {
+ if (actual instanceof AbstractSQLStatement) {
+ assertTrue(assertContext.getText("Comment should be empty."), ((AbstractSQLStatement) actual).getCommentSegments().isEmpty());
+ }
+ }
+
+ private static void assertCommentIsCorrect(final SQLCaseAssertContext assertContext, final SQLStatement actual, final SQLParserTestCase expected) {
+ assertTrue(assertContext.getText("Comment should exist."), actual instanceof AbstractSQLStatement);
+ assertThat(assertContext.getText("Comments size assertion error: "), ((AbstractSQLStatement) actual).getCommentSegments().size(), is(expected.getComments().size()));
+ Iterator<CommentSegment> actualIterator = ((AbstractSQLStatement) actual).getCommentSegments().iterator();
+ for (final ExpectedComment each : expected.getComments()) {
+ assertThat(assertContext.getText("Comments assertion error: "), actualIterator.next().getText(),
+ is(each.getText()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/DALStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/DALStatementAssert.java
new file mode 100644
index 00000000000..872e2511cc9
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/DALStatementAssert.java
@@ -0,0 +1,302 @@
+/*
+ * 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.internal.asserts.statement.dal;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.DALStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.EmptyStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.ExplainStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.ResetParameterStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.SetStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.ShowStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLAlterResourceGroupStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLBinlogStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCacheIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCheckTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLChecksumTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCloneStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCreateResourceGroupStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLDelimiterStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLDropResourceGroupStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLFlushStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLInstallComponentStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLInstallPluginStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLKillStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLLoadIndexInfoStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLOptimizeTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLRepairTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLResetPersistStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLResetStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLRestartStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLSetResourceGroupStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowBinlogEventsStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowCollationStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowColumnsStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowCreateTableStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowCreateTriggerStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowCreateUserStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowDatabasesStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowEventsStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowFunctionStatusStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowOpenTablesStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowProcedureCodeStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowProcedureStatusStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowRelayLogEventsStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowReplicaStatusStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowReplicasStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowSlaveHostsStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowSlaveStatusStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowStatusStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowTableStatusStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowTablesStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowTriggersStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShowVariablesStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLShutdownStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLUninstallComponentStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLUninstallPluginStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLUseStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.CacheIndexStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.CheckTableStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.CloneStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.EmptyStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ExplainStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.FlushStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.InstallComponentStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.InstallPluginStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.KillStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.LoadIndexInfoStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLAlterResourceGroupStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLBinlogStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLChecksumTableStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLCreateResourceGroupStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLDelimiterStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLDropResourceGroupStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLOptimizeTableStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLRepairTableStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLResetPersistStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLResetStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLSetResourceGroupStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.MySQLUseStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ResetParameterStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.RestartStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.SetParameterStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowBinlogEventsStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowCollationStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowColumnsStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowCreateTableStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowCreateTriggerStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowCreateUserStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowDatabasesStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowEventsStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowFunctionStatusStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowIndexStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowOpenTablesStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowProcedureCodeStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowProcedureStatusStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowRelaylogEventsStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowReplicaStatusStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowReplicasStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowSlaveHostsStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowSlaveStatusStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowStatusStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowTableStatusStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowTablesStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowTriggersStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShowVariablesStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.ShutdownStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.UninstallComponentStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.dal.impl.UninstallPluginStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.SQLParserTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.AlterResourceGroupStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.BinlogStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CacheIndexStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CheckTableStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ChecksumTableStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CloneStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CreateResourceGroupStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.DelimiterStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.DropResourceGroupStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.EmptyStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ExplainStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.FlushStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.InstallComponentStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.InstallPluginStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.KillStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.LoadIndexInfoStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.OptimizeTableStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.RepairTableStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ResetParameterStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ResetPersistStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ResetStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.RestartStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.SetParameterStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.SetResourceGroupStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowBinlogEventsStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowCollationStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowColumnsStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowCreateTableStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowCreateTriggerStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowCreateUserStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowDatabasesStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowEventsStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowFunctionStatusStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowIndexStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowOpenTablesStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowProcedureCodeStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowProcedureStatusStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowRelayLogEventsStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowReplicaStatusStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowReplicasStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowSlaveHostsStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowSlaveStatusStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowStatusStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowTableStatusStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowTablesStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowTriggersStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShowVariablesStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ShutdownStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.UninstallComponentStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.UninstallPluginStatementTestCase;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.UseStatementTestCase;
+
+/**
+ * DAL statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class DALStatementAssert {
+
+ /**
+ * Assert DAL statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual DAL statement
+ * @param expected expected DAL statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final DALStatement actual, final SQLParserTestCase expected) {
+ if (actual instanceof MySQLUseStatement) {
+ MySQLUseStatementAssert.assertIs(assertContext, (MySQLUseStatement) actual, (UseStatementTestCase) expected);
+ } else if (actual instanceof EmptyStatement) {
+ EmptyStatementAssert.assertIs(assertContext, (EmptyStatement) actual, (EmptyStatementTestCase) expected);
+ } else if (actual instanceof ExplainStatement) {
+ ExplainStatementAssert.assertIs(assertContext, (ExplainStatement) actual, (ExplainStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowDatabasesStatement) {
+ ShowDatabasesStatementAssert.assertIs(assertContext, (MySQLShowDatabasesStatement) actual, (ShowDatabasesStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowTablesStatement) {
+ ShowTablesStatementAssert.assertIs(assertContext, (MySQLShowTablesStatement) actual, (ShowTablesStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowColumnsStatement) {
+ ShowColumnsStatementAssert.assertIs(assertContext, (MySQLShowColumnsStatement) actual, (ShowColumnsStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowCreateTableStatement) {
+ ShowCreateTableStatementAssert.assertIs(assertContext, (MySQLShowCreateTableStatement) actual, (ShowCreateTableStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowCreateTriggerStatement) {
+ ShowCreateTriggerStatementAssert.assertIs(assertContext, (MySQLShowCreateTriggerStatement) actual, (ShowCreateTriggerStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowCreateUserStatement) {
+ ShowCreateUserStatementAssert.assertIs(assertContext, (MySQLShowCreateUserStatement) actual, (ShowCreateUserStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowTableStatusStatement) {
+ ShowTableStatusStatementAssert.assertIs(assertContext, (MySQLShowTableStatusStatement) actual, (ShowTableStatusStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowIndexStatement) {
+ ShowIndexStatementAssert.assertIs(assertContext, (MySQLShowIndexStatement) actual, (ShowIndexStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowRelayLogEventsStatement) {
+ ShowRelaylogEventsStatementAssert.assertIs(assertContext, (MySQLShowRelayLogEventsStatement) actual, (ShowRelayLogEventsStatementTestCase) expected);
+ } else if (actual instanceof ShowStatement) {
+ ShowStatementAssert.assertIs(assertContext, (ShowStatement) actual, (ShowStatementTestCase) expected);
+ } else if (actual instanceof SetStatement) {
+ SetParameterStatementAssert.assertIs(assertContext, (SetStatement) actual, (SetParameterStatementTestCase) expected);
+ } else if (actual instanceof ResetParameterStatement) {
+ ResetParameterStatementAssert.assertIs(assertContext, (ResetParameterStatement) actual, (ResetParameterStatementTestCase) expected);
+ } else if (actual instanceof MySQLInstallComponentStatement) {
+ InstallComponentStatementAssert.assertIs(assertContext, (MySQLInstallComponentStatement) actual, (InstallComponentStatementTestCase) expected);
+ } else if (actual instanceof MySQLFlushStatement) {
+ FlushStatementAssert.assertIs(assertContext, (MySQLFlushStatement) actual, (FlushStatementTestCase) expected);
+ } else if (actual instanceof MySQLInstallPluginStatement) {
+ InstallPluginStatementAssert.assertIs(assertContext, (MySQLInstallPluginStatement) actual, (InstallPluginStatementTestCase) expected);
+ } else if (actual instanceof MySQLCloneStatement) {
+ CloneStatementAssert.assertIs(assertContext, (MySQLCloneStatement) actual, (CloneStatementTestCase) expected);
+ } else if (actual instanceof MySQLUninstallComponentStatement) {
+ UninstallComponentStatementAssert.assertIs(assertContext, (MySQLUninstallComponentStatement) actual, (UninstallComponentStatementTestCase) expected);
+ } else if (actual instanceof MySQLCreateResourceGroupStatement) {
+ MySQLCreateResourceGroupStatementAssert.assertIs(assertContext, (MySQLCreateResourceGroupStatement) actual, (CreateResourceGroupStatementTestCase) expected);
+ } else if (actual instanceof MySQLUninstallPluginStatement) {
+ UninstallPluginStatementAssert.assertIs(assertContext, (MySQLUninstallPluginStatement) actual, (UninstallPluginStatementTestCase) expected);
+ } else if (actual instanceof MySQLRestartStatement) {
+ RestartStatementAssert.assertIs(assertContext, (MySQLRestartStatement) actual, (RestartStatementTestCase) expected);
+ } else if (actual instanceof MySQLSetResourceGroupStatement) {
+ MySQLSetResourceGroupStatementAssert.assertIs(assertContext, (MySQLSetResourceGroupStatement) actual, (SetResourceGroupStatementTestCase) expected);
+ } else if (actual instanceof MySQLOptimizeTableStatement) {
+ MySQLOptimizeTableStatementAssert.assertIs(assertContext, (MySQLOptimizeTableStatement) actual, (OptimizeTableStatementTestCase) expected);
+ } else if (actual instanceof MySQLRepairTableStatement) {
+ MySQLRepairTableStatementAssert.assertIs(assertContext, (MySQLRepairTableStatement) actual, (RepairTableStatementTestCase) expected);
+ } else if (actual instanceof MySQLBinlogStatement) {
+ MySQLBinlogStatementAssert.assertIs(assertContext, (MySQLBinlogStatement) actual, (BinlogStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowFunctionStatusStatement) {
+ ShowFunctionStatusStatementAssert.assertIs(assertContext, (MySQLShowFunctionStatusStatement) actual, (ShowFunctionStatusStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowProcedureStatusStatement) {
+ ShowProcedureStatusStatementAssert.assertIs(assertContext, (MySQLShowProcedureStatusStatement) actual, (ShowProcedureStatusStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowReplicasStatement) {
+ ShowReplicasStatementAssert.assertIs(assertContext, (MySQLShowReplicasStatement) actual, (ShowReplicasStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowReplicaStatusStatement) {
+ ShowReplicaStatusStatementAssert.assertIs(assertContext, (MySQLShowReplicaStatusStatement) actual, (ShowReplicaStatusStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowSlaveStatusStatement) {
+ ShowSlaveStatusStatementAssert.assertIs(assertContext, (MySQLShowSlaveStatusStatement) actual, (ShowSlaveStatusStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowSlaveHostsStatement) {
+ ShowSlaveHostsStatementAssert.assertIs(assertContext, (MySQLShowSlaveHostsStatement) actual, (ShowSlaveHostsStatementTestCase) expected);
+ } else if (actual instanceof MySQLResetStatement) {
+ MySQLResetStatementAssert.assertIs(assertContext, (MySQLResetStatement) actual, (ResetStatementTestCase) expected);
+ } else if (actual instanceof MySQLResetPersistStatement) {
+ MySQLResetPersistStatementAssert.assertIs(assertContext, (MySQLResetPersistStatement) actual, (ResetPersistStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowProcedureCodeStatement) {
+ ShowProcedureCodeStatementAssert.assertIs(assertContext, (MySQLShowProcedureCodeStatement) actual, (ShowProcedureCodeStatementTestCase) expected);
+ } else if (actual instanceof MySQLKillStatement) {
+ KillStatementAssert.assertIs(assertContext, (MySQLKillStatement) actual, (KillStatementTestCase) expected);
+ } else if (actual instanceof MySQLCacheIndexStatement) {
+ CacheIndexStatementAssert.assertIs(assertContext, (MySQLCacheIndexStatement) actual, (CacheIndexStatementTestCase) expected);
+ } else if (actual instanceof MySQLLoadIndexInfoStatement) {
+ LoadIndexInfoStatementAssert.assertIs(assertContext, (MySQLLoadIndexInfoStatement) actual, (LoadIndexInfoStatementTestCase) expected);
+ } else if (actual instanceof MySQLShutdownStatement) {
+ ShutdownStatementAssert.assertIs(assertContext, (MySQLShutdownStatement) actual, (ShutdownStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowOpenTablesStatement) {
+ ShowOpenTablesStatementAssert.assertIs(assertContext, (MySQLShowOpenTablesStatement) actual, (ShowOpenTablesStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowTriggersStatement) {
+ ShowTriggersStatementAssert.assertIs(assertContext, (MySQLShowTriggersStatement) actual, (ShowTriggersStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowStatusStatement) {
+ ShowStatusStatementAssert.assertIs(assertContext, (MySQLShowStatusStatement) actual, (ShowStatusStatementTestCase) expected);
+ } else if (actual instanceof MySQLCheckTableStatement) {
+ CheckTableStatementAssert.assertIs(assertContext, (MySQLCheckTableStatement) actual, (CheckTableStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowEventsStatement) {
+ ShowEventsStatementAssert.assertIs(assertContext, (MySQLShowEventsStatement) actual, (ShowEventsStatementTestCase) expected);
+ } else if (actual instanceof MySQLDropResourceGroupStatement) {
+ MySQLDropResourceGroupStatementAssert.assertIs(assertContext, (MySQLDropResourceGroupStatement) actual, (DropResourceGroupStatementTestCase) expected);
+ } else if (actual instanceof MySQLAlterResourceGroupStatement) {
+ MySQLAlterResourceGroupStatementAssert.assertIs(assertContext, (MySQLAlterResourceGroupStatement) actual, (AlterResourceGroupStatementTestCase) expected);
+ } else if (actual instanceof MySQLChecksumTableStatement) {
+ MySQLChecksumTableStatementAssert.assertIs(assertContext, (MySQLChecksumTableStatement) actual, (ChecksumTableStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowCollationStatement) {
+ ShowCollationStatementAssert.assertIs(assertContext, (MySQLShowCollationStatement) actual, (ShowCollationStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowVariablesStatement) {
+ ShowVariablesStatementAssert.assertIs(assertContext, (MySQLShowVariablesStatement) actual, (ShowVariablesStatementTestCase) expected);
+ } else if (actual instanceof MySQLDelimiterStatement) {
+ MySQLDelimiterStatementAssert.assertIs(assertContext, (MySQLDelimiterStatement) actual, (DelimiterStatementTestCase) expected);
+ } else if (actual instanceof MySQLShowBinlogEventsStatement) {
+ ShowBinlogEventsStatementAssert.assertIs(assertContext, (MySQLShowBinlogEventsStatement) actual, (ShowBinlogEventsStatementTestCase) expected);
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CacheIndexStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CacheIndexStatementAssert.java
new file mode 100644
index 00000000000..e7ca041d518
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CacheIndexStatementAssert.java
@@ -0,0 +1,88 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCacheIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.CacheTableIndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.PartitionDefinitionSegment;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.PartitionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.index.IndexAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.index.ExpectedCacheTableIndex;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.index.ExpectedPartitionDefinition;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CacheIndexStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Cache index statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CacheIndexStatementAssert {
+
+ /**
+ * Assert cache index statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual cache index statement
+ * @param expected expected cache index statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLCacheIndexStatement actual, final CacheIndexStatementTestCase expected) {
+ if (!expected.getTableIndexes().isEmpty()) {
+ int count = 0;
+ for (CacheTableIndexSegment each : actual.getTableIndexes()) {
+ TableAssert.assertIs(assertContext, each.getTable(), expected.getTableIndexes().get(count).getTable());
+ assertIndexes(assertContext, each, expected.getTableIndexes().get(count));
+ SQLSegmentAssert.assertIs(assertContext, each, expected.getTableIndexes().get(count));
+ count++;
+ }
+ }
+ if (null != expected.getPartitionDefinition()) {
+ assertPartitions(assertContext, actual.getPartitionDefinition(), expected.getPartitionDefinition());
+ SQLSegmentAssert.assertIs(assertContext, actual.getPartitionDefinition(), expected.getPartitionDefinition());
+ }
+ if (null != expected.getName()) {
+ assertThat(assertContext.getText("Cache index statement name assert error: "), actual.getName().getValue(), is(expected.getName()));
+ }
+ }
+
+ private static void assertIndexes(final SQLCaseAssertContext assertContext, final CacheTableIndexSegment actual, final ExpectedCacheTableIndex expected) {
+ int count = 0;
+ for (IndexSegment index : actual.getIndexes()) {
+ IndexAssert.assertIs(assertContext, index, expected.getIndexNames().get(count));
+ count++;
+ }
+ }
+
+ private static void assertPartitions(final SQLCaseAssertContext assertContext, final PartitionDefinitionSegment actual, final ExpectedPartitionDefinition expected) {
+ TableAssert.assertIs(assertContext, actual.getTable(), expected.getTable());
+ int count = 0;
+ for (PartitionSegment each : actual.getPartitions()) {
+ IdentifierValueAssert.assertIs(assertContext, each.getName(), expected.getPartitions().get(count), "Partition");
+ SQLSegmentAssert.assertIs(assertContext, each, expected.getPartitions().get(count));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CheckTableStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CheckTableStatementAssert.java
new file mode 100644
index 00000000000..cdf34a5b144
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CheckTableStatementAssert.java
@@ -0,0 +1,43 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCheckTableStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CheckTableStatementTestCase;
+
+/**
+ * Check table statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CheckTableStatementAssert {
+
+ /**
+ * Assert check table statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual check table statement
+ * @param expected expected check table statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLCheckTableStatement actual, final CheckTableStatementTestCase expected) {
+ TableAssert.assertIs(assertContext, actual.getTables(), expected.getTables());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CloneStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CloneStatementAssert.java
new file mode 100644
index 00000000000..ca5068b3bdf
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/CloneStatementAssert.java
@@ -0,0 +1,56 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCloneStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.CloneInstanceSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CloneStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Clone statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class CloneStatementAssert {
+
+ /**
+ * Assert clone statement is correct with expected clone statement test case.
+ *
+ * @param assertContext assert context
+ * @param actual actual clone statement
+ * @param expected expected clone statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLCloneStatement actual, final CloneStatementTestCase expected) {
+ if (null != expected.getDataDirectory()) {
+ assertThat(assertContext.getText("Actual data directory does not match: "), actual.getCloneActionSegment().getCloneDir(), is(expected.getDataDirectory().getLocation()));
+ }
+ if (null != expected.getInstance()) {
+ CloneInstanceSegment instance = actual.getCloneActionSegment().getCloneInstance();
+ assertThat(assertContext.getText("Actual instance hostname does not match: "), instance.getHostname(), is(expected.getInstance().getHostname()));
+ assertThat(assertContext.getText("Actual instance username does not match: "), instance.getUsername(), is(expected.getInstance().getUsername()));
+ assertThat(assertContext.getText("Actual instance port does not match: "), instance.getPort(), is(expected.getInstance().getPort()));
+ assertThat(assertContext.getText("Actual instance password does not match: "), instance.getPassword(), is(expected.getInstance().getPassword()));
+ assertThat(assertContext.getText("Actual instance SSL requirement does not match: "), instance.isSslRequired(), is(expected.getInstance().isSslRequired()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/EmptyStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/EmptyStatementAssert.java
new file mode 100644
index 00000000000..e6558c4d29f
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/EmptyStatementAssert.java
@@ -0,0 +1,41 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.EmptyStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.EmptyStatementTestCase;
+
+/**
+ * Empty statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class EmptyStatementAssert {
+
+ /**
+ * Assert empty statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual empty statement
+ * @param expected expected empty statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final EmptyStatement actual, final EmptyStatementTestCase expected) {
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/ExplainStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/ExplainStatementAssert.java
new file mode 100644
index 00000000000..f2e5c155f61
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/ExplainStatementAssert.java
@@ -0,0 +1,81 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.statement.dal.ExplainStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLExplainStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.column.ColumnAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.statement.SQLStatementAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ExplainStatementTestCase;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Explain statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class ExplainStatementAssert {
+
+ /**
+ * Assert explain statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual explain statement
+ * @param expected expected explain statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final ExplainStatement actual, final ExplainStatementTestCase expected) {
+ if (null != expected.getSelectClause()) {
+ assertTrue(assertContext.getText("Actual statement should exist."), actual.getStatement().isPresent());
+ SQLStatementAssert.assertIs(assertContext, actual.getStatement().get(), expected.getSelectClause());
+ } else if (null != expected.getUpdateClause()) {
+ assertTrue(assertContext.getText("Actual statement should exist."), actual.getStatement().isPresent());
+ SQLStatementAssert.assertIs(assertContext, actual.getStatement().get(), expected.getUpdateClause());
+ } else if (null != expected.getInsertClause()) {
+ assertTrue(assertContext.getText("Actual statement should exist."), actual.getStatement().isPresent());
+ SQLStatementAssert.assertIs(assertContext, actual.getStatement().get(), expected.getInsertClause());
+ } else if (null != expected.getDeleteClause()) {
+ assertTrue(assertContext.getText("Actual statement should exist."), actual.getStatement().isPresent());
+ SQLStatementAssert.assertIs(assertContext, actual.getStatement().get(), expected.getDeleteClause());
+ } else if (null != expected.getCreateTableAsSelectClause()) {
+ assertTrue(assertContext.getText("Actual statement should exist."), actual.getStatement().isPresent());
+ SQLStatementAssert.assertIs(assertContext, actual.getStatement().get(), expected.getCreateTableAsSelectClause());
+ } else if (actual instanceof MySQLExplainStatement && null != expected.getTable()) {
+ mysqlExplainStatementAssert(assertContext, (MySQLExplainStatement) actual, expected);
+ } else {
+ assertFalse(assertContext.getText("Actual statement should not exist."), actual.getStatement().isPresent());
+ }
+ }
+
+ private static void mysqlExplainStatementAssert(final SQLCaseAssertContext assertContext, final MySQLExplainStatement actual, final ExplainStatementTestCase expected) {
+ if (actual.getTable().isPresent()) {
+ TableAssert.assertIs(assertContext, actual.getTable().get(), expected.getTable());
+ if (actual.getColumnWild().isPresent()) {
+ ColumnAssert.assertIs(assertContext, actual.getColumnWild().get(), expected.getColumn());
+ } else {
+ assertFalse(assertContext.getText("Actual column wild should not exist."), actual.getColumnWild().isPresent());
+ }
+ } else {
+ assertFalse(assertContext.getText("Actual table should not exist."), actual.getTable().isPresent());
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/FlushStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/FlushStatementAssert.java
new file mode 100644
index 00000000000..5a79d33dce3
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/FlushStatementAssert.java
@@ -0,0 +1,51 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLFlushStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.FlushStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Flush statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class FlushStatementAssert {
+
+ /**
+ * Assert flush statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual flush statement
+ * @param expected expected flush statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLFlushStatement actual, final FlushStatementTestCase expected) {
+ assertThat(assertContext.getText("Flush statement is flush table assert error: "), actual.isFlushTable(), is(expected.isFlushTable()));
+ assertTables(assertContext, actual, expected);
+ }
+
+ private static void assertTables(final SQLCaseAssertContext assertContext, final MySQLFlushStatement actual, final FlushStatementTestCase expected) {
+ TableAssert.assertIs(assertContext, actual.getTables(), expected.getTables());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/InstallComponentStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/InstallComponentStatementAssert.java
new file mode 100644
index 00000000000..3a46f2b75b7
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/InstallComponentStatementAssert.java
@@ -0,0 +1,57 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLInstallComponentStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.component.ExpectedComponent;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.InstallComponentStatementTestCase;
+
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Install component statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class InstallComponentStatementAssert {
+
+ /**
+ * Assert install component statement is correct with expected install component statement test case.
+ *
+ * @param assertContext assert context
+ * @param actual actual install component statement
+ * @param expected expected install component statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLInstallComponentStatement actual, final InstallComponentStatementTestCase expected) {
+ assertThat(assertContext.getText("Actual components size assertion error: "), actual.getComponents().size(), is(expected.getComponents().size()));
+ assertComponents(assertContext, actual.getComponents(), expected.getComponents());
+ }
+
+ private static void assertComponents(final SQLCaseAssertContext assertContext, final List<String> actual, final List<ExpectedComponent> expected) {
+ int count = 0;
+ for (String each : actual) {
+ assertThat(assertContext.getText("Actual component value does not match: "), each, is(expected.get(count).getName()));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/InstallPluginStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/InstallPluginStatementAssert.java
new file mode 100644
index 00000000000..776676573f2
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/InstallPluginStatementAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLInstallPluginStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.InstallPluginStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Install plugin statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class InstallPluginStatementAssert {
+
+ /**
+ * Assert install plugin statement is correct with expected install plugin statement test case.
+ *
+ * @param assertContext assert context
+ * @param actual actual install plugin statement
+ * @param expected expected install plugin statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLInstallPluginStatement actual, final InstallPluginStatementTestCase expected) {
+ assertThat(assertContext.getText("Actual plugin name does not match: "), actual.getPluginName(), is(expected.getPlugin().getName()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/KillStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/KillStatementAssert.java
new file mode 100644
index 00000000000..293d0fbb9b2
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/KillStatementAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLKillStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.KillStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Kill statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class KillStatementAssert {
+
+ /**
+ * Assert kill statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual kill statement
+ * @param expected expected kill statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLKillStatement actual, final KillStatementTestCase expected) {
+ assertThat(assertContext.getText("Kill statement context does not match: "), actual.getProcesslistId(), is(expected.getProcesslistId()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/LoadIndexInfoStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/LoadIndexInfoStatementAssert.java
new file mode 100644
index 00000000000..ceaa3f91653
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/LoadIndexInfoStatementAssert.java
@@ -0,0 +1,78 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLLoadIndexInfoStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.LoadTableIndexSegment;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.PartitionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.index.IndexAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.value.IdentifierValueAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.index.ExpectedLoadTableIndex;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.LoadIndexInfoStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * Load index info statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class LoadIndexInfoStatementAssert {
+
+ /**
+ * Assert load index info statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual load index info statement
+ * @param expected expected load index info statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLLoadIndexInfoStatement actual, final LoadIndexInfoStatementTestCase expected) {
+ assertThat("Load index info statement table index size assertion error: ", actual.getTableIndexes().size(), is(expected.getTableIndexes().size()));
+ int count = 0;
+ for (LoadTableIndexSegment each : actual.getTableIndexes()) {
+ TableAssert.assertIs(assertContext, each.getTable(), expected.getTableIndexes().get(count).getTable());
+ assertIndexes(assertContext, each, expected.getTableIndexes().get(count));
+ assertPartitions(assertContext, each, expected.getTableIndexes().get(count));
+ SQLSegmentAssert.assertIs(assertContext, each, expected.getTableIndexes().get(count));
+ count++;
+ }
+ }
+
+ private static void assertIndexes(final SQLCaseAssertContext assertContext, final LoadTableIndexSegment actual, final ExpectedLoadTableIndex expected) {
+ int count = 0;
+ for (IndexSegment index : actual.getIndexes()) {
+ IndexAssert.assertIs(assertContext, index, expected.getIndexNames().get(count));
+ count++;
+ }
+ }
+
+ private static void assertPartitions(final SQLCaseAssertContext assertContext, final LoadTableIndexSegment actual, final ExpectedLoadTableIndex expected) {
+ int count = 0;
+ for (PartitionSegment each : actual.getPartitions()) {
+ IdentifierValueAssert.assertIs(assertContext, each.getName(), expected.getPartitions().get(count), "Partition");
+ SQLSegmentAssert.assertIs(assertContext, each, expected.getPartitions().get(count));
+ count++;
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLAlterResourceGroupStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLAlterResourceGroupStatementAssert.java
new file mode 100644
index 00000000000..b563a08f515
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLAlterResourceGroupStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLAlterResourceGroupStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.AlterResourceGroupStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL alter resource group statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLAlterResourceGroupStatementAssert {
+
+ /**
+ * Assert alter resource group statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual alter resource group statement
+ * @param expected expected alter resource group statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLAlterResourceGroupStatement actual, final AlterResourceGroupStatementTestCase expected) {
+ assertNotNull("expected alter resource group should be not null", expected.getGroup());
+ assertThat(actual.getGroupName(), is(expected.getGroup().getName()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLBinlogStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLBinlogStatementAssert.java
new file mode 100644
index 00000000000..01f6432723f
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLBinlogStatementAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLBinlogStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.BinlogStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL binlog statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLBinlogStatementAssert {
+
+ /**
+ * Assert binlog statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual binlog statement
+ * @param expected expected binlog statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLBinlogStatement actual, final BinlogStatementTestCase expected) {
+ assertThat(assertContext.getText("Binlog statement context does not match: "), actual.getBase64Str(), is(expected.getBase64Str()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLChecksumTableStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLChecksumTableStatementAssert.java
new file mode 100644
index 00000000000..b6da97a420f
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLChecksumTableStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLChecksumTableStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ChecksumTableStatementTestCase;
+
+/**
+ * MySQL checksum table statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLChecksumTableStatementAssert {
+
+ /**
+ * Assert checksum table statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual checksum table statement
+ * @param expected expected checksum table statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLChecksumTableStatement actual, final ChecksumTableStatementTestCase expected) {
+ assertTables(assertContext, actual, expected);
+ }
+
+ private static void assertTables(final SQLCaseAssertContext assertContext, final MySQLChecksumTableStatement actual, final ChecksumTableStatementTestCase expected) {
+ TableAssert.assertIs(assertContext, actual.getTables(), expected.getTables());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLCreateResourceGroupStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLCreateResourceGroupStatementAssert.java
new file mode 100644
index 00000000000..84e0c3dd971
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLCreateResourceGroupStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLCreateResourceGroupStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.CreateResourceGroupStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL create resource group statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLCreateResourceGroupStatementAssert {
+
+ /**
+ * Assert create resource group statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual create resource group statement
+ * @param expected expected create resource group statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLCreateResourceGroupStatement actual, final CreateResourceGroupStatementTestCase expected) {
+ assertNotNull("expected create resource group should be not null", expected.getGroup());
+ assertThat(actual.getGroupName(), is(expected.getGroup().getName()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLDelimiterStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLDelimiterStatementAssert.java
new file mode 100644
index 00000000000..2125d320b83
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLDelimiterStatementAssert.java
@@ -0,0 +1,45 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLDelimiterStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.DelimiterStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * delimiter statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLDelimiterStatementAssert {
+
+ /**
+ * Assert delimiter index statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual delimiter statement
+ * @param expected expected delimiter statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLDelimiterStatement actual, final DelimiterStatementTestCase expected) {
+ assertThat(assertContext.getText("delimiter name assertion error: "), actual.getDelimiterName(), is(expected.getDelimiterName()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLDropResourceGroupStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLDropResourceGroupStatementAssert.java
new file mode 100644
index 00000000000..c352a2be23e
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLDropResourceGroupStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLDropResourceGroupStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.DropResourceGroupStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL drop resource group statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLDropResourceGroupStatementAssert {
+
+ /**
+ * Assert create resource group statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual create resource group statement
+ * @param expected expected create resource group statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLDropResourceGroupStatement actual, final DropResourceGroupStatementTestCase expected) {
+ assertNotNull("expected drop resource group should be not null", expected.getGroup());
+ assertThat(actual.getGroupName(), is(expected.getGroup().getName()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLOptimizeTableStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLOptimizeTableStatementAssert.java
new file mode 100644
index 00000000000..3cdbed1f8d1
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLOptimizeTableStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLOptimizeTableStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.OptimizeTableStatementTestCase;
+
+/**
+ * MySQL optimize table statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLOptimizeTableStatementAssert {
+
+ /**
+ * Assert optimize table statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual optimize table statement
+ * @param expected expected optimize table statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLOptimizeTableStatement actual, final OptimizeTableStatementTestCase expected) {
+ assertTables(assertContext, actual, expected);
+ }
+
+ private static void assertTables(final SQLCaseAssertContext assertContext, final MySQLOptimizeTableStatement actual, final OptimizeTableStatementTestCase expected) {
+ TableAssert.assertIs(assertContext, actual.getTables(), expected.getTables());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLRepairTableStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLRepairTableStatementAssert.java
new file mode 100644
index 00000000000..208055f475b
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLRepairTableStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLRepairTableStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.table.TableAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.RepairTableStatementTestCase;
+
+/**
+ * MySQL repair table statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLRepairTableStatementAssert {
+
+ /**
+ * Assert repair table statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual repair table statement
+ * @param expected expected repair table statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLRepairTableStatement actual, final RepairTableStatementTestCase expected) {
+ assertTables(assertContext, actual, expected);
+ }
+
+ private static void assertTables(final SQLCaseAssertContext assertContext, final MySQLRepairTableStatement actual, final RepairTableStatementTestCase expected) {
+ TableAssert.assertIs(assertContext, actual.getTables(), expected.getTables());
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLResetPersistStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLResetPersistStatementAssert.java
new file mode 100644
index 00000000000..81a959762a0
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLResetPersistStatementAssert.java
@@ -0,0 +1,48 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLResetPersistStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ResetPersistStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL reset persist statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLResetPersistStatementAssert {
+
+ /**
+ * Assert reset persist statement is correct with expected reset persist statement test case.
+ *
+ * @param assertContext assert context
+ * @param actual actual reset persist statement
+ * @param expected expected reset persist statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLResetPersistStatement actual, final ResetPersistStatementTestCase expected) {
+ assertThat(assertContext.getText("Actual reset persist exist clause does not match: "), actual.isIfExists(), is(expected.isIfExists()));
+ if (null != expected.getIdentifier()) {
+ assertThat(assertContext.getText("Actual reset persist identifier does not match: "), actual.getIdentifier().getValue(), is(expected.getIdentifier()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLResetStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLResetStatementAssert.java
new file mode 100644
index 00000000000..e08d2e0c7d8
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLResetStatementAssert.java
@@ -0,0 +1,79 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLResetStatement;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.ResetMasterOptionSegment;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.ResetOptionSegment;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.segment.ResetSlaveOptionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.segment.SQLSegmentAssert;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.segment.impl.reset.ExpectedResetOptionSegment;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.ResetStatementTestCase;
+
+import java.util.List;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL reset statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLResetStatementAssert {
+
+ /**
+ * Assert reset statement is correct with expected reset statement test case.
+ *
+ * @param assertContext assert context
+ * @param actual actual reset statement
+ * @param expected expected reset statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLResetStatement actual, final ResetStatementTestCase expected) {
+ assertThat(assertContext.getText("Actual options size assertion error: "), actual.getOptions().size(), is(expected.getOptions().size()));
+ assertOptions(assertContext, actual.getOptions(), expected.getOptions());
+ }
+
+ private static void assertOptions(final SQLCaseAssertContext assertContext, final List<ResetOptionSegment> actual, final List<ExpectedResetOptionSegment> expected) {
+ int i = 0;
+ for (ExpectedResetOptionSegment each : expected) {
+ SQLSegmentAssert.assertIs(assertContext, actual.get(i), each);
+ if (each.isMaster()) {
+ assertMasterOption(assertContext, (ResetMasterOptionSegment) actual.get(i), each);
+ } else {
+ assertSlaveOption(assertContext, (ResetSlaveOptionSegment) actual.get(i), each);
+ }
+ i++;
+ }
+ }
+
+ private static void assertMasterOption(final SQLCaseAssertContext assertContext, final ResetMasterOptionSegment actual, final ExpectedResetOptionSegment expected) {
+ if (null != expected.getBinaryLogFileIndexNumber()) {
+ assertThat(assertContext.getText("Actual reset master binlog index does not match: "), actual.getBinaryLogFileIndexNumber(), is(expected.getBinaryLogFileIndexNumber()));
+ }
+ }
+
+ private static void assertSlaveOption(final SQLCaseAssertContext assertContext, final ResetSlaveOptionSegment actual, final ExpectedResetOptionSegment expected) {
+ assertThat(assertContext.getText("Actual reset slave all does not match: "), actual.isAll(), is(expected.isAll()));
+ if (null != expected.getChannel()) {
+ assertThat(assertContext.getText("Actual reset slave channel does not match: "), actual.getChannelOption(), is(expected.getChannel()));
+ }
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLSetResourceGroupStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLSetResourceGroupStatementAssert.java
new file mode 100644
index 00000000000..3c6671deb3d
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLSetResourceGroupStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLSetResourceGroupStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.SetResourceGroupStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNotNull;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL set resource group statement assert.
+ */
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MySQLSetResourceGroupStatementAssert {
+
+ /**
+ * Assert set resource group statement is correct with expected parser result.
+ *
+ * @param assertContext assert context
+ * @param actual actual set resource group statement
+ * @param expected expected set resource group statement test case
+ */
+ public static void assertIs(final SQLCaseAssertContext assertContext, final MySQLSetResourceGroupStatement actual, final SetResourceGroupStatementTestCase expected) {
+ assertNotNull("expected set resource group should be not null", expected.getGroup());
+ assertThat(actual.getGroupName(), is(expected.getGroup().getName()));
+ }
+}
diff --git a/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLUseStatementAssert.java b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLUseStatementAssert.java
new file mode 100644
index 00000000000..0384609bb68
--- /dev/null
+++ b/test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/internal/asserts/statement/dal/impl/MySQLUseStatementAssert.java
@@ -0,0 +1,47 @@
+/*
+ * 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.internal.asserts.statement.dal.impl;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.dialect.statement.mysql.dal.MySQLUseStatement;
+import org.apache.shardingsphere.test.sql.parser.internal.asserts.SQLCaseAssertContext;
+import org.apache.shardingsphere.test.sql.parser.internal.jaxb.cases.domain.statement.dal.UseStatementTestCase;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+/**
+ * MySQL use statement assert.
... 83367 lines suppressed ...