org.specrunner.junit
Class SRRunnerScenario

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
          extended by org.junit.runners.BlockJUnit4ClassRunner
              extended by org.specrunner.junit.SRRunnerScenario
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable, IRunnerScenario

public class SRRunnerScenario
extends org.junit.runners.BlockJUnit4ClassRunner
implements IRunnerScenario

SpecRunner executor.

Author:
Thiago Santos

Field Summary
protected  org.junit.runners.model.FrameworkMethod fakeMethod
          The fake method.
protected  Object instance
          The fixture object, if it exists, null, otherwise.
protected  List<INodeListener> listeners
          Scenario listeners.
protected  org.junit.runner.notification.RunNotifier notifier
          The notifier.
protected  SpecRunnerStatement statement
          Statement performed.
 
Constructor Summary
SRRunnerScenario(Class<?> clazz)
          Basic constructor.
 
Method Summary
protected  List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
           
 org.junit.runner.Description describeChild(org.junit.runners.model.FrameworkMethod method)
          Get description.
protected  void free()
          Clean resource references to avoid JUnit overload.
 org.junit.runners.model.FrameworkMethod getFakeMethod()
          The fake method.
 Object getInstance()
          The fixture object, if it exists, null, otherwise.
 List<INodeListener> getListeners()
          Scenario listeners.
 org.junit.runner.notification.RunNotifier getNotifier()
          The notifier.
 SpecRunnerStatement getStatement()
          Statement performed.
protected  org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method, Object test)
           
 void run(org.junit.runner.notification.RunNotifier notifier)
           
protected  void runChild(org.junit.runners.model.FrameworkMethod method, org.junit.runner.notification.RunNotifier notifier)
           
 void setFakeMethod(org.junit.runners.model.FrameworkMethod fakeMethod)
          Set fake method.
 void setListeners(List<INodeListener> listeners)
          Get listeners.
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, createTest, getChildren, getTestRules, isIgnored, methodBlock, possiblyExpectingExceptions, rules, testName, validateConstructor, validateFields, validateInstanceMethods, validateNoNonStaticInnerClass, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, classRules, createTestClass, filter, getDescription, getName, getRunnerAnnotations, getTestClass, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
 
Methods inherited from class org.junit.runner.Runner
testCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.specrunner.junit.IRunnerScenario
getTestClass
 

Field Detail

notifier

protected org.junit.runner.notification.RunNotifier notifier
The notifier.


fakeMethod

protected org.junit.runners.model.FrameworkMethod fakeMethod
The fake method.


listeners

protected List<INodeListener> listeners
Scenario listeners.


instance

protected Object instance
The fixture object, if it exists, null, otherwise.


statement

protected SpecRunnerStatement statement
Statement performed.

Constructor Detail

SRRunnerScenario

public SRRunnerScenario(Class<?> clazz)
                 throws org.junit.runners.model.InitializationError
Basic constructor.

Parameters:
clazz - The test class.
Throws:
org.junit.runners.model.InitializationError - On initialization errors.
Method Detail

getNotifier

public org.junit.runner.notification.RunNotifier getNotifier()
Description copied from interface: IRunnerScenario
The notifier.

Specified by:
getNotifier in interface IRunnerScenario
Returns:
A notifier.

getFakeMethod

public org.junit.runners.model.FrameworkMethod getFakeMethod()
Description copied from interface: IRunnerScenario
The fake method.

Specified by:
getFakeMethod in interface IRunnerScenario
Returns:
A fake method.

setFakeMethod

public void setFakeMethod(org.junit.runners.model.FrameworkMethod fakeMethod)
Description copied from interface: IRunnerScenario
Set fake method.

Specified by:
setFakeMethod in interface IRunnerScenario
Parameters:
fakeMethod - A method.

getListeners

public List<INodeListener> getListeners()
Description copied from interface: IRunnerScenario
Scenario listeners.

Specified by:
getListeners in interface IRunnerScenario
Returns:
A scenario listeners set.

setListeners

public void setListeners(List<INodeListener> listeners)
Description copied from interface: IRunnerScenario
Get listeners.

Specified by:
setListeners in interface IRunnerScenario
Parameters:
listeners - A set of listeners.

getInstance

public Object getInstance()
Description copied from interface: IRunnerScenario
The fixture object, if it exists, null, otherwise.

Specified by:
getInstance in interface IRunnerScenario
Returns:
Instance object.

getStatement

public SpecRunnerStatement getStatement()
Description copied from interface: IRunnerScenario
Statement performed.

Specified by:
getStatement in interface IRunnerScenario
Returns:
A statement.

run

public void run(org.junit.runner.notification.RunNotifier notifier)
Overrides:
run in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>

computeTestMethods

protected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
Overrides:
computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunner

describeChild

public org.junit.runner.Description describeChild(org.junit.runners.model.FrameworkMethod method)
Description copied from interface: IRunnerScenario
Get description.

Specified by:
describeChild in interface IRunnerScenario
Overrides:
describeChild in class org.junit.runners.BlockJUnit4ClassRunner
Parameters:
method - A method.
Returns:
Description.

runChild

protected void runChild(org.junit.runners.model.FrameworkMethod method,
                        org.junit.runner.notification.RunNotifier notifier)
Overrides:
runChild in class org.junit.runners.BlockJUnit4ClassRunner

free

protected void free()
Clean resource references to avoid JUnit overload.


methodInvoker

protected org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method,
                                                          Object test)
Overrides:
methodInvoker in class org.junit.runners.BlockJUnit4ClassRunner


Copyright © 2015. All rights reserved.