I have developed a BlackBox Testing framework / facility wherein you could add Kettle Transformations and test the results against a Golden file.
1. The Test directory structure should be as follows:
Main dir (Name it whatever you would like. eg: Kettle BlackBox Tests)
|- Input (Has to be named "Input")
|- Output (Has to be named "Output")
|- Temp (Has to be named "Temp")
|- Golden (Has to be named "Golden")
* 2. The Transformation file names should start with Test_Case_#.ktr [eg: Test_Case_1.ktr, Test_Case_34.ktr]
* 3. The Output file name should have the following format: Test_Case_#_Out_Actual.[txt|csv] [eg: Test_Case_1_Out_Actual.csv, Test_Case_34_Out_Actual.txt]
* 4. The sub directories of the Golden dir should be numeric. [eg: 2.5.1, 3.0.1, 3.0.2]
* 5. The Input, Output, Temp, Golden dirs should be named strictly as Input, Output, Temp, Golden respectively.
* 6. The Golden dir would be searched for the file to be compared against starting from the highest version and backwards.
* For eg: Test_Case_5_Out_Actual.txt could exist in 3.0.2 and 2.5.1 but the search for the file would stop at 3.0.2
* 7. The Golden dir should have a file to be compared against for all test cases.
* 8. If exceptions are encountered while executing a particular test case or while comparing Output file to Golden, then they would be
* ignored and we would continue with next test case.
* 9. doTests() method will execute all the Transformations in the transformation dir and compare all the files in Golden dir.
* 10. Currently there is no support for testing Jobs.
The Input files required to run the Transformations
The program looks to execute specific test cases or ALL test cases. To execute specific test cases, add the test case number to the testIDs property in testing-config.xml file. For ex: the configuration below would execute test case number 1, 2, 3 and 7.
If you want to run ALL test cases then remove any entry in the value node. For ex: