org.specrunner.plugins.core.logical
Class PluginEquals
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
org.specrunner.plugins.core.logical.PluginEquals
- All Implemented Interfaces:
- IParameterHolder, IActionType, IParalelPlugin, IPlugin, ISleepPlugin, ITestPlugin, ITimedPlugin, IWaitPlugin
- Direct Known Subclasses:
- PluginNotEquals
public class PluginEquals
- extends AbstractPluginDual
Compare elements. Use class 'eq', there are two approaches:
- Add two classes with 'left' class to the first argument, and 'right'
class to the second argument.
- Value attribute is compared with tag content.
In both comparisons a specific comparator can be set using attribute
comparator.
- Author:
- Thiago Santos
| Methods inherited from class org.specrunner.plugins.core.AbstractPlugin |
copy, getCondition, getConditionModel, getNormalized, getNormalized, getParent, getSleep, getSleepModel, getThreadsafe, getTimeout, getTimeoutModel, getWait, getWaitModel, initialize, setCondition, setConditionModel, setNormalized, setParent, setSleep, setSleepModel, setThreadsafe, setTimeout, setTimeoutModel, setWait, setWaitModel, toString |
error
protected Throwable error
- Error object after failure.
PluginEquals
public PluginEquals()
getActionType
public ActionType getActionType()
- Description copied from interface:
IActionType
- Get the plugin type.
- Returns:
- The type.
setValue
public void setValue(Object value)
- Description copied from class:
AbstractPluginValue
- Sets the value.
- Overrides:
setValue in class AbstractPluginValue
- Parameters:
value - A new value.
operation
protected boolean operation(Object obj,
IContext context)
throws PluginException
- Description copied from class:
AbstractPluginDual
- Stand for the testing operation.
- Specified by:
operation in class AbstractPluginDual
- 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.
verify
protected boolean verify(IContext context,
IComparator comparator,
Object expected,
Object received)
throws SpecRunnerException
- Verify the condition.
- Parameters:
context - The context.comparator - Comparator.expected - The reference value.received - The received value.
- Returns:
- true, if equals, false, otherwise.
- Throws:
SpecRunnerException - On condition errors.
getError
protected Throwable getError()
- Description copied from class:
AbstractPluginDual
- Gets the error, if the
operation returns false.
- Specified by:
getError in class AbstractPluginDual
- Returns:
- The failure.
Copyright © 2014. All rights reserved.