public class TestReporting

  1. Object
  2. TestReporting
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’.

Constructors

public TestReporting()

Methods

public static TestReporting getInstance()Gets the test reporting instance
public static void setInstance(TestReporting i)Sets the test reporting instance to a subclass of this class.
public void startingTestCase(String testName)Invoked when a unit test is started
public void startingTestCase(UnitTest test)Deprecated
public void logMessage(String message)Indicates a message from the current test case
public void logException(Throwable err)Indicates an error from the current test case
public void finishedTestCase(String testName, boolean passed)Invoked when a unit test has completed
public void finishedTestCase(UnitTest test, boolean passed)Deprecated
public void writeReport(String testSuiteName, OutputStream os) throws IOExceptionWrites a test report to the given stream
public void writeReport(OutputStream os) throws IOExceptionDeprecated
public void testExecutionFinished(String testSuiteName)Callback to indicate the test execution has finished allowing for a report to be generated if appropriate
public void testExecutionFinished()Deprecated

Inherited methods

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 TestReporting
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 String
the message

logException

public void logException(Throwable err)
Indicates an error from the current test case

Parameters

err Throwable
the error message

finishedTestCase

public void finishedTestCase(String testName, boolean passed)
Invoked when a unit test has completed

Parameters

testName String
the name of the test case
passed boolean
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 String
the name of the test suite
os OutputStream
the destination stream

writeReport

public void writeReport(OutputStream os) throws IOException
Deprecated. this method is no longer invoked by the testing framework; please use OutputStream)

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)