提交 63a72297 编写于 作者: H haocao

Refactor parser and integrate test cases from to do xml 20th.

上级 e89b2107
......@@ -75,15 +75,15 @@ public class ParserAssertHelper {
return result;
}
public static void assertSqlTokens(final List<TableToken> tableTokens, final List<SQLToken> actual) {
public static void assertSqlTokens(final List<TableToken> expected, final List<SQLToken> actual) {
// TODO add more sql tokens
if (null == tableTokens) {
if (null == expected) {
return;
}
Iterator<com.dangdang.ddframe.rdb.sharding.parsing.parser.token.TableToken> sqlTokenIterator = buildExpectedTableTokens(tableTokens).iterator();
Iterator<com.dangdang.ddframe.rdb.sharding.parsing.parser.token.TableToken> sqlTokenIterator = buildExpectedTableTokens(expected).iterator();
for (SQLToken each : actual) {
com.dangdang.ddframe.rdb.sharding.parsing.parser.token.TableToken expected = sqlTokenIterator.next();
assertTrue(new ReflectionEquals(expected).matches(each));
com.dangdang.ddframe.rdb.sharding.parsing.parser.token.TableToken tableToken = sqlTokenIterator.next();
assertTrue(new ReflectionEquals(tableToken).matches(each));
}
assertFalse(sqlTokenIterator.hasNext());
}
......
......@@ -20,6 +20,9 @@
<tables>
<table name="t_order" />
</tables>
<table-tokens>
<table-token begin-position="12" original-literals="t_order" />
</table-tokens>
<conditions>
<condition column-name="order_id" table-name="t_order" operator="EQUAL">
<value index="0" literal="1" type="int" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册