OOoRunner test harness

lib
Class TestResult

java.lang.Object
  |
  +--lib.Status
        |
        +--lib.TestResult

public class TestResult
extends Status

The class supports interface tests development and Status calculation.


Field Summary
protected  Hashtable testedMethods
          Contains methods having been tested and their results.
 
Fields inherited from class lib.Status
EXCEPTION, EXCLUDED, FAILED, OK, PASSED, SKIPPED
 
Constructor Summary
TestResult()
           
 
Method Summary
 int getRunState()
          Returns the run state of the test, eg.g.
 String getRunStateString()
          Returns the string describing run state of the test, e.g.
 int getState()
          Returns the state of the test, e.g.
 Status getStatusFor(String method)
           
 String[] getTestedMethods()
           
 boolean hasMethod(String method)
           
 boolean tested(String method, boolean result)
          The method makes method tested with the result, i.e.
 boolean tested(String method, Status status)
          The method makes the method tested with the status, i.e.
 
Methods inherited from class lib.Status
exception, excluded, failed, getDescription, isException, isExcluded, isFailed, isOK, isPassed, isSkipped, passed, skipped, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

testedMethods

protected Hashtable testedMethods
Contains methods having been tested and their results.
Constructor Detail

TestResult

public TestResult()
Method Detail

getRunStateString

public String getRunStateString()
Returns the string describing run state of the test, e.g. PASSED, SKIPPED, etc.
Overrides:
getRunStateString in class Status
See Also:
Status

getState

public int getState()
Returns the state of the test, e.g. OK, FAILED.
Overrides:
getState in class Status
See Also:
Status

getRunState

public int getRunState()
Returns the run state of the test, eg.g. : PASSED, SKIPPED, etc.
Overrides:
getRunState in class Status
See Also:
Status

tested

public boolean tested(String method,
                      boolean result)
The method makes method tested with the result, i.e. it adds to its state OK (if result == true) or FAILED (if result == false) status and makes the state of the method completed. It's equal to tested(method, Status(result)) call.
Parameters:
method - reffers to the method whoch was tested
result - the result of testing the method
Returns:
the result value
See Also:
tested(String, Status)

tested

public boolean tested(String method,
                      Status status)
The method makes the method tested with the status, i.e. it adds the status to its state and makes it completed.
Parameters:
method - reffers to the method whoch was tested
status - describes the result of testing the method
Returns:
true if status is OK, false otherwise.

getTestedMethods

public String[] getTestedMethods()
Returns:
methods available in the interface tested.

hasMethod

public boolean hasMethod(String method)
Returns:
true if the method belongs to the interface tested, false otherwise.

getStatusFor

public Status getStatusFor(String method)
Returns:
status of testing the method, if it is available (was set by the tested or assert method), null otherwise.
See Also:
tested(String, boolean), tested(String, Status), #assert

OOoRunner test harness