org.apache.felix.ipojo.junit4osgi.plugin
Class Report

java.lang.Object
  extended by org.apache.felix.ipojo.junit4osgi.plugin.Report
Direct Known Subclasses:
XMLReport

public class Report
extends Object

Test report. This class is provides the basics to support several output format.

Author:
Felix Project Team

Field Summary
protected  int m_completedCount
          Number of ran tests.
protected  long m_endTime
          Time at the end of the test execution.
protected  int m_errorsCount
          Number of errors.
protected  int m_failuresCount
          Number of failures.
protected  long m_startTime
          Time at the beginning of the test execution.
protected static String NL
          New line constant.
 
Constructor Summary
Report()
           
 
Method Summary
protected  String elapsedTimeAsString(long runTime)
          Returns the formatted String to display the given double.
 List getErrorSources()
          Gets tests in error.
 List getFailureSources()
          Gets failing tests.
 int getNumErrors()
           
 int getNumFailures()
           
 int getNumTests()
           
protected  String getStackTrace(junit.framework.Test test, Throwable e)
          Returns the stack trace as String.
 void reset()
          Reset the report.
 void testError(junit.framework.Test test)
          Callback called when a test throws an unexpected error.
 void testFailed(junit.framework.Test test)
          Callback called when a test fails.
 void testStarting()
          Callback called when a test starts.
 void testSucceeded()
          Callback called when a test ends successfully.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NL

protected static final String NL
New line constant.


m_completedCount

protected int m_completedCount
Number of ran tests.


m_errorsCount

protected int m_errorsCount
Number of errors.


m_failuresCount

protected int m_failuresCount
Number of failures.


m_startTime

protected long m_startTime
Time at the beginning of the test execution.


m_endTime

protected long m_endTime
Time at the end of the test execution.

Constructor Detail

Report

public Report()
Method Detail

getFailureSources

public List getFailureSources()
Gets failing tests.

Returns:
the list of failing tests.

getErrorSources

public List getErrorSources()
Gets tests in error.

Returns:
the list of test throwing unexpected exceptions

testStarting

public void testStarting()
Callback called when a test starts.


testSucceeded

public void testSucceeded()
Callback called when a test ends successfully.


testError

public void testError(junit.framework.Test test)
Callback called when a test throws an unexpected error.

Parameters:
test - the test in error.

testFailed

public void testFailed(junit.framework.Test test)
Callback called when a test fails.

Parameters:
test - the failing test.

getNumErrors

public int getNumErrors()

getNumFailures

public int getNumFailures()

getNumTests

public int getNumTests()

reset

public void reset()
Reset the report.


elapsedTimeAsString

protected String elapsedTimeAsString(long runTime)
Returns the formatted String to display the given double.

Parameters:
runTime - the elapsed time
Returns:
the String displaying the elapsed time

getStackTrace

protected String getStackTrace(junit.framework.Test test,
                               Throwable e)
Returns the stack trace as String.

Parameters:
test - the test
e - the exception
Returns:
stack trace as string.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.