SQL Rewrite Test
The rewrite tests are in the test folder under . Followings are the main part for rewrite tests:
- test engine
- assert data
Environment configuration is the yaml file under test type under test\resources\yaml
. The configuration file contains dataSources, shardingRule, encryptRule and other info. for example:
<rewrite-assertions yaml-rule="yaml/sharding/sharding-rule.yaml">
<input sql="CREATE INDEX index_name ON t_account ('status')" />
<output sql="CREATE INDEX index_name ON t_account_0 ('status')" />
<output sql="CREATE INDEX index_name ON t_account_1 ('status')" />
</rewrite-assertions>
After set up the assert data and environment configuration, rewrite test engine will assert the corresponding SQL without any Java code modification.