forked from cdapio/hydrator-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
405 additions
and
0 deletions.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
core-plugins/src/e2e-test/features/xmlReader/XmlReader.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Copyright © 2024 Cask Data, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
|
||
@XmlReader_Source | ||
Feature:File Sink - Verification of XmlReader plugin to File successful data transfer | ||
|
||
@XmlReader_Source_Required @XMLREADER_TEST @FILE_SINK_TEST | ||
Scenario: To verify data is getting transferred from XmlReader to File sink | ||
Given Open Datafusion Project to configure pipeline | ||
When Select plugin: "XML Reader" from the plugins list as: "Source" | ||
When Expand Plugin group in the LHS plugins list: "Sink" | ||
When Select plugin: "File" from the plugins list as: "Sink" | ||
Then Connect plugins: "XMLReader" and "File" to establish connection | ||
Then Navigate to the properties page of plugin: "XMLReader" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter input plugin property: "path" with value: "xmlTestFile" | ||
Then Enter input plugin property: "nodePath" with value: "node" | ||
Then Select dropdown plugin property: "reprocessingRequired" with option value: "No" | ||
Then Validate "XMLReader" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Navigate to the properties page of plugin: "File" | ||
Then Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
Then Enter input plugin property: "path" with value: "fileSinkTargetBucket" | ||
Then Replace input plugin property: "pathSuffix" with value: "yyyy-MM-dd-HH-mm" | ||
Then Select dropdown plugin property: "format" with option value: "csv" | ||
Then Validate "File" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save the pipeline | ||
Then Deploy the pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
Then Validate OUT record count is equal to IN record count | ||
Then Validate output file generated by file sink plugin "fileSinkTargetBucket" is equal to expected output file "outputForXMLTest" | ||
|
||
@XmlReader_Source_Required @XMLREADER_DELETE_TEST @FILE_SINK_TEST | ||
Scenario: To verify data is getting transferred from XmlReader to File sink using pattern and delete action | ||
Given Open Datafusion Project to configure pipeline | ||
When Select plugin: "XML Reader" from the plugins list as: "Source" | ||
When Expand Plugin group in the LHS plugins list: "Sink" | ||
When Select plugin: "File" from the plugins list as: "Sink" | ||
Then Connect plugins: "XMLReader" and "File" to establish connection | ||
Then Navigate to the properties page of plugin: "XMLReader" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter input plugin property: "path" with value: "xmlTestFile" | ||
Then Enter input plugin property: "nodePath" with value: "node" | ||
Then Select dropdown plugin property: "reprocessingRequired" with option value: "No" | ||
Then Enter input plugin property: "pattern" with value: "filePattern" | ||
Then Select dropdown plugin property: "ActionAfterProcessingFile" with option value: "Delete" | ||
Then Validate "XMLReader" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Navigate to the properties page of plugin: "File" | ||
Then Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
Then Enter input plugin property: "path" with value: "fileSinkTargetBucket" | ||
Then Replace input plugin property: "pathSuffix" with value: "yyyy-MM-dd-HH-mm" | ||
Then Select dropdown plugin property: "format" with option value: "csv" | ||
Then Validate "File" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save the pipeline | ||
Then Deploy the pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
Then Validate OUT record count is equal to IN record count | ||
Then Validate that file gets successfully deleted from the gcs bucket | ||
Then Validate output file generated by file sink plugin "fileSinkTargetBucket" is equal to expected output file "outputForXMLTest" | ||
|
||
@XMLREADER_TEST @FILE_SINK_TEST | ||
Scenario: To verify data is getting transferred from XmlReader to File sink using move action | ||
Given Open Datafusion Project to configure pipeline | ||
When Select plugin: "XML Reader" from the plugins list as: "Source" | ||
When Expand Plugin group in the LHS plugins list: "Sink" | ||
When Select plugin: "File" from the plugins list as: "Sink" | ||
Then Connect plugins: "XMLReader" and "File" to establish connection | ||
Then Navigate to the properties page of plugin: "XMLReader" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter input plugin property: "path" with value: "xmlTestFile" | ||
Then Enter input plugin property: "nodePath" with value: "node" | ||
Then Select dropdown plugin property: "reprocessingRequired" with option value: "No" | ||
Then Select dropdown plugin property: "ActionAfterProcessingFile" with option value: "Move" | ||
Then Enter input plugin property: "targetFolder" with value: "folder" | ||
Then Validate "XMLReader" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Navigate to the properties page of plugin: "File" | ||
Then Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
Then Enter input plugin property: "path" with value: "fileSinkTargetBucket" | ||
Then Replace input plugin property: "pathSuffix" with value: "yyyy-MM-dd-HH-mm" | ||
Then Select dropdown plugin property: "format" with option value: "csv" | ||
Then Validate "File" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save the pipeline | ||
Then Deploy the pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
Then Validate OUT record count is equal to IN record count | ||
Then Validate that file gets successfully moved to the target location | ||
Then Validate output file generated by file sink plugin "fileSinkTargetBucket" is equal to expected output file "outputForXMLTest" |
76 changes: 76 additions & 0 deletions
76
core-plugins/src/e2e-test/features/xmlReader/XmlReaderErrorScenarios.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Copyright © 2024 Cask Data, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
|
||
@XmlReader_Source | ||
Feature:File Sink - Verify XML Reader Plugin Error scenarios | ||
|
||
@XMLREADER_DELETE_TEST @FILE_SINK_TEST | ||
Scenario: Verify Pipeline fails when an invalid pattern is entered | ||
Given Open Datafusion Project to configure pipeline | ||
When Select plugin: "XML Reader" from the plugins list as: "Source" | ||
When Expand Plugin group in the LHS plugins list: "Sink" | ||
When Select plugin: "File" from the plugins list as: "Sink" | ||
Then Connect plugins: "XMLReader" and "File" to establish connection | ||
Then Navigate to the properties page of plugin: "XMLReader" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter input plugin property: "path" with value: "xmlTestFile" | ||
Then Enter input plugin property: "nodePath" with value: "node" | ||
Then Select dropdown plugin property: "reprocessingRequired" with option value: "No" | ||
Then Enter input plugin property: "pattern" with value: "invalidPattern" | ||
Then Validate "XMLReader" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Navigate to the properties page of plugin: "File" | ||
Then Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
Then Enter input plugin property: "path" with value: "fileSinkTargetBucket" | ||
Then Replace input plugin property: "pathSuffix" with value: "yyyy-MM-dd-HH-mm" | ||
Then Select dropdown plugin property: "format" with option value: "csv" | ||
Then Validate "File" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save the pipeline | ||
Then Deploy the pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Failed" | ||
Then Close the pipeline logs | ||
|
||
@XMLREADER_TEST @FILE_SINK_TEST | ||
Scenario: Verify no data is transferred when an invalid node path is entered | ||
Given Open Datafusion Project to configure pipeline | ||
When Select plugin: "XML Reader" from the plugins list as: "Source" | ||
When Expand Plugin group in the LHS plugins list: "Sink" | ||
When Select plugin: "File" from the plugins list as: "Sink" | ||
Then Connect plugins: "XMLReader" and "File" to establish connection | ||
Then Navigate to the properties page of plugin: "XMLReader" | ||
Then Enter input plugin property: "referenceName" with value: "ReferenceName" | ||
Then Enter input plugin property: "path" with value: "xmlTestFile" | ||
Then Enter input plugin property: "nodePath" with value: "invalidNode" | ||
Then Select dropdown plugin property: "reprocessingRequired" with option value: "No" | ||
Then Validate "XMLReader" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Navigate to the properties page of plugin: "File" | ||
Then Enter input plugin property: "referenceName" with value: "FileReferenceName" | ||
Then Enter input plugin property: "path" with value: "fileSinkTargetBucket" | ||
Then Replace input plugin property: "pathSuffix" with value: "yyyy-MM-dd-HH-mm" | ||
Then Select dropdown plugin property: "format" with option value: "csv" | ||
Then Validate "File" plugin properties | ||
Then Close the Plugin Properties page | ||
Then Save the pipeline | ||
Then Deploy the pipeline | ||
Then Run the Pipeline in Runtime | ||
Then Wait till pipeline is in running state | ||
Then Open and capture logs | ||
Then Verify the pipeline status is "Succeeded" | ||
Then Close the pipeline logs | ||
Then Validate OUT record count is equal to IN record count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
core-plugins/src/e2e-test/java/io/cdap/plugin/xmlreader/runners/TestRunner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright © 2024 Cask Data, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package io.cdap.plugin.xmlreader.runners; | ||
|
||
import io.cucumber.junit.Cucumber; | ||
import io.cucumber.junit.CucumberOptions; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Test Runner to execute XmlReader Source plugin testcases. | ||
*/ | ||
@RunWith(Cucumber.class) | ||
@CucumberOptions( | ||
features = {"src/e2e-test/features"}, | ||
glue = {"stepsdesign", "io.cdap.plugin.common.stepsdesign"}, | ||
tags = {"@XmlReader_Source"}, | ||
monochrome = true, | ||
plugin = {"pretty", "html:target/cucumber-html-report/XmlReader-source", | ||
"json:target/cucumber-reports/cucumber-xmlreader-source.json", | ||
"junit:target/cucumber-reports/cucumber-xmlreader-source.xml"} | ||
) | ||
public class TestRunner { | ||
} |
36 changes: 36 additions & 0 deletions
36
core-plugins/src/e2e-test/java/io/cdap/plugin/xmlreader/runners/TestRunnerRequired.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright © 2024 Cask Data, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
package io.cdap.plugin.xmlreader.runners; | ||
|
||
import io.cucumber.junit.Cucumber; | ||
import io.cucumber.junit.CucumberOptions; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Test Runner to execute only required XmlReader Source plugin testcases. | ||
*/ | ||
@RunWith(Cucumber.class) | ||
@CucumberOptions( | ||
features = {"src/e2e-test/features"}, | ||
glue = {"stepsdesign", "io.cdap.plugin.common.stepsdesign"}, | ||
tags = {"@XmlReader_Source_Required"}, | ||
monochrome = true, | ||
plugin = {"pretty", "html:target/cucumber-html-report/xmlreader-source", | ||
"json:target/cucumber-reports/cucumber-xmlreader-source.json", | ||
"junit:target/cucumber-reports/cucumber-xmlreader-source.xml"} | ||
) | ||
public class TestRunnerRequired { | ||
} |
Oops, something went wrong.