Package jetbrains.buildServer
Class MockBuildStatistics
- java.lang.Object
-
- jetbrains.buildServer.MockBuildStatistics
-
- All Implemented Interfaces:
BuildStatistics
,ShortStatistics
public class MockBuildStatistics extends Object implements BuildStatistics
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildStatistics
BuildStatistics.Order
-
-
Constructor Summary
Constructors Constructor Description MockBuildStatistics()
-
Method Summary
-
-
-
Method Detail
-
getIgnoredTests
public List<STestRun> getIgnoredTests()
- Specified by:
getIgnoredTests
in interfaceBuildStatistics
- Returns:
- Collection of ignored tests in the build in natural order.
-
isEmpty1
public boolean isEmpty1()
Description copied from interface:ShortStatistics
This method has so strange name because "empty" is predefined keyword in JSP EL.- Specified by:
isEmpty1
in interfaceShortStatistics
- Returns:
- true if build doesn't have any tests and has no compilation errors
-
getPassedTests
public List<STestRun> getPassedTests()
- Specified by:
getPassedTests
in interfaceBuildStatistics
- Returns:
- Collection of successful tests in the build in natural order.
-
getBuildStatus
public Status getBuildStatus()
- Specified by:
getBuildStatus
in interfaceShortStatistics
- Returns:
- build status
-
getCompilationErrorBlocks
public List<CompilationBlockBean> getCompilationErrorBlocks()
- Specified by:
getCompilationErrorBlocks
in interfaceBuildStatistics
- Returns:
- messages with compilation error text.
-
getPreviousFailedTestsCount
public int getPreviousFailedTestsCount()
- Specified by:
getPreviousFailedTestsCount
in interfaceBuildStatistics
- Returns:
- number of tests which fail in this build and in the previous build as well
-
getCurrentStage
public String getCurrentStage()
- Specified by:
getCurrentStage
in interfaceShortStatistics
- Returns:
- current progress text of the build. Progress text can be set either via specific syntax of the echo task
or using specific message from build runner with block type
DefaultMessagesInfo.BLOCK_TYPE_PROGRESS
. Progress blocks can be nested.
-
getCompilationErrorsCount
public int getCompilationErrorsCount()
- Specified by:
getCompilationErrorsCount
in interfaceShortStatistics
- Returns:
- number of detected compilation errors within compilation blocks.
-
getTotalDuration
public long getTotalDuration()
- Specified by:
getTotalDuration
in interfaceShortStatistics
- Returns:
- total duration of test execution, i.e. sum of all test durations (msecs). Depending on test runner, may either include or exclude time for test setup/teardown times
-
getPassedTestCount
public int getPassedTestCount()
- Specified by:
getPassedTestCount
in interfaceShortStatistics
- Returns:
- number of passed(successful) tests in the build.
-
getNewFailedCount
public int getNewFailedCount()
- Specified by:
getNewFailedCount
in interfaceShortStatistics
- Returns:
- number of newly failed tests in the build, i.e. number of tests which fail in this build the first time comparing with recent builds.
-
getAllTestRunCount
public int getAllTestRunCount()
- Specified by:
getAllTestRunCount
in interfaceBuildStatistics
- Returns:
- Total number of test runs in the build. If a test was run several times withing the build, all its runs will be considered.
-
getTests
public List<STestRun> getTests(@Nullable Status status, @NotNull BuildStatistics.Order order)
- Specified by:
getTests
in interfaceBuildStatistics
- Parameters:
status
- if specified, this is the status of tests to be returned. Supported values areNORMAL
,FAILURE
,UNKNOWN
.- Passing
Status.UNKNOWN
yields a list of ignored tests. - Passing
Status.NORMAL
yields a list of passed tests. - Passing
Status.WARNING
yields an empty list - Passing
Status.FAILURE
orStatus.ERROR
yields a list of failed tests (excl. muted ones). - Passing
null
yields all tests.
- Passing
order
- specifies result order- Returns:
- Non-modifiable list of tests according to the parameters query (passed and ignored tests are returned only if statistics were created with corresponding BuildStatisticsOptions)
-
getAllTests
public List<STestRun> getAllTests()
- Specified by:
getAllTests
in interfaceBuildStatistics
- Returns:
- all build tests in natural order (passed and ignored tests are returned only if statistics were created with corresponding BuildStatisticsOptions)
-
getFailedTestsIncludingMuted
@NotNull public List<STestRun> getFailedTestsIncludingMuted()
- Specified by:
getFailedTestsIncludingMuted
in interfaceShortStatistics
- Returns:
- Collection of failed tests in the build, ordered by isNew, orderNumber (including muted runs)
-
getIgnoredTestCount
public int getIgnoredTestCount()
- Specified by:
getIgnoredTestCount
in interfaceShortStatistics
- Returns:
- number of ignored tests in the build.
-
getFailedTestCount
public int getFailedTestCount()
- Specified by:
getFailedTestCount
in interfaceShortStatistics
- Returns:
- number of failed or error tests in the build
-
getAllTestCount
public int getAllTestCount()
- Specified by:
getAllTestCount
in interfaceShortStatistics
- Returns:
- total number of tests, including ignored, passed, and failed
-
getFailedTests
public List<STestRun> getFailedTests()
- Specified by:
getFailedTests
in interfaceShortStatistics
- Returns:
- Collection of failed tests in the build, ordered by isNew, orderNumber (excluding muted runs)
-
getMutedTests
@NotNull public List<STestRun> getMutedTests()
- Specified by:
getMutedTests
in interfaceShortStatistics
- Returns:
- collection of muted tests in the build
-
getMutedTestsCount
public int getMutedTestsCount()
- Specified by:
getMutedTestsCount
in interfaceShortStatistics
- Returns:
- number of muted tests
-
findTestsBy
public List<STestRun> findTestsBy(TestName testName)
- Specified by:
findTestsBy
in interfaceBuildStatistics
- Returns:
- collection of test runs by a testName (test with the same name can run several times in the build)
-
getSignature
public int getSignature()
- Specified by:
getSignature
in interfaceShortStatistics
- Returns:
- a signature of the build. We consider two builds fail the same way if they have the same signature.
-
findTestByTestNameId
@Nullable public STestRun findTestByTestNameId(long testNameId)
- Specified by:
findTestByTestNameId
in interfaceBuildStatistics
- Returns:
- Composite STestRun based on given testNameId
- See Also:
STest.getTestNameId()
-
findTestByTestRunId
@Nullable public STestRun findTestByTestRunId(long testRunId)
Description copied from interface:BuildStatistics
Allows to find a specific STestRun by given testRunId.- Specified by:
findTestByTestRunId
in interfaceBuildStatistics
- Parameters:
testRunId
- test run id- Returns:
- Test run according to given testRunId
- See Also:
STestRun.getTestRunId()
-
-