-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce support for declarative test suites #744
Comments
Please consider a new name other than suites - so that people with JUnit 3
history don't accidentally mis-use these for Unit Testing.
Cheers
Mark
|
Tentatively slated for M5. |
@smoyer64, thanks for creating the ticket! I think there are two main topics we need to sort out here:
If I understand correctly, you are currently focusing on # 1; whereas, I would first like to focus on # 2. Status Quo
The Future
My VisionI think it would be most beneficial to the entire community if the JUnit Platform provides support for declarative test suites, akin to what the In other words, the declarative test suite support should be analogous to using the This can be achieved by moving the internals for processing such suite annotations and building the corresponding In this manner, all test engines could benefit from being able to be configured by a generic suite (which is already supported in build scripts). From the perspective of a |
My above proposal avoids exactly such a need. If we support suites at the platform level, there is no need for any additional test engines. |
By the way, my proposal does not in any way preclude the introduction of suite support specific to a particular test engine. The idea is that the Platform (at the launcher level) would only honor the suite API annotations if a special, platform-specific annotation is present (e.g., |
Another topic to sort out (which I didn't explain so well above) is whether suites should be handled specially within the test plan. With the generic approach (at the Launcher level), this would not be the case since test engines would not see the presence of a suite as a first-class citizen in the test plan. As I mentioned above, suites would be invisible to test engines. So, if we want to include first-class support for suites as nodes within the test plan, that opens up a whole new can of worms! ... And I'm not so sure we want to go that route, at least not before GA. |
@sbrannen I actually think we're exactly on the same page - #687 along with #681 were the two issues that I put in to allow an extension to implement suites. The engine I've already created works fine but with a couple more extension points it would be trivial to simply make it an extension. Let's ignore the word "suite" for a moment - I think there's a great argument that these are simply hierarchical test containers that participate in the engine's life-cycle at their appropriate level of the hierarchy. And the I wrote this issue as asked in #681 because I thought you were promoting a built-in suite (which may be worthwhile) but the original two issues were simply to make it easier to write extensions that implement arbitrary containers. Breaking the tie between EDIT - It appears we're trying to have one of those conversations where we're both talking at the same time ;) I also should have noted that the code blocks I put in the original description are indicative of what I'd like to write when creating suites. The only really important feature included that's lacking in JUnit 4 is that |
I will make another attempt to explain why I think there are risks/issues with the name. I like the concept, but the linkage to the old names causes risk. All of my work is consulting work in organizations. Frequently when I sit down with teams I get a chance to see their code. In too many cases I see people who have JUnit 3 style tests and suites in JUnit 4. When prompted they're not aware that this is no longer the preferred way. What I have loved about JUnit 5 is that by and large the right choices will be made by default. Re-using the suites word by default will make easier for people to accidentally mis-use them in world where people use their "intelli-sense" type technology, instead of reading the documentation and reflecting. Cheers |
Do you have a better name in mind, Mark? |
@mlevison, I have to admit that I don't really understand your concerns. I personally cannot think of a better name than "suite" for something that allows you to group together a collection of tests that should be run together. In fact, the
We also use the term suite in the documentation for the
So I would argue that the familiarity with suites from JUnit 3, JUnit 4, and other testing frameworks will make the intended usage on the JUnit Platform quite clear. |
@sbrannen When I said to "ignore the word suite", I wasn't implying that I didn't think that name was appropriate ... it definitely feels familiar and I think it would actually be confusing to migrating users to suddenly use a different term (my intent in that paragraph was to point out that suites are a "kind of" test container). I'll see about cleaning up my suite-engine and getting it moved into junit-pioneer - perhaps we can use it as a safe way to beta-test before committing to a course of action in platform/jupiter. |
On Fri, Mar 24, 2017 at 10:37 AM, Christian Stein ***@***.***> wrote:
Do you have a better name in mind, Mark?
No you expect intelligent thought. I didn't yet. Ideas (that I don't
like): collection, series, set, map or if we're attached to Suite
something more expressive like IntegrationSuite that makes it clear that
these are not intended for Unit tests.
Cheers
Mark
…
On Fri, Mar 24, 2017 at 10:37 AM, Christian Stein ***@***.***> wrote:
Do you have a better name in mind, Mark?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#744 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAImZsXAUEHKkIlABffel3vXKWH562d9ks5ro9UcgaJpZM4Ml3IL>
.
--
[image: headshot-square-300x300]
<http://www.flickr.com/photos/36331075@N00/9674877046/> *Mark Levison* | 1
(877) 248-8277 | Twitter <https://twitter.com/mlevison> | LinkedIn
<http://ca.linkedin.com/in/marklevison> | Facebook
<https://www.facebook.com/agilepainrelief>
Certified ScrumMaster Training: Vancouver
<http://agilepainrelief.com/courses/vancouver> | Edmonton
<http://agilepainrelief.com/courses/edmonton> | Ottawa
<http://agilepainrelief.com/courses/ottawa> | Montreal
<http://agilepainrelief.com/courses/montreal> | Toronto
<http://agilepainrelief.com/courses/toronto>
Certified Product Owner & Private Training also available ~ Our Training
Schedule <http://agilepainrelief.com/courses/certified-scrum-agile-training>
Agile Pain Relief Consulting <http://agilepainrelief.com/> | Notes from a
Tool User <http://agilepainrelief.com/notesfromatooluser>
Proud Sponsor of Agile Tour Gatineau Ottawa <http://goagiletour.ca/> and Agile
Coach Camp Canada <http://agilecoachcampcanada.wordpress.com/>
|
On Fri, Mar 24, 2017 at 10:57 AM, Sam Brannen ***@***.***> wrote:
@mlevison <https://github.com/mlevison>, I have to admit that I don't
really understand your concerns.
I personally cannot think of a better name than "suite" for something that
allows you to group together a collection of tests that should be run
together.
In fact, the Suite support in JUnit 4 achieves exactly what we are
describing here:
Using Suite as a runner allows you to manually build a suite containing
tests from many classes.
My point is that some years after the appearance I JUnit 4 - I still find
people writing their tests as if they were using JUnit 3. Not because this
was desirable, but because they didn't know that they didn't need suites
anymore. Often when I point out that they're not longer needed they tidy up.
My original concern, was that by reusing the name you risk the same cargo
cult habits with JUnit 5 as I've seen before.
Its cool if you disagree, am I at least making sense this time?
Cheers
Mark
|
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works by mapping the `TestIdentifier` used by the launcher to `TestDescriptor` used by the engine during discovery and execution. ``` package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ``` import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` The suite engine converts an annotated class into a discovery request. This request is executed and the resulting test plan is mapped to a tree of test descriptors. In essence the tree of test descriptors are a view on the test plan. So suppose the discovery requests produces this test plan: ``` JUnit Jupiter |- TestA ||- method1 ||- method2 |- TestB ||- method1 ||- method2 ``` Then that test plan is mapped to a tree of test descriptors like so: ``` SuiteEngine |- ExampleSuite ||-JUnit Jupiter |||- TestA ||||- method1 ||||- method2 |||- TestB ||||- method1 ||||- method2 ```` The unique identifiers are remapped by pre-pending the unique identifier of the suite. So: ``` junit-jupiter/TestA/method1() -> junit-suite/ExampleSuite/junit-jupiter/TestA/method1() ``` Issue: junit-team#744
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works adding the test descriptors of the discovered engines and tests as children to its own test descriptor. ```java package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ```java import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` Resolves #744.
Hi All,
|
There's a sample class in the user guide: If that's not clear enough, we should improve it. Please let us know!
Yes, you can freely mix tests from different engines in one suite. |
Implements a test engine that allows declarative execution of test suites using the `@Suite` annotation. Internally the Suite Engine uses the JUnit Platform Launcher. The engine works adding the test descriptors of the discovered engines and tests as children to its own test descriptor. ```java package org.junit.platform.suite; import org.junit.platform.suite.api.SelectPackages; @suite @SelectPackages("org.junit.suite.testcases") class SelectPackageSuite { } ``` Is equivalent to: ```java import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; public class Main { public static void main(String[] args) { Launcher launcher = LauncherFactory.create(); LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(DiscoverySelectors.selectPackage("org.junit.suite.testcases")) .build(); launcher.execute(request); } } ``` Resolves junit-team#744.
Overview
As requested in issue #681 (
Introduce junit-platform-suite-api module
), the annotations used for test discovery and selection in theJUnitPlatform
runner have been refactored into thejunit-platform-suite-api
. This allows a purely JUnit 5 test suite to be defined declaratively, though it currently requires an alternate engine (as opposed to an extension).This issue describes a generalized JUnit platform suite that's suitable for the Jupiter test engine as well as any others that might be chosen. It's my opinion that unit tests rarely require test suites, but it becomes far more common when integration, system and acceptance tests are being executed due to the very common integration with external systems that should only be initialized before the entire test run. Examples of resources that can be safely shared among tests are database connection pools (or really any connection pool), test frameworks that require significant set-up time (e.g. GWT test suites eliminate 20s of HtmlUnit set-up time for each test - it's only incurred once at the beginning of each suite).
The examples shown below indicate how the
@Suite
annotation can be used in conjunction with those already in thejunit-platform-suite-api
module. Originally I'd also defined the@BeforeSuite
and@AfterSuite
annotations but after further consideration decided that since suites are really just an arbitrary collection of indeterminately nested test containers, it would be better if the@BeforeAll
and@AfterAll
annotations were contextual (nested in the same way the hierarchy would be presented in the test tree). I've also assumed that these annotations no longer require the static modifier as discussed elsewhere.Imagine if you will a set of acceptance tests that have a custom reporting mechanism that should be configured for the entire test run. Included within this outer suite is a set of tests that require a database connection pool and a different set of tests that require an LDAP connection pool. The top-level suite definition for the acceptance tests might look something like:
There are two notable characteristics of this test suite:
A child suite for tests that require a database connection pool might look something like this:
If run under Maven, test classes that end in "IT" would be run using the
maven-failsafe-plugin
. If there are other classes of integration tests not run during acceptance testing it would also be necessary to make sure the acceptance test classes were not run (as they'd fail without the suite's set-up methods).Feature Request
Provide the means for arbitrarily nested, declarative tests suites in JUnit 5 including the execution of set-up and tear-down methods
Related Issues
@BeforeSuite
and@AfterSuite
annotations #456Deliverables
The text was updated successfully, but these errors were encountered: