Class ClassTester

All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess,

public final class ClassTester
extends java.util.Vector

A class for running unit tests on classes which implement the _Testable interface. A ClassTester is a Vector which contains a list of classes to test. Each element in the ClassTester must be an object which "refers" to a class which implements the _Testable interface. An object "refers" to such a class in one of three ways:

  1. The object is an instance of the class.
  2. The object is an instance of java.lang.Class which encapsulates the class.
  3. The object is a String containing the fully-qualified name of the class. (Remember: nested classes must be specified as "outerClass$innerClass", not as "outerClass.innerClass"!)
Note that ClassTester does not implement _Testable and therefore cannot explicitly be used to test itself. However, it does run a number of internal self-tests whenever run_tests() is called.

See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
Fields inherited from class java.util.AbstractList
Constructor Summary
ClassTester(java.util.Collection objects_to_test)
Method Summary
 void clear_messages()
 java.lang.String get_messages()
          Get diagnostic messages.
 boolean run_tests()
          Tests all of the classes in this ClassTester (by calling the static _test_class() methods of each one).
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.List
iterator, listIterator, listIterator

Constructor Detail


public ClassTester(java.util.Collection objects_to_test)


public ClassTester()
Method Detail


public java.lang.String get_messages()
Get diagnostic messages.

a String containing possibly useful diagnostic messages.


public void clear_messages()


public boolean run_tests()
                  throws java.lang.ClassNotFoundException
Tests all of the classes in this ClassTester (by calling the static _test_class() methods of each one).

true on success, false otherwise. On failure, get_messages() may contain useful diagnostic messages.