Search code examples
javagroovyjunitgroovy-console

Running a JUnit test from Groovy Console


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

(Currently using Groovy 1.6.0)


Solution

  • 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?