OOoRunner test harness

complexlib
Class ComplexTestCase

java.lang.Object
  |
  +--complexlib.ComplexTestCase
All Implemented Interfaces:
ComplexTest

public abstract class ComplexTestCase
extends Object
implements ComplexTest

Base class for all complex tests.


Inner Class Summary
 class ComplexTestCase.AssureException
           
 
Field Summary
static boolean BREAK
          End a test if it did fail
static boolean CONTINUE
          Continue a test even if it did fail
protected static LogWriter log
          Log writer
protected  String message
          The message if the test did fail
protected  int mThreadTimeOut
          Maximal time one method is allowed to execute Can be set with parameter 'ThreadTimeOut'
protected static TestParameters param
          The test parameters
protected  boolean state
          State of the current test method
protected  DescEntry subEntry
          Description entry
 
Constructor Summary
ComplexTestCase()
           
 
Method Summary
protected  void addResult(String message, boolean state)
          Deprecated.  
protected  void assure(boolean s)
          Assure that s is true.
protected  void assure(String msg, boolean s)
          Assure that s is true.
protected  void assure(String msg, boolean s, boolean cont)
          Assure that s is true.
 void executeMethods(DescEntry entry, TestParameters environment)
          Call test.
protected  void failed()
          Mark the currently executed method as failed.
protected  void failed(String msg)
          Mark the currently executed method as failed.
protected  void failed(String msg, boolean cont)
          Mark the currently executed method as failed.
abstract  String[] getTestMethodNames()
          Implement this method in the Complex test.
 String getTestObjectName()
          Return a name for the test or tested object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

param

protected static TestParameters param
The test parameters

log

protected static LogWriter log
Log writer

subEntry

protected DescEntry subEntry
Description entry

state

protected boolean state
State of the current test method

message

protected String message
The message if the test did fail

mThreadTimeOut

protected int mThreadTimeOut
Maximal time one method is allowed to execute Can be set with parameter 'ThreadTimeOut'

CONTINUE

public static final boolean CONTINUE
Continue a test even if it did fail

BREAK

public static final boolean BREAK
End a test if it did fail
Constructor Detail

ComplexTestCase

public ComplexTestCase()
Method Detail

executeMethods

public void executeMethods(DescEntry entry,
                           TestParameters environment)
Call test. It is expected, that an environment is given to this test.
Parameters:
method - The name of the test method that should be called.
environment - The environment for the test.

getTestMethodNames

public abstract String[] getTestMethodNames()
Implement this method in the Complex test.
Specified by:
getTestMethodNames in interface ComplexTest
Returns:
All test method names.

getTestObjectName

public String getTestObjectName()
Return a name for the test or tested object. Override to give an own name.
Specified by:
getTestObjectName in interface ComplexTest
Returns:
As default, the name of this class.

assure

protected void assure(boolean s)
Assure that s is true. This function generates "Assure failed." as standard message.
Parameters:
s - The condition that should be true.

assure

protected void assure(String msg,
                      boolean s)
Assure that s is true. The given message will be only evaluated, if s is false.
Parameters:
msg - The message that is evaluated.
s - The condition that should be true.

failed

protected void failed()
Mark the currently executed method as failed. This function generates "Test did fail." as standard message.

failed

protected void failed(String msg)
Mark the currently executed method as failed. with the given message.
Parameters:
msg - The message of the failure.

assure

protected void assure(String msg,
                      boolean s,
                      boolean cont)
Assure that s is true. The given message will be only evaluated, if s is false. Normally, assure() leaves the current test method, and the next one is executed. With the parameter 'cont' set to true, the current test method will continue.
The current method will of course marked as failed.
Parameters:
msg - The message that is evaluated.
s - The condition that should be true.
cont - Continue with test method, even if s is false.

failed

protected void failed(String msg,
                      boolean cont)
Mark the currently executed method as failed. with the given message. The given message will be only evaluated, if s is false. With the parameter 'cont' set to true, the current test method will continue.
The current method will of course marked as failed.
Parameters:
msg - The message that is evaluated.
cont - Continue with test method, even if s is false.

addResult

protected void addResult(String message,
                         boolean state)
Deprecated.  


OOoRunner test harness