INFORMIX
DataBlade Developers Kit User's Guide
Chapter 3: Using BladeSmith
Home Contents Index Master Index New Book

Adding Test Data

You can add test data for opaque type support routines, user-defined routines, and casts. Using the test data you enter, BladeSmith generates a functional test for each routine. BladeSmith creates shell scripts and SQL scripts to create test tables in a database, populate them with your test data, and run SQL scripts that execute the DataBlade module routines.

BladeSmith generates functional tests for an object only if you enter test data for it. You must regenerate functional tests whenever you add test data to update the functional test scripts.

Chapter 8, "Testing and Debugging DataBlade Modules on UNIX," describes how to use the functional tests that BladeSmith generates.

To enter test data for an object, select the object and choose Edit Gather Test Data.

The following sections describe the test data you enter in BladeSmith.

Test Data for Opaque Types

For opaque types, each test data item includes the following elements:

Enter values to test the opaque type boundaries. For example, if a type does not accept negative input values, enter test data with negative values and specify the error code you expect to receive from the text input routine.

The data you enter for an opaque type is used to test all of the supporting routines defined for the type. BladeSmith generates SQL scripts to test each supporting routine, including the text input and output routines and other routines, such as binary input and output routines and comparison routines. Add test data values that thoroughly test each of these routines.

Test Data for User-Defined Routines

The test data for user-defined routines includes the following items:

For example, the Circle DataBlade module defines a Contains function that takes a Circle value and a Pnt value and returns a Boolean result. To test the Contains function with a Circle value of '(12,12,2)' and a Pnt value of '(12,12)', enter the following input parameters:

Calling Contains with these values should return a true result, which you can enter as t. Because the input parameters are valid, you leave the Error code field blank.

Test Data for Casts

The test data for a cast includes the following items:

Enter invalid input values and values that test boundary conditions for the data type.




DataBlade Developers Kit User's Guide, version 3.6
Copyright © 1998, Informix Software, Inc. All rights reserved.