org.specrunner.listeners.core
Class ScenarioCleanerListener

java.lang.Object
  extended by org.specrunner.listeners.core.ScenarioCleanerListener
All Implemented Interfaces:
IScenarioListener

public class ScenarioCleanerListener
extends Object
implements IScenarioListener

Cleaner for scenarios considering @BeforeScenario and @AfterScenario as references.

Author:
Thiago Santos.

Constructor Summary
ScenarioCleanerListener()
           
 
Method Summary
 void afterScenario(String title, nu.xom.Node node, IContext context, IResultSet result, Object instance)
          Perform something after each scenario.
 void beforeScenario(String title, nu.xom.Node node, IContext context, IResultSet result, Object instance)
          Perform something before each scenario.
protected  void execute(Object instance, Class<? extends Annotation> type, String title, nu.xom.Node node, IContext context, IResultSet result)
          Execute annotated methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScenarioCleanerListener

public ScenarioCleanerListener()
Method Detail

beforeScenario

public void beforeScenario(String title,
                           nu.xom.Node node,
                           IContext context,
                           IResultSet result,
                           Object instance)
                    throws SpecRunnerException
Description copied from interface: IScenarioListener
Perform something before each scenario.

Specified by:
beforeScenario in interface IScenarioListener
Parameters:
title - The scenario title.
node - The scenario node.
context - The test context.
result - The result set.
instance - The fixture object, if it exists, null, otherwise.
Throws:
SpecRunnerException - Exception for scenarios.

afterScenario

public void afterScenario(String title,
                          nu.xom.Node node,
                          IContext context,
                          IResultSet result,
                          Object instance)
                   throws SpecRunnerException
Description copied from interface: IScenarioListener
Perform something after each scenario.

Specified by:
afterScenario in interface IScenarioListener
Parameters:
title - The scenario title.
node - The scenario node.
context - The test context.
result - The result set.
instance - The fixture object, if it exists, null, otherwise.
Throws:
SpecRunnerException - Exception for scenarios.

execute

protected void execute(Object instance,
                       Class<? extends Annotation> type,
                       String title,
                       nu.xom.Node node,
                       IContext context,
                       IResultSet result)
                throws SpecRunnerException
Execute annotated methods.

Parameters:
instance - The fixture object, if it exists, null, otherwise.
type - The annotation type to perform methods.
title - The title.
node - The scenario node.
context - The context.
result - The result set.
Throws:
SpecRunnerException - On calling errors.


Copyright © 2015. All rights reserved.