-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestXML.java
More file actions
43 lines (36 loc) · 1.59 KB
/
Copy pathtestXML.java
File metadata and controls
43 lines (36 loc) · 1.59 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
package test;
import demos.visitors.xmlVisitor;
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.TGSqlParser;
import junit.framework.TestCase;
public class testXML extends TestCase {
String xsdfile = "file:/C:/prg/gsp_java/library/doc/xml/sqlquery.xsd";
void toXmlFiles(EDbVendor db, String dir) throws Exception {
TGSqlParser sqlparser = new TGSqlParser(db);
test.SqlFileList sqlfiles = new test.SqlFileList(dir,true);
for(int k=0;k < sqlfiles.sqlfiles.size();k++){
sqlparser.sqlfilename = sqlfiles.sqlfiles.get(k).toString();
//System.out.println(sqlparser.sqlfilename);
try{
boolean b = sqlparser.parse() == 0;
assertTrue(sqlparser.sqlfilename+"\n"+sqlparser.getErrormessage(),b);
if (b){
xmlVisitor xv2 = new xmlVisitor(xsdfile);
xv2.run(sqlparser);
//xv2.validXml();
}
}catch (Exception e){
System.out.println("testXML error:"+e.getMessage()+" "+ sqlparser.sqlfilename);
throw e;
}
}
}
public void testSQLServer() throws Exception {
toXmlFiles(EDbVendor.dbvmssql, "c:/prg/gsqlparser/Test/TestCases/mssql");
toXmlFiles(EDbVendor.dbvmssql, "c:/prg/gsqlparser/Test/TestCases/java/mssql");
}
public void testOracle() throws Exception {
toXmlFiles(EDbVendor.dbvoracle, "c:/prg/gsqlparser/Test/TestCases/oracle");
toXmlFiles(EDbVendor.dbvoracle, "c:/prg/gsqlparser/Test/TestCases/java/oracle");
}
}