Java Reference
In-Depth Information
Listing 6.5. A Groovy JUnit test for a Java implementation
There are some code simplifications here, but this is still recognizably a standard JUnit test.
Initial data canbeprovidedbycoercing arangeintoanarrayofintegers. The every meth-
od in Collection lets me check all the return values in one statement. Otherwise this is
the same as before.
One other note: due to the Groovy Truth, [ 3 ] assert in Groovy is the same as asser-
tTrue and assertNotNull . Also, the Groovy assert has excellent debugging out-
Search WWH ::




Custom Search