OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 13 of file ForeignServerTest.java.

Constructor & Destructor Documentation

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

Definition at line 14 of file ForeignServerTest.java.

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

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

Member Function Documentation

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

Definition at line 44 of file ForeignServerTest.java.

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

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

Definition at line 56 of file ForeignServerTest.java.

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

56  {
57  final JsonObject expectedJsonObject =
58  getJsonFromFile("alter_foreign_server_rename_server.json");
59  final TPlanResult result =
60  processDdlCommand("ALTER SERVER my_csv_server RENAME TO my_new_csv_server;");
61  final JsonObject actualJsonObject =
62  gson.fromJson(result.plan_result, JsonObject.class);
63 
64  assertEquals(expectedJsonObject, actualJsonObject);
65  }
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.ForeignServerTest.AlterServerSetDataWrapper ( ) throws Exception
inline

Definition at line 20 of file ForeignServerTest.java.

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

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

Definition at line 32 of file ForeignServerTest.java.

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

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

Definition at line 68 of file ForeignServerTest.java.

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

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

Definition at line 80 of file ForeignServerTest.java.

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

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

Definition at line 93 of file ForeignServerTest.java.

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

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

Definition at line 103 of file ForeignServerTest.java.

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

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

Definition at line 114 of file ForeignServerTest.java.

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

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

Definition at line 156 of file ForeignServerTest.java.

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

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

Definition at line 134 of file ForeignServerTest.java.

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

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

Definition at line 145 of file ForeignServerTest.java.

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

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

Definition at line 167 of file ForeignServerTest.java.

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

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

Definition at line 123 of file ForeignServerTest.java.

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

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