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

Public Member Functions

 ForeignServerTest ()
 
void AlterServerSetDataWrapper () throws Exception
 
void AlterServerSetOptions () throws Exception
 
void AlterServerChangeOwner () throws Exception
 
void AlterServerRenameServer () throws Exception
 
void CreateServerDdlCommand () throws Exception
 
void CreateServerDdlCommandWithIfNotExists () throws Exception
 
void DropServerDdlCommand () throws Exception
 
void DropServerDdlCommandWithIfExists () throws Exception
 
void ShowForeignServers () throws Exception
 
void ShowForeignServersWhere () throws Exception
 
void ShowForeignServersLike () throws Exception
 
void ShowForeignServersLikeAnd () throws Exception
 
void ShowForeignServersEqOr () throws Exception
 
void ShowForeignServersLikeAndLikeOrEq () 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 ForeignServerTest.java.

Constructor & Destructor Documentation

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

Definition at line 13 of file ForeignServerTest.java.

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

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

Member Function Documentation

void com.mapd.parser.extension.ddl.ForeignServerTest.AlterServerChangeOwner ( ) throws Exception
inline

Definition at line 43 of file ForeignServerTest.java.

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

43  {
44  final JsonObject expectedJsonObject =
45  getJsonFromFile("alter_foreign_server_change_owner.json");
46  final TPlanResult result =
47  processDdlCommand("ALTER SERVER my_csv_server OWNER TO Joe;");
48  final JsonObject actualJsonObject =
49  gson.fromJson(result.plan_result, JsonObject.class);
50 
51  assertEquals(expectedJsonObject, actualJsonObject);
52  }
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.ForeignServerTest.AlterServerRenameServer ( ) throws Exception
inline

Definition at line 55 of file ForeignServerTest.java.

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

55  {
56  final JsonObject expectedJsonObject =
57  getJsonFromFile("alter_foreign_server_rename_server.json");
58  final TPlanResult result =
59  processDdlCommand("ALTER SERVER my_csv_server RENAME TO my_new_csv_server;");
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:37
TPlanResult processDdlCommand(final String ddlCommand)
Definition: DDLTest.java:32

+ Here is the call graph for this function:

void com.mapd.parser.extension.ddl.ForeignServerTest.AlterServerSetDataWrapper ( ) throws Exception
inline

Definition at line 19 of file ForeignServerTest.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 =
21  getJsonFromFile("alter_foreign_server_set_data_wrapper_csv.json");
22  final TPlanResult result = processDdlCommand(
23  "ALTER SERVER test_server SET FOREIGN DATA WRAPPER OMNISCI_CSV;");
24  final JsonObject actualJsonObject =
25  gson.fromJson(result.plan_result, JsonObject.class);
26 
27  assertEquals(expectedJsonObject, actualJsonObject);
28  }
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.ForeignServerTest.AlterServerSetOptions ( ) throws Exception
inline

Definition at line 31 of file ForeignServerTest.java.

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

31  {
32  final JsonObject expectedJsonObject =
33  getJsonFromFile("alter_foreign_server_set_options.json");
34  final TPlanResult result = processDdlCommand(
35  "ALTER SERVER my_csv_server WITH (base_path = '/home/my_user/data/new-csv/');");
36  final JsonObject actualJsonObject =
37  gson.fromJson(result.plan_result, JsonObject.class);
38 
39  assertEquals(expectedJsonObject, actualJsonObject);
40  }
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.ForeignServerTest.CreateServerDdlCommand ( ) throws Exception
inline

Definition at line 67 of file ForeignServerTest.java.

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

67  {
68  final JsonObject expectedJsonObject = getJsonFromFile("create_foreign_server.json");
69  final TPlanResult result = processDdlCommand(
70  "CREATE SERVER test_server FOREIGN DATA WRAPPER test_data_wrapper "
71  + "WITH (attribute_1 = 'value_1', attribute_2 = 2);");
72  final JsonObject actualJsonObject =
73  gson.fromJson(result.plan_result, JsonObject.class);
74 
75  assertEquals(expectedJsonObject, actualJsonObject);
76  }
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.ForeignServerTest.CreateServerDdlCommandWithIfNotExists ( ) throws Exception
inline

Definition at line 79 of file ForeignServerTest.java.

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

79  {
80  final JsonObject expectedJsonObject =
81  getJsonFromFile("create_foreign_server_w_if_not_exists.json");
82  final TPlanResult result = processDdlCommand(
83  "CREATE SERVER IF NOT EXISTS test_server FOREIGN DATA WRAPPER test_data_wrapper "
84  + "WITH (attribute_1 = 'value_1', attribute_2 = 2);");
85  final JsonObject actualJsonObject =
86  gson.fromJson(result.plan_result, JsonObject.class);
87 
88  assertEquals(expectedJsonObject, actualJsonObject);
89  }
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.ForeignServerTest.DropServerDdlCommand ( ) throws Exception
inline

Definition at line 92 of file ForeignServerTest.java.

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

92  {
93  final JsonObject expectedJsonObject = getJsonFromFile("drop_foreign_server.json");
94  final TPlanResult result = processDdlCommand("DROP SERVER test_server;");
95  final JsonObject actualJsonObject =
96  gson.fromJson(result.plan_result, JsonObject.class);
97 
98  assertEquals(expectedJsonObject, actualJsonObject);
99  }
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.ForeignServerTest.DropServerDdlCommandWithIfExists ( ) throws Exception
inline

Definition at line 102 of file ForeignServerTest.java.

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

102  {
103  final JsonObject expectedJsonObject =
104  getJsonFromFile("drop_foreign_server_w_if_exists.json");
105  final TPlanResult result = processDdlCommand("DROP SERVER IF EXISTS test_server;");
106  final JsonObject actualJsonObject =
107  gson.fromJson(result.plan_result, JsonObject.class);
108 
109  assertEquals(expectedJsonObject, actualJsonObject);
110  }
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.ForeignServerTest.ShowForeignServers ( ) throws Exception
inline

Definition at line 113 of file ForeignServerTest.java.

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

113  {
114  final JsonObject expectedJsonObject = getJsonFromFile("show_foreign_server.json");
115  final TPlanResult result = processDdlCommand("SHOW SERVERS;");
116  final JsonObject actualJsonObject =
117  gson.fromJson(result.plan_result, JsonObject.class);
118  assertEquals(expectedJsonObject, actualJsonObject);
119  }
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.ForeignServerTest.ShowForeignServersEqOr ( ) throws Exception
inline

Definition at line 153 of file ForeignServerTest.java.

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

153  {
154  final JsonObject expectedJsonObject =
155  getJsonFromFile("show_foreign_server_eq_or.json");
156  final TPlanResult result = processDdlCommand(
157  "SHOW SERVERS WHERE data_wrapper LIKE 'omnisci_%' OR data_wrapper = 'test';");
158  final JsonObject actualJsonObject =
159  gson.fromJson(result.plan_result, JsonObject.class);
160  assertEquals(expectedJsonObject, actualJsonObject);
161  }
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.ForeignServerTest.ShowForeignServersLike ( ) throws Exception
inline

Definition at line 131 of file ForeignServerTest.java.

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

131  {
132  final JsonObject expectedJsonObject =
133  getJsonFromFile("show_foreign_server_like.json");
134  final TPlanResult result =
135  processDdlCommand("SHOW SERVERS WHERE data_wrapper LIKE 'omnisci_%';");
136  final JsonObject actualJsonObject =
137  gson.fromJson(result.plan_result, JsonObject.class);
138  assertEquals(expectedJsonObject, actualJsonObject);
139  }
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.ForeignServerTest.ShowForeignServersLikeAnd ( ) throws Exception
inline

Definition at line 142 of file ForeignServerTest.java.

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

142  {
143  final JsonObject expectedJsonObject =
144  getJsonFromFile("show_foreign_server_like_and.json");
145  final TPlanResult result = processDdlCommand(
146  "SHOW SERVERS WHERE data_wrapper LIKE 'omnisci_%' AND data_wrapper LIKE '%_csv';");
147  final JsonObject actualJsonObject =
148  gson.fromJson(result.plan_result, JsonObject.class);
149  assertEquals(expectedJsonObject, actualJsonObject);
150  }
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.ForeignServerTest.ShowForeignServersLikeAndLikeOrEq ( ) throws Exception
inline

Definition at line 164 of file ForeignServerTest.java.

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

164  {
165  final JsonObject expectedJsonObject =
166  getJsonFromFile("show_foreign_server_like_and_like_or_eq.json");
167  final TPlanResult result = processDdlCommand(
168  "SHOW SERVERS WHERE data_wrapper LIKE 'omnisci_%' AND created_at LIKE '2020%' OR data_wrapper = 'test';");
169  final JsonObject actualJsonObject =
170  gson.fromJson(result.plan_result, JsonObject.class);
171  assertEquals(expectedJsonObject, actualJsonObject);
172  }
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.ForeignServerTest.ShowForeignServersWhere ( ) throws Exception
inline

Definition at line 121 of file ForeignServerTest.java.

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

121  {
122  final JsonObject expectedJsonObject =
123  getJsonFromFile("show_foreign_server_where.json");
124  final TPlanResult result =
125  processDdlCommand("SHOW SERVERS WHERE data_wrapper = 'omnisci_csv';");
126  final JsonObject actualJsonObject =
127  gson.fromJson(result.plan_result, JsonObject.class);
128  assertEquals(expectedJsonObject, actualJsonObject);
129  }
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: