net.thucydides.core.reports
Class TestOutcomes

Package class diagram package TestOutcomes
java.lang.Object
  extended by net.thucydides.core.reports.TestOutcomes

public class TestOutcomes
extends Object

A set of test outcomes, which lets you perform query operations on the test outcomes. In particular, you can filter a set of test outcomes by tag type and by tag values. Since these operations also return TestOutcomes, you can then further drill down into the test outcome sets. The TestOutcomes object will usually return a list of TestOutcome objects. You can also inject statistics and test run history by using the withHistory() method. This will return a list of TestOutcomeWithHistory instances.


Constructor Summary
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount)
           
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, HibernateTestStatisticsProvider testStatisticsProvider)
           
protected TestOutcomes(List<? extends TestOutcome> outcomes, double estimatedAverageStepCount, String label, HibernateTestStatisticsProvider testStatisticsProvider, TestOutcomes rootOutcomes)
           
 
Method Summary
 double getAverageTestSize()
           
 String getDecimalPercentageFailingStepCount()
           
 String getDecimalPercentagePassingStepCount()
           
 String getDecimalPercentagePendingStepCount()
           
 Long getDuration()
           
 double getDurationInSeconds()
           
 TestOutcomes getFailingTests()
          Find the failing test outcomes in this set
 int getFailureCount()
           
 CoverageFormatter getFormatted()
           
 String getLabel()
           
 double getOverallStability()
           
 TestOutcomes getPassingTests()
          Find the successful test outcomes in this set
 int getPendingCount()
           
 TestOutcomes getPendingTests()
          Find the pending or ignored test outcomes in this set
 Double getPercentageFailingStepCount()
           
 Double getPercentagePassingStepCount()
           
 Double getPercentagePendingStepCount()
           
 double getRecentStability()
           
 TestResult getResult()
           
 TestOutcomes getRootOutcomes()
           
 int getSkipCount()
           
 int getStepCount()
           
 int getSuccessCount()
           
 List<String> getTagNames()
           
 List<TestTag> getTags()
           
 List<String> getTagsOfType(String tagType)
           
 List<String> getTagsOfTypeExcluding(String tagType, String excludedTags)
           
 List<String> getTagTypes()
           
 List<? extends TestOutcome> getTests()
           
protected  TestStatisticsProvider getTestStatisticsProvider()
           
 int getTotal()
           
static TestOutcomes of(List<? extends TestOutcome> outcomes)
           
 TestOutcomes withHistory()
          Return a copy of the current test outcomes, with test run history and statistics.
protected  TestOutcomes withLabel(String label)
           
 TestOutcomes withTag(String tagName)
          Find the test outcomes with a given tag name
 TestOutcomes withTagType(String tagType)
          Find the test outcomes with a given tag type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestOutcomes

@Inject
protected TestOutcomes(List<? extends TestOutcome> outcomes,
                              double estimatedAverageStepCount,
                              String label,
                              HibernateTestStatisticsProvider testStatisticsProvider,
                              TestOutcomes rootOutcomes)

TestOutcomes

protected TestOutcomes(List<? extends TestOutcome> outcomes,
                       double estimatedAverageStepCount,
                       String label,
                       HibernateTestStatisticsProvider testStatisticsProvider)

TestOutcomes

protected TestOutcomes(List<? extends TestOutcome> outcomes,
                       double estimatedAverageStepCount)
Method Detail

withLabel

protected TestOutcomes withLabel(String label)

of

public static TestOutcomes of(List<? extends TestOutcome> outcomes)

getTestStatisticsProvider

protected TestStatisticsProvider getTestStatisticsProvider()

getLabel

public String getLabel()

getTagTypes

public List<String> getTagTypes()
Returns:
The list of all of the different tag types that appear in the test outcomes.

getTagNames

public List<String> getTagNames()
Returns:
The list of all the names of the different tags in these test outcomes

getTags

public List<TestTag> getTags()
Returns:
The list of all the different tags in these test outcomes

getTagsOfType

public List<String> getTagsOfType(String tagType)
Returns:
The list of all the tags associated with a given tag type.

getTagsOfTypeExcluding

public List<String> getTagsOfTypeExcluding(String tagType,
                                           String excludedTags)

getRootOutcomes

public TestOutcomes getRootOutcomes()

withTagType

public TestOutcomes withTagType(String tagType)
Find the test outcomes with a given tag type

Parameters:
tagType - the tag type we are filtering on
Returns:
A new set of test outcomes for this tag type

withTag

public TestOutcomes withTag(String tagName)
Find the test outcomes with a given tag name

Parameters:
tagName - the name of the tag type we are filtering on
Returns:
A new set of test outcomes for this tag name

withHistory

public TestOutcomes withHistory()
Return a copy of the current test outcomes, with test run history and statistics.

Returns:
a TestOutcome instance containing a list of TestOutcomeWithHistory instances.

getFailingTests

public TestOutcomes getFailingTests()
Find the failing test outcomes in this set

Returns:
A new set of test outcomes containing only the failing tests

getPassingTests

public TestOutcomes getPassingTests()
Find the successful test outcomes in this set

Returns:
A new set of test outcomes containing only the successful tests

getPendingTests

public TestOutcomes getPendingTests()
Find the pending or ignored test outcomes in this set

Returns:
A new set of test outcomes containing only the pending or ignored tests

getTests

public List<? extends TestOutcome> getTests()
Returns:
The list of TestOutcomes contained in this test outcome set.

getDuration

public Long getDuration()
Returns:
The total duration of all of the tests in this set in milliseconds.

getDurationInSeconds

public double getDurationInSeconds()
Returns:
The total duration of all of the tests in this set in milliseconds.

getTotal

public int getTotal()
Returns:
The total number of test runs in this set.

getResult

public TestResult getResult()
Returns:
The overall result for the tests in this test outcome set.

getStepCount

public int getStepCount()
Returns:
The total number of nested steps in these test outcomes.

getSuccessCount

public int getSuccessCount()
Returns:
The number of successful tests in this set.

getFailureCount

public int getFailureCount()
Returns:
How many test cases contain at least one failing test.

getPendingCount

public int getPendingCount()
Returns:
How many test cases contain at least one pending test.

getSkipCount

public int getSkipCount()
Returns:
How many tests have been skipped.

getPercentagePassingStepCount

public Double getPercentagePassingStepCount()
Returns:
The percent of passing steps, based on the real and estimated test size in terms of the relative number of steps.

getDecimalPercentagePassingStepCount

public String getDecimalPercentagePassingStepCount()

getDecimalPercentagePendingStepCount

public String getDecimalPercentagePendingStepCount()

getDecimalPercentageFailingStepCount

public String getDecimalPercentageFailingStepCount()

getPercentageFailingStepCount

public Double getPercentageFailingStepCount()
Returns:
The percent of failing steps, based on the real and estimated test size in terms of the relative number of steps.

getPercentagePendingStepCount

public Double getPercentagePendingStepCount()
Returns:
The percent of pending steps, based on the real and estimated test size in terms of the relative number of steps.

getFormatted

public CoverageFormatter getFormatted()
Returns:
Formatted version of the test coverage metrics

getAverageTestSize

public double getAverageTestSize()

getRecentStability

public double getRecentStability()

getOverallStability

public double getOverallStability()


Copyright © 2011-2012 Wakaleo Consulting. All Rights Reserved.