groovy

Allow JUnit 4 tests to be run by the groovy command

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5.2
  • Component/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

Groovy allows JUnit 3.8.x tests and GroovyTestCases to be invoked from the command line. It would be good to also support JUnit 4 tests in this way. The attached patch does this.

Pros and Cons:
It 'simply' saves the 'JUnitCore.main(MyTest.name)' added to the bottom of a script which manually invokes the runner. So we are adding code to the Groovy codebase for only a small saving
It does allow the script to be left as a test class that IDEs would run using their runners and doesn't require them to be polluted with the JUnitCore manual runner code which makes no sense to a IDE runner
Given that Groovy 1.5 is offering Java 1.5 support, it does round out nicely JUnit 4 support which is often used in the jump to Java 1.5 and hence improves the case for using Groovy as your testing language for Java 1.5 projects (e.g. making TDD and BDD easier out of the box)
Are we showing favouritism vs other alternatives, e.g. TestNG
We already have a testng runner but no direct JUnit runner

I am happy to apply it but wanted to attach it here so that discussion can occur around whether it should be a 1.5.2 or 1.6 feature (or not included).

Paul.

Issue Links

Activity

Hide
Paul King added a comment -

This is an extension to GROOVY-1001 (which was for JUnit 3.8.x tests.

Show
Paul King added a comment - This is an extension to GROOVY-1001 (which was for JUnit 3.8.x tests.
Hide
Paul King added a comment -

OK, patch the now includes support for both JUnit 4.4 and TestNG 5.6

Show
Paul King added a comment - OK, patch the now includes support for both JUnit 4.4 and TestNG 5.6
Hide
Guillaume Laforge added a comment -

+1 for me

Show
Guillaume Laforge added a comment - +1 for me
Hide
Russel Winder added a comment -

TestNG 5.7 ?

Show
Russel Winder added a comment - TestNG 5.7 ?
Hide
Paul King added a comment -

Is that a hint to me to support 5.7 (I didn't see one on the download page)? Or a hint for a 5.7 to be released? Or a hint that I should try with HEAD to make sure there are no problems?

Show
Paul King added a comment - Is that a hint to me to support 5.7 (I didn't see one on the download page)? Or a hint for a 5.7 to be released? Or a hint that I should try with HEAD to make sure there are no problems?
Hide
Steven Olsen added a comment -

I think this should definitely be include asap (probably 1.6). I am looking forward to this!

Show
Steven Olsen added a comment - I think this should definitely be include asap (probably 1.6). I am looking forward to this!
Hide
Paul King added a comment -

Hi Steven, this was included in 1.5.2 and hence is closed with the fix version. Cheers, Paul.

Show
Paul King added a comment - Hi Steven, this was included in 1.5.2 and hence is closed with the fix version. Cheers, Paul.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: