OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.parser.extension.ddl.UserMappingTest Class Reference
+ Inheritance diagram for com.mapd.parser.extension.ddl.UserMappingTest:
+ Collaboration diagram for com.mapd.parser.extension.ddl.UserMappingTest:

Public Member Functions

 UserMappingTest ()
 
void createUserMapping () throws Exception
 
void createUserMappingForCurrentUser () throws Exception
 
void createUserMappingForPublicUser () throws Exception
 
void createUserMappingWithIfNotExists () throws Exception
 
void createUserMappingNoWithClause () throws Exception
 
void createUserMappingEmptyOptions () throws Exception
 
void dropUserMapping () throws Exception
 
void dropUserMappingWithIfExists () throws Exception
 
- Public Member Functions inherited from com.mapd.parser.extension.ddl.DDLTest
void setup () throws Exception
 

Additional Inherited Members

- Protected Attributes inherited from com.mapd.parser.extension.ddl.DDLTest
String resourceDirPath
 
String jsonTestDir
 
- Static Protected Attributes inherited from com.mapd.parser.extension.ddl.DDLTest
static final Gson gson = new Gson()
 
- Package Functions inherited from com.mapd.parser.extension.ddl.DDLTest
TPlanResult processDdlCommand (final String ddlCommand) throws Exception
 
JsonObject getJsonFromFile (final String fileName) throws Exception
 

Detailed Description

Definition at line 12 of file UserMappingTest.java.

Constructor & Destructor Documentation

com.mapd.parser.extension.ddl.UserMappingTest.UserMappingTest ( )
inline

Definition at line 13 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.jsonTestDir, and com.mapd.parser.extension.ddl.DDLTest.resourceDirPath.

13  {
14  resourceDirPath = UserMappingTest.class.getClassLoader().getResource("").getPath();
15  jsonTestDir = "usermapping";
16  }

Member Function Documentation

void com.mapd.parser.extension.ddl.UserMappingTest.createUserMapping ( ) throws Exception
inline

Definition at line 19 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.getJsonFromFile(), com.mapd.parser.extension.ddl.DDLTest.processDdlCommand(), and run_benchmark_import.result.

19  {
20  final JsonObject expectedJsonObject = getJsonFromFile("create_user_mapping.json");
21  final TPlanResult result = processDdlCommand(
22  "CREATE USER MAPPING FOR test_user SERVER test_server WITH (attribute_1 = 'value_1', attribute_2 = 2);");
23  final JsonObject actualJsonObject =
24  gson.fromJson(result.plan_result, JsonObject.class);
25 
26  assertEquals(expectedJsonObject, actualJsonObject);
27  }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:51
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.UserMappingTest.createUserMappingEmptyOptions ( ) throws Exception
inline

Definition at line 72 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.processDdlCommand().

72  {
73  processDdlCommand("CREATE USER MAPPING FOR test_user SERVER test_server WITH ();");
74  }
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.UserMappingTest.createUserMappingForCurrentUser ( ) throws Exception
inline

Definition at line 30 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.getJsonFromFile(), com.mapd.parser.extension.ddl.DDLTest.processDdlCommand(), and run_benchmark_import.result.

30  {
31  final JsonObject expectedJsonObject =
32  getJsonFromFile("create_user_mapping_w_current_user.json");
33  final TPlanResult result = processDdlCommand(
34  "CREATE USER MAPPING FOR CURRENT_USER SERVER test_server WITH (attribute_1 = 'value_1', attribute_2 = 2);");
35  final JsonObject actualJsonObject =
36  gson.fromJson(result.plan_result, JsonObject.class);
37 
38  assertEquals(expectedJsonObject, actualJsonObject);
39  }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:51
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.UserMappingTest.createUserMappingForPublicUser ( ) throws Exception
inline

Definition at line 42 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.getJsonFromFile(), com.mapd.parser.extension.ddl.DDLTest.processDdlCommand(), and run_benchmark_import.result.

42  {
43  final JsonObject expectedJsonObject =
44  getJsonFromFile("create_user_mapping_w_public.json");
45  final TPlanResult result = processDdlCommand(
46  "CREATE USER MAPPING FOR PUBLIC SERVER test_server WITH (attribute_1 = 'value_1', attribute_2 = 2);");
47  final JsonObject actualJsonObject =
48  gson.fromJson(result.plan_result, JsonObject.class);
49 
50  assertEquals(expectedJsonObject, actualJsonObject);
51  }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:51
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.UserMappingTest.createUserMappingNoWithClause ( ) throws Exception
inline

Definition at line 67 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.processDdlCommand().

67  {
68  processDdlCommand("CREATE USER MAPPING FOR test_user SERVER test_server;");
69  }
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.UserMappingTest.createUserMappingWithIfNotExists ( ) throws Exception
inline

Definition at line 54 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.getJsonFromFile(), com.mapd.parser.extension.ddl.DDLTest.processDdlCommand(), and run_benchmark_import.result.

54  {
55  final JsonObject expectedJsonObject =
56  getJsonFromFile("create_user_mapping_w_if_not_exists.json");
57  final TPlanResult result = processDdlCommand(
58  "CREATE USER MAPPING IF NOT EXISTS FOR test_user SERVER test_server "
59  + "WITH (attribute_1 = 'value_1', attribute_2 = 2);");
60  final JsonObject actualJsonObject =
61  gson.fromJson(result.plan_result, JsonObject.class);
62 
63  assertEquals(expectedJsonObject, actualJsonObject);
64  }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:51
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.UserMappingTest.dropUserMapping ( ) throws Exception
inline

Definition at line 77 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.getJsonFromFile(), com.mapd.parser.extension.ddl.DDLTest.processDdlCommand(), and run_benchmark_import.result.

77  {
78  final JsonObject expectedJsonObject = getJsonFromFile("drop_user_mapping.json");
79  final TPlanResult result =
80  processDdlCommand("DROP USER MAPPING FOR test_user SERVER test_server;");
81  final JsonObject actualJsonObject =
82  gson.fromJson(result.plan_result, JsonObject.class);
83 
84  assertEquals(expectedJsonObject, actualJsonObject);
85  }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:51
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.UserMappingTest.dropUserMappingWithIfExists ( ) throws Exception
inline

Definition at line 88 of file UserMappingTest.java.

References com.mapd.parser.extension.ddl.DDLTest.getJsonFromFile(), com.mapd.parser.extension.ddl.DDLTest.processDdlCommand(), and run_benchmark_import.result.

88  {
89  final JsonObject expectedJsonObject =
90  getJsonFromFile("drop_user_mapping_w_if_exists.json");
91  final TPlanResult result = processDdlCommand(
92  "DROP USER MAPPING IF EXISTS FOR test_user SERVER test_server;");
93  final JsonObject actualJsonObject =
94  gson.fromJson(result.plan_result, JsonObject.class);
95 
96  assertEquals(expectedJsonObject, actualJsonObject);
97  }
JsonObject getJsonFromFile(final String fileName)
Definition: DDLTest.java:51
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:35

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: