views:

393

answers:

1

How can I use the Groovy Console to kick off junit tests?

(Currently using Groovy 1.6.0)

+2  A: 

I currently use:

junit.textui.TestRunner.run(MyTest)

(Where my junit test class is MyTest)

I've tried running:

MyTest

within the Groovy Console, but that just returns the class instance. Is there an easier way?

Peter
What's wrong with the way you currently use?
Joachim Sauer
I've done it this way too; combined with log4j config to dump out a junit run
sal
@saua - I was hoping to be able to just highlight the classname and run that
Peter