| org.apache.commons.jexl.junit.Asserter
Asserter | public class Asserter extends Assert (Code) | | A utility class for performing JUnit based assertions using Jexl
expressions. This class can make it easier to do unit tests using
Jexl navigation expressions.
since: 1.0 author: James Strachan version: $Revision: 398153 $ |
Constructor Summary | |
public | Asserter() Create an asserter. | public | Asserter(Object variableValue) This constructor will register the given variableValue as the
"this" variable. |
Method Summary | |
public void | assertExpression(String expression, Object expected) Performs an assertion that the value of the given Jexl expression
evaluates to the given expected value. | public void | setVariable(String name, Object value) Puts a variable of a certain name in the context so that it can be used from
assertion expressions. |
Asserter | public Asserter()(Code) | | Create an asserter.
|
Asserter | public Asserter(Object variableValue)(Code) | | This constructor will register the given variableValue as the
"this" variable.
Parameters: variableValue - 'this'. |
assertExpression | public void assertExpression(String expression, Object expected) throws Exception(Code) | | Performs an assertion that the value of the given Jexl expression
evaluates to the given expected value.
Parameters: expression - is the Jexl expression to evaluate Parameters: expected - is the expected value of the expression throws: Exception - if the expression could not be evaluationed or an assertionfails |
setVariable | public void setVariable(String name, Object value)(Code) | | Puts a variable of a certain name in the context so that it can be used from
assertion expressions.
Parameters: name - variable name Parameters: value - variable value |
|
|