Class LightweightTestRunImpl

  • All Implemented Interfaces:
    STestRun, TestRunEx

    public class LightweightTestRunImpl
    extends TestRunWithContext
    Major memory improvement: build ids instead of builds MuteInfo is fairly small.
    Since:
    7.0
    Author:
    Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
    See Also:
    TestRunImpl
    • Constructor Detail

      • LightweightTestRunImpl

        public LightweightTestRunImpl​(@NotNull
                                      TestRunContext testRunContext,
                                      @NotNull
                                      TestRunEx testRun)
    • Method Detail

      • 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
      • 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
      • 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
      • 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
      • getDuration

        public int getDuration()
        Description copied from interface: STestRun
        Returns test duration.
        Returns:
        test duration in milliseconds
      • 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
      • getFirstFailed

        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
      • getFixedIn

        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
      • 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
      • setFirstFailedIn

        public void setFirstFailedIn​(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​(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()
      • getMuteInfo

        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()
      • getFullText

        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
      • getIgnoreComment

        public String getIgnoreComment()
        Description copied from interface: STestRun
        Returns ignore comment, if available
        Returns:
        ignore comment, if available
      • getBuildId

        public long getBuildId()
        Returns:
        id of the build where this test run has occurred
      • toString

        public String toString()
        Only for debug
        Overrides:
        toString in class Object
        Returns:
        debug line