-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestOracle.java
More file actions
42 lines (37 loc) · 1.77 KB
/
Copy pathtestOracle.java
File metadata and controls
42 lines (37 loc) · 1.77 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
package gettablecolumn;
import demos.gettablecolumns.TGetTableColumn;
import gudusoft.gsqlparser.EDbVendor;
import junit.framework.TestCase;
public class testOracle extends TestCase {
static void doTest(String inputQuery, String desireResult){
TGetTableColumn getTableColumn = new TGetTableColumn(EDbVendor.dbvoracle);
getTableColumn.isConsole = false;
getTableColumn.showTableEffect = false;
getTableColumn.showColumnLocation = false;
getTableColumn.showTreeStructure = false;
getTableColumn.runText(inputQuery);
// System.out.println(getTableColumn.outList.toString().trim());
assertTrue(getTableColumn.outList.toString().trim().equalsIgnoreCase(desireResult));
}
public static void testInsertAll() {
doTest(" INSERT ALL\n" +
" WHEN id <= 3 THEN\n" +
" INTO dest_tab1 VALUES(id, description1)\n" +
" WHEN id BETWEEN 4 AND 7 THEN\n" +
" INTO dest_tab2 VALUES(id, description2)\n" +
" WHEN 1=1 THEN\n" +
" INTO dest_tab3 VALUES(id, description3)\n" +
"SELECT id, description1, description2,description3\n" +
"FROM source_tab;",
"Tables:\n" +
"dest_tab1\n" +
"dest_tab2\n" +
"dest_tab3\n" +
"source_tab\n" +
"\nFields:\n" +
"source_tab.description1\n" +
"source_tab.description2\n" +
"source_tab.description3\n" +
"source_tab.id");
}
}