From 5f10bfa1c0499a535633b5038a231173c974cf7c Mon Sep 17 00:00:00 2001 From: sahilkapoor301992 Date: Sat, 20 Nov 2021 18:32:07 +0530 Subject: [PATCH 01/22] ODP Changes --- pom.xml | 142 +++++++ src/e2e-test/features/DemoGcs.feature | 20 + src/e2e-test/features/DesignTimeODP.feature | 75 ++++ .../features/DesignTimeODPError.feature | 177 +++++++++ .../features/LoadAndDirectConn.feature | 24 ++ src/e2e-test/features/RuntimeODP.feature | 236 +++++++++++ src/e2e-test/features/SecureODP.feature | 69 ++++ .../cdap/plugin/odp/actions/ODPActions.java | 123 ++++++ .../cdap/plugin/odp/actions/package-info.java | 4 + .../io/cdap/plugin/odp/lib/libsapjco3.jnilib | Bin 0 -> 4848184 bytes .../java/io/cdap/plugin/odp/lib/libsapjco3.so | Bin 0 -> 5394442 bytes .../cdap/plugin/odp/locators/ODPLocators.java | 134 +++++++ .../plugin/odp/locators/package-info.java | 4 + .../plugin/odp/stepsdesign/DesginTimeODP.java | 123 ++++++ .../odp/stepsdesign/DesignTimeODPError.java | 111 ++++++ .../plugin/odp/stepsdesign/RuntimeODP.java | 367 ++++++++++++++++++ .../cdap/plugin/odp/stepsdesign/Security.java | 190 +++++++++ .../plugin/odp/stepsdesign/package-info.java | 6 + .../plugin/odp/tests/runner/TestRunner.java | 36 ++ .../plugin/odp/tests/runner/package-info.java | 6 + .../mandate/TestRunnerMand.java | 36 ++ .../runneroptional/mandate/package-info.java | 6 + .../runneroptional/optional/PropModifier.java | 34 ++ .../optional/TestRunnerOpt.java | 38 ++ .../runneroptional/optional/package-info.java | 6 + .../io/cdap/plugin/odp/utils/CDAPUtils.java | 47 +++ .../cdap/plugin/odp/utils/package-info.java | 4 + .../Google_SAP_Connection.properties | 9 + .../resources/PluginParameters.properties | 42 ++ .../optional_odploadconnect.properties | 3 + .../resources/error_message.properties | 20 + 31 files changed, 2092 insertions(+) create mode 100644 src/e2e-test/features/DemoGcs.feature create mode 100644 src/e2e-test/features/DesignTimeODP.feature create mode 100644 src/e2e-test/features/DesignTimeODPError.feature create mode 100644 src/e2e-test/features/LoadAndDirectConn.feature create mode 100644 src/e2e-test/features/RuntimeODP.feature create mode 100644 src/e2e-test/features/SecureODP.feature create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/actions/ODPActions.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/actions/package-info.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/lib/libsapjco3.jnilib create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/lib/libsapjco3.so create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/locators/ODPLocators.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/locators/package-info.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/stepsdesign/DesginTimeODP.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/stepsdesign/DesignTimeODPError.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/stepsdesign/RuntimeODP.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/stepsdesign/Security.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/stepsdesign/package-info.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/tests/runner/TestRunner.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/tests/runner/package-info.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/tests/runneroptional/mandate/TestRunnerMand.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/tests/runneroptional/mandate/package-info.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/tests/runneroptional/optional/PropModifier.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/tests/runneroptional/optional/TestRunnerOpt.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/tests/runneroptional/optional/package-info.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/utils/CDAPUtils.java create mode 100644 src/e2e-test/java/io/cdap/plugin/odp/utils/package-info.java create mode 100644 src/e2e-test/resources/Google_SAP_Connection.properties create mode 100644 src/e2e-test/resources/PluginParameters.properties create mode 100644 src/e2e-test/resources/additional/optional_odploadconnect.properties create mode 100644 src/e2e-test/resources/error_message.properties diff --git a/pom.xml b/pom.xml index 8c11ef8..7f69449 100644 --- a/pom.xml +++ b/pom.xml @@ -88,6 +88,7 @@ 4.6.0 2.0.11 1.49 + ${project.basedir}/src/test/java/ @@ -138,6 +139,11 @@ ${cdap.version} provided + + com.google.guava + guava + 31.0.1-jre + io.cdap.cdap cdap-formats @@ -333,6 +339,7 @@ + ${testSourceLocation} @@ -450,6 +457,10 @@ true true true + + src/test/java + src/e2e-test/java + **/org/apache/cassandra/**,**/org/apache/hadoop/** @@ -510,6 +521,137 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.14.1 + + -Xmx512m + + ${project.build.directory} + + + **/*TestSuite.java + **/Test*.java + **/*Test.java + **/*TestCase.java + + + + + + + + e2e-tests + + src/e2e-test/java + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.18.1 + + true + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.0.0-M5 + + + TestRunner.java, TestRunnerMand.java, TestRunnerOpt.java + + + + + + integration-test + + + + + + + net.masterthought + maven-cucumber-reporting + 5.5.0 + + + + execution + verify + + generate + + + Cucumber Reports + target/cucumber-reports/advanced-reports + 1 + false + ${project.build.directory}/cucumber-reports + + **/*.json + + ${project.build.directory}/cucumber-reports + true + + + + + + + + + + io.cdap.tests.e2e + cdap-e2e-framework + 0.0.1-SNAPSHOT + test + + + org.ehcache + ehcache + 3.8.1 + + + com.sap.conn.jco + sapjco3 + 3.0.14 + system + ${basedir}/src/e2e-test/java/io/cdap/plugin/odp/lib/sapjco3.jar + + + com.sap.conn.idoc + sapidoc3 + 3.0.12 + system + ${basedir}/src/e2e-test/java/io/cdap/plugin/odp/lib/sapidoc3.jar + + + com.google.adaptor + cs + 0.0.1 + system + ${basedir}/src/e2e-test/java/io/cdap/plugin/odp/lib/com.google.adapter.cs-0.0.1.jar + + + + + diff --git a/src/e2e-test/features/DemoGcs.feature b/src/e2e-test/features/DemoGcs.feature new file mode 100644 index 0000000..ecb1528 --- /dev/null +++ b/src/e2e-test/features/DemoGcs.feature @@ -0,0 +1,20 @@ +Feature: Demo1 + + @TC-Demo-1 + Scenario: User is able to Login and confirm data is getting transferred from GCS to BigQuery + Given Open Datafusion Project to configure pipeline + When Source is GCS bucket + When Target is BigQuery + Then Link Source and Sink to establish connection + Then Enter the GCS Properties with "@TC-Demo-1_GCS" GCS bucket + Then Close the GCS Properties + Then Enter the BigQuery Properties for table "tableDemo" + Then Close the BigQuery Properties + Then Save and Deploy Pipeline + Then Run the Pipeline in Runtime + Then Wait till pipeline is in running state + Then Open Logs + Then Verify the pipeline status is "Succeeded" + Then validate successMessage is displayed + Then Get Count of no of records transferred to BigQuery in "tableDemo" + Then Delete the table "tableDemo" diff --git a/src/e2e-test/features/DesignTimeODP.feature b/src/e2e-test/features/DesignTimeODP.feature new file mode 100644 index 0000000..ef4706b --- /dev/null +++ b/src/e2e-test/features/DesignTimeODP.feature @@ -0,0 +1,75 @@ +Feature: Design Time ODP Scenario + + @ODP @DesignTime-TC-ODP-DSGN-01(Direct) + Scenario:User configured direct connection parameters and Security parameters by providing values on SAP UI(ENV) + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then Connection is established + + @ODP @DesignTime-TC-ODP-DSGN-01(LOAD) + Scenario:User configured Load connection parameters and Security parameters by providing values on SAP UI(ENV) + Given Open CDF application to configure pipeline + When Source is SAP ODP + When LoadProp "S4client" "S4asHost" "S4msServ" "S4systemID" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" "S4Lgrp" + When Username and Password is provided + Then Connection is established + + @ODP @DesignTime-TC-ODP-DSGN-01.02 + Scenario: User is able to configure Security parameters using macros in direct connection + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + When User has selected Sap client macro to configure + Then User is validate without any error + When User has selected Sap language macro to configure + Then User is validate without any error + When User has selected Sap server as host macro to configure + Then User is validate without any error + When User has selected System Number macro to configure + Then User is validate without any error + When User has selected datasource macro to configure + Then User is validate without any error + When User has selected gcsPath macro to configure + Then User is validate without any error + + @ODP @DesignTime-TC-ODP-DSGN-01.05 + Scenario: User is able to configure Security parameters using macros in load connection + Given Open CDF application to configure pipeline + When Source is SAP ODP + When LoadProp "S4client" "S4msHost" "S4msServ" "S4systemID" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" "S4Lgrp" + When Username and Password is provided + When User has selected Sap msHost macro to configure + Then User is validate without any error + When User has selected Sap msServ macro to configure + Then User is validate without any error + When User has selected UserName and Password macro to configure + Then User is validate without any error + + @ODP @DesignTime-TC-ODP-DSGN-05.01 + Scenario:User is able to get the schema of the datasources supporting all the datatype + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "dsAllDataType" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then Validate the Schema created + + + @ODP @DesignTime-TC-ODP-DSGN-09.01 + Scenario Outline: User is able to get the schema of the SAP Datasource + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + When data source as "" is added + Then Validate the Schema created + Examples: + |datasource| + |2LIS_02_ITM| + |2LIS_11_VAITM| + |0MATERIAL_LPRH_HIER| + + + diff --git a/src/e2e-test/features/DesignTimeODPError.feature b/src/e2e-test/features/DesignTimeODPError.feature new file mode 100644 index 0000000..8c7da89 --- /dev/null +++ b/src/e2e-test/features/DesignTimeODPError.feature @@ -0,0 +1,177 @@ +Feature: User has entered all the details of the connection with below mentioned wrong parameter + and by pressing validate button all the parameters are validated and error is thrown. + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty referenceName parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + Then "referenceName" as "" and getting "noRefName" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty client parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + Then "jco.client.client" as "" and getting "noJcoClient" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty lang parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then "jco.client.lang" as "" and getting "noJcoLang" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty ashost parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then "jco.client.ashost" as "" and getting "sapAppServerHostRequired" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty sysnr parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then "jco.client.sysnr" as "" and getting "sapSystemNumberRequired" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty sapSourceObjName parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then "sapSourceObjName" as "" and getting "noSapSource" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty user parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then "jco.client.user" as "" and getting "noJcoUser" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if empty gcsPath parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then "gcsPath" as "" and getting "noGcsPath" + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if wrong client parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then User is able to set parameter "jco.client.client" as "abc" and getting "wrongJcoCLientConfig" for wrong input + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if wrong lang parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then User is able to set parameter "jco.client.lang" as "Eq" and getting "wrongLogonLang" for wrong input + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if wrong ashost parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then User is able to set parameter "jco.client.ashost" as "10.132.0.300" and getting "sapgatewayFailure" for wrong input + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if wrong user parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then User is able to set parameter "jco.client.user" as "invalid" and getting "wrongCreds" for wrong input + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario: User is able to view error messages if wrong gcs parameter is provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then User is able to set parameter "gcsPath" as "gs://invalid" and getting "missingBillingAc" for wrong input + Then User is able to validate the validate the error + Then User is able to validate the text box is highlighted + + @DesignTime-TC-ODP-DSGN-03.02 + Scenario Outline: User is able to view error messages if wrong advanced options are provided + Given Open CDF application to configure pipeline + When Source is SAP ODP + When Configure Direct Connection "S4client" "S4sysnr" "S4asHost" "S4dsName" "S4gcsPath" "S4Splitrow" "S4pkgSize" + When Username and Password is provided + Then User is able to set parameter