ES-Fit

In order to write a simple Fit Fixture, we need to do the following:

1. Root class of the system must inherit from ES_SUITE
2. In the root class we bind the Fixture code written in different classes to the associated Fit tables in the HTML document (e.g. in the following figure, we bind the tables with heading “Arithmetic” to a column fixture ARITHMETIC_FIXTURE.

3. The Fixture must inherit from one of the standard types of Fixture (i.e. ES_COLUMN_FIXTURE, ES_ROW_FIXTURE and ES_ACTION_FIXTURE) see TUhttp://fit.c2.com/UT for more information on the various types of fixtures you can use.

4. The following is the associated HTML document:

5. Make sure the project is compilable
6.  Open ESpec tool
7.  If you have not already enabled “ES-Fit” buttons do the following:
8. Select tools -> enable ES-Fit buttons
9. Click on “Settings” under the “ES-Fit” button:

You’ll see the settings window for setting up a Fit project. Browse for the executable associated with the project (located in the EIFGENs/project_name/W_code).

10. Select the HTML file (arithmetic.htm) and Press on the Run button:

This will run all the Fit tests.

Important notes for implementing Action Fixtures

·        The class must inherit from ES_ACTION_FIXTURE

·        start routine is a deferred feature from ES_ACTION_FIXTURE and must be implemented in your class. Its job is to initialize the shared objects.

·        The name appeared in bind must be exactly the same as the name appeared in the second column of the table.

·        To execute the fixture code, system’s root class must inherit from ES_SUITE. Developer can then add the fixture code to the root class using add_fixture method

Important notes for implementing Row Fixtures

·        The class must inherit from ES_ROW_FIXTURE [G] where G is the generic parameter that represents the type of objects in the database, e.g., MUSIC objects in the above example.

·        query routine is a deferred feature from ES_ROW_FIXTURE and must be implemented in your class. query feature returns a LINKED_LIST[G] which represents the current objects in the database.

·        The name appeared in bind must be exactly the same as the name appeared in the second column of the table.

·        To execute the fixture code, system’s root class must inherit from ES_SUITE. Developer can then add the fixture code to the root class using add_fixture method

·        See Usample_projects/es_fitU located in espec folder for the fixture code of this example