Class QtafTestNGAnnotatedMethodInterceptor<T extends AbstractStepExecutionInfo>

java.lang.Object
de.qytera.qtaf.core.guice.method_interceptor.QtafTestNGAnnotatedMethodInterceptor<T>
Type Parameters:
T - the test execution info type
All Implemented Interfaces:
AbstractTestNGAnnotatedMethodInterceptor<T>, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor
Direct Known Subclasses:
QtafTestNGAfterMethodInterceptor, QtafTestNGAfterSuiteInterceptor, QtafTestNGAfterTestInterceptor, QtafTestNGBeforeMethodInterceptor, QtafTestNGBeforeSuiteInterceptor, QtafTestNGBeforeTestInterceptor

public abstract class QtafTestNGAnnotatedMethodInterceptor<T extends AbstractStepExecutionInfo> extends Object implements org.aopalliance.intercept.MethodInterceptor, AbstractTestNGAnnotatedMethodInterceptor<T>
Method interceptor for methods that are annotated with the Step annotation.
  • Field Details

    • beforeStepExecution

      protected final rx.subjects.PublishSubject<T extends AbstractStepExecutionInfo> beforeStepExecution
      Publisher which notifies all subjects before step executions.
    • afterStepExecutionSuccess

      protected final rx.subjects.PublishSubject<T extends AbstractStepExecutionInfo> afterStepExecutionSuccess
      Publisher which notifies all subjects after successful step executions.
    • afterStepExecutionFailure

      protected final rx.subjects.PublishSubject<T extends AbstractStepExecutionInfo> afterStepExecutionFailure
      Publisher which notifies all subjects after failed step executions.
  • Constructor Details

    • QtafTestNGAnnotatedMethodInterceptor

      protected QtafTestNGAnnotatedMethodInterceptor(rx.subjects.PublishSubject<T> beforeStepExecution, rx.subjects.PublishSubject<T> afterStepExecutionSuccess, rx.subjects.PublishSubject<T> afterStepExecutionFailure)
      Return a QtafTestNGAnnotatedMethodInterceptor Object.
      Parameters:
      beforeStepExecution - Subject that emits events before a step is executed
      afterStepExecutionSuccess - Subject that emits events after a step was executed successfully
      afterStepExecutionFailure - Subject that emits events after a step failed
  • Method Details

    • invoke

      public Object invoke(org.aopalliance.intercept.MethodInvocation methodInvocation) throws Throwable
      This method works as a proxy for methods. Instead of executing the annotated method directly this method will be executed.
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Parameters:
      methodInvocation - Invoked method
      Returns:
      Method execution result
      Throws:
      Throwable - Error
    • onInvoke

      protected abstract void onInvoke(org.aopalliance.intercept.MethodInvocation methodInvocation)
      Code to execute just before method invocation.
      Parameters:
      methodInvocation - the pending method invocation