Class DefaultStepReporter

  • All Implemented Interfaces:
    StepReporter

    public class DefaultStepReporter
    extends java.lang.Object
    implements StepReporter
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.reactivex.Maybe<OperationCompletionRS> finishNestedStep()  
      io.reactivex.Maybe<OperationCompletionRS> finishNestedStep​(ItemStatus status)  
      io.reactivex.Maybe<OperationCompletionRS> finishNestedStep​(FinishTestItemRQ finishStepRequest)  
      io.reactivex.Maybe<OperationCompletionRS> finishNestedStep​(java.lang.Throwable throwable)  
      io.reactivex.Maybe<java.lang.String> finishPreviousStep()
      Finish current step started by any of #sendStep methods.
      io.reactivex.Maybe<java.lang.String> finishPreviousStep​(ItemStatus status)
      Finish current step started by any of #sendStep methods.
      io.reactivex.Maybe<java.lang.String> getParent()  
      boolean isFailed​(io.reactivex.Maybe<java.lang.String> parentId)  
      void removeParent​(io.reactivex.Maybe<java.lang.String> parentUuid)  
      io.reactivex.Maybe<java.lang.String> sendStep​(ItemStatus status, java.lang.String name)  
      io.reactivex.Maybe<java.lang.String> sendStep​(ItemStatus status, java.lang.String name, java.io.File... files)  
      protected io.reactivex.Maybe<java.lang.String> sendStep​(ItemStatus status, java.lang.String name, java.lang.Runnable actions)  
      io.reactivex.Maybe<java.lang.String> sendStep​(ItemStatus status, java.lang.String name, java.lang.String... logs)  
      io.reactivex.Maybe<java.lang.String> sendStep​(ItemStatus status, java.lang.String name, java.lang.Throwable throwable)  
      io.reactivex.Maybe<java.lang.String> sendStep​(ItemStatus status, java.lang.String name, java.lang.Throwable throwable, java.io.File... files)  
      io.reactivex.Maybe<java.lang.String> sendStep​(java.lang.String name)  
      io.reactivex.Maybe<java.lang.String> sendStep​(java.lang.String name, java.io.File... files)  
      io.reactivex.Maybe<java.lang.String> sendStep​(java.lang.String name, java.lang.String... logs)  
      void setParent​(io.reactivex.Maybe<java.lang.String> parentUuid)  
      void setStepStatus​(ItemStatus status)
      Set execution status for current step.
      io.reactivex.Maybe<java.lang.String> startNestedStep​(StartTestItemRQ startStepRequest)  
      io.reactivex.Maybe<java.lang.String> step​(ItemStatus status, java.lang.String name)
      Report a step with specified status and name.
      <T> T step​(ItemStatus stepSuccessStatus, java.lang.String name, java.util.function.Supplier<T> actions)
      Wrap passed actions as a separate step and report it.
      io.reactivex.Maybe<java.lang.String> step​(java.lang.String name)
      Report a step with specified name.
      <T> T step​(java.lang.String name, java.util.function.Supplier<T> actions)
      Wrap passed actions as a separate step and report it.
      • Methods inherited from class java.lang.Object

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

      • DefaultStepReporter

        public DefaultStepReporter​(Launch currentLaunch)
    • Method Detail

      • getParent

        @Nullable
        public io.reactivex.Maybe<java.lang.String> getParent()
        Specified by:
        getParent in interface StepReporter
      • setStepStatus

        public void setStepStatus​(@Nonnull
                                  ItemStatus status)
        Description copied from interface: StepReporter
        Set execution status for current step. This status will be applied to the step no matter what will happen with the step next. E.G. if you set ItemStatus.PASSED with the method and then throw an exception the status of the step will stay passed.
        Specified by:
        setStepStatus in interface StepReporter
        Parameters:
        status - wanted step status
      • setParent

        public void setParent​(@Nullable
                              io.reactivex.Maybe<java.lang.String> parentUuid)
        Specified by:
        setParent in interface StepReporter
      • removeParent

        public void removeParent​(@Nullable
                                 io.reactivex.Maybe<java.lang.String> parentUuid)
        Specified by:
        removeParent in interface StepReporter
      • isFailed

        public boolean isFailed​(@Nullable
                                io.reactivex.Maybe<java.lang.String> parentId)
        Specified by:
        isFailed in interface StepReporter
      • sendStep

        @Nonnull
        protected io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                                ItemStatus status,
                                                                @Nonnull
                                                                java.lang.String name,
                                                                @Nullable
                                                                java.lang.Runnable actions)
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             ItemStatus status,
                                                             @Nonnull
                                                             java.lang.String name)
        Specified by:
        sendStep in interface StepReporter
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             java.lang.String name)
        Specified by:
        sendStep in interface StepReporter
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             ItemStatus status,
                                                             @Nonnull
                                                             java.lang.String name,
                                                             java.lang.String... logs)
        Specified by:
        sendStep in interface StepReporter
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             java.lang.String name,
                                                             java.lang.String... logs)
        Specified by:
        sendStep in interface StepReporter
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             ItemStatus status,
                                                             @Nonnull
                                                             java.lang.String name,
                                                             java.lang.Throwable throwable)
        Specified by:
        sendStep in interface StepReporter
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             ItemStatus status,
                                                             @Nonnull
                                                             java.lang.String name,
                                                             java.io.File... files)
        Specified by:
        sendStep in interface StepReporter
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             java.lang.String name,
                                                             java.io.File... files)
        Specified by:
        sendStep in interface StepReporter
      • sendStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> sendStep​(@Nonnull
                                                             ItemStatus status,
                                                             @Nonnull
                                                             java.lang.String name,
                                                             java.lang.Throwable throwable,
                                                             java.io.File... files)
        Specified by:
        sendStep in interface StepReporter
      • finishPreviousStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> finishPreviousStep​(@Nullable
                                                                       ItemStatus status)
        Finish current step started by any of #sendStep methods. Overrides original status if provided.
        Specified by:
        finishPreviousStep in interface StepReporter
        Parameters:
        status - finish status
      • finishPreviousStep

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> finishPreviousStep()
        Finish current step started by any of #sendStep methods.
        Specified by:
        finishPreviousStep in interface StepReporter
      • step

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> step​(@Nonnull
                                                         ItemStatus status,
                                                         @Nonnull
                                                         java.lang.String name)
        Description copied from interface: StepReporter
        Report a step with specified status and name.
        Specified by:
        step in interface StepReporter
        Parameters:
        status - step status
        name - step name
        Returns:
        step ID
      • step

        @Nonnull
        public io.reactivex.Maybe<java.lang.String> step​(@Nonnull
                                                         java.lang.String name)
        Description copied from interface: StepReporter
        Report a step with specified name.
        Specified by:
        step in interface StepReporter
        Parameters:
        name - step name
        Returns:
        step ID
      • step

        @Nullable
        public <T> T step​(@Nonnull
                          ItemStatus stepSuccessStatus,
                          @Nonnull
                          java.lang.String name,
                          @Nonnull
                          java.util.function.Supplier<T> actions)
        Description copied from interface: StepReporter
        Wrap passed actions as a separate step and report it.
        Specified by:
        step in interface StepReporter
        Type Parameters:
        T - return type
        Parameters:
        stepSuccessStatus - step status in case of graceful finish
        name - step name
        actions - action function to execute
        Returns:
        actions result
      • step

        @Nullable
        public <T> T step​(@Nonnull
                          java.lang.String name,
                          @Nonnull
                          java.util.function.Supplier<T> actions)
        Description copied from interface: StepReporter
        Wrap passed actions as a separate step and report it.
        Specified by:
        step in interface StepReporter
        Type Parameters:
        T - return type
        Parameters:
        name - step name
        actions - action function to execute
        Returns:
        actions result