[GRADLE-493] JUnit Test Case detection broken for Created: 21/May/09 Updated: 04/Jan/13 Resolved: 23/May/09 |
|
| Status: | Resolved |
| Project: | Gradle |
| Affects Version/s: | 0.6 |
| Fix Version/s: | 0.6.1 |
| Type: | Bug | ||
| Reporter: | Steve Appling | Assignee: | Tom Eyckmans |
| Resolution: | Fixed | Votes: | 1 |
| Description |
|
The JUnit Test Case detection is broken in a way that makes it unusable for many cases. If your test class inherits from a base test class that in turn inherits from TestCase, it won't be detected. The detection logic requires that your test class directly inherits from TestCase. Any class X where X instanceof TestCase should be accepted. |
| Comments |
| Comment by Johnny Jian [ 22/May/09 ] |
|
Facing the same problem while using Gmock. To be more specific, the test case extends GMockTestCase which extends GroovyTestCase. And I found some statement "return null;// TODO possibly in jars or other directories on the classpath" in org.gradle.api.testing.execution.AbstractTestFrameworkDetector, which should be the cause. |
| Comment by Tom Eyckmans [ 22/May/09 ] |
|
This should work, the only limitation here is that the test class detection doesn't scan into jar files, so if your test classes inherit from a class that is available in a jar file it will not be scanned. We do plan to add this in an upcoming release. I didn't mention this limitation in the documentation yet, so I've added it. |
| Comment by Tom Eyckmans [ 22/May/09 ] |
|
I've added some logic to the test class detection so it scans in jar files, it is available in trunk, if you can please give it a try |
| Comment by Steve Appling [ 22/May/09 ] |
|
The change in trunk seems to work well. Thanks for a quick fix! |
| Comment by Tom Eyckmans [ 23/May/09 ] |
|
Fixed in trunk |