January 31, 2008

TestNG and Scala

There's been a lot of activity in the TestNG world lately... Here are some highlights.

TestNG in Scala

Josh Cough has been busy working with TestNG and Scala. As a credit to Scala's great integration with the JVM, it looks like the task was rather easy and Josh is showing a few examples in this blog post.

I notice two interesting pieces. First, a Data Provider:

@DataProvider{val name="generators"}
def createGenerators = {
val gens = Array(off, on)
for( x
Notice how the same array is used to generate the two dimensions of the boolean matrix... This data provider will simply return the four possible combinations of "on" and "off" pairs.

ScalaTest

Bill Venners, from Artima, has also been busy cranking Scala code, and he came up with this nifty test framework called ScalaTest. His 0.9 release made the rounds and the discussion on Artima is now up to 58 replies(!).

Not surprisingly, Josh chimed in on the thread about the 0.9.1 release and TestNG support in ScalaTest was achieved in less time it took to write these words (I'm a slow typist). Talk about a match in heaven!

ReportNG

On a different front, the efforts to replace the default TestNG reports have not abated. First, there were Cosmin Marginean's XSL based reports, and now we have ReportNG, by Daniel Dyer, who uses Velocity to achieve grace and aesthetics in testing reports (who would have thought?).

Surefire 2.4 release

TestNG users who use Maven to build their code have been having a very hard time these past months. Because of various incompatibilities in the ways that TestNG and Surefire have evolved, TestNG users have been forced to use Surefire snapshots, which are notoriously unstable, and all kinds of mayhems and cryptic errors ensued.