net.thucydides.core.statistics.model
Class TestStatistics

Package class diagram package TestStatistics
java.lang.Object
  extended by net.thucydides.core.statistics.model.TestStatistics

public class TestStatistics
extends Object

A summary of statistics related to a particular set of tests. First, obtain a set of statistics using the HibernateTestStatisticsProvider class. For example, you could obtain statistics for a particular test outcome like this:

     
      TestStatistics stats = testStatisticsProvider.statisticsForTests(With.title(testOutcome.getTitle()));
     
 
or
     
      TestStatistics stats = testStatisticsProvider.statisticsForTests(With.tag("A story));
     
 
Then, you can obtain various statistics about the test (or group of tests):
     
     Double passRateForAllTests = stats.getOverallPassRate();
     Double recentPassRate = stats.getPassRate().overTheLast(5).testRuns();
     
 


Nested Class Summary
 class TestStatistics.PassRateBuilder
           
 class TestStatistics.ResultCountBuilder
           
 
Constructor Summary
TestStatistics(Long totalTestRuns, Long passingTestRuns, Long failingTestRuns, List<TestResult> testResults, List<TestRunTag> tags)
           
 
Method Summary
 TestStatistics.ResultCountBuilder countResults()
           
 Long getFailingTestRuns()
           
 Double getOverallPassRate()
           
 Long getPassingTestRuns()
           
 TestStatistics.PassRateBuilder getPassRate()
          Calculate the pass rate over a given number of tests, e.g.
 List<TestRunTag> getTags()
           
 Long getTotalTestRuns()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestStatistics

public TestStatistics(Long totalTestRuns,
                      Long passingTestRuns,
                      Long failingTestRuns,
                      List<TestResult> testResults,
                      List<TestRunTag> tags)
Method Detail

getTotalTestRuns

public Long getTotalTestRuns()

getPassingTestRuns

public Long getPassingTestRuns()

getFailingTestRuns

public Long getFailingTestRuns()

getOverallPassRate

public Double getOverallPassRate()

getTags

public List<TestRunTag> getTags()

getPassRate

public TestStatistics.PassRateBuilder getPassRate()
Calculate the pass rate over a given number of tests, e.g.
     
     Double recentPassRate = stats.getPassRate().overTheLast(5).testRuns();
     
 


countResults

public TestStatistics.ResultCountBuilder countResults()


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