format code

git-svn-id: http://code.alibabatech.com/svn/druid/trunk@527 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
wenshao
2011-08-01 19:45:46 +00:00
parent a803236cfa
commit c270d3f308
161 changed files with 3709 additions and 2349 deletions
@@ -9,7 +9,8 @@ import com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser;
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleOutputVisitor;
public class CommentTest extends TestCase {
public void test_0 () throws Exception {
public void test_0() throws Exception {
String sql = "SELECT /*mark for picman*/ * FROM WP_ALBUM WHERE MEMBER_ID = ? AND ID IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
Lexer lexer = new Lexer(sql);
@@ -20,7 +21,7 @@ public class CommentTest extends TestCase {
if (tok == Token.IDENTIFIER) {
System.out.println(tok.name() + "\t\t" + lexer.stringVal());
} else if (tok == Token.MULTI_LINE_COMMENT) {
System.out.println(tok.name() + "\t\t" + lexer.stringVal());
System.out.println(tok.name() + "\t\t" + lexer.stringVal());
} else {
System.out.println(tok.name() + "\t\t\t" + tok.name);
}
@@ -30,8 +31,8 @@ public class CommentTest extends TestCase {
}
}
}
public void test_1 () throws Exception {
public void test_1() throws Exception {
String sql = "SELECT /*mark for picman*/ * FROM WP_ALBUM WHERE MEMBER_ID = ? AND ID IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
StringBuilder out = new StringBuilder();
@@ -21,7 +21,7 @@ public class PerfTest extends TestCase {
// perf("SELECT * FROM my_table WHERE TRUNC(SYSDATE) = DATE '2002-10-03';");
perfOracle("SELECT * FROM T");
perfMySql("SELECT * FROM T");
//perf(loadSql("bvt/parser/oracle-23.txt"));
// perf(loadSql("bvt/parser/oracle-23.txt"));
}
}
@@ -44,7 +44,7 @@ public class PerfTest extends TestCase {
long millis = System.currentTimeMillis() - startMillis;
System.out.println("Oracle\t" + millis);
}
void perfMySql(String sql) {
long startMillis = System.currentTimeMillis();
for (int i = 0; i < 1000 * 1000; ++i) {
@@ -51,6 +51,7 @@ public class SQLMergeTest extends TestCase {
private String merge() {
StringBuilder out = new StringBuilder();
OracleOutputVisitor visitor = new OracleOutputVisitor(out) {
public boolean visit(SQLInListExpr x) {
x.getExpr().accept(this);