Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atlassian.bamboo.build
Class TestCaseLuceneImpl

    java.lang.Object
      com.atlassian.bamboo.build.TestCaseLuceneImpl

All Implemented Interfaces:
  TestCase

    public class TestCaseLuceneImpl

extends 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, String key, String actualMethodName, String methodName, String classname)`
`TestCaseLuceneImpl(BuildResultsSummaryManager buildResultsSummaryManager, Build build, String key, TestCaseResult result)`

Method Summary
`void` | `addResult(TestCaseResult result)`
`String` | `getActualMethodName()`
`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
`String` | `getClassName()`
`int` | `getCreatedInBuild()`
`List` | `getFailedTestBuildNumbers()`
`List` | `getFailurePeriods()`
`String` | `getKey()` The Key of the test case, in format: a.c.X:testFoo
`int` | `getLastRanInBuild()`
`String` | `getMethodName()`
`String` | `getShortSuiteName()`
`List` | `getSuccessfulTestBuildNumbers()`
`double` | `getSuccessPercentage()`
`SortedMap` | `getTestResults()` Get a map of test case result objects.
`int` | `getTotalFailures()`
`int` | `getTotalNumberOfResults()`
`int` | `getTotalSuccesses()`
`void` | `setActualMethodName(String actualMethodName)`
`void` | `setBuild(Build build)`
`void` | `setClassname(String classname)`
`void` | `setKey(String key)`
`void` | `setMethodName(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,
                              String key,
                              TestCaseResult result)

### TestCaseLuceneImpl

    public TestCaseLuceneImpl(BuildResultsSummaryManager buildResultsSummaryManager,
                              Build build,
                              String key,
                              String actualMethodName,
                              String methodName,
                              String classname)

Method Detail

### getFailurePeriods

    public 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`

### getKey

    public String getKey()

  Description copied from interface: `TestCase`
  The Key of the test case, in format: a.c.X:testFoo

  Specified by:
    `getKey` in interface `TestCase`
  Returns:
    `String` representing key

### 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 List getAllTestBuildNumbers()

  Specified by:
    `getAllTestBuildNumbers` in interface `TestCase`
  Returns:
    `List` of `Integer` build numbers in which this test case occurred.

### getSuccessfulTestBuildNumbers

    public List getSuccessfulTestBuildNumbers()

  Specified by:
    `getSuccessfulTestBuildNumbers` in interface `TestCase`
  Returns:
    `List` of `Integer` representing all sucessful builds numbers for this test case.

### getFailedTestBuildNumbers

    public List getFailedTestBuildNumbers()

  Specified by:
    `getFailedTestBuildNumbers` in interface `TestCase`
  Returns:
    `List` of `Integer` represnting all failed build numbers for this test case.

### getTestResults

    public 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 String getActualMethodName()

  Specified by:
    `getActualMethodName` in interface `TestCase`
  Returns:
    the method name

### getMethodName

    public String getMethodName()

  Specified by:
    `getMethodName` in interface `TestCase`
  Returns:
    `String` representing nice test description derived from the testCase method name

### getClassName

    public String getClassName()

  Specified by:
    `getClassName` in interface `TestCase`
  Returns:
    `String` of the full class path for which this test case exists in.

### getShortSuiteName

    public 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(String classname)

### setBuild

    public void setBuild(Build build)

### setKey

    public void setKey(String key)

### setActualMethodName

    public void setActualMethodName(String actualMethodName)

### setMethodName

    public void setMethodName(String methodName)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Atlassian Software Systems. All Rights Reserved.