org.specrunner.listeners.core
Class AbstractScenarioWrapperListener

java.lang.Object
  extended by org.specrunner.listeners.core.AbstractScenarioWrapperListener
All Implemented Interfaces:
IScenarioListener
Direct Known Subclasses:
AbstractScenarioWrapperAfterListener, AbstractScenarioWrapperBeforeListener

public abstract class AbstractScenarioWrapperListener
extends Object
implements IScenarioListener

Wrapp a scenario with a start tag, and an end tag, i.e. clean database (dbms) and compare database (compareBase).

Author:
Thiago Santos

Constructor Summary
AbstractScenarioWrapperListener()
           
 
Method Summary
 void afterScenario(String title, nu.xom.Node node, IContext context, IResultSet result, Object instance)
          Perform something after each scenario.
protected  void append(nu.xom.Node node, IContext context, IResultSet result, Class<? extends IPlugin> type, String message, boolean onStart)
          Append a start and and tag to a scenario.
 void beforeScenario(String title, nu.xom.Node node, IContext context, IResultSet result, Object instance)
          Perform something before each scenario.
protected  nu.xom.Element createElement(Class<? extends IPlugin> type, String message)
          Create element to add.
protected abstract  Class<? extends IPlugin> getOnEnd()
          On end plugin type.
protected abstract  String getOnEndMessage()
          Get on end message.
protected abstract  Class<? extends IPlugin> getOnStart()
          On start plugin type.
protected abstract  String getOnStartMessage()
          On start message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScenarioWrapperListener

public AbstractScenarioWrapperListener()
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.

append

protected void append(nu.xom.Node node,
                      IContext context,
                      IResultSet result,
                      Class<? extends IPlugin> type,
                      String message,
                      boolean onStart)
               throws PluginException
Append a start and and tag to a scenario.

Parameters:
node - Scenario node.
context - A context.
result - A result set.
type - A plugin type to add.
message - A message to add.
onStart - true, if add on start scenario, false, otherwise.
Throws:
PluginException - On processing errors.

getOnStart

protected abstract Class<? extends IPlugin> getOnStart()
On start plugin type.

Returns:
A type.

getOnStartMessage

protected abstract String getOnStartMessage()
On start message.

Returns:
A message.

getOnEnd

protected abstract Class<? extends IPlugin> getOnEnd()
On end plugin type.

Returns:
A type.

getOnEndMessage

protected abstract String getOnEndMessage()
Get on end message.

Returns:
A message.

createElement

protected nu.xom.Element createElement(Class<? extends IPlugin> type,
                                       String message)
                                throws PluginException
Create element to add.

Parameters:
type - Plugin type.
message - A message.
Returns:
An element.
Throws:
PluginException - O creation errors.

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.


Copyright © 2015. All rights reserved.