utPLSQL logo

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

< Previous Section: Use Non-Default Prefix | Next Section: User Guide >

Create and Run a Test Suite

Usually our applications are composed of multiple packages. To test our application, we must test all of the packages. utPLSQL makes it easier for you to do that by offering test suites.

Here is an example of a script that defines a (partial) test suite for PL/Vision, a code library available from RevealNet as part of its Active PL/SQL Knowledge Base:

/*file plvision.tst */
BEGIN
   -- Define a test suite for PL/Vision
   utsuite.add ('PLVision');
   
   -- Add packages for testing
   utpackage.add (
      'PLVision', 'PLVstr', dir_in => 'e:\openoracle\utplsql\examples');
   utpackage.add (
      'PLVision', 'PLVdate', dir_in => 'e:\openoracle\utplsql\examples');
END;   
/

This is a very simple test suite definition. I rely on all defaults, but I specify a location for my test package code. By doing this, utPLSQL will be able to find my test packages even if the default/current utPLSQL directory is set to another location.

If I want to, I can also specify the order in which packages are tested by passing a value for the seq_in argument. I can request that the test code be looked for in the same package as the source code, and so on. Here is a rewriting of the above sutie creation script that demonstrates these options:

BEGIN
   utsuite.add ('PLVision');

   utpackage.add ('PLVision',
      'PLVstr',
      dir_in => 'e:\openoracle\utplsql\examples',
      seq_in => 1,
      samepackage_in => TRUE
   );

   utpackage.add ('PLVision',
      'PLVdate',
      dir_in => 'e:\openoracle\utplsql\examples',
      seq_in => 2,
      samepackage_in => TRUE
   );
END;
/

< Previous Section: Use Non-Default Prefix | Next Section: User Guide >

utPLSQL logo

Valid XHTML 1.0 Strict