utPLSQL logo

[ Home | Getting Started | Build Test Packages | Examples | User Guide | Release Notes | Document Map ]

< Previous Section: utConfig Package | Next Section: utAssert Package >

utResult Package

This package contains the following procedures and functions:

utResult.init Initialize the results data
utResult.show
utResult.showone
utResult.showlast
Show results
utResult.success
utResult.failure
Show the success or failure of the last test
utResult.firstresult
utResult.nextresult
utResult.nthresult
utResult.resultcount
Iterate through the results array
utResult.include_successes
utResult.ignore_successes
Control the display of passed tests

The utResult package offers an API to the information sent by the various utAssert assertion routines after a test is run. If you employ the utPLSQL.test and utPLSQL.testsuite to run your tests, then the results will be displayed by calling the utResult.show procedure.

So, generally, you do not have to do anything to see or evaluate the results of a test (or suite of tests). The information will be displayed on your screen using DBMS_OUTPUT, or elsewhere if you use a custom output reporter. You might, however, want to access this information in another environment (say, Oracle Forms or Java, etc.). You might also want to build your own assertion logic or test engine. In either of these cases, you will want to use the programs in the utResult package.

Initialize

Initialize the utResult data, setting it all back to NULL:

PROCEDURE utResult.init;

Show Results

Show the results of your test with one of the following three procedures.

PROCEDURE utResult.show (reset_in IN BOOLEAN := FALSE);
PROCEDURE utResult.showone (indx_in in pls_integer);
PROCEDURE utResult.showlast;

Use the show procedure to display the full set of results stored in the utResult array. If you pass TRUE for its single argument, the results informatino will be initialized.

Use the showone procedure to show the Nth result.

Use the showlast procedure to show the results of the last test run.

Retrieve Test Status

The success and failure functions return the status of the most recently executed test.

FUNCTION utResult.success RETURN BOOLEAN;
FUNCTION utResult.failure RETURN BOOLEAN;

Scan Results Array

The utPLSQL.show procedure iterates through the contents of the utResult array and displays the information found there. You can write the same kind of logic by calling a combination of the following programs:

PROCEDURE utResult.firstresult;

FUNCTION utResult.nextresult RETURN utResult.result_rt;

PROCEDURE utResult.nextresult (
   name_out OUT VARCHAR2,
   msg_out OUT VARCHAR2,
   case_indx_out OUT PLS_INTEGER
);

FUNCTION utResult.nthresult (indx_in IN PLS_INTEGER)
   RETURN utResult.result_rt;

PROCEDURE utResult.nthresult (
   indx_in IN PLS_INTEGER,
   name_out OUT VARCHAR2,
   msg_out OUT VARCHAR2,
   case_indx_out OUT PLS_INTEGER
);

FUNCTION utResult.resultcount RETURN PLS_INTEGER;

Control the Display of Success Messages

The following procedures turn on or off the display of success messages. In other words, when turned on (as is the default) a message will be displayed for each successful assertion. The specifications are as follows:

procedure include_successes;
procedure ignore_successes; 

< Previous Section: utConfig Package | Next Section: utAssert Package >

utPLSQL logo

Valid XHTML 1.0 Strict