Issue Details (XML | Word | Printable)

Key: GROOVY-2447
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: Paul King
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Allow JUnit 4 tests to be run by the groovy command

Created: 25/Dec/07 02:26 PM   Updated: 16/May/08 05:53 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.2

Time Tracking:
Not Specified

File Attachments: 1. Text File Allow_junit4_testCase_to_be_run_by_groovy_command.patch (9 kB)
2. Text File native_junit4_testng_tests.patch (15 kB)

Issue Links:
Supercedes
 

Patch Submitted: Yes


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King added a comment - 25/Dec/07 02:29 PM
This is an extension to GROOVY-1001 (which was for JUnit 3.8.x tests.

Paul King added a comment - 26/Dec/07 03:07 AM
OK, patch the now includes support for both JUnit 4.4 and TestNG 5.6

Guillaume Laforge added a comment - 26/Dec/07 03:33 AM
+1 for me

Russel Winder added a comment - 26/Dec/07 10:33 AM
TestNG 5.7 ?

Paul King added a comment - 26/Dec/07 02:20 PM
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?

Steven Olsen added a comment - 16/May/08 05:40 PM
I think this should definitely be include asap (probably 1.6). I am looking forward to this!

Paul King added a comment - 16/May/08 05:53 PM
Hi Steven, this was included in 1.5.2 and hence is closed with the fix version. Cheers, Paul.