-
Notifications
You must be signed in to change notification settings - Fork 34
e2e tests Oracle source #535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ | |
| package io.cdap.plugin.common.stepsdesign; | ||
|
|
||
| import com.google.cloud.bigquery.BigQueryException; | ||
| import io.cdap.e2e.pages.actions.CdfConnectionActions; | ||
| import io.cdap.e2e.pages.actions.CdfPluginPropertiesActions; | ||
| import io.cdap.e2e.utils.BigQueryClient; | ||
| import io.cdap.e2e.utils.PluginPropertyUtils; | ||
| import io.cdap.plugin.OracleClient; | ||
|
|
@@ -48,8 +50,10 @@ public static void setTableName() { | |
| PluginPropertyUtils.addPluginProp("sourceTable", sourceTableName); | ||
| PluginPropertyUtils.addPluginProp("targetTable", targetTableName); | ||
| String schema = PluginPropertyUtils.pluginProp("schema"); | ||
| PluginPropertyUtils.addPluginProp("selectQuery", String.format("select * from %s.%s", schema, | ||
| sourceTableName)); | ||
| PluginPropertyUtils.addPluginProp("selectQuery", String.format("select * from %s.%s " | ||
| + "WHERE $CONDITIONS", schema, sourceTableName)); | ||
| PluginPropertyUtils.addPluginProp("boundingQuery", String.format("select MIN(ID),MAX(ID)" | ||
| + " from %s.%s", schema, sourceTableName)); | ||
| } | ||
|
|
||
| @Before(order = 2, value = "@ORACLE_SOURCE_TEST") | ||
|
|
@@ -416,4 +420,25 @@ public static void dropOracleTargetDateTable() throws SQLException, ClassNotFoun | |
| BeforeActions.scenario.write("Oracle Target Table - " + PluginPropertyUtils.pluginProp("targetTable") | ||
| + " deleted successfully"); | ||
| } | ||
|
|
||
| @Before(order = 1, value = "@CONNECTION") | ||
| public static void setNewConnectionName() { | ||
| String connectionName = "Oracle" + RandomStringUtils.randomAlphanumeric(10); | ||
|
Comment on lines
+424
to
+426
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a common class, we should take connectionPrefix as parameterized, it would not necessary be
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are having different TestSetupHooks class file for different database plugins. For each database plugin we are using according to the plugin name. |
||
| PluginPropertyUtils.addPluginProp("connection.name", connectionName); | ||
| BeforeActions.scenario.write("New Connection name: " + connectionName); | ||
| } | ||
|
|
||
| private static void deleteConnection(String connectionType, String connectionName) throws IOException { | ||
| CdfConnectionActions.openWranglerConnectionsPage(); | ||
| CdfConnectionActions.expandConnections(connectionType); | ||
| CdfConnectionActions.openConnectionActionMenu(connectionType, connectionName); | ||
| CdfConnectionActions.selectConnectionAction(connectionType, connectionName, "Delete"); | ||
| CdfPluginPropertiesActions.clickPluginPropertyButton("Delete"); | ||
| } | ||
|
|
||
| @After(order = 1, value = "@CONNECTION") | ||
| public static void deleteBQConnection() throws IOException { | ||
| deleteConnection("Oracle", "connection.name"); | ||
| PluginPropertyUtils.removePluginProp("connection.name"); | ||
itsankit-google marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.