org.cdlib.xtf.util
Class Tester

Object
  extended by Tester

public abstract class Tester
extends Object

Handles tedious details of making a little regression test for a given class.

Author:
Martin Haye

Field Summary
private static LinkedList allTests
          List of all tests (or at least, tests for all classes that have been loaded.
private  String name
          Name of this test
private  boolean testedAlready
          True after test has been tried
 
Constructor Summary
Tester(String name)
          Add this test to the global list of tests
 
Method Summary
 void test()
          Run this particular test.
static void testAll()
          Run all registered tests.
protected abstract  void testImpl()
          Derived classes should override this method to perform the actual work of the test.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allTests

private static LinkedList allTests
List of all tests (or at least, tests for all classes that have been loaded.


name

private String name
Name of this test


testedAlready

private boolean testedAlready
True after test has been tried

Constructor Detail

Tester

public Tester(String name)
Add this test to the global list of tests

Method Detail

testAll

public static final void testAll()
Run all registered tests. It doesn't matter which runs first, since if a test has a dependency it should directly call those tests it depends on.


test

public final void test()
Run this particular test. If it has already been run, the test is skipped.


testImpl

protected abstract void testImpl()
                          throws Exception
Derived classes should override this method to perform the actual work of the test.

Throws:
Exception