org.specrunner.plugins.core
Class AbstractPluginDual
java.lang.Object
org.specrunner.parameters.core.ParameterHolder
org.specrunner.plugins.core.AbstractPlugin
org.specrunner.plugins.core.AbstractPluginNamed
org.specrunner.plugins.core.AbstractPluginScoped
org.specrunner.plugins.core.AbstractPluginValue
org.specrunner.plugins.core.AbstractPluginDual
- All Implemented Interfaces:
- IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin
- Direct Known Subclasses:
- AbstractPluginDefine, PluginEquals
public abstract class AbstractPluginDual
- extends AbstractPluginValue
A generic plugin which performs a test, it the result is true, a success
result is added, otherwise adds an error to the result.
- Author:
- Thiago Santos
|
Field Summary |
protected Boolean |
onstart
Adjust execution moment, if on start node or at the end. |
| Methods inherited from class org.specrunner.plugins.core.AbstractPlugin |
copy, getCondition, getConditionModel, getNormalized, getNormalized, getNormalizer, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, initialize, setCondition, setConditionModel, setNormalized, setNormalizer, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toString |
onstart
protected Boolean onstart
- Adjust execution moment, if on start node or at the end. Default is
'false', to perform on end.
AbstractPluginDual
public AbstractPluginDual()
getOnstart
public Boolean getOnstart()
- Get if execute on start.
- Returns:
- true, to perform on start, false, otherwise.
setOnstart
public void setOnstart(Boolean onstart)
- Set on start flag.
- Parameters:
onstart - On start execution.
doStart
public ENext doStart(IContext context,
IResultSet result)
throws PluginException
- Description copied from interface:
IPlugin
- Performs the start action. i.e. create a database schema. Performed after
initialization.
- Specified by:
doStart in interface IPlugin- Overrides:
doStart in class AbstractPlugin
- Parameters:
context - The context.result - The result set.
- Returns:
- SKIP, to skip node, DEEP, to go deep into the node.
- Throws:
PluginException - On execution errors.
doEnd
public void doEnd(IContext context,
IResultSet result)
throws PluginException
- Description copied from interface:
IPlugin
- The end action. i.e. after a loop specification perform something in a
newly generated table. Performed after doStart().
- Specified by:
doEnd in interface IPlugin- Overrides:
doEnd in class AbstractPlugin
- Parameters:
context - The context.result - The result set.
- Throws:
PluginException - On execution errors.
perform
protected ENext perform(IContext context,
IResultSet result)
throws PluginException
- Perform plugin action/assertion.
- Parameters:
context - The context.result - The result.
- Returns:
- The next move.
- Throws:
PluginException - On plugin execution errors.
getObjectValue
protected Object getObjectValue(IContext context,
nu.xom.Node node)
throws PluginException
- Default behavior.
- Parameters:
context - The context.node - The node.
- Returns:
- The value object.
- Throws:
PluginException - On evaluation errors.
operation
protected abstract boolean operation(Object obj,
IContext context)
throws PluginException
- Stand for the testing operation.
- Parameters:
obj - The value to be used.context - The context.
- Returns:
- true status must be OK, false otherwise, in which case error
should be set.
- Throws:
PluginException - On operation errors.
getError
protected abstract Throwable getError()
- Gets the error, if the
operation returns false.
- Returns:
- The failure.
Copyright © 2015. All rights reserved.