Package jetbrains.buildServer.serverSide
Class TestRunImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.BaseTestRun
-
- jetbrains.buildServer.serverSide.TestRunWithContext
-
- jetbrains.buildServer.serverSide.TestRunImpl
-
public class TestRunImpl extends TestRunWithContext
This class is used to represent a particular test in some build. You can ask for test status and some more information. Many methods in this class are used to represent test on the web.- Author:
- Kir, Sergey Anchipolevsky, Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.serverSide.TestRunWithContext
IGNORE_BUILD_STATISTICS_ERRORS, myNewFailure, myTestRunContext
-
Fields inherited from interface jetbrains.buildServer.serverSide.STestRun
NEW_FIRST_NAME_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description TestRunImpl(int orderId, int testRunId, SBuild build, STest test, Status status, int duration, TestOutputInfo testOutputInfo, MuteInfo muteInfo, TestRunContext testRunContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TestRunImpl
createFailedTest(int orderId, int testRunId, int duration, SBuild build, STest test, Status status, String shortText, TestFullTextBuilder fullTextBuilder, MuteInfo muteInfo, TestRunContext testRunContext)
static TestRunImpl
createIgnoredTest(int orderId, int testRunId, int duration, SBuild build, STest test, String ignoreComment, TestRunContext testRunContext)
static TestRunImpl
createSuccessfulTest(int orderId, int testRunId, int duration, SBuild build, STest test, TestFullTextBuilder fullTextBuilder, TestRunContext testRunContext)
SBuild
getBuild()
Returns corresponding build instance.long
getBuildId()
SBuild
getBuildOrNull()
Returns the build and does not throw an exception if it is null.int
getDuration()
Returns test duration.SBuild
getFirstFailed()
Returns the first build in a failing sequence containing this test runSBuild
getFixedIn()
Returns the first build in which test is fixed after a failing sequence containing this test runString
getFullText()
Returns complete test output, including stdout, stderr and exceptionsString
getIgnoreComment()
Returns ignore comment, if availableTestRunMetadata
getMetadata()
MuteInfo
getMuteInfo()
Returns the brief mute information for this test run.int
getOrderId()
Returns ordinal number of this test in the build statistics collection.Status
getStatus()
Returns test status.STest
getTest()
Returns corresponding test instance.int
getTestRunId()
Returns the unique test run id within the buildboolean
isFixed()
Returns true if this test was fixed after this failure.void
setBuild(SBuild build)
Sets the associated with this test run buildvoid
setFirstFailedIn(SBuild firstFailedIn)
Sets the build where this TestRun is considered first failed invoid
setFixedIn(SBuild fixedIn)
Sets the build where this test is considered to be fixedvoid
setFixedInId(long fixedInId)
void
setMuteInfo(MuteInfo muteInfo)
Sets the mute information for this test run.String
toString()
Only for debug-
Methods inherited from class jetbrains.buildServer.serverSide.TestRunWithContext
checkStatisticsErrors, createHistoryDataCalculator, findBuild, isNewFailure, isNewFailureComputed, loadFFIData, setNewFailure
-
Methods inherited from class jetbrains.buildServer.serverSide.BaseTestRun
getFailedInvocationCount, getFirstFailedTestRunId, getInvocationCount, getStatusText, isIgnored, isMuted
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.STestRun
getFailureInfo
-
-
-
-
Constructor Detail
-
TestRunImpl
public TestRunImpl(int orderId, int testRunId, @Nullable SBuild build, @NotNull STest test, @NotNull Status status, int duration, @Nullable TestOutputInfo testOutputInfo, @Nullable MuteInfo muteInfo, @NotNull TestRunContext testRunContext)
-
-
Method Detail
-
getTest
@NotNull public STest getTest()
Description copied from interface:STestRun
Returns corresponding test instance.Note: the instance might or might not be shared between different test runs of one test.
- Returns:
- corresponding test instance
-
getMetadata
@NotNull public TestRunMetadata getMetadata()
- Specified by:
getMetadata
in interfaceTestRunEx
- Overrides:
getMetadata
in classBaseTestRun
-
getBuild
@NotNull public SBuild getBuild()
Description copied from interface:STestRun
Returns corresponding build instance.Note: each test run has an associated build, but depending on how this test run instance was created build might not be populated. In this case a
UnsupportedOperationException
is thrown.- Returns:
- corresponding build instance
-
getBuildId
public long getBuildId()
- Returns:
- id of the build where this test run has occurred
-
getDuration
public int getDuration()
Description copied from interface:STestRun
Returns test duration.- Returns:
- test duration in milliseconds
-
getFirstFailed
@Nullable public SBuild getFirstFailed()
Description copied from interface:STestRun
Returns the first build in a failing sequence containing this test run- Returns:
- first failed in build
-
isFixed
public boolean isFixed()
Description copied from interface:STestRun
Returns true if this test was fixed after this failure. Returns false for a successful test.- Returns:
- true if this test was fixed
-
getFixedIn
@Nullable public SBuild getFixedIn()
Description copied from interface:STestRun
Returns the first build in which test is fixed after a failing sequence containing this test run- Returns:
- fixed in build
-
getOrderId
public int getOrderId()
Description copied from interface:STestRun
Returns ordinal number of this test in the build statistics collection. This number can be different depending on what tests were loaded into the build statistics instance.- Returns:
- ordinal number of this test in the build statistics collection
-
getTestRunId
public int getTestRunId()
Description copied from interface:STestRun
Returns the unique test run id within the build- Returns:
- test run id
-
getStatus
@NotNull public Status getStatus()
Description copied from interface:STestRun
Returns test status. Currently the test status could be one of: Status.NORMAL Status.FAILURE (better check isFailed() on status object) Status.UNKNOWN - for ignored tests- Returns:
- test status
-
getIgnoreComment
@Nullable public String getIgnoreComment()
Description copied from interface:STestRun
Returns ignore comment, if available- Returns:
- ignore comment, if available
-
getFullText
@Nullable public String getFullText()
Description copied from interface:STestRun
Returns complete test output, including stdout, stderr and exceptions- Returns:
- complete test output, including stdout, stderr and exceptions
-
getBuildOrNull
public SBuild getBuildOrNull()
Description copied from interface:TestRunEx
Returns the build and does not throw an exception if it is null.- Returns:
- the build
-
setBuild
public void setBuild(@Nullable SBuild build)
Description copied from interface:TestRunEx
Sets the associated with this test run build- Parameters:
build
- associated build
-
setMuteInfo
public void setMuteInfo(@Nullable MuteInfo muteInfo)
Description copied from interface:TestRunEx
Sets the mute information for this test run.- Parameters:
muteInfo
- the mute info
-
getMuteInfo
@Nullable public MuteInfo getMuteInfo()
Description copied from interface:STestRun
Returns the brief mute information for this test run.- Returns:
- mute information if exists.
- See Also:
STestRun.isMuted()
-
setFirstFailedIn
public void setFirstFailedIn(@Nullable SBuild firstFailedIn)
Description copied from interface:STestRun
Sets the build where this TestRun is considered first failed in- Parameters:
firstFailedIn
- the first failed in build- See Also:
STestRun.getFirstFailed()
-
setFixedIn
public void setFixedIn(@Nullable SBuild fixedIn)
Description copied from interface:STestRun
Sets the build where this test is considered to be fixed- Parameters:
fixedIn
- the fixed in build- See Also:
STestRun.getFixedIn()
-
setFixedInId
public void setFixedInId(long fixedInId)
- Specified by:
setFixedInId
in classBaseTestRun
-
createSuccessfulTest
public static TestRunImpl createSuccessfulTest(int orderId, int testRunId, int duration, @NotNull SBuild build, @NotNull STest test, @NotNull TestFullTextBuilder fullTextBuilder, @NotNull TestRunContext testRunContext)
-
createFailedTest
public static TestRunImpl createFailedTest(int orderId, int testRunId, int duration, @NotNull SBuild build, @NotNull STest test, @NotNull Status status, @Nullable String shortText, @NotNull TestFullTextBuilder fullTextBuilder, @Nullable MuteInfo muteInfo, @NotNull TestRunContext testRunContext)
-
createIgnoredTest
public static TestRunImpl createIgnoredTest(int orderId, int testRunId, int duration, @NotNull SBuild build, @NotNull STest test, @Nullable String ignoreComment, @NotNull TestRunContext testRunContext)
-
-