Ultra Light Client Guide and Reference

Standardized Test Format

Having a standard format for all or most of our ULC tests makes it possible to provide a flexible environment for running those tests. In addition, the format also allows us to maintain a growing suite of tests. Test cases should be simple and easy to use. The test controls should be grouped in a small units (see below) in one notebook, or they be implemented as separate test cases. All tests are expected to be subclasses of UlxAbstractTestComposite and generally conform to this layout:

Test Area
The widgets being tested are grouped in the left part of the split pane.

Control Area
The right half of split pane contains the controls to manipulate the tested widgets and instructions as to how to use the controls. If there are too many controls to fit in one border, the control area may be implemented using a notebook. In any case, below every group of control widgets is the instructions panel explaining how the controls must be used, in what order (if any), etc.

Test API
In addition to the interactive test mode there is API in place that allows tests to be run in unattended mode. Subclasses of UlxAbstractTestComposite implement the (automatically generated) #runIt method:
testStarted("The name of the Test"); 
    boolean result = callingTheTestRoutine(); 
    testCompleted(result); 
    return result; 

Classes that have meaningful unattended tests to run should call the test methods after the #testStarted, but before the #testCompleted method. Those two methods will take (eventually) log the test(s), and update the Test Suite window's visual feedback widgets. The string passed to #testStarted names the test, and is added to the log entry. The boolean parameter of #testCompleted indicates the success of the test, with nil/null standing for no test run. Classes that cannot run unattended tests, should nevertheless log the fact that they do not have tests by passing "N/A" to the #testStarted method, and null to the #testCompleted method, while doing nothing between the two calls.

Test Data
Whenever applicable, test cases should create their test data based on the data scope defined by the test suite in which the tests are running. To faciliate this, the test project includes the class UlxTestData which implements methods to get the standard sets of data. An instance of this class is created by every test suite and should be used by tests (by using their inherited API #getTestData) to obtain the data needed in the test. Class UlxTestData will be extended by OTI to provide most if not all data needed for all supported UlcProxies.
  • DATA_NORMAL (the default)
  • DATA_HUGE (very large data)
  • DATA_NONE (no data)


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]