MetaBoss
User Guides
Synopsis
Beginner's Guide
Configuration Guide
Design Studio Guide
Programming Model Guide
Testing Framework Guide
'How To ...' Guides
References
Synopsis
Design Model Reference
Design Model UML Profile
Test Schema Reference
MetaBoss design library
Run-time libraries API
Dev-time libraries API
HatMaker Example
Synopsis
Enterprise Model Description
Enterprise Model Reference
SystemTest Example
WebServices Example
Miscellaneous
About MetaBoss
Quality Assurance
Compatibility Notes
Acknowledgments
Glossary
Change Log
Version 1.4.0001
Built on 15 Dec 2005 22:31:47

HatMaker SystemTest Example Description.

Example Overview

The HatMaker System Test example shows how to use the MetaBoss Testing Framework. The underlying requirement of the example is quite simple:

  • Prior to coding of the CRM system we needed to have a CRM system simulator so our GUI Client developers can work in parallel with middleware developers and our Testers can (again in parallel) play with the system and prepare test cases.
  • After the real implementation of the CRM system was coded we needed to test it against requirements using prepared test cases.
  • When subsequent releases of the CRM were made we needed to regression test these releases to ensure that the system has not changed its behaviour in unexpected spots.
In this document we will show how these goals can be achieved. Please note that the MetaBoss documentation pack also contains the Testing Framework User Gude and the Test Schema Reference which should help you to better understand this example.

All files directly related to the HatMaker System Test example are located in the ${metaboss_home}/examples/HatMaker/SystemTest subdirectory. Some notable files and directories are:

  • ${metaboss_home}/examples/HatMaker/SystemTest/test.xml - Apache Ant file with all procedures used in this example (eg. initialise database, run test, run simulator etc)
  • ${metaboss_home}/examples/HatMaker/SystemTest/*.bat - various DOS batch files used to run all sorts of test related procedures. The purpose of the particular batch file is documented at the beginning of the file. One particular file - setenvironment.bat is used to set the environment (eg. JAVA_HOME, ANT_HOME etc). You will need to review and possibly modify this file prior to running the tests.

Please note that this system test example is a real-life working example in a sence that it is used in MetaBoss product releases. Each time during release of MetaBoss we automatically generate, build and test HatMaker in a number of configurations. At the end we automatically verify that test results from all tested configurations do match and that there is no regression (at least there is no unexpected regression). All log files from the tests we run during MetaBoss product release are located in the ${metaboss_home}/examples/HatMaker/SystemTest/testlogs directory.

Using Simulator

This area is under construction

System Testing

System testing is performed by executing a collection of test scenarios against a particular enterprise configuration. Consequently there are three key question: How to define test scenarios, How to define particular enterprise configuration and How to run the test.

The test run is conducted by running Apache Ant with the ${metaboss_home}/examples/HatMaker/SystemTest/test.xml script. This script file holds all the answers to the above questions. Some points to note are:

  • Test scenarios are defined in series of XML files located in the ${metaboss_home}/examples/HatMaker/SystemTest/testscenario directory. All xml files found in this directory (excluding the file named RegressionTestSpecimen.xml for the reasons we will explain latter) will be executed in alphabetical order (in other words list of files will be sorted by name in alphabetical order)
  • There are four test environment configurations provided in the example:
    • Inprocess (not distributed) configuration using Oracle database server.
    • Inprocess (not distributed) configuration using MySQL database server.
    • J2EE Client (distributed) configuration using whatever database J2EE container is configured with (we are using Oracle, but this is not important in this discussion).
    • Inprocess (not distributed) configuration using XML files to provide simulated data.
  • The SQL scripts to initialise databases are generated during the build and stored in ${metaboss_home}/examples/HatMaker/SystemTest/dbscripts/oracle directory for Oracle and ${metaboss_home}/examples/HatMaker/SystemTest/dbscripts/mysql for MySQL. These scripts are used to automatically reinitialise database every time at the beginning of the test run.

Regression Testing

The first step in regression test preparation is to prepare a good specimen file. We do that by taking a system test log file and transforming it in to a specimen file. The ${metaboss_home}/examples/HatMaker/SystemTest/specimenworkshop subdirectory contains the example of procedure used to convert trusted test scenario log into the specimen file. Some notable files are:

The next step is to actually run the test. The procedure to run the regression test is exactly the same as the one for system test with only one addition: parameter -specimenFile= must be passed to the ScenarioRunner application and point to the specimen file. Please see "runscenario.real.inprocess" build target inside ${metaboss_home}/examples/HatMaker/SystemTest/test.xml for more details.

The final console output from the successful regression test run which has not detected any differences between the current run and the specimen - should look like the example below: Sample Output From Regression Test run