-
Notifications
You must be signed in to change notification settings - Fork 32
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
e2e tests Oracle source #535
base: develop
Are you sure you want to change the base?
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
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 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"); | ||
Comment on lines
+439
to
+442
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. similar comment here 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. Hence using the database plugin name for different database plugin connections. |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why
useConnection
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here verifying the error message displayed on header as in-line error is already covered in mandatory fields use case.