Toad World® Forums

Inserting unit test data into input tables


One test type that we encounter often and currently struggle with in code tester involves the following steps

  1. Load sample data to input tables
  2. Run package (MAIN PACKAGE) that uses the data in input tables & generates data in output tables
  3. Compare output tables to expected results

Currently, the approach we have taken is to write a wrapper procedure for step 1 & 2 and write unit tests on the wrapper package. While this works, it ends up creating a several additional wrapper procedures for each variant of input data.

Is there a cleaner way to do this with code tester?


Before I answer, I need some clarification:

  1. Are you testing a specific program or are you testing a set of
    steps that involve calling multiple programs?

  2. (I suppose this is a variation on #1) You don’t actually run a
    package. You run programs in a package. So what do you mean by “Run
    package (MAIN PACKAGE)”.

  3. Have you looked at putting all your loading in first step into a
    customization section of the test definition itself?

Thanks, SF

  1. I am testing a specific procedure
  2. You are right, I run a program in a package. Ignore reference to “MAIN PACKAGE”.
  3. No I have not tried that, I can check that out.


OK, then, yes, I suggest you look at using the customization tab in Test Editor (also available in Test Builder) to define your setup logic. Or you can keep it in the separate procedures/packages, and simply CALL those programs in the customization section. Either way, Code Tester will automatically run it for you and setup the tables.

Does this address all your questions?