Products Downloads


French version


 

A test program is a Java client generated batch VADELIA program, the purpose of which is to batch test the modules of your application.

It can call up subroutines in your application (VADELIA batch or SADELIA) or consume Web services and check the results provided by means of the instruction ASSERT.

In the event that the programs tested are not Java client generated objects, you will need to place their call in a server part corresponding to the platform where they are generated.


A test program contains four particular public client procedures (BEFORE_PGM, AFTER_PGM, BEFORE and AFTER ) and one or more public client procedures performing the tests (hereinafter called "test procedures").

All these procedures have no parameters.

A test procedure contains one or more ASSERT instructions.


When running a test program, the system first calls the BEFORE_PGM procedure and then, for each test procedure, it calls the following sequence

call the BEFORE procedure, call the test procedure, call the AFTER procedure and then once all the test procedures have been called, call the AFTER_PGM procedure.


Each of the BEFORE_PGM, AFTER_PGM, BEFORE or AFTER procedures is optional.

You do not have control over the order in which test procedures are called.

Similarly, when executing a set of test programs, you do not control the order in which the test programs are executed.

The BEFORE_PGM and AFTER_PGM procedures share global variables and the same possible Middleware connection.

The procedures in the sequence "BEFORE procedure, test procedure, AFTER procedure" share global variables and the same possible Middleware connection, but this is not the case for two different "test" sequences or a test sequence and the BEFORE_PGM/AFTER_PGM procedures.


Each test program must be assigned to an Adelia task of the "test" type.

All your test programs can be distributed over one or more test-type tasks.

The test tasks are used to indicate a package and target generation directory for the Java client source specific to the programs of the task and thereby deviate from the values shown on the "Java Cclient" page for the attributes of the environment (public programs) or of the logic level of the application area (private programs).


Example of a test program:

In the example below, the test program tests the SADELIA PERSON-READ and _DEL programs of an application using PERSON-READ_EXISTS, PERSON-READ_DOES_NOT_EXIST and PERSON_DEL_OK test procedures.

The CONFIG_TEST management rule establishes a dynamic Middleware connection (via VaToolBx functions) by retrieving the connection information in the context of the test project.

The BEFORE_PGM procedure creates a test set which will be used by the test procedures.

The BEFORE procedure establishes just the Middleware connection (via the CONFIG_TEST management rule).



Source of CONFIG_TEST management rule:


Note: we provide the source of the CONFIG_TEST management rule in the BDCADEL environment. This environment is in the full package of the Adelia Studio product.

↑ Top of page

  • Aucune étiquette