Previous Topic Next topic Print topic


Test Scripts

You can save the commands that the SP Test tool uses to test a stored procedure as a script that you can execute without having to reset options, input and output parameters, or filenames. This enables you to easily retest your stored procedures.

Test scripts are saved as ASCII command files in the following format:

TEST_storedprocedurename.cmd

Test script files are stored in the same directory as is specified for the COBOL option on the Options dialog box.

Each script includes the input and output file names used when the stored procedure is executed. The following is an example test script named TEST_GETEMPD.cmd:

MFXDBRUNSP IN=G:\temp\xml\GETEMPD_IN_0001.xml; OT=G:\temp\xml\GETEMPD_OUT_0001.xml;
MFXDBRUNSP IN=G:\temp\xml\GETEMPD_IN_0002.xml; OT=G:\temp\xml\GETEMPD_OUT_0002.xml;

This script runs two commands, one using XML input file GETEMPD_IN_0001.xml and another using XML input file GETEMPD_IN_0002.xml. The “OT” token specifies an output XML file.

The SP Test tool automatically creates a script file for each stored procedure you execute if you set the Test Script Generation option to Automatically save commands or Prompt before saving.

You can edit a generated test script in any text editor. You can also write your own test scripts by creating a command file that invokes individual stored procedure test scripts. See the topic Command Line Interface for additional commands you can specify in a test script.

Previous Topic Next topic Print topic