Chapter 16. Testing Changes

Where changes have been made in the model some will indirectly also affect the TheonUI datasets and TheonCoupler configuration. Specific changes may also have been made that directly affect the TheonUI and TheonCoupler. In order to apply these changes and test them (before rollout to a live production service, in a private installation there is not really a testing environment, i.e. everything is live) test instances of TheonUI and TheonCoupler are used.

16.1. Testing Changes to TheonUI

Where changes have been made in the model that will also affect the TheonUI datasets (either to the DDL aspects, or directly to TheonUI elements) then a new dataset must be exported and the application restarted. For consistency in the development environment, after any changes, the datasets must be rebuilt.

ttkm mydb derive ui

Here mydb is the name of the model. If the current working directory is a checked out working copy of a Subversion repository containing a SchemaTree then the model used will default to the model within the current working directory (when a model is not specified in the command).

Otherwise the model name will be searched for as a directory (containing a SchemaTree): in the current working directory; in the local Theon installation (for models included with Theon such as self) or a specific path/URI given as an option to the command. When a path/URI is given as an option and no model name is specified the path/URI must lead to a directory containing a SchemaTree and that will be what is used. Otherwise the path/URI should contain a directory containing a SchemaTree which is the same as the model name specified in the command. A URI would normally be a file:/// (or just a local file path) but can equally be a reference to a SchemaTree published on the web or in a version control repository (and specific revision thereof).

The derive command will look for an instance of complete.xsd in the relevant directory that is newer (by timestamp) then MODEL.xsd in the same directory. If it does not exist, is older (by timestamp) or the complete option is specified then the complete sub-command is used first to create it (see section on Transforms).

The result of this command is a directory called derived in the current working directory, or a sub-directory therein named after the model, containing two directories called data and html. These hold the relevant transformed schema structured and formatted as needed by TheonUI. If an output path (or file) is specified as an option to this command then that directory (or file) will be used for the result instead.

Any live running instance of TheonUI will not see the updated datasets by default and so must be restarted first.

ttkm ui server

This will work assuming TheonUI was configured to point at the correct location for the updated datasets.

16.2. Testing Changes to TheonCoupler

Changes made to a model in Theon might also affect the TheonCoupler stream processing scripts. This might be the case even if they are not direct changes to stream configuration (due to the general interaction with the physical database structure). For consistency in the development environment, after any changes, the stream configuration files must be rebuilt.

ttkm mydb derive coupler

Here mydb is the name of the model. If the current working directory is a checked out working copy of a Subversion repository containing a SchemaTree then the model used will default to the model within the current working directory (when a model is not specified in the command).

Otherwise the model name will be searched for as a directory (containing a SchemaTree): in the current working directory; in the local Theon installation (for models included with Theon such as self) or a specific path/URI given as an option to the command. When a path/URI is given as an option and no model name is specified the path/URI must lead to a directory containing a SchemaTree and that will be what is used. Otherwise the path/URI should contain a directory containing a SchemaTree which is the same as the model name specified in the command. A URI would normally be a file:/// (or just a local file path) but can equally be a reference to a SchemaTree published on the web or in a version control repository (and specific revision thereof).

The derive command will look for an instance of complete.xsd in the relevant directory that is newer (by timestamp) then MODEL.xsd in the same directory. If it does not exist, is older (by timestamp) or the complete option is specified then the complete sub-command is used first to create it (see section on Transforms).

The result of this command is a directory called derived in the current working directory, or a sub-directory therein named after the model. This will contain the coupler stream processing scripts as produced by transform from the model schema. If an output path (or file) is specified as an option to this command then that directory (or file) will be used for the result instead.

They can be tested directly by using the relevant ttkm stream command line, ensuring that the environmental context points at the processing scripts defined in the current working directory (or as specified) rather than the default ones in the installation of Theon itself.