Class Launch

  • Direct Known Subclasses:
    LaunchImpl

    public abstract class Launch
    extends java.lang.Object
    Launch object represents a lifecycle of a Launch on ReportPortal. It is used to manipulate its state: starting, finishing, adding test results.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ReportPortalClient client  
      static Launch NOOP_LAUNCH
      Launch implementation for disabled Reporting, every method does nothing.
      static Issue NOT_ISSUE
      An Issue to remove 'To Investigate' mark from a skipped/failed Test Item
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract io.reactivex.Maybe<java.lang.String> createVirtualItem()
      Starts a virtual test item in ReportPortal.
      static Launch currentLaunch()
      Returns a current launch in a link to the current thread.
      abstract void finish​(FinishExecutionRQ rq)
      Finishes launch in ReportPortal.
      abstract io.reactivex.Maybe<OperationCompletionRS> finishTestItem​(io.reactivex.Maybe<java.lang.String> itemId, FinishTestItemRQ rq)
      Finishes Test Item in ReportPortal asynchronously (non-blocking).
      ReportPortalClient getClient()
      Returns ReportPortal client for the launch.
      abstract io.reactivex.Maybe<java.lang.String> getLaunch()
      Returns current launch UUID promise as Maybe, empty if the launch is not started.
      ListenerParameters getParameters()
      Returns reporting parameters of the current launch.
      StepReporter getStepReporter()
      Returns Nested Step reporter for the current launch.
      abstract void log​(SaveLogRQ rq)
      // * Logs message to the ReportPortal Launch, provided request.
      abstract void log​(io.reactivex.Maybe<java.lang.String> logItemUuid, java.util.function.Function<java.lang.String,​SaveLogRQ> logSupplier)
      Logs message to the ReportPortal Launch, request factory with specified Test Item UUID.
      abstract void log​(java.util.function.Function<java.lang.String,​SaveLogRQ> logSupplier)
      Logs message to the ReportPortal Launch, request factory.
      abstract io.reactivex.Maybe<java.lang.String> start()
      Starts new launch in ReportPortal asynchronously (non-blocking).
      abstract io.reactivex.Maybe<java.lang.String> startTestItem​(StartTestItemRQ rq)
      Starts new root test item in ReportPortal asynchronously (non-blocking).
      abstract io.reactivex.Maybe<java.lang.String> startTestItem​(io.reactivex.Maybe<java.lang.String> parentId, StartTestItemRQ rq)
      Starts new test item in ReportPortal asynchronously (non-blocking).
      abstract io.reactivex.Maybe<java.lang.String> startTestItem​(io.reactivex.Maybe<java.lang.String> parentId, io.reactivex.Maybe<java.lang.String> retryOf, StartTestItemRQ rq)
      Starts new test item in ReportPortal asynchronously (non-blocking), ensure provided retry item ID starts first.
      abstract io.reactivex.Maybe<java.lang.String> startVirtualTestItem​(io.reactivex.Maybe<java.lang.String> virtualItem, StartTestItemRQ rq)
      Starts new test item in ReportPortal asynchronously (non-blocking) and populates the provided virtual item with the real item ID.
      abstract io.reactivex.Maybe<java.lang.String> startVirtualTestItem​(io.reactivex.Maybe<java.lang.String> parentId, io.reactivex.Maybe<java.lang.String> virtualItem, StartTestItemRQ rq)
      Starts new test item in ReportPortal asynchronously (non-blocking) and populates the provided virtual item with the real item ID.
      abstract boolean useMicroseconds()
      Determines whether timestamps should use microsecond precision based on the ReportPortal server version.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NOOP_LAUNCH

        public static final Launch NOOP_LAUNCH
        Launch implementation for disabled Reporting, every method does nothing.
      • NOT_ISSUE

        public static final Issue NOT_ISSUE
        An Issue to remove 'To Investigate' mark from a skipped/failed Test Item
    • Method Detail

      • useMicroseconds

        public abstract boolean useMicroseconds()
        Determines whether timestamps should use microsecond precision based on the ReportPortal server version. Versions greater than or equal to 5.13.2 support microseconds.

        The value is computed once and cached for subsequent calls.

        Returns:
        true if server version greater or equal 5.13.2, otherwise false
      • start

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> start()
        Starts new launch in ReportPortal asynchronously (non-blocking).
        Returns:
        Launch ID promise.
      • finish

        public abstract void finish​(@Nonnull
                                    FinishExecutionRQ rq)
        Finishes launch in ReportPortal. Blocks until all items are reported correctly.
        Parameters:
        rq - Launch finish request.
      • createVirtualItem

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> createVirtualItem()
        Starts a virtual test item in ReportPortal. Virtual items are used as temporary placeholders until they are populated with real item IDs. This is useful for scenarios where item creation order needs to be decoupled from test execution order.
        Returns:
        Virtual test item ID promise that will be populated with a real ID later
      • startTestItem

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> startTestItem​(StartTestItemRQ rq)
        Starts new root test item in ReportPortal asynchronously (non-blocking).
        Parameters:
        rq - Item start request.
        Returns:
        Test Item ID promise.
      • startTestItem

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> startTestItem​(io.reactivex.Maybe<java.lang.String> parentId,
                                                                           StartTestItemRQ rq)
        Starts new test item in ReportPortal asynchronously (non-blocking).
        Parameters:
        parentId - Promise of parent item ID.
        rq - Item start request.
        Returns:
        Test Item ID promise
      • startTestItem

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> startTestItem​(io.reactivex.Maybe<java.lang.String> parentId,
                                                                           io.reactivex.Maybe<java.lang.String> retryOf,
                                                                           StartTestItemRQ rq)
        Starts new test item in ReportPortal asynchronously (non-blocking), ensure provided retry item ID starts first. Also sets flags retry: true and retryOf: {retryOf argument value}.
        Parameters:
        parentId - Promise of parent item ID.
        retryOf - Previous item ID promise, which is retried.
        rq - Item start request.
        Returns:
        Promise of Test Item ID.
      • startVirtualTestItem

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> startVirtualTestItem​(io.reactivex.Maybe<java.lang.String> virtualItem,
                                                                                  StartTestItemRQ rq)
        Starts new test item in ReportPortal asynchronously (non-blocking) and populates the provided virtual item with the real item ID.
        Parameters:
        virtualItem - Virtual item ID promise to populate with real ID.
        rq - Item start rq.
        Returns:
        Real Test Item ID promise.
      • startVirtualTestItem

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> startVirtualTestItem​(io.reactivex.Maybe<java.lang.String> parentId,
                                                                                  io.reactivex.Maybe<java.lang.String> virtualItem,
                                                                                  StartTestItemRQ rq)
        Starts new test item in ReportPortal asynchronously (non-blocking) and populates the provided virtual item with the real item ID.
        Parameters:
        parentId - Promise of parent item ID.
        virtualItem - Virtual item ID promise to populate with real ID.
        rq - Item start request.
        Returns:
        Real Test Item ID promise.
      • log

        public abstract void log​(@Nonnull
                                 SaveLogRQ rq)
        // * Logs message to the ReportPortal Launch, provided request.
        Parameters:
        rq - Log request.
      • log

        public abstract void log​(@Nonnull
                                 java.util.function.Function<java.lang.String,​SaveLogRQ> logSupplier)
        Logs message to the ReportPortal Launch, request factory.
        Parameters:
        logSupplier - Log Message Factory. Argument of the function will be actual launch UUID.
      • log

        public abstract void log​(@Nonnull
                                 io.reactivex.Maybe<java.lang.String> logItemUuid,
                                 @Nonnull
                                 java.util.function.Function<java.lang.String,​SaveLogRQ> logSupplier)
        Logs message to the ReportPortal Launch, request factory with specified Test Item UUID.
        Parameters:
        logItemUuid - Test Item ID promise
        logSupplier - Log Message Factory. Argument of the function will be actual launch UUID.
      • finishTestItem

        @Nonnull
        public abstract io.reactivex.Maybe<OperationCompletionRS> finishTestItem​(io.reactivex.Maybe<java.lang.String> itemId,
                                                                                 FinishTestItemRQ rq)
        Finishes Test Item in ReportPortal asynchronously (non-blocking). Schedules finish after success of all child items.
        Parameters:
        itemId - Item ID promise.
        rq - Item finish request.
        Returns:
        Promise of Test Item finish response.
      • getParameters

        @Nonnull
        public ListenerParameters getParameters()
        Returns reporting parameters of the current launch.
        Returns:
        parameters instance.
      • currentLaunch

        @Nullable
        public static Launch currentLaunch()
        Returns a current launch in a link to the current thread.
        Returns:
        launch instance.
      • getStepReporter

        @Nonnull
        public StepReporter getStepReporter()
        Returns Nested Step reporter for the current launch.
        Returns:
        a StepReporter instance.
      • getLaunch

        @Nonnull
        public abstract io.reactivex.Maybe<java.lang.String> getLaunch()
        Returns current launch UUID promise as Maybe, empty if the launch is not started.
        Returns:
        Launch UUID promise.