mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
32 lines
863 B
Java
32 lines
863 B
Java
package com.alibaba.druid.sql;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
import junit.framework.TestCase;
|
|
|
|
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlLexer;
|
|
import com.alibaba.druid.sql.parser.Keywords;
|
|
|
|
public class KeywordsTest extends TestCase {
|
|
|
|
public void test_sort() throws Exception {
|
|
List<String> list = new ArrayList<String>(MySqlLexer.DEFAULT_MYSQL_KEYWORDS.getKeywords().keySet());
|
|
|
|
Collections.sort(list);
|
|
|
|
int i = 0;
|
|
for (String item : list) {
|
|
if (Keywords.DEFAULT_KEYWORDS.getKeywords().containsKey(item)) {
|
|
continue;
|
|
}
|
|
if (i % 5 == 0) {
|
|
System.out.println();
|
|
}
|
|
System.out.println("map.put(\"" + item + "\", Token." + item + ");");
|
|
++i;
|
|
}
|
|
}
|
|
}
|