Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-889

JUnit | support inheritance of test's categories/groups

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.12.1
    • Maven Surefire Plugin
    • None
    • Patch

    Description

      We have multiple tests in multiple groups and we want to use tests group hierarchy using interface inheritance so we can specify if we wants to run e.g. all NiceTests or more specific NicePurpleTests.

      Right now are tests @Category compared to surefire's group by class name.

      e.g.:
      If we have category hierarchy:

      interface NiceTests extends AllTests;
      interface NicePurpleTests extends NiceTests;
      

      and tests:

      @Category(NiceTests.class) public void ReallyNiceTest();
      @Category(NicePurpleTests.class) public void NicePurpleTestWithDots();
      

      and surefire groups set to:

      <groups>com.example.NiceTests</groups>

      it runs only ReallyNiceTest, but not NicePurpleTestWithDots as wanted.

      I've attached patch which fixed it for me.

      Attachments

        1. surefire-hierarchical-categories.patch
          0.9 kB
          Honza Brázdil
        2. surefire-hierarchical-categories-doc.patch
          1 kB
          Honza Brázdil

        Activity

          People

            pgier Paul Gier
            janinko Honza Brázdil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: