OmniSciDB  95562058bd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 11 of file UserMappingTest.java.

Constructor & Destructor Documentation

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

Definition at line 12 of file UserMappingTest.java.

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

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

Member Function Documentation

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

Definition at line 18 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 71 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 29 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 41 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 66 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 53 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 76 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:

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

Definition at line 87 of file UserMappingTest.java.

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

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

+ Here is the call graph for this function:


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