|
||||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES All Classes |
See:
Description
Class Summary | |
---|---|
Asserter | A utility class for performing JUnit based assertions using Jexl expressions. |
Using JEXL expressions in JUnit assertions.
This package only contains one class, Asserter, which allows you to use a JEXL expression in a JUnit assertion. The following example demonstrates the use of the Asserter class. An instance is created, and the internal JexlContext is populated via calls to setVariable(). Calls to assertExpression() succeed if the expression evaluates to the value of the second parameter, otherwise an AssertionFailedException is thrown.
Asserter asserter = new Asserter(); asserter.setVariable("foo", new Foo()); asserter.setVariable("person", "James"); asserter.assertExpression("person", "James"); asserter.assertExpression("size(person)", new Integer(5)); asserter.assertExpression("foo.getCount()", new Integer(5)); asserter.assertExpression("foo.count", new Integer(5));
|
||||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES All Classes |