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

Support the discovery of declarative test suites introduced with JUnit 5.8.0-M1

    XMLWordPrintableJSON

    Details

      Description

      JUnit 5.8.0-M1 introduced declarative test suites [1]. Specifically, a declarative test suite can now be declared via:

       

      package org.junit.platform.suite;
      
      @Suite
      @SelectClasses({
              XTest.class,
              YTest.class,
              ZTest.class
      })
      class SelectClassesTest {
      } 

      which is equivalent to

       

         SummaryGeneratingListener listener = new SummaryGeneratingListener();
              Launcher launcher = LauncherFactory.create();
              LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
                      .selectors(
                              DiscoverySelectors.selectClass(XTest.class),
                              DiscoverySelectors.selectClass(YTest.class),
                              DiscoverySelectors.selectClass(ZTest.class)
                      )
                      .build();
              launcher.execute(request, listener);
              // get the test execution summary from the given listener
      

       

      Further details can be found in [2].

      At the moment, surefire will not discover SelectClassesTest as a valid test class (as well as the selected classes or packages) and will subsequently fail to discover related unit tests.

      I would love to see support for declarative test suites in surefire.

      References

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rzo1 Richard Zowalla
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: