-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtestCreateGroup.java
More file actions
21 lines (17 loc) · 924 Bytes
/
Copy pathtestCreateGroup.java
File metadata and controls
21 lines (17 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package test.redshift;
import gudusoft.gsqlparser.EDbVendor;
import gudusoft.gsqlparser.ESqlStatementType;
import gudusoft.gsqlparser.TGSqlParser;
import gudusoft.gsqlparser.stmt.redshift.TRedshiftCreateGroup;
import junit.framework.TestCase;
public class testCreateGroup extends TestCase {
public void testTable() {
TGSqlParser sqlparser = new TGSqlParser(EDbVendor.dbvredshift);
sqlparser.sqltext = "create group admin_group with user admin;";
assertTrue(sqlparser.parse() == 0);
assertTrue(sqlparser.sqlstatements.get(0).sqlstatementtype == ESqlStatementType.sstredshiftCreateGroup);
TRedshiftCreateGroup createGroup = (TRedshiftCreateGroup) sqlparser.sqlstatements.get(0);
assertTrue(createGroup.getGroupName().toString().equalsIgnoreCase("admin_group"));
assertTrue(createGroup.getUserList().getObjectName(0).toString().equalsIgnoreCase("admin"));
}
}