FrontPage. ExperimentalFixtures.
ColumnFixtureOgnlTests
Test Results
Assertions: 21 right, 1 wrong, 0 ignored, 0 exceptions
classpath: C:\Documents and Settings\James Carr\workspace\FixturesSquared\bin
classpath: C:\Documents and Settings\James Carr\workspace\FixturesSquared\lib\fitnesse.jar
classpath: C:\Documents and Settings\James Carr\workspace\FixturesSquared\lib\ognl-2.6.9.jar

Import
fit.fixtures
Just a few quick examples of using OGNL expressions inside of column fixtures.


Calculator
x y sum? product? quotient?
5 2 7 10 2
5 2 sum > x product > 7 quotient > 1
10 10 sum eq (x+y) product eq (x*y) quotient eq (x/y)
3 3 sum >= 6 and sum < 10 product > 8 and product < 10 2 > quotient > 0
2 2   4   4   1
Testing mathematical expressions


A bunch o' examples using string methods... because OGNL's major strength is the ability to access objects of course!
Hello World
description greeting greetee padded message?
normal comparison Hello World   no Hello, World!
call string methods. Hello World   no message.contains("Hello")
  blank Hello James   no !message.contains("World")
  blank Hi Bob   no message.contains(greeting) and message.contains(greetee)
Randomly pad the string, CF fails here. Hi dude yes Hi, dude! expected
Hi, dude! actual
But not the new CF! Hi dude yes message.trim() eq 'Hi, dude!'
Pad again, but just use contains Hi dude yes message.contains('Hi, dude!')
  blank hey man   no message.length() eq 9

HEY!! WHAT ABOUT SYMBOLS!?

Hello World
greeting greetee =message?
Hello World some symbol = Hello, World!

Hello World
greeting greetee= message?
Hey there some symbol Hey there, Hello, World!!
Tire of some symbol message.contains('Hello, World!!')










[.FrontPage] [.RecentChanges]