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:

    1. <rewrite-assertions yaml-rule="yaml/sharding/sharding-rule.yaml">
    2. <input sql="CREATE INDEX index_name ON t_account ('status')" />
    3. <output sql="CREATE INDEX index_name ON t_account_0 ('status')" />
    4. <output sql="CREATE INDEX index_name ON t_account_1 ('status')" />
    5. </rewrite-assertions>

    After set up the assert data and environment configuration, rewrite test engine will assert the corresponding SQL without any Java code modification.