public interface UnitTest

Known subtypesAbstractTest

A Codename One unit test interface, you would normally like to derive from AbstractTest which is less verbose and contains many helper methods.

Methods

public abstract boolean runTest() throws ExceptionRuns a unit test, if it returns true it passed.
public abstract void prepare()Prepares the unit test for execution
public abstract void cleanup()Cleanup after a test case executed
public abstract int getTimeoutMillis()Returns the time in milliseconds after which the test should be automatically failed.
public abstract boolean shouldExecuteOnEDT()Returns true to indicate that the test expects to be executed on the EDT

Method details

runTest

public abstract boolean runTest() throws Exception
Runs a unit test, if it returns true it passed. If it threw an exception or returned false it failed.

Returns

whether it passed

Throws

Exception
thrown if it failed

prepare

public abstract void prepare()
Prepares the unit test for execution

cleanup

public abstract void cleanup()
Cleanup after a test case executed

getTimeoutMillis

public abstract int getTimeoutMillis()
Returns the time in milliseconds after which the test should be automatically failed.

Returns

time in milliseconds

shouldExecuteOnEDT

public abstract boolean shouldExecuteOnEDT()
Returns true to indicate that the test expects to be executed on the EDT

Returns

whether the test should execute on the EDT or the testing thread