OEUnit - Unit Testing Framework |
Once a test case or test suite has been run, the results can be reported in a variety of formats. If the appropriate format is not already available, a custom reporter can be created to output the results as required.
In basic terms, reporting the test results is a case of:
For example (using the Text reporter):
ROUTINE-LEVEL ON ERROR UNDO, THROW. USING OEUnit.Runners.OEUnitRunner. USING OEUnit.Automation.BaseReporter. USING OEUnit.Automation.TextReporter. /* Create an instance of your test case or suite */ DEFINE VARIABLE suite AS SimpleSuite NO-UNDO. suite = NEW SimpleSuite(). /* Create an instance of the runner */ DEFINE VARIABLE runner AS OEUnitRunner NO-UNDO. runner = NEW OEUnitRunner(). /* Create an instance of the reporter */ DEFINE VARIABLE reporter AS BaseReporter NO-UNDO. reporter = NEW TextReporter("report.txt"). /* Run your test case or suite */ runner:RunTest(suite). /* Display the results */ MESSAGE runner:Results:ToString() VIEW-AS ALERT-BOX. /* Report the results */ reporter:Report(runner). /* Delete the test and runner */ FINALLY: DELETE OBJECT reporter NO-ERROR. DELETE OBJECT suite NO-ERROR. DELETE OBJECT runner NO-ERROR. END FINALLY.
Outputs the results into a CSV based format
Parameter Name | Data Type | Description |
---|---|---|
fName | CHARACTER | Path and File name where the output will be saved |
Outputs the results into an XML file which is compatible with JUnit output.
Parameter Name | Data Type | Description |
---|---|---|
fName | CHARACTER | Path and File name where the output will be saved |
Outputs the results into an XML file which is compatible with SureFire output.
Parameter Name | Data Type | Description |
---|---|---|
outputDirectoryName | CHARACTER | Directory where the output files will be saved |
Outputs the results into a text file, formatted by the ToString() method of the TestResult class.
Parameter Name | Data Type | Description |
---|---|---|
fName | CHARACTER | Path and File name where the output will be saved |