com.atlassian.bamboo.build
Class TestCaseLuceneImpl

java.lang.Object
  extended by com.atlassian.bamboo.build.TestCaseLuceneImpl
All Implemented Interfaces:
TestCase

public class TestCaseLuceneImpl
extends java.lang.Object
implements TestCase

Basic implementation of a test case object to hold results grabbed from Lucene index.

Refer to DefaultTestManager which generates the Testcase.


Constructor Summary
TestCaseLuceneImpl(BuildResultsSummaryManager buildResultsSummaryManager, Build build, java.lang.String actualMethodName, java.lang.String methodName, java.lang.String classname)
           
TestCaseLuceneImpl(BuildResultsSummaryManager buildResultsSummaryManager, Build build, TestCaseResult result)
           
 
Method Summary
 void addResult(TestCaseResult result)
           
 java.lang.String getActualMethodName()
           
 java.util.List getAllTestBuildNumbers()
           
 double getAverageDurationInSeconds()
           
 float getAverageElapsedBuilds()
          Calculates the average number of builds between fixes.
 long getAverageElapsedTime()
          Returns the averag etime in milliseconds it takes for builds to be fixed
 double getAverageTimeToFix()
          Alternative method to get the average time to fix for this test case.
 Build getBuild()
          The build for which this test case exists in
 java.lang.String getClassName()
           
 int getCreatedInBuild()
           
 java.util.List getFailedTestBuildNumbers()
           
 java.util.List getFailurePeriods()
           
 int getLastRanInBuild()
           
 java.lang.String getMethodName()
           
 java.lang.String getShortSuiteName()
           
 java.util.List getSuccessfulTestBuildNumbers()
           
 double getSuccessPercentage()
           
 java.util.SortedMap getTestResults()
          Get a map of test case result objects.
 int getTotalFailures()
           
 int getTotalNumberOfResults()
           
 int getTotalSuccesses()
           
 void setActualMethodName(java.lang.String actualMethodName)
           
 void setBuild(Build build)
           
 void setClassname(java.lang.String classname)
           
 void setMethodName(java.lang.String methodName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestCaseLuceneImpl

public TestCaseLuceneImpl(BuildResultsSummaryManager buildResultsSummaryManager,
                          Build build,
                          TestCaseResult result)

TestCaseLuceneImpl

public TestCaseLuceneImpl(BuildResultsSummaryManager buildResultsSummaryManager,
                          Build build,
                          java.lang.String actualMethodName,
                          java.lang.String methodName,
                          java.lang.String classname)
Method Detail

getFailurePeriods

public java.util.List getFailurePeriods()
Specified by:
getFailurePeriods in interface TestCase
Returns:
List of TestCaseFailurePeriod objects.

getSuccessPercentage

public double getSuccessPercentage()
Specified by:
getSuccessPercentage in interface TestCase
Returns:
percentage of successes to total tests

getAverageDurationInSeconds

public double getAverageDurationInSeconds()
Specified by:
getAverageDurationInSeconds in interface TestCase

getBuild

public Build getBuild()
Description copied from interface: TestCase
The build for which this test case exists in

Specified by:
getBuild in interface TestCase
Returns:
Build

getTotalNumberOfResults

public int getTotalNumberOfResults()
Specified by:
getTotalNumberOfResults in interface TestCase
Returns:
number of times test case ran - i.e. number of builds existed in.

getTotalFailures

public int getTotalFailures()
Specified by:
getTotalFailures in interface TestCase
Returns:
how many times it failed

getTotalSuccesses

public int getTotalSuccesses()
Specified by:
getTotalSuccesses in interface TestCase
Returns:
how many times it succeeded.

getAllTestBuildNumbers

public java.util.List getAllTestBuildNumbers()
Specified by:
getAllTestBuildNumbers in interface TestCase
Returns:
List of Integer build numbers in which this test case occurred.

getSuccessfulTestBuildNumbers

public java.util.List getSuccessfulTestBuildNumbers()
Specified by:
getSuccessfulTestBuildNumbers in interface TestCase
Returns:
List of Integer representing all sucessful builds numbers for this test case.

getFailedTestBuildNumbers

public java.util.List getFailedTestBuildNumbers()
Specified by:
getFailedTestBuildNumbers in interface TestCase
Returns:
List of Integer represnting all failed build numbers for this test case.

getTestResults

public java.util.SortedMap getTestResults()
Description copied from interface: TestCase
Get a map of test case result objects.

Specified by:
getTestResults in interface TestCase
Returns:
SortedMap containing the actual test case result objects. key - Integer of build number for the test case result value - TestCaseResult representing one run of the test case.

getCreatedInBuild

public int getCreatedInBuild()
Specified by:
getCreatedInBuild in interface TestCase
Returns:
which build number when this test case first appeared.

getLastRanInBuild

public int getLastRanInBuild()

getActualMethodName

public java.lang.String getActualMethodName()
Specified by:
getActualMethodName in interface TestCase
Returns:
the method name

getMethodName

public java.lang.String getMethodName()
Specified by:
getMethodName in interface TestCase
Returns:
String representing nice test description derived from the testCase method name

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface TestCase
Returns:
String of the full class path for which this test case exists in.

getShortSuiteName

public java.lang.String getShortSuiteName()

getAverageElapsedTime

public long getAverageElapsedTime()
Returns the averag etime in milliseconds it takes for builds to be fixed

Returns:
time in milliseconds

getAverageElapsedBuilds

public float getAverageElapsedBuilds()
Calculates the average number of builds between fixes.

Returns:
approximate number of builds elapsed before a fix

getAverageTimeToFix

public double getAverageTimeToFix()
Alternative method to get the average time to fix for this test case. Formula is worked out by the total time to fix for all "fixed" tests divided by the number of fixed tests. (Could be slightly different to the elapsed time method based on failure periods).

Specified by:
getAverageTimeToFix in interface TestCase
Returns:

addResult

public void addResult(TestCaseResult result)

setClassname

public void setClassname(java.lang.String classname)

setBuild

public void setBuild(Build build)

setActualMethodName

public void setActualMethodName(java.lang.String actualMethodName)

setMethodName

public void setMethodName(java.lang.String methodName)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.