Class TestReporting

java.lang.Object
com.codename1.testing.TestReporting

public class TestReporting extends Object
Test reports can be overriden to provide custom test reporting options you can replace the test reporter on the device by sending the build argument build.testReporter='com.x.MyTestReporterClass'.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    finishedTestCase(UnitTest test, boolean passed)
    Deprecated
    void
    finishedTestCase(String testName, boolean passed)
    Invoked when a unit test has completed
    Gets the test reporting instance
    void
    Indicates an error from the current test case
    void
    logMessage(String message)
    Indicates a message from the current test case
    static void
    Sets the test reporting instance to a subclass of this class.
    void
    Deprecated
    void
    Invoked when a unit test is started
    void
    Deprecated
    void
    Callback to indicate the test execution has finished allowing for a report to be generated if appropriate
    void
    Deprecated
    void
    writeReport(String testSuiteName, OutputStream os)
    Writes a test report to the given stream

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • Constructor Details

    • TestReporting

      public TestReporting()
  • Method Details

    • getInstance

      public static TestReporting getInstance()
      Gets the test reporting instance
    • setInstance

      public static void setInstance(TestReporting i)

      Sets the test reporting instance to a subclass of this class.

      Parameters
      • i: the new instance
    • startingTestCase

      public void startingTestCase(String testName)
      Invoked when a unit test is started
    • startingTestCase

      public void startingTestCase(UnitTest test)
      Deprecated

      this method is no longer invoked by the testing framework; please use #startingTestCase(String)

    • logMessage

      public void logMessage(String message)

      Indicates a message from the current test case

      Parameters
      • message: the message
    • logException

      public void logException(Throwable err)

      Indicates an error from the current test case

      Parameters
      • err: the error message
    • finishedTestCase

      public void finishedTestCase(String testName, boolean passed)

      Invoked when a unit test has completed

      Parameters
      • testName: the name of the test case

      • passed: true if the test passed and false otherwise

    • finishedTestCase

      public void finishedTestCase(UnitTest test, boolean passed)
      Deprecated

      this method is no longer invoked by the testing framework; please use boolean)

    • writeReport

      public void writeReport(String testSuiteName, OutputStream os) throws IOException

      Writes a test report to the given stream

      Parameters
      • testSuiteName: the name of the test suite

      • os: the destination stream

      Throws:
      IOException
    • writeReport

      public void writeReport(OutputStream os) throws IOException
      Deprecated

      this method is no longer invoked by the testing framework; please use OutputStream)

      Throws:
      IOException
    • testExecutionFinished

      public void testExecutionFinished(String testSuiteName)
      Callback to indicate the test execution has finished allowing for a report to be generated if appropriate
    • testExecutionFinished

      public void testExecutionFinished()
      Deprecated

      this method is no longer invoked by the testing framework; please use #testExecutionFinished(String)