Enhydra 5.1 API

com.lutris.testutil
Class Tester

java.lang.Object
  |
  +--com.lutris.testutil.Tester

public class Tester
extends java.lang.Object

Class use to verify the results of tests.

Version:
$Revision: 1.1 $
Author:
Mark Diekhans

Field Summary
 int errorCnt
          Count of the number of failures that have occured.
 
Constructor Summary
Tester()
           
 
Method Summary
 boolean check(java.lang.String testId, java.lang.Object result, java.lang.Object expect)
          Compare an object representing the result of a test to an expected value.
 boolean checkExcept(java.lang.String testId, java.lang.Object result, java.lang.Throwable expect)
          Compare an object representing an exception that should have occured to an result object.
 void failure(java.lang.String testId, java.lang.String msg)
          Generate a general failure message for cases not covered by above functions.
 void unexpectedException(java.lang.String testId, java.lang.Throwable except)
          Generate an error message on an unexpected exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorCnt

public int errorCnt
Count of the number of failures that have occured.

Constructor Detail

Tester

public Tester()
Method Detail

check

public boolean check(java.lang.String testId,
                     java.lang.Object result,
                     java.lang.Object expect)
Compare an object representing the result of a test to an expected value. Print an error message with details of the values of the object if they don't compare.

Parameters:
result - An object representing the result. If the object is derived from type Throwable, then its assumed that an exception occured.
expect - An object to compare to the result of the test step.
Returns:
true if test succeeded, false if it failed. Generally not used unless test process needs to have flow altered on failure.

checkExcept

public boolean checkExcept(java.lang.String testId,
                           java.lang.Object result,
                           java.lang.Throwable expect)
Compare an object representing an exception that should have occured to an result object.

Parameters:
result - An object representing the result. If its not an exception, this is a failure. Often set to null if an exception did not occur.
expect - The expected exception.
Returns:
true if test succeeded, false if it failed. Generally not used unless test process needs to have flow altered on failure.

unexpectedException

public void unexpectedException(java.lang.String testId,
                                java.lang.Throwable except)
Generate an error message on an unexpected exception.

Parameters:
except - Expection.

failure

public void failure(java.lang.String testId,
                    java.lang.String msg)
Generate a general failure message for cases not covered by above functions.


Enhydra 5.1 API