-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestBlock.java
More file actions
24 lines (18 loc) · 784 Bytes
/
Copy pathtestBlock.java
File metadata and controls
24 lines (18 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package db2;
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.TGSqlParser;
import gudusoft.gsqlparser.stmt.TCommonBlock;
import junit.framework.TestCase;
import static gudusoft.gsqlparser.ESqlStatementType.sstplsql_nullstmt;
public class testBlock extends TestCase {
public void test1(){
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvdb2);
sqlparser.sqltext = "BEGIN\n" +
" null;\n" +
"END;";
assertTrue(sqlparser.parse() == 0);
TCommonBlock block = (TCommonBlock)sqlparser.getSqlstatements().get(0);
assertTrue(block.getBodyStatements().size() == 1);
assertTrue(block.getBodyStatements().get(0).sqlstatementtype == sstplsql_nullstmt);
}
}