Performing functional tests on DataBlade modules

When you have completed the code for your DataBlade® module and finished debugging it, run functional tests to validate it.

About this task

When you generate functional tests, BladeSmith creates a set of files that include shell scripts and SQL scripts for testing extended data types, user-defined routines, and casts. By default, these files are created in the functest subdirectory of the directory containing the BladeSmith project file.

Functional tests are generated only for the DataBlade module objects for which you enter test data in your BladeSmith project. See Perform functional test data for information about entering test data.

The test scripts are created to run in a UNIX shell. Therefore, you must install a UNIX-compatible toolkit on your Windows computer: for example, MKS Toolkit. For information about functional tests, see Functional test overview.

Although functional tests are meant to be executed after development of the DataBlade module is complete, functional testing can be an iterative process, repeated several times until the code passes all the tests. The testing process has the following general steps:

Procedure

  1. In Visual C++, build the project.bld file.
  2. Create a project directory under the %ONEDB_HOME%\extend directory for your database server.
  3. Install your DataBlade module. To do this, run the Upload DataBlade Module and Upload SQL Scripts commands on the add-in or manually copy the necessary files
    See Installing a DataBlade module for instructions.
  4. Register your DataBlade module. To do this, run the Register DataBlade Module command on the add-in or use BladeManager.
    See Register a DataBlade module for instructions.
  5. Execute the functional tests from a UNIX shell by using MKS Toolkit.
    See Execute functional tests for instructions.
  6. Regenerate functional tests in BladeSmith if you change any of your test data. If you change the definition of any of your DataBlade module objects, regenerate source code and functional tests in BladeSmith.
  7. Edit the source code (if necessary).
  8. Repeat the procedure, as necessary.