Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-1279

Junit test class detection includes non-static inner classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9.1

      Description

      Noticed this when building a gradle build for apache commons collections. That project has a bunch of junit test classes which follow this pattern:

      AbstractMapTest.java
      public abstract class AbstractMapTest extends TestCase {
        public MapTest extends AbstractMapTest {
          // test stuff
        }
      }
      

      It's weird, and I'm not even sure how they would work...but that's not really at issue. Gradle detects those inner classes as junit test classes, but it should probably filter any inner classes which are not static, since it is impossible to instantiate them independently.

        Attachments

          Activity

            People

            Assignee:
            hans_d Hans Dockter
            Reporter:
            ansel1 Russ Egan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: