Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.lutris.testutil
Class Tester  view Tester download Tester.java

java.lang.Object
  extended bycom.lutris.testutil.Tester

public class Tester
extends java.lang.Object

Class use to verify the results of tests.

Version:
$Revision: 1.11.12.1 $

Nested Class Summary
(package private)  class Tester.FailDesc
           
 
Field Summary
private static java.lang.String arrayLenMsg
           
private static java.lang.String bigBar
           
 int errorCnt
          Count of the number of failures that have occured.
private static java.lang.String expectNullMsg
           
private static java.lang.String notEqualMsg
           
private static java.lang.String resultNullMsg
           
(package private) static java.lang.String smallBar
           
private static java.lang.String wrongTypeMsg
           
 
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.
private  Tester.FailDesc compare(java.lang.Object result, java.lang.Object expect)
           
private  Tester.FailDesc compareArrays(java.lang.Object result, java.lang.Object expect)
           
private  Tester.FailDesc compareThrowable(java.lang.Throwable result, java.lang.Throwable expect)
           
 void failure(java.lang.String testId, java.lang.String msg)
          Generate a general failure message for cases not covered by above functions.
private  java.lang.String getTypeName(java.lang.Class classObj)
           
private  void printFailure(java.lang.String testId, Tester.FailDesc failDesc)
           
 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.


wrongTypeMsg

private static final java.lang.String wrongTypeMsg
See Also:
Constant Field Values

notEqualMsg

private static final java.lang.String notEqualMsg
See Also:
Constant Field Values

resultNullMsg

private static final java.lang.String resultNullMsg
See Also:
Constant Field Values

expectNullMsg

private static final java.lang.String expectNullMsg
See Also:
Constant Field Values

arrayLenMsg

private static final java.lang.String arrayLenMsg
See Also:
Constant Field Values

bigBar

private static final java.lang.String bigBar
See Also:
Constant Field Values

smallBar

static final java.lang.String smallBar
See Also:
Constant Field Values
Constructor Detail

Tester

public Tester()
Method Detail

printFailure

private void printFailure(java.lang.String testId,
                          Tester.FailDesc failDesc)

getTypeName

private java.lang.String getTypeName(java.lang.Class classObj)

compareArrays

private Tester.FailDesc compareArrays(java.lang.Object result,
                                      java.lang.Object expect)

compareThrowable

private Tester.FailDesc compareThrowable(java.lang.Throwable result,
                                         java.lang.Throwable expect)

compare

private Tester.FailDesc compare(java.lang.Object result,
                                java.lang.Object expect)

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.


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.


unexpectedException

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


failure

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