de.bechte.junit.runners.context.statements
Class StatementExecutor

java.lang.Object
  extended by de.bechte.junit.runners.context.statements.StatementExecutor
Direct Known Subclasses:
MethodStatementExecutor

public class StatementExecutor
extends Object

The StatementExecutor evaluates the given Statement and notifies the RunNotifier about all events that occur during execution. It also handles the errors that might be thrown during execution. One can easily provide additional notifications by overriding the StatementExecutor and providing an implementation for the template methods: beforeExecution(EachTestNotifier) afterExecution(EachTestNotifier)

See Also:
MethodStatementExecutor

Constructor Summary
StatementExecutor()
           
 
Method Summary
protected  void afterExecution(org.junit.internal.runners.model.EachTestNotifier notifier)
          Clients may override this method to add additional behavior after the execution of the statement.
protected  void beforeExecution(org.junit.internal.runners.model.EachTestNotifier notifier)
          Clients may override this method to add additional behavior prior to the execution of the statement.
 void execute(org.junit.runners.model.Statement statement, org.junit.runner.notification.RunNotifier notifier, org.junit.runner.Description description)
           
protected  void whenAssumptionViolatedExceptionIsRaised(org.junit.internal.runners.model.EachTestNotifier notifier, org.junit.internal.AssumptionViolatedException e)
          Clients may override this method to add additional behavior when a AssumptionViolatedException is raised.
protected  void whenInitializationErrorIsRaised(org.junit.internal.runners.model.EachTestNotifier notifier, org.junit.runners.model.InitializationError e)
          Clients may override this method to add additional behavior when a InitializationError is raised.
protected  void whenThrowableIsRaised(org.junit.internal.runners.model.EachTestNotifier notifier, Throwable e)
          Clients may override this method to add additional behavior when a Throwable is raised.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatementExecutor

public StatementExecutor()
Method Detail

execute

public void execute(org.junit.runners.model.Statement statement,
                    org.junit.runner.notification.RunNotifier notifier,
                    org.junit.runner.Description description)

beforeExecution

protected void beforeExecution(org.junit.internal.runners.model.EachTestNotifier notifier)
Clients may override this method to add additional behavior prior to the execution of the statement. The call of this method is guaranteed.

Parameters:
notifier - the notifier

whenInitializationErrorIsRaised

protected void whenInitializationErrorIsRaised(org.junit.internal.runners.model.EachTestNotifier notifier,
                                               org.junit.runners.model.InitializationError e)
Clients may override this method to add additional behavior when a InitializationError is raised. The call of this method is guaranteed.

Parameters:
notifier - the notifier
e - the error

whenAssumptionViolatedExceptionIsRaised

protected void whenAssumptionViolatedExceptionIsRaised(org.junit.internal.runners.model.EachTestNotifier notifier,
                                                       org.junit.internal.AssumptionViolatedException e)
Clients may override this method to add additional behavior when a AssumptionViolatedException is raised. The call of this method is guaranteed.

Parameters:
notifier - the notifier
e - the error

whenThrowableIsRaised

protected void whenThrowableIsRaised(org.junit.internal.runners.model.EachTestNotifier notifier,
                                     Throwable e)
Clients may override this method to add additional behavior when a Throwable is raised.

Parameters:
notifier - the notifier
e - the error

afterExecution

protected void afterExecution(org.junit.internal.runners.model.EachTestNotifier notifier)
Clients may override this method to add additional behavior after the execution of the statement. The call of this method is guaranteed.

Parameters:
notifier - the notifier


Copyright © 2015. All rights reserved.