Object-Graph Navigation Language (OGNL)
has an extension to supports OGNL expressions. Here are some examples, using the Calculator system:
| < , <= , > , >= , and , or |
supports these simple mathematical expressions. Use the question mark to specify the position of the value returned by the system. For example, if the expected value should be greater than 15, you will write "? > 15" in the cell. |
| + , - , / , * |
performs simple operations as a resulting expression. To specify you want to evaluate those operations prior to the comparison, insert an equal sign at the beginning of the operation (ex: =4+1-3). |
| Import |
| com.greenpepper.samples.application.calculator |
| rule for |
calculator |
| x |
y |
sum? |
product? |
quotient? |
| 6 |
2 |
8 |
12 |
3 |
| 7 |
0 |
7 |
0 |
error |
| 40 |
50 |
90 |
? > 100 |
|
| 4 |
-5 |
? <= 0 |
-20 |
? <= 0 |
| 3 |
3 |
? < 1 or ? > 4 |
? >= 9 and ? < 12 |
"1" |
| 4 |
2 |
=4+2-0 |
=2*4 |
=4/2 |
To use this extension, you need to specify the fixture factory as com.greenpepper.extensions.ognl.OgnlSupport and add the greenpepper-extensions-ognl-x.x.jar and ognl-x.x.x.jar (that can be found here http://www.greenpeppersoftware.com/nexus/content/groups/public/
) to the classpath of the SUT.