com.android.ddmlib.testrunner
Class TestRunResult

java.lang.Object
  extended by com.android.ddmlib.testrunner.TestRunResult

public class TestRunResult
extends java.lang.Object

Holds results from a single test run.

Maintains an accurate count of tests during execution, and tracks incomplete tests.


Constructor Summary
TestRunResult()
          Create an emptyTestRunResult.
TestRunResult(java.lang.String runName)
          Create a TestRunResult.
 
Method Summary
 void addMetrics(java.util.Map<java.lang.String,java.lang.String> runMetrics, boolean aggregateMetrics)
          Adds test run metrics.
 java.util.Set<TestIdentifier> getCompletedTests()
          Gets the set of completed tests.
 long getElapsedTime()
           
 java.lang.String getName()
           
 int getNumCompleteTests()
          Gets the number of complete tests in this run ie with status != incomplete.
 int getNumErrorTests()
          Gets the number of error tests in this run.
 int getNumFailedTests()
          Gets the number of failed tests in this run.
 int getNumIncompleteTests()
          Gets the number of incomplete tests in this run.
 int getNumPassedTests()
          Gets the number of passed tests for this run.
 int getNumTests()
          Gets the number of tests in 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.
 boolean hasFailedTests()
           
 boolean isRunComplete()
           
 boolean isRunFailure()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestRunResult

public TestRunResult(java.lang.String runName)
Create a TestRunResult.

Parameters:
runName -

TestRunResult

public TestRunResult()
Create an emptyTestRunResult.

Method Detail

getName

public java.lang.String getName()
Returns:
the test run name

getTestResults

public java.util.Map<TestIdentifier,TestResult> getTestResults()
Gets a map of the test results.

Returns:

addMetrics

public void addMetrics(java.util.Map<java.lang.String,java.lang.String> runMetrics,
                       boolean aggregateMetrics)
Adds test run metrics.

Parameters:
runMetrics - the run metrics
aggregateMetrics - if true, attempt to add given metrics values to any currently stored values. If false, replace any currently stored metrics with the same key.

getRunMetrics

public java.util.Map<java.lang.String,java.lang.String> getRunMetrics()
Returns:
a Map of the test test run metrics.

getCompletedTests

public java.util.Set<TestIdentifier> getCompletedTests()
Gets the set of completed tests.


isRunFailure

public boolean isRunFailure()
Returns:
true if test run failed.

isRunComplete

public boolean isRunComplete()
Returns:
true if test run finished.

getNumPassedTests

public int getNumPassedTests()
Gets the number of passed tests for this run.


getNumTests

public int getNumTests()
Gets the number of tests in this run.


getNumCompleteTests

public int getNumCompleteTests()
Gets the number of complete tests in this run ie with status != incomplete.


getNumFailedTests

public int getNumFailedTests()
Gets the number of failed tests in this run.


getNumErrorTests

public int getNumErrorTests()
Gets the number of error tests in this run.


getNumIncompleteTests

public int getNumIncompleteTests()
Gets the number of incomplete tests in this run.


hasFailedTests

public boolean hasFailedTests()
Returns:
true if test run had any failed or error tests.

getElapsedTime

public long getElapsedTime()
Returns:

getRunFailureMessage

public java.lang.String getRunFailureMessage()
Return the run failure error message, null if run did not fail.