-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestTableNull.java
More file actions
51 lines (40 loc) · 1.29 KB
/
Copy pathtestTableNull.java
File metadata and controls
51 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package test;
import junit.framework.TestCase;
import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
import gudusoft.gsqlparser.nodes.TTable;
import gudusoft.gsqlparser.TGSqlParser;
import gudusoft.gsqlparser.EDbVendor;
public class testTableNull extends TestCase {
public static void testTableNull()
{
String dir = "c:\\prg\\gsqlparser\\Test\\TestCases\\oracle";
int ret;
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvoracle);
SqlFileList sqlfiles = new SqlFileList(dir);
for(int k=0;k < sqlfiles.sqlfiles.size()-1;k++){
sqlparser.sqlfilename = sqlfiles.sqlfiles.get(k).toString();
ret = sqlparser.parse();
if (ret == 0){
searchVisitor sv = new searchVisitor();
sqlparser.sqlstatements.accept(sv);
assertTrue(!sv.isFound());
if (sv.isFound()) {
System.out.println(sqlparser.sqlfilename);
}
}
}
}
}
class searchVisitor extends TParseTreeVisitor {
private boolean found = false;
public boolean isFound() {
return found;
}
public searchVisitor(){
}
public void preVisit(TTable node){
if (node.toString() == null){
found = true;
}
}
}