de.bechte.junit.runners.context.processing
Class MethodExecutor

java.lang.Object
  extended by de.bechte.junit.runners.context.processing.MethodExecutor
All Implemented Interfaces:
ChildExecutor<org.junit.runners.model.FrameworkMethod>

public class MethodExecutor
extends Object
implements ChildExecutor<org.junit.runners.model.FrameworkMethod>

The MethodExecutor is responsible for executing a test for the given FrameworkMethod. This implementation creates a new test instance along the context hierarchy, i.e. it starts by creating an instance of the outer class and then creates instances of the inner classes until the actual test class to which the current FrameworkMethod belongs to is created. Currently, the following annotations are supported by this executor: Before, After, ExpectException, FailOnTimeout, Rule Note: All annotations are evaluated for the entire context hierarchy of the test instance. Example: public class A {


Field Summary
protected  Describer<org.junit.runners.model.FrameworkMethod> describer
           
protected  List<MethodStatementBuilder> statementBuilders
           
protected  StatementExecutor statementExecutor
           
 
Constructor Summary
MethodExecutor(Describer<org.junit.runners.model.FrameworkMethod> describer, StatementExecutor statementExecutor, List<MethodStatementBuilder> statementBuilders)
           
 
Method Summary
protected  org.junit.runners.model.Statement buildStatement(org.junit.runners.model.TestClass testClass, org.junit.runners.model.FrameworkMethod method, Object target, org.junit.runner.Description description, org.junit.runner.notification.RunNotifier notifier)
           
 void run(org.junit.runners.model.TestClass testClass, org.junit.runners.model.FrameworkMethod method, org.junit.runner.notification.RunNotifier notifier)
          Runs the given object of type T and informs the RunNotifier about all notifications.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

describer

protected Describer<org.junit.runners.model.FrameworkMethod> describer

statementExecutor

protected StatementExecutor statementExecutor

statementBuilders

protected List<MethodStatementBuilder> statementBuilders
Constructor Detail

MethodExecutor

public MethodExecutor(Describer<org.junit.runners.model.FrameworkMethod> describer,
                      StatementExecutor statementExecutor,
                      List<MethodStatementBuilder> statementBuilders)
Method Detail

run

public void run(org.junit.runners.model.TestClass testClass,
                org.junit.runners.model.FrameworkMethod method,
                org.junit.runner.notification.RunNotifier notifier)
Description copied from interface: ChildExecutor
Runs the given object of type T and informs the RunNotifier about all notifications.

Specified by:
run in interface ChildExecutor<org.junit.runners.model.FrameworkMethod>
Parameters:
testClass - the corresponding TestClass
method - the object of type T
notifier - the RunNotifier to be notified

buildStatement

protected org.junit.runners.model.Statement buildStatement(org.junit.runners.model.TestClass testClass,
                                                           org.junit.runners.model.FrameworkMethod method,
                                                           Object target,
                                                           org.junit.runner.Description description,
                                                           org.junit.runner.notification.RunNotifier notifier)


Copyright © 2015. All rights reserved.