All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.ajug.jsl.jester.tester.Tester

java.lang.Object
   |
   +----org.ajug.jsl.jester.tester.Tester

public class Tester
extends Object
This class runs a test suite and reports on results. A suite is a tree of Tests. The one run is usually a container serving as the root of the entire suite.

Example:

 java -nojit org.ajug.jsl.jester.tester.Tester org.ajug.jsl.jester.samples.TestContainer
 

The command line syntax documentation for Tester is:

  Usage: java org.ajug.jsl.jester.tester.Tester testclassname [-options]
     Note that testclassname must be a class implementing Test.
     -nocatch     Do not catch exceptions. Useful for use in debegger
                    to allow going right to line with problem.
 

Our exception policies are:

1. If the -nocatch option is not used, we catch all exceptions. This allows an entire suite to run to completion, with info about the exceptions encountered saved for reporting. Otherwise the following rules are used:

2. If an exception occurs in beforeTest() then runTest() is not called and child tests are not run, but afterTest() is called. Other remaining tests will be run.

3. If an exception occurs in runTest() then child tests are skipped but afterTest() is still called.

Note that is all cases afterTest() is still called.

Property Passing Policy - Containers can pass properties to children according to this policy:

  1. If property name is already in child don't pass. This
       allows shadowing.
  2. If a container's parent has the same property instance
       and the instance is not inherited, don't add. Note
       that by comparing instances we allow the container to
       shadow it's parent.
  3. Else add to the container's child. 


Constructor Index

 o Tester()

Method Index

 o createTestTree(String)
Creates, initializes and returns a tree of tests given the root className, which must implement Test and is probably a container.
 o getSuiteOptions()
Returns the suite options.
 o getSuiteState()
Returns the suite state, probably for use in monitoring the Tester.
 o main(String[])
Runs the tester using the first command line argument, which must be the name of a class implementing Test.
 o runSuite()
Runs the test suite as defined in SuiteOptions.
 o runSuite(Test)
Runs the rootTest using SuiteOptions.

Constructors

 o Tester
 public Tester()

Methods

 o main
 public static void main(String args[])
Runs the tester using the first command line argument, which must be the name of a class implementing Test.

 o getSuiteState
 public SuiteState getSuiteState()
Returns the suite state, probably for use in monitoring the Tester.

 o getSuiteOptions
 public SuiteOptions getSuiteOptions()
Returns the suite options. These are always current.

 o runSuite
 public void runSuite()
Runs the test suite as defined in SuiteOptions. Be sure to configure SuiteOptions before calling this method.

 o runSuite
 public void runSuite(Test rootTest)
Runs the rootTest using SuiteOptions. The rootTest is provided by another portions of the system such as the GUI. The rootTest may be a tree root, branch root or even a leaf. It is usually a tree root.

 o createTestTree
 public Test createTestTree(String className)
Creates, initializes and returns a tree of tests given the root className, which must implement Test and is probably a container. This is useful for creating but not running a test suite. Note none of the tree is retained by this Tester, allowing tools to create and examine different trees and branches.

Later the Test returned can be run via runSuite(Test).


All Packages  Class Hierarchy  This Package  Previous  Next  Index