I have been trying to set up test outcomes dealing with system output content (produced by dbms_output.put_line() calls. Unfortunately I could not find any good help dealing with this issue. Tutorials and videos deal with testing collections, but none deals with system output directly.
Here are the issues.
In Preferences ->Results there is a check box “Show output to screen…”. It looks like a display option, no more. For some reason the test outcomes dealing with system output were all failing (stating the the program produced no output) until I turned this option on. Is this the expected behavior?
I have to add an empty line to the expected value of the collection for the number of elements between the f_System_Output1 and e_System_Output1 to match. That is, I always have to add a line below (after the 9 lines of output I expect to get) for the test to run.
e_System_Output11(10) := ‘’;
Some tests run when executed individually, but fail when run in a suite. In one such test I expect 10 lines of output (including the fake empty line). It runs fine when executed individually. When I run all the tests for the same package, this tests fails. The message states that the program produced 17 lines of output instead of 10. Where do those extra line come from? Does the tool separate the output produced by different tests when a series of tests is executed? This is a serious problem, since the tests fail for an unexplainable reason.
When the tool states that a line of output does not match the expected value, it is very hard to find out what the actual value is. If I include a System Output-related test outcome for a test, no system output for that test is displayed in the test result viewer. The only way to see the actual output I could find was to delete the system output outcome and rerun the test. This is very cumbersome. Also, I would expect the error message to be more informative by displaying the actual and expected values, not just saying that they differ.