# Interface UnitTest

All Known Implementing Classes:
  `AbstractTest`

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cleanup()`
  Cleanup after a test case executed
  `int`
  `getTimeoutMillis()`
  Returns the time in milliseconds after which the test should be automatically failed.
  `void`
  `prepare()`
  Prepares the unit test for execution
  `boolean`
  `runTest()`
  Runs a unit test, if it returns true it passed.
  `boolean`
  `shouldExecuteOnEDT()`
  Returns true to indicate that the test expects to be executed on the EDT

- ## Method Details

  - ### runTest

    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
    Throws:
      `Exception`

  - ### prepare

    void prepare()
    Prepares the unit test for execution

  - ### cleanup

    void cleanup()
    Cleanup after a test case executed

  - ### getTimeoutMillis

    int getTimeoutMillis()

    Returns the time in milliseconds after which the test should be automatically failed.

    ###### Returns

    time in milliseconds

  - ### shouldExecuteOnEDT

    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