|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.ddmlib.testrunner.TestRunResult
public class TestRunResult
Holds results from a single test run.
Maintains an accurate count of tests, and tracks incomplete tests. Not thread safe! The test* callbacks must be called in order
Constructor Summary | |
---|---|
TestRunResult()
Create an empty TestRunResult . |
Method Summary | |
---|---|
java.util.Set<TestIdentifier> |
getCompletedTests()
Gets the set of completed tests. |
long |
getElapsedTime()
|
java.lang.String |
getName()
|
int |
getNumAllFailedTests()
Return total number of tests in a failure state (failed, assumption failure) |
int |
getNumCompleteTests()
Gets the number of complete tests in this run ie with status != incomplete. |
int |
getNumTests()
Gets the number of tests in this run. |
int |
getNumTestsInState(TestResult.TestStatus status)
Gets the number of tests in given state for this run. |
java.lang.String |
getRunFailureMessage()
Return the run failure error message, null if run did not fail. |
java.util.Map<java.lang.String,java.lang.String> |
getRunMetrics()
|
java.util.Map<TestIdentifier,TestResult> |
getTestResults()
Gets a map of the test results. |
java.lang.String |
getTextSummary()
Return a user friendly string describing results. |
boolean |
hasFailedTests()
|
boolean |
isRunComplete()
|
boolean |
isRunFailure()
|
void |
setAggregateMetrics(boolean metricAggregation)
|
void |
setRunComplete(boolean runComplete)
|
void |
testAssumptionFailure(TestIdentifier test,
java.lang.String trace)
Called when an atomic test flags that it assumes a condition that is false |
void |
testEnded(TestIdentifier test,
java.util.Map<java.lang.String,java.lang.String> testMetrics)
Reports the execution end of an individual test case. |
void |
testFailed(TestIdentifier test,
java.lang.String trace)
Reports the failure of a individual test case. |
void |
testIgnored(TestIdentifier test)
Called when a test will not be run, generally because a test method is annotated with org.junit.Ignore. |
void |
testRunEnded(long elapsedTime,
java.util.Map<java.lang.String,java.lang.String> runMetrics)
Reports end of test run. |
void |
testRunFailed(java.lang.String errorMessage)
Reports test run failed to complete due to a fatal error. |
void |
testRunStarted(java.lang.String runName,
int testCount)
Reports the start of a test run. |
void |
testRunStopped(long elapsedTime)
Reports test run stopped before completion due to a user request. |
void |
testStarted(TestIdentifier test)
Reports the start of an individual test case. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestRunResult()
TestRunResult
.
Method Detail |
---|
public void setAggregateMetrics(boolean metricAggregation)
public java.lang.String getName()
public java.util.Map<TestIdentifier,TestResult> getTestResults()
public java.util.Map<java.lang.String,java.lang.String> getRunMetrics()
Map
of the test test run metrics.public java.util.Set<TestIdentifier> getCompletedTests()
public boolean isRunFailure()
true
if test run failed.public boolean isRunComplete()
true
if test run finished.public void setRunComplete(boolean runComplete)
public int getNumTestsInState(TestResult.TestStatus status)
public int getNumTests()
public int getNumCompleteTests()
public boolean hasFailedTests()
true
if test run had any failed or error tests.public int getNumAllFailedTests()
public long getElapsedTime()
public java.lang.String getRunFailureMessage()
null
if run did not fail.
public void testRunStarted(java.lang.String runName, int testCount)
ITestRunListener
testRunStarted
in interface ITestRunListener
runName
- the test run nametestCount
- total number of tests in test runpublic void testStarted(TestIdentifier test)
ITestRunListener
testStarted
in interface ITestRunListener
test
- identifies the testpublic void testFailed(TestIdentifier test, java.lang.String trace)
ITestRunListener
testFailed
in interface ITestRunListener
test
- identifies the testtrace
- stack trace of failurepublic void testAssumptionFailure(TestIdentifier test, java.lang.String trace)
ITestRunListener
testAssumptionFailure
in interface ITestRunListener
test
- identifies the testtrace
- stack trace of failurepublic void testIgnored(TestIdentifier test)
ITestRunListener
testIgnored
in interface ITestRunListener
test
- identifies the testpublic void testEnded(TestIdentifier test, java.util.Map<java.lang.String,java.lang.String> testMetrics)
ITestRunListener
ITestRunListener.testFailed(com.android.ddmlib.testrunner.TestIdentifier, java.lang.String)
was not invoked, this test passed. Also returns any key/value
metrics which may have been emitted during the test case's execution.
testEnded
in interface ITestRunListener
test
- identifies the testtestMetrics
- a Map
of the metrics emittedpublic void testRunFailed(java.lang.String errorMessage)
ITestRunListener
testRunFailed
in interface ITestRunListener
errorMessage
- String
describing reason for run failure.public void testRunStopped(long elapsedTime)
ITestRunListener
testRunStopped
in interface ITestRunListener
elapsedTime
- device reported elapsed time, in millisecondspublic void testRunEnded(long elapsedTime, java.util.Map<java.lang.String,java.lang.String> runMetrics)
ITestRunListener
testRunEnded
in interface ITestRunListener
elapsedTime
- device reported elapsed time, in millisecondsrunMetrics
- key-value pairs reported at the end of a test runpublic java.lang.String getTextSummary()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |