From e09772eb7b14cebd8d7089cd427c1a30eb4f2c01 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 13 Sep 2020 15:36:11 +0200 Subject: [PATCH 0001/1433] Back to snapshots for further development --- .../docs/asciidoc/release-notes/index.adoc | 10 +- .../release-notes/release-notes-5.6.0.adoc | 22 -- .../release-notes/release-notes-5.6.1.adoc | 36 ---- .../release-notes/release-notes-5.6.2.adoc | 39 ---- .../release-notes/release-notes-5.7.0.adoc | 196 +----------------- .../release-notes/release-notes-5.8.0-M1.adoc | 58 ++++++ gradle.properties | 6 +- 7 files changed, 66 insertions(+), 301 deletions(-) delete mode 100644 documentation/src/docs/asciidoc/release-notes/release-notes-5.6.0.adoc delete mode 100644 documentation/src/docs/asciidoc/release-notes/release-notes-5.6.1.adoc delete mode 100644 documentation/src/docs/asciidoc/release-notes/release-notes-5.6.2.adoc create mode 100644 documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc diff --git a/documentation/src/docs/asciidoc/release-notes/index.adoc b/documentation/src/docs/asciidoc/release-notes/index.adoc index 82817f7d5100..85932bdfc78f 100644 --- a/documentation/src/docs/asciidoc/release-notes/index.adoc +++ b/documentation/src/docs/asciidoc/release-notes/index.adoc @@ -8,7 +8,7 @@ Stefan Bechtold; Sam Brannen; Johannes Link; Matthias Merdes; Marc Philipp; Juli :numbered!: // -This document contains the _change log_ for all JUnit 5 releases since 5.6 GA. +This document contains the _change log_ for all JUnit 5 releases since 5.7 GA. Please refer to the <<../user-guide/index.adoc#user-guide,User Guide>> for comprehensive reference documentation for programmers writing tests, extension authors, and engine @@ -16,10 +16,6 @@ authors as well as build tool and IDE vendors. include::{includedir}/link-attributes.adoc[] -include::{basedir}/release-notes-5.7.0.adoc[] - -include::{basedir}/release-notes-5.6.2.adoc[] +include::{basedir}/release-notes-5.8.0-M1.adoc[] -include::{basedir}/release-notes-5.6.1.adoc[] - -include::{basedir}/release-notes-5.6.0.adoc[] +include::{basedir}/release-notes-5.7.0.adoc[] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.0.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.0.adoc deleted file mode 100644 index 472f6baa708d..000000000000 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.0.adoc +++ /dev/null @@ -1,22 +0,0 @@ -[[release-notes-5.6.0]] -== 5.6.0 - -*Date of Release:* January 20, 2020 - -*Scope:* - -* New `@EnabledForJreRange` and `@DisabledForJreRange` execution conditions -* `@Order` allows to specify relative order -* Parameter names are included in default display names of parameterized test invocations -* Improvements to `@CsvSource` and `@CsvFileSource` -* New `TestInstancePreDestroyCallback` extension API -* Performance improvements and bug fixes for the Vintage engine -* Improved error reporting for failures during test discovery and execution -* Support for using `any()` and `none()` in tag expressions -* `org.junit.platform.console` now provides a `java.util.spi.ToolProvider` -* `DiscoverySelectors` for tests in inherited nested classes -* OSGi metadata -* Minor bug fixes and improvements - -For complete details consult the -https://junit.org/junit5/docs/5.6.0/release-notes/index.html[5.6.0 Release Notes] online. diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.1.adoc deleted file mode 100644 index ba7fd3266eb3..000000000000 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.1.adoc +++ /dev/null @@ -1,36 +0,0 @@ -[[release-notes-5.6.1]] -== 5.6.1 - -*Date of Release:* March 22, 2020 - -*Scope:* Bug fixes since 5.6.0 - -For a complete list of all _closed_ issues and pull requests for this release, consult the -link:{junit5-repo}+/milestone/47?closed=1+[5.6.1] milestone page in the JUnit repository -on GitHub. - - -[[release-notes-5.6.1-junit-platform]] -=== JUnit Platform - -==== Bug Fixes - -* In order to avoid file locking issues on Microsoft Windows, URLs are no longer cached - when loading `junit-platform.properties` files. -* The presence of multiple `junit-platform.properties` files on the classpath now only - results in a warning if the files have different URLs. - - -[[release-notes-5.6.1-junit-jupiter]] -=== JUnit Jupiter - -==== Bug Fixes - -* `TestInstancePreDestroyCallback` extensions are now invoked in reverse registration - order when `PER_CLASS` test instance lifecycle semantics have been configured. - - -[[release-notes-5.6.1-junit-vintage]] -=== JUnit Vintage - -No changes. diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.2.adoc deleted file mode 100644 index 0da105d0ef82..000000000000 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.6.2.adoc +++ /dev/null @@ -1,39 +0,0 @@ -[[release-notes-5.6.2]] -== 5.6.2 - -*Date of Release:* April 10, 2020 - -*Scope:* Bug fixes since 5.6.1 - -For a complete list of all _closed_ issues and pull requests for this release, consult the -link:{junit5-repo}+/milestone/48?closed=1+[5.6.2] milestone page in the JUnit repository -on GitHub. - - -[[release-notes-5.6.2-junit-platform]] -=== JUnit Platform - -==== Bug Fixes - -* `ReflectionSupport.findNestedClasses()` no longer detects inner class cycles for classes - that do not match the supplied `Predicate`. For example, JUnit Jupiter no longer throws - an exception if an inner class cycle is detected in a nested class hierarchy whose inner - classes are not annotated with `@Nested`. - - -[[release-notes-5.6.2-junit-jupiter]] -=== JUnit Jupiter - -==== Bug Fixes - -* Test discovery no longer halts with an exception for inner class hierarchies that form a - cycle if such inner classes are not annotated with `@Nested`. - - -[[release-notes-5.6.2-junit-vintage]] -=== JUnit Vintage - -==== Bug Fixes - -* Generating display names from JUnit 4 `Descriptions` now falls back to `getDisplayName` - if `getMethodName` returns a blank `String` instead of throwing an exception. diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.0.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.0.adoc index 972739531da1..80cf3cc235ab 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.0.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.0.adoc @@ -14,197 +14,5 @@ * Improvements to `assertTimeoutPreemptively()` * Improvements to `@CsvFileSource` and `@CsvSource` - -For a complete list of all _closed_ issues and pull requests for this release, consult the -link:{junit5-repo}+/milestone/44?closed=1+[5.7 M1], -link:{junit5-repo}+/milestone/49?closed=1+[5.7 RC1], and -link:{junit5-repo}+/milestone/50?closed=1+[5.7 GA] milestone pages in the JUnit repository -on GitHub. - - -[[release-notes-5.7.0-RC1-overall-improvements]] -=== Overall Improvements - -* Javadoc JARs now contain `package-list` in addition to `element-list` for compatibility - with tools like NetBeans 11. - - -[[release-notes-5.7.0-junit-platform]] -=== JUnit Platform - -==== Promoted Features - -The following APIs have been promoted from "experimental" status: - -* `LauncherConstants` is now _stable_ -* `LauncherConfig` (except for methods introduced in 5.7) is now _stable_ -* `LegacyXmlReportGeneratingListener` is now _stable_ -* `org.junit.platform.testkit.engine` is now _maintained_ - -==== Bug Fixes - -* In XML reports generated by the `ConsoleLauncher` or - `LegacyXmlReportGeneratingListener`, characters in exception messages and other - user-supplied values that are not allowed in XML are now replaced with their character - reference – for example, `\0` becomes `�`. -* The `Launcher` now throws an exception when a previously executed `TestPlan` is - attempted to be executed again. - -==== Deprecations and Breaking Changes - -* In the `EngineTestKit` API, the `all()`, `containers()`, and `tests()` methods in - `EngineExecutionResults` that were deprecated in JUnit Platform 1.6.0 have been removed - in favor of `allEvents()`, `containerEvents()`, and `testEvents()`, respectively. -* The following methods in `EngineTestKit` are now deprecated with replacements: - - `execute(String, EngineDiscoveryRequest)` → `execute(String, LauncherDiscoveryRequest)` - - `execute(TestEngine, EngineDiscoveryRequest)` → `execute(TestEngine, LauncherDiscoveryRequest)` - - `Builder.filters(DiscoveryFilter...)` → `Builder.filters(Filter...)` -* `EngineTestKit` no longer takes into account implicit configuration parameters (i.e. - system properties and the `junit-platform.properties` classpath resource) by default. - This change makes tests executed via `EngineTestKit` independent of the environment they - are executed in. - -==== New Features and Improvements - -* The number of containers and tests excluded by post discovery filters based on their tags - is now logged, along with the exclusion reasons. -* New `junit.platform.execution.listeners.deactivate` configuration parameter that allows - one to specify a comma-separated list of patterns for deactivating - `TestExecutionListener` implementations registered via the `ServiceLoader` mechanism. -* The `@Testable` annotation may now be applied _directly_ to fields. -* New `Node.DynamicTestExecutor#execute(TestDescriptor, EngineExecutionListener)` method - for engines that wish to provide a custom `EngineExecutionListener` and cancel or wait - for the execution of a submitted test via the returned `Future`. -* New `EngineExecutionListener.NOOP` `EngineExecutionListener` implementation. -* All declared methods in the `EngineExecutionListener` API now have empty `default` - implementations. -* The `EngineTestKit` now reuses the same test discovery and execution logic as the - `Launcher`. Thus, it's now possible to test an engine's behavior in the presence of - post-discovery filters (e.g. tag filters) and with regard to pruning. -* The `EngineTestKit` now supports matching conditions with events loosely, i.e. an - incomplete match with or without a fixed order. -* The `@Testable` annotation may now target any element type, including fields, methods, - classes, packages, and modules. -* When using the `ConsoleLauncher`, classes selected explicitly via `--select-class` and - `--select-method` are now always executed regardless of class name patterns provided - via `--include-classname` or the default class name pattern. -* The `ConsoleLauncher` now honors the `--disable-ansi-colors` option when printing usage - help. -* New `FilePosition` support in `FileSelector` and `ClasspathResourceSelector`. -* New `getJavaClass()` and `getJavaMethod()` methods in - `org.junit.platform.engine.support.descriptor.MethodSource`. -* Custom `PostDiscoveryFilter` implementations can now be registered via Java’s - `ServiceLoader` mechanism. -* New `org.junit.platform.jfr` module. When running on Java 11 or later, it provides and - registers a `TestExecutionListener` that generates Java Flight Recorder events. -* The `ExecutionRecorder` in `junit-platform-testkit` is now public for fine-grained - testing of classes that use `EngineExecutionListener`. -* `ForkJoinPoolHierarchicalTestExecutorService` can now be constructed by supplying a - `ParallelExecutionConfiguration`. -* `HierarchicalTestEngine` now supports a global resource lock. - - -[[release-notes-5.7.0-junit-jupiter]] -=== JUnit Jupiter - -==== Promoted Features - -The following APIs have been promoted from _experimental_ to _stable_: - -* `junit-jupiter-migrationsupport` -* `junit-jupiter-params` (i.e. `@ParameterizedTest` etc.) -* `@TestMethodOrder`, `MethodOrderer`, and its pre-5.7 implementations -* `@DisplayNameGeneration`, `DisplayNameGenerator`, and its pre-5.7 implementations -* `@Timeout` -* `TestInstanceFactory` -* `TestInstancePreDestroyCallback` -* `TestInstances` and corresponding `ExtensionContext` methods -* `TestWatcher` -* Kotlin-specific assertions that were introduced in 5.1 - -==== Bug Fixes - -* `@TempDir` is now able to clean up files in read-only directories. -* The Jupiter engine now ignores `MethodSelectors` for methods in non-Jupiter test - classes instead of failing for missing methods in such cases. -* `CloseableResource` instances stored in `ExtensionContext.Store` are now closed in the - reverse order they were added in. Previously, the order was undefined and unstable. -* Inherited `@BeforeEach` methods are now executed on correct instances for `@Nested` - classes. -* Registered `TestInstancePreDestroyCallback` extensions are now always called if an - instance of a test class was created, regardless whether any registered - `TestInstancePostProcessor` extension threw an exception. -* Disabled `@TestTemplate` methods (e.g. `@ParameterizedTest` and `@RepeatedTest` methods) - are now reported to registered `TestWatcher` extensions. - -==== Deprecations and Breaking Changes - -* `MethodOrderer.Alphanumeric` has been deprecated in favor of `MethodOrderer.MethodName` - which provides the exact same functionality but has a more descriptive name. - -==== New Features and Improvements - -* New `@EnabledIf` and `@DisabledIf` annotations can be used to enable or disable a test - or container based on condition methods. -* New `MethodOrderer` named `DisplayName` that sorts test methods alphanumerically based - on their display names. -* New `DisplayNameGenerator` named `Simple` (based on `Standard`) that removes trailing - parentheses for methods with no parameters. -* `assertThrows()` for Kotlin can now be used with suspending functions and other lambda - contexts that require inlining. -* The `JRE` enum now provides a static `currentVersion()` method that returns the enum - constant for the currently executing JRE, e.g. for use in custom execution conditions - and other extensions. -* The `name` attribute of `@ParameterizedTest` is now clearly documented to be a - `MessageFormat` pattern. -* Synthetic constructors are now ignored when instantiating a test class. -* The Javadoc for the `provideTestTemplateInvocationContexts()` method in - `TestTemplateInvocationContextProvider` has been aligned with the actual implementation. - Providers are now officially allowed to return an empty stream, and the error message - when all provided streams are empty is now more helpful. -* New `getDisplayName()` method in `MethodDescriptor` for use in `MethodOrderer` - implementations. -* New `assertLinesMatch()` method overloads in `Assertions` that accept two - `Stream` instances for comparison. -* `assertTimeoutPreemptively()` in `Assertions` now reports the stack trace of the timed - out thread in the cause of the `AssertionFailedError`. -* `assertTimeoutPreemptively()` now uses threads with a specific name, conveying their use - by the framework, to facilitate debugging and stack trace analysis. -* All `@Enabled*`/`@Disabled*` annotations now have an optional `disabledReason` attribute - that can be used to provide an additional explanation as to why a test or container - might be disabled. -* `JAVA_16` has been added to the `JRE` enum for use with JRE-based execution conditions. -* New `MethodOrderer.MethodName` to replace `MethodOrderer.Alphanumeric` with the exact - same functionality but a more descriptive name. -* New `junit.jupiter.testmethod.order.default` configuration parameter to set the default - `MethodOrderer` that will be used unless `@TestMethodOrder` is present. -* New `DynamicTest.stream()` factory method that accepts a `Stream` instead of an - `Iterator` for the input source. -* `@CsvFileSource` now allows one to specify file paths as an alternative to classpath - resources. -* `@CsvFileSource` and `@CsvSource` now provide a `maxCharsPerColumn` attribute for - configuring the maximum number of characters per column. -* Arguments in display names of parameterized test invocations are now truncated if they - exceed a configurable maximum length (defaults to 512 characters). -* New `@Isolated` annotation allows to run test classes in isolation of other test classes - when using parallel test execution. -* New `TypedArgumentConverter` for converting one specific type to another, therefore - reducing boilerplate type checks compared to implementing `ArgumentConverter` directly. -* New `ExtensionContext.getConfigurationParameter(String, Function)` - convenience method for reading transformed configuration parameters from extensions. - - -[[release-notes-5.7.0-junit-vintage]] -=== JUnit Vintage - -==== Bug Fixes - -* The Vintage engine no longer fails when resolving a `MethodSelector` for methods of test - classes that cannot be found via reflection. This allows selecting Spock feature methods - by their source code name even though they have a generated method name in the bytecode. - -==== New Features and Improvements - -* The internal `JUnit4VersionCheck` class -- which verifies that a supported version of - JUnit 4 is on the classpath -- now implements a lenient version ID parsing algorithm in - order to support custom version ID formats such as `4.12.0`, `4.12-patch_1`, etc. +For complete details consult the +https://junit.org/junit5/docs/5.7.0/release-notes/index.html[5.7.0 Release Notes] online. diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc new file mode 100644 index 000000000000..b281c6fc672c --- /dev/null +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -0,0 +1,58 @@ +[[release-notes-5.8.0-M1]] +== 5.8.0-M1 + +*Date of Release:* ❓ + +*Scope:* ❓ + +For a complete list of all _closed_ issues and pull requests for this release, consult +the link:{junit5-repo}+/milestone/51?closed=1+[5.8 M1] milestone page in the JUnit repository +on GitHub. + + +[[release-notes-5.8.0-M1-junit-platform]] +=== JUnit Platform + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ + + +[[release-notes-5.8.0-M1-junit-jupiter]] +=== JUnit Jupiter + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ + + +[[release-notes-5.8.0-M1-junit-vintage]] +=== JUnit Vintage + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ diff --git a/gradle.properties b/gradle.properties index 30e3b4488249..02f0edf292b1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,13 @@ group = org.junit -version = 5.7.0 +version = 5.8.0-SNAPSHOT jupiterGroup = org.junit.jupiter platformGroup = org.junit.platform -platformVersion = 1.7.0 +platformVersion = 1.8.0-SNAPSHOT vintageGroup = org.junit.vintage -vintageVersion = 5.7.0 +vintageVersion = 5.8.0-SNAPSHOT defaultBuiltBy = JUnit Team From 5d8384323fd77c21e9a29078807f453a1b7eaf61 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 13 Sep 2020 15:55:39 +0200 Subject: [PATCH 0002/1433] Disable VintageMavenIntegrationTests for now Follow-up: #2402 --- .../tooling/support/tests/VintageMavenIntegrationTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index d396beaaf5b8..11d93dc0643d 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -18,6 +18,7 @@ import de.sormuras.bartholdy.Result; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -26,6 +27,7 @@ import platform.tooling.support.Helper; import platform.tooling.support.Request; +@Disabled("needs to consume maven.repo system property instead of downloading from Sonatype snapshot repo or Maven local repo") class VintageMavenIntegrationTests { @Test From 7aebb420d594c6b62a780420878595ca46279c62 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Mon, 14 Sep 2020 17:39:59 +0200 Subject: [PATCH 0003/1433] Add JUnit Platform JFR in Dependency Metadata and Diagram This commit also removes the dependency metadata from the README.md file and replaces it with a link to the user guide instead. Closes #2403 --- README.md | 50 +++---------------- .../docs/asciidoc/user-guide/appendix.adoc | 5 ++ 2 files changed, 11 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 8b6a8761c39d..5439f0bf54c0 100644 --- a/README.md +++ b/README.md @@ -78,60 +78,22 @@ consumption in other projects via the following command. ## Dependency Metadata -The following sections list the dependency metadata for the JUnit Platform, JUnit -Jupiter, and JUnit Vintage. +Consult the [Dependency Metadata] section of the [User Guide] for a list of all artifacts +of the JUnit Platform, JUnit Jupiter, and JUnit Vintage. -See also for releases and for snapshots. - -### JUnit Platform - -- **Group ID**: `org.junit.platform` -- **Version**: `1.7.0` or `1.8.0-SNAPSHOT` -- **Artifact IDs** and Java **module** name: - - `junit-platform-commons` (`org.junit.platform.commons`) - - `junit-platform-console` (`org.junit.platform.console`) - - `junit-platform-console-standalone` (*N/A*) - - `junit-platform-engine` (`org.junit.platform.engine`) - - `junit-platform-jfr` (`org.junit.platform.jfr`) - - `junit-platform-launcher` (`org.junit.platform.launcher`) - - `junit-platform-reporting` (`org.junit.platform.reporting`) - - `junit-platform-runner` (`org.junit.platform.runner`) - - `junit-platform-suite-api` (`org.junit.platform.suite.api`) - - `junit-platform-testkit` (`org.junit.platform.testkit`) - -### JUnit Jupiter - -- **Group ID**: `org.junit.jupiter` -- **Version**: `5.7.0` or `5.8.0-SNAPSHOT` -- **Artifact IDs** and Java **module** name: - - `junit-jupiter` (`org.junit.jupiter`) - - `junit-jupiter-api` (`org.junit.jupiter.api`) - - `junit-jupiter-engine` (`org.junit.jupiter.engine`) - - `junit-jupiter-migrationsupport` (`org.junit.jupiter.migrationsupport`) - - `junit-jupiter-params` (`org.junit.jupiter.params`) - -### JUnit Vintage - -- **Group ID**: `org.junit.vintage` -- **Version**: `5.7.0` or `5.8.0-SNAPSHOT` -- **Artifact ID** and Java **module** name: - - `junit-vintage-engine` (`org.junit.vintage.engine`) - -### Bill of Materials (BOM) - -- **Group ID**: `org.junit` -- **Artifact ID** `junit-bom` -- **Version**: `5.7.0` or `5.8.0-SNAPSHOT` +See also for releases and + for snapshots. [Codecov]: https://codecov.io/gh/junit-team/junit5 [CONTRIBUTING.md]: https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md +[Dependency Metadata]: https://junit.org/junit5/docs/current/user-guide/#dependency-metadata [Gitter]: https://gitter.im/junit-team/junit5 [Gradle Wrapper]: https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:using_wrapper [JaCoCo]: https://www.eclemma.org/jacoco/ [Javadoc]: https://junit.org/junit5/docs/current/api/ [JDK 11]: https://jdk.java.net/11/ [Release Notes]: https://junit.org/junit5/docs/current/release-notes/ +[Samples]: https://github.com/junit-team/junit5-samples [StackOverflow]: https://stackoverflow.com/questions/tagged/junit5 [User Guide]: https://junit.org/junit5/docs/current/user-guide/ -[Samples]: https://github.com/junit-team/junit5-samples diff --git a/documentation/src/docs/asciidoc/user-guide/appendix.adoc b/documentation/src/docs/asciidoc/user-guide/appendix.adoc index 2551c36ba692..ab0164d15321 100644 --- a/documentation/src/docs/asciidoc/user-guide/appendix.adoc +++ b/documentation/src/docs/asciidoc/user-guide/appendix.adoc @@ -39,6 +39,8 @@ artifacts are deployed to Sonatype's {snapshot-repo}[snapshots repository] under directory. See <> for details. `junit-platform-engine`:: Public API for test engines. See <> for details. + `junit-platform-jfr`:: + Provides a `TestExecutionListener` for Java Flight Recorder events on the JUnit Platform. See <> for details. `junit-platform-launcher`:: Public API for configuring and launching test plans -- typically used by IDEs and build tools. See <> for details. @@ -142,6 +144,7 @@ package org.junit.platform { [junit-platform-commons] as commons [junit-platform-console] as console [junit-platform-engine] as engine + [junit-platform-jfr] as jfr [junit-platform-launcher] as launcher [junit-platform-reporting] as reporting [junit-platform-runner] as runner @@ -185,6 +188,8 @@ console ..> reporting launcher ..> engine +jfr ..> launcher + engine ..> opentest4j engine ..> commons From 6bed033234a656b9145367382b1167172c3d889e Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 18 Sep 2020 12:36:20 +0200 Subject: [PATCH 0004/1433] Avoid deprecation warning in OrderedMethodTests --- .../org/junit/jupiter/engine/extension/OrderedMethodTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java index 16d98f8c3eea..e9ff3b2032da 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java @@ -35,7 +35,6 @@ import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.MethodDescriptor; import org.junit.jupiter.api.MethodOrderer; -import org.junit.jupiter.api.MethodOrderer.Alphanumeric; import org.junit.jupiter.api.MethodOrderer.MethodName; import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; import org.junit.jupiter.api.MethodOrderer.Random; @@ -409,7 +408,7 @@ void zzz() { } @SuppressWarnings("deprecation") - @TestMethodOrder(Alphanumeric.class) + @TestMethodOrder(org.junit.jupiter.api.MethodOrderer.Alphanumeric.class) static class AlphanumericTestCase extends BaseTestCase { @BeforeEach From ad8dde1c6ff29dabca46e359242855360322777d Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 18 Sep 2020 12:37:03 +0200 Subject: [PATCH 0005/1433] Ensure OrderedMethodTests.alphanumeric() tests correct SUT --- .../junit/jupiter/engine/extension/OrderedMethodTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java index e9ff3b2032da..af550d36be60 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java @@ -85,7 +85,7 @@ void alphanumeric() { // on the class names. assertThat(testClass.getSuperclass().getName()).isGreaterThan(testClass.getName()); - var tests = executeTestsInParallel(MethodNameTestCase.class); + var tests = executeTestsInParallel(testClass); tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); @@ -107,7 +107,7 @@ void methodName() { // on the class names. assertThat(testClass.getSuperclass().getName()).isLessThan(testClass.getName()); - var tests = executeTestsInParallel(MethodNameTestCase.class); + var tests = executeTestsInParallel(testClass); tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); From ca2087677e649623bf3ec6cb886329bf238a9c46 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 18 Sep 2020 12:40:23 +0200 Subject: [PATCH 0006/1433] Remove unused variable in CsvFileArgumentsProviderTests --- .../jupiter/params/provider/CsvFileArgumentsProviderTests.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java index 49b60a764b11..92eab62aa0a4 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java @@ -425,8 +425,6 @@ void throwsExceptionForExceedsMaxCharsFileWithDefaultConfig(@TempDir Path tempDi .files(csvFile.toAbsolutePath().toString())// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); - CsvParsingException exception = assertThrows(CsvParsingException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); From d7cf3627a3f7add64869dd5a3d5e1727fe0c4b9d Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 18 Sep 2020 12:45:52 +0200 Subject: [PATCH 0007/1433] Polish release notes and template --- .../docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc | 4 ++-- .../docs/asciidoc/release-notes/release-notes-TEMPLATE.adoc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index b281c6fc672c..052f5cf75d23 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -5,8 +5,8 @@ *Scope:* ❓ -For a complete list of all _closed_ issues and pull requests for this release, consult -the link:{junit5-repo}+/milestone/51?closed=1+[5.8 M1] milestone page in the JUnit repository +For a complete list of all _closed_ issues and pull requests for this release, consult the +link:{junit5-repo}+/milestone/51?closed=1+[5.8 M1] milestone page in the JUnit repository on GitHub. diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-TEMPLATE.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-TEMPLATE.adoc index 2952e59175fe..17790483e124 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-TEMPLATE.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-TEMPLATE.adoc @@ -7,9 +7,9 @@ *Scope:* ❓ -For a complete list of all _closed_ issues and pull requests for this release, consult -the link:{junit5-repo}+/milestone/⚠️?closed=1+[⚠️] milestone page in the JUnit repository -on GitHub. +For a complete list of all _closed_ issues and pull requests for this release, consult the +link:{junit5-repo}+/milestone/⚠️?closed=1+[⚠️] milestone page in the JUnit repository on +GitHub. [[release-notes-⚠️-junit-platform]] From da043adee5fad859de9fc9fff1707108bebfb9bf Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 18 Sep 2020 12:56:03 +0200 Subject: [PATCH 0008/1433] Return "null" from StringUtils.nullSafeToString if toString() returns null Prior to this commit, the implementation of StringUtils.nullSafeToString did not align with the Javadoc. Specifically, the documentation states that nullSafeToString() never returns null; however, if the invocation of toString() on the supplied object returned null, nullSafeToString() simply returned that null value. This commit fixes this by ensuring that nullSafeToString() returns "null" if the invocation of toString() returns null. Closes #2410 --- .../release-notes/release-notes-5.8.0-M1.adoc | 4 +++- .../junit/platform/commons/util/StringUtils.java | 8 +++++--- .../platform/commons/util/StringUtilsTests.java | 13 +++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 052f5cf75d23..c902f9d1c403 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -15,7 +15,9 @@ on GitHub. ==== Bug Fixes -* ❓ +* `StringUtils.nullSafeToString()` now returns `"null"` if the invocation of `toString()` + on the supplied object returns `null`. Although this is an internal utility, the effect + of this change may be witnessed by end users and test engine or extension authors. ==== Deprecations and Breaking Changes diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java index f7780004cb63..a704d935e403 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java @@ -142,8 +142,9 @@ public static boolean doesNotContainIsoControlCharacter(String str) { * {@code Arrays#toString(...)} variant will be used to convert it to a String. *
  • If the supplied object is an object array, {@code Arrays#deepToString(Object[])} * will be used to convert it to a String.
  • - *
  • Otherwise, the result of invoking {@code toString()} on the object - * will be returned.
  • + *
  • Otherwise, {@code toString()} will be invoked on the object. If the + * result is non-null, that result will be returned. If the result is + * {@code null}, {@code "null"} will be returned.
  • *
  • If any of the above results in an exception, this method delegates to * {@link #defaultToString(Object)}
  • * @@ -190,7 +191,8 @@ public static String nullSafeToString(Object obj) { } // else - return obj.toString(); + String result = obj.toString(); + return result != null ? result : "null"; } catch (Throwable throwable) { UnrecoverableExceptions.rethrowIfUnrecoverable(throwable); diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java index 750edf844824..bbf2cbc4b2c5 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java @@ -138,6 +138,11 @@ void nullSafeToStringChecks() { assertEquals("[[2, 4], [3, 9]]", nullSafeToString(new Integer[][] { { 2, 4 }, { 3, 9 } })); } + @Test + void nullSafeToStringForObjectWhoseToStringImplementationReturnsNull() { + assertEquals("null", nullSafeToString(new ToStringReturnsNull())); + } + @Test void nullSafeToStringForObjectWhoseToStringImplementationThrowsAnException() { assertThat(nullSafeToString(new ToStringThrowsException()))// @@ -168,6 +173,14 @@ private void shouldNotContainIsoControlCharacter(String str) { () -> String.format("'%s' should not contain ISO control character", str)); } + private static class ToStringReturnsNull { + + @Override + public String toString() { + return null; + } + } + private static class ToStringThrowsException { @Override From 84ffb8c38e9a52f3dbb2c0acec232b2883854032 Mon Sep 17 00:00:00 2001 From: Stefano Cordio Date: Tue, 15 Sep 2020 08:47:48 +0200 Subject: [PATCH 0009/1433] Evaluate argument length only when argument is not null JUnit Jupiter 5.7.0 introduced a regression in conjunction with the work performed to address #2358. Specifically, an attempt to truncate an argument to a parameterized test results in a NullPointerException if the toString() implementation of the given argument returns null. This regression has already been addressed indirectly in #2410; however, we would like to keep the additional non-null check in ParameterizedTestNameFormatter. In addition, we want to keep the test introduced in PR #2408 as a regression test. Closes #2408 Fixes #2405 --- .../ParameterizedTestNameFormatter.java | 2 +- .../ParameterizedTestNameFormatterTests.java | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java index 559fc08ceb76..937e91f60103 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java @@ -103,7 +103,7 @@ private Object[] makeReadable(MessageFormat format, Object[] arguments) { } private String truncateIfExceedsMaxLength(String argument) { - if (argument.length() > argumentMaxLength) { + if (argument != null && argument.length() > argumentMaxLength) { return argument.substring(0, argumentMaxLength - 1) + ELLIPSIS; } return argument; diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java index e092bc0178c0..78d0fe09c647 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java @@ -45,7 +45,7 @@ */ class ParameterizedTestNameFormatterTests { - private Locale originalLocale = Locale.getDefault(); + private final Locale originalLocale = Locale.getDefault(); @AfterEach void restoreLocale() { @@ -159,11 +159,20 @@ void throwsReadableExceptionForInvalidPattern() { assertEquals(IllegalArgumentException.class, exception.getCause().getClass()); } + @Test + void formattingDoesNotFailIfArgumentToStringImplementationReturnsNull() { + ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); + + String formattedName = formatter.format(1, new ToStringReturnsNull(), "foo"); + + assertThat(formattedName).isEqualTo("null, foo"); + } + @Test void formattingDoesNotFailIfArgumentToStringImplementationThrowsAnException() { ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); - String formattedName = formatter.format(1, new Object[] { new ToStringThrowsException(), "foo" }); + String formattedName = formatter.format(1, new ToStringThrowsException(), "foo"); assertThat(formattedName).startsWith(ToStringThrowsException.class.getName() + "@"); assertThat(formattedName).endsWith("foo"); @@ -239,6 +248,14 @@ private static ParameterizedTestNameFormatter formatter(String pattern, String d // ------------------------------------------------------------------- + private static class ToStringReturnsNull { + + @Override + public String toString() { + return null; + } + } + private static class ToStringThrowsException { @Override From 7955bc4c8d95aaf4b0e18b6007ea0c695acf40b3 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 18 Sep 2020 13:30:07 +0200 Subject: [PATCH 0010/1433] Document regression fix in release notes See #2408 --- .../docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index c902f9d1c403..baeae7979485 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -33,7 +33,10 @@ on GitHub. ==== Bug Fixes -* ❓ +* If the `toString()` implementation of an argument passed to a `@ParameterizedTest` + method returns `null`, the display name formatter for the parameterized test now treats + the name of the corresponding argument as `"null"` instead of throwing an exception. + This fixes a regression introduced in JUnit Jupiter 5.7.0. ==== Deprecations and Breaking Changes From fd6dc3eb82df2ce4317350b5078c48eb891d6a6c Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 22 Sep 2020 17:11:52 +0200 Subject: [PATCH 0011/1433] Update Gradle Enterprise Plugin (#2418) This updates the Gradle Enterprise Gradle plugin to the latest version. This also fixes the usage of an internal api that was moved packages. --- gradle.properties | 2 +- settings.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 02f0edf292b1..6495ec07d862 100644 --- a/gradle.properties +++ b/gradle.properties @@ -46,7 +46,7 @@ surefire.version=2.22.2 bnd.version=5.1.2 # Plugins -gradle.enterprise.plugin.version=3.3.1 +gradle.enterprise.plugin.version=3.4.1 versioning.plugin.version=2.14.0 versions.plugin.version=0.29.0 spotless.plugin.version=5.1.1 diff --git a/settings.gradle.kts b/settings.gradle.kts index cb7e633fa944..0d548d7b34ff 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,4 +1,4 @@ -import com.gradle.scan.plugin.internal.api.BuildScanExtensionWithHiddenFeatures +import com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures pluginManagement { plugins { From ae2a336fe4b371d398da386e8b336cc06329da7d Mon Sep 17 00:00:00 2001 From: Jonathan Leitschuh Date: Sat, 3 Oct 2020 08:16:49 -0400 Subject: [PATCH 0012/1433] Enable GitHub Code Scanning Feature (#2436) --- .github/workflows/codeql-analysis.yml | 77 +++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000000..5247cf51f210 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,77 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [main, releases/**] + pull_request: + # The branches below must be a subset of the branches above + branches: [main, releases/**] + schedule: + - cron: '0 19 * * 3' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['java', 'javascript'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Install and setup JDK 11 + - name: Setup JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From 126c5041f0266cb69d0bf4962f9c42b8ce284e63 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 4 Oct 2020 10:03:14 +0200 Subject: [PATCH 0013/1433] Upgradle to 6.7-rc-3 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4a1a99959e8b..6e888e8ac8fa 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=7873ed5287f47ca03549ab8dcb6dc877ac7f0e3d7b1eb12685161d10080910ac -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionSha256Sum=f4a236ffc777d6a4c25cdf7b1c45fe7024910afc65c88a9c9027aab9a765d295 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 54ab3dd59a784427773f11521d70a0d449c1fd75 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 4 Oct 2020 14:14:27 +0200 Subject: [PATCH 0014/1433] Consume artifacts from temp repo Fixes #2402. --- .../projects/vintage/pom.xml | 10 ++++++++++ .../support/tests/VintageMavenIntegrationTests.java | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/platform-tooling-support-tests/projects/vintage/pom.xml b/platform-tooling-support-tests/projects/vintage/pom.xml index 3390f68d5f55..5cea432f7701 100644 --- a/platform-tooling-support-tests/projects/vintage/pom.xml +++ b/platform-tooling-support-tests/projects/vintage/pom.xml @@ -50,6 +50,16 @@ + + local-temp + file://${maven.repo} + + true + + + true + + sonatype-snapshots https://oss.sonatype.org/content/repositories/snapshots diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index 11d93dc0643d..d396beaaf5b8 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -18,7 +18,6 @@ import de.sormuras.bartholdy.Result; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -27,7 +26,6 @@ import platform.tooling.support.Helper; import platform.tooling.support.Request; -@Disabled("needs to consume maven.repo system property instead of downloading from Sonatype snapshot repo or Maven local repo") class VintageMavenIntegrationTests { @Test From 4dd6981ece3a5d5275844ba6d9b4fa7ab60bf0af Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 4 Oct 2020 11:33:04 +0200 Subject: [PATCH 0015/1433] =?UTF-8?q?Use=20Gradle=E2=80=99s=20new=20toolch?= =?UTF-8?q?ain=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cross-version.yml | 2 +- build.gradle.kts | 6 --- .../main/kotlin/custom-java-home.gradle.kts | 48 ------------------- .../java-library-conventions.gradle.kts | 2 +- .../java-toolchain-conventions.gradle.kts | 18 +++++++ junit-bom/junit-bom.gradle.kts | 2 +- 6 files changed, 21 insertions(+), 57 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/custom-java-home.gradle.kts create mode 100644 buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 05e5a3d5c08e..9a1560ef20d2 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -46,4 +46,4 @@ jobs: - name: Test run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -PjavaHome=$ADDITIONAL_JDK build "-Dscan.tag.JDK_${{ matrix.jdk }}" + ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=ADDITIONAL_JDK -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" diff --git a/build.gradle.kts b/build.gradle.kts index 41cba6dc5c6b..21721cdfe334 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,12 +12,6 @@ plugins { apply(from = "gradle/build-scan-user-data.gradle") -buildScan { - if (project.hasProperty("javaHome")) { - value("Custom Java home", project.property("javaHome") as String) - } -} - val buildTimeAndDate by extra { // SOURCE_DATE_EPOCH is a UNIX timestamp for pinning build metadata against diff --git a/buildSrc/src/main/kotlin/custom-java-home.gradle.kts b/buildSrc/src/main/kotlin/custom-java-home.gradle.kts deleted file mode 100644 index 8533c5f949fd..000000000000 --- a/buildSrc/src/main/kotlin/custom-java-home.gradle.kts +++ /dev/null @@ -1,48 +0,0 @@ -import org.gradle.internal.os.OperatingSystem -import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile - -if (project.hasProperty("javaHome")) { - - val javaHome: String by project - require(file(javaHome).isDirectory) { - "Java home directory set via `javaHome` project property is invalid: $javaHome" - } - - fun javaHomeExecutable(execName: String): String { - val extension = if (OperatingSystem.current().isWindows) ".exe" else "" - val executable = File(File(javaHome, "bin"), "$execName$extension") - require(executable.exists()) { - "File does not exist: $executable" - } - return executable.canonicalPath - } - - tasks { - withType().configureEach { - options.isFork = true - options.forkOptions.javaHome = file(javaHome) - doFirst { - // Avoid compiler warnings for non-existing path entries - classpath = classpath.filter { it.exists() } - } - } - withType().configureEach { - options.isFork = true - options.forkOptions.javaHome = file(javaHome) - } - withType().configureEach { - kotlinOptions { - jdkHome = javaHome - } - } - withType().configureEach { - executable = javaHomeExecutable("javadoc") - } - withType().configureEach { - executable = javaHomeExecutable("java") - } - withType().configureEach { - setExecutable(javaHomeExecutable("java")) - } - } -} diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 6ebed2f22a2e..12fb79884da3 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -3,7 +3,7 @@ plugins { eclipse idea checkstyle - id("custom-java-home") + id("java-toolchain-conventions") } val mavenizedProjects: List by rootProject.extra diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts new file mode 100644 index 000000000000..b8acf3f7cc9c --- /dev/null +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -0,0 +1,18 @@ +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile + +val javaToolchainVersion: String? by project + +project.pluginManager.withPlugin("java") { + val extension = the() + val javaLanguageVersion = JavaLanguageVersion.of(javaToolchainVersion?.toInt() ?: 11) + extension.toolchain { + languageVersion.set(javaLanguageVersion) + } + val service = the() + val javaHome = service.compilerFor(extension.toolchain).get().metadata.installationPath.asFile.absolutePath + tasks.withType().configureEach { + kotlinOptions { + jdkHome = javaHome + } + } +} diff --git a/junit-bom/junit-bom.gradle.kts b/junit-bom/junit-bom.gradle.kts index 6d50be082030..4a7a327a1789 100644 --- a/junit-bom/junit-bom.gradle.kts +++ b/junit-bom/junit-bom.gradle.kts @@ -1,7 +1,7 @@ plugins { `java-platform` + `java-toolchain-conventions` `publishing-conventions` - `custom-java-home` } description = "${rootProject.description} (Bill of Materials)" From 2d42030bf87effac2216865b273026801ab71bbc Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 4 Oct 2020 13:58:52 +0200 Subject: [PATCH 0016/1433] Configure Java release for test fixtures --- buildSrc/src/main/kotlin/java-library-conventions.gradle.kts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 12fb79884da3..da74eb53f918 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -286,7 +286,10 @@ tasks { } pluginManager.withPlugin("java-test-fixtures") { - tasks.named("checkstyleTestFixtures").configure { + tasks.named("checkstyleTestFixtures") { configFile = rootProject.file("src/checkstyle/checkstyleTest.xml") } + tasks.named("compileTestFixturesJava") { + options.release.set(extension.testJavaVersion.majorVersion.toInt()) + } } From 0592102bf1a3fcec9e0f1f6eb13d6d81196fa15f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 5 Oct 2020 20:57:40 +0200 Subject: [PATCH 0017/1433] Let Gradle find Java 8 toolchain --- .github/workflows/cross-version.yml | 2 +- .../platform-tooling-support-tests.gradle.kts | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 9a1560ef20d2..beb9521299bc 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -46,4 +46,4 @@ jobs: - name: Test run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=ADDITIONAL_JDK -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" + ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,ADDITIONAL_JDK -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index fc5cc895609a..9a6bd0585fd8 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -56,23 +56,15 @@ tasks.test { (mavenizedProjects + project(":junit-bom")) .map { project -> project.tasks.named("publishAllPublicationsTo${tempRepoName.capitalize()}Repository") } .forEach { dependsOn(it) } - // Pass "java.home.N" system properties from sources like "~/.gradle/gradle.properties". - // Values will be picked up by: platform.tooling.support.Helper::getJavaHome - for (N in 8..99) { - val home = project.properties["java.home.$N"] ?: System.getenv("JDK$N") - if (home != null) systemProperty("java.home.$N", home) - } - // TODO Enabling parallel execution fails due to Gradle's listener not being thread-safe: - // Received a completed event for test with unknown id "10.5". - // Registered test ids: "[:platform-tooling-support-tests:test, 10.1]" - // systemProperty("junit.jupiter.execution.parallel.enabled", "true") // Pass version constants (declared in Versions.kt) to tests as system properties systemProperty("Versions.apiGuardian", versions.apiguardian) systemProperty("Versions.assertJ", versions.assertj) systemProperty("Versions.junit4", versions.junit4) systemProperty("Versions.ota4j", versions.opentest4j) + jvmArgumentProviders += MavenRepo(tempRepoDir) + jvmArgumentProviders += JavaHomeDir(project, 8) } filter { @@ -90,3 +82,17 @@ tasks.test { class MavenRepo(@get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) val repoDir: File) : CommandLineArgumentProvider { override fun asArguments() = listOf("-Dmaven.repo=$repoDir") } + +class JavaHomeDir(project: Project, @Input val version: Int) : CommandLineArgumentProvider { + @Internal + val javaLauncher: Property = project.objects.property() + .value(project.the().launcherFor { + languageVersion.set(JavaLanguageVersion.of(version)) + }) + + override fun asArguments(): List { + val metadata = javaLauncher.map { it.metadata } + val javaHome = metadata.map { it.installationPath.asFile.absolutePath }.orNull + return javaHome?.let { listOf("-Djava.home.$version=$it") } ?: emptyList() + } +} From 1ca7b514f8a09769dd88d3c0b9ee036a5ffac70e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 5 Oct 2020 21:11:25 +0200 Subject: [PATCH 0018/1433] Don't resolve toolchain at configuration time --- .../main/kotlin/java-toolchain-conventions.gradle.kts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index b8acf3f7cc9c..e174a3660d1b 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -4,15 +4,13 @@ val javaToolchainVersion: String? by project project.pluginManager.withPlugin("java") { val extension = the() - val javaLanguageVersion = JavaLanguageVersion.of(javaToolchainVersion?.toInt() ?: 11) + val javaToolchainService = the() extension.toolchain { - languageVersion.set(javaLanguageVersion) + languageVersion.set(JavaLanguageVersion.of(javaToolchainVersion?.toInt() ?: 11)) } - val service = the() - val javaHome = service.compilerFor(extension.toolchain).get().metadata.installationPath.asFile.absolutePath tasks.withType().configureEach { - kotlinOptions { - jdkHome = javaHome + doFirst { + kotlinOptions.jdkHome = javaToolchainService.compilerFor(extension.toolchain).get().metadata.installationPath.asFile.absolutePath } } } From 1b8fdd0a7cc61a639cabcb1b4a0bd7735a72686b Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 6 Oct 2020 08:53:28 +0200 Subject: [PATCH 0019/1433] Upgrade JaCoCo to 0.8.6 https://www.jacoco.org/jacoco/trunk/doc/changes.html --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6495ec07d862..6dedcd348422 100644 --- a/gradle.properties +++ b/gradle.properties @@ -39,7 +39,7 @@ spock.version=1.3-groovy-2.5 # Tools checkstyle.version=8.31 -jacoco.version=0.8.5 +jacoco.version=0.8.6 jmh.version=1.25 ktlint.version=0.35.0 surefire.version=2.22.2 From 7ca3c6f0934a5535a2868960557ca9190178c644 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 6 Oct 2020 09:21:53 +0200 Subject: [PATCH 0020/1433] Upgrade CheckStyle to 8.36.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6dedcd348422..b0055eabb331 100644 --- a/gradle.properties +++ b/gradle.properties @@ -38,7 +38,7 @@ slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 # Tools -checkstyle.version=8.31 +checkstyle.version=8.36.1 jacoco.version=0.8.6 jmh.version=1.25 ktlint.version=0.35.0 From 134e04b9a1b644fa52165b6f7dc690cde63a1018 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 6 Oct 2020 09:49:45 +0200 Subject: [PATCH 0021/1433] Upgrade Spotless Plugin to 5.5.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b0055eabb331..7c31715ba09b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,7 +49,7 @@ bnd.version=5.1.2 gradle.enterprise.plugin.version=3.4.1 versioning.plugin.version=2.14.0 versions.plugin.version=0.29.0 -spotless.plugin.version=5.1.1 +spotless.plugin.version=5.5.1 git-publish.plugin.version=2.1.3 kotlin.plugin.version=1.4.0 asciidoctor-pdf.version=1.5.3 From 34b99ffaf4a75c6782c21757244c928d75716714 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 6 Oct 2020 12:40:32 +0200 Subject: [PATCH 0022/1433] Enable info logging to debug Toolchain flakiness --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a4b5da0d7e0..9cd82aafb49e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,7 +79,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build + ./gradlew --info --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build ./gradlew --stop mac: name: 'Mac OS' From 5d89d5f4147268a008e0473419eb215a200e1961 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 6 Oct 2020 15:16:14 +0200 Subject: [PATCH 0023/1433] Upgrade CheckStyle to 8.36.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 7c31715ba09b..407cb5025b07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -38,7 +38,7 @@ slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 # Tools -checkstyle.version=8.36.1 +checkstyle.version=8.36.2 jacoco.version=0.8.6 jmh.version=1.25 ktlint.version=0.35.0 From c74bba43710decdabd51f9b6d10bd5d3e8393d71 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 10 Oct 2020 11:18:51 +0200 Subject: [PATCH 0024/1433] Upgrade to Shadow 6.1.0 --- buildSrc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index fd74ea278a13..679ce910df40 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -11,6 +11,6 @@ dependencies { implementation(kotlin("gradle-plugin")) implementation("de.marcphilipp.gradle:nexus-publish-plugin:0.4.0") implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2") - implementation("com.github.jengelman.gradle.plugins:shadow:6.0.0") + implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.gradle:test-retry-gradle-plugin:1.1.8") } From cabaf221dad03392e764cb38c7bf2d057f8e7397 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 10 Oct 2020 16:57:49 +0200 Subject: [PATCH 0025/1433] Upgradle to 6.7-rc-4 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6e888e8ac8fa..af6df179e1ab 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=f4a236ffc777d6a4c25cdf7b1c45fe7024910afc65c88a9c9027aab9a765d295 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-3-bin.zip +distributionSha256Sum=01b4f3804b6c3f15ff3eb39e56efae55e265b6007c9fa3bd58b83b2dc4697dc4 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From c0a6ca5c178a1a2a0a9a3be3c6abb22f5cf1c3b7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 6 Oct 2020 18:51:22 +0200 Subject: [PATCH 0026/1433] Remove custom env vars for toolchains Since Gradle supports SDKMAN out of the box. --- .github/workflows/cross-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index beb9521299bc..ca3d0ccd12c1 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -46,4 +46,4 @@ jobs: - name: Test run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,ADDITIONAL_JDK -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" + ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" From 08153b7165196d5e6abb0480b544199dee7ba7a7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 7 Oct 2020 11:15:14 +0200 Subject: [PATCH 0027/1433] Disable auto-download of toolchains --- .github/workflows/cross-version.yml | 1 + .github/workflows/main.yml | 5 +++-- .github/workflows/reproducible-build.yml | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index ca3d0ccd12c1..6b1774a247d2 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -12,6 +12,7 @@ on: env: ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} + ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' jobs: openjdk: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9cd82aafb49e..af945e84538e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,7 @@ on: env: ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} + ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' jobs: linux: @@ -23,7 +24,7 @@ jobs: - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: - path: | + path: | /root/.gradle/caches/ /root/.gradle/wrapper/dists key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} @@ -53,7 +54,7 @@ jobs: - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: - path: | + path: | ~/.gradle/caches/ ~/.gradle/wrapper/dists key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index e48b0c5ff1b2..7df4ae9e9610 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -9,6 +9,9 @@ on: branches: - '*' +env: + ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' + jobs: check_build_reproducibility: name: 'Check build reproducibility' From 1c04a4c78c7465be12ee6d8cfbdfefccc4b39f9f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 7 Oct 2020 21:18:54 +0200 Subject: [PATCH 0028/1433] Remove trailing whitespace --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index af945e84538e..8e600859e501 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -90,7 +90,7 @@ jobs: - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: - path: | + path: | ~/.gradle/caches/ ~/.gradle/wrapper/dists key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} @@ -126,7 +126,7 @@ jobs: - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: - path: | + path: | /root/.gradle/caches/ /root/.gradle/wrapper/dists key: coverage-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} @@ -169,7 +169,7 @@ jobs: - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: - path: | + path: | ~/.gradle/caches/ ~/.gradle/wrapper/dists key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} @@ -196,7 +196,7 @@ jobs: - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: - path: | + path: | ~/.gradle/caches/ ~/.gradle/wrapper/dists key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} From 8f4de76b2654d99fb13c2ca841c73143a6dce375 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 8 Oct 2020 07:31:56 +0200 Subject: [PATCH 0029/1433] Add JDK 8 to Windows builds --- .github/workflows/main.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e600859e501..1a40670e33d8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,6 +67,13 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- + - name: 'Set up JDK 8' + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: 'Prepare JDK8 env var' + shell: bash + run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - name: 'Set up JDK 11' uses: actions/setup-java@v1 with: @@ -80,7 +87,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew --info --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build + ./gradlew --info --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build ./gradlew --stop mac: name: 'Mac OS' From 38d54ea84c18592d0d8812e33efd2eee61db191b Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 8 Oct 2020 07:48:51 +0200 Subject: [PATCH 0030/1433] Make Java 8 toolchain optional --- .../platform-tooling-support-tests.gradle.kts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 9a6bd0585fd8..1f45aa624309 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -1,3 +1,5 @@ +import org.gradle.jvm.toolchain.internal.NoToolchainAvailableException + plugins { `java-library-conventions` `testing-conventions` @@ -86,8 +88,14 @@ class MavenRepo(@get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) class JavaHomeDir(project: Project, @Input val version: Int) : CommandLineArgumentProvider { @Internal val javaLauncher: Property = project.objects.property() - .value(project.the().launcherFor { - languageVersion.set(JavaLanguageVersion.of(version)) + .value(project.provider { + try { + project.the().launcherFor { + languageVersion.set(JavaLanguageVersion.of(version)) + }.get() + } catch (e: NoToolchainAvailableException) { + null + } }) override fun asArguments(): List { From 9b61cebecbe25063ad6abefdbca92fa4a7141a19 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 8 Oct 2020 07:52:53 +0200 Subject: [PATCH 0031/1433] Remove info logging again --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a40670e33d8..1fe43d5043d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,7 +87,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew --info --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build + ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build ./gradlew --stop mac: name: 'Mac OS' From 5565b1c7dfd74fdfaa01d43db60ee0763c18e6f7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 8 Oct 2020 08:47:25 +0200 Subject: [PATCH 0032/1433] Remove unused Maven toolchain lookup --- .../java/platform/tooling/support/Helper.java | 48 ++++--------------- .../platform/tooling/support/HelperTests.java | 8 ++-- 2 files changed, 12 insertions(+), 44 deletions(-) diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java index 2075a8a9477b..2e26c94b6491 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java @@ -24,16 +24,12 @@ import java.util.Properties; import java.util.function.Consumer; import java.util.function.Predicate; -import java.util.function.Supplier; import java.util.jar.JarFile; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPathFactory; - /** * @since 1.3 */ @@ -117,43 +113,15 @@ public static List loadJarFiles() { public static Optional getJavaHome(String version) { // First, try various system sources... - List> sources = List.of( // - () -> System.getProperty("java.home." + version), // - () -> System.getProperty("java." + version), // - () -> System.getProperty("jdk.home." + version), // - () -> System.getProperty("jdk." + version), // - () -> System.getenv("JAVA_HOME_" + version), // - () -> System.getenv("JAVA_" + version) // + Stream sources = Stream.of( // + System.getProperty("java.home." + version), // + System.getProperty("java." + version), // + System.getProperty("jdk.home." + version), // + System.getProperty("jdk." + version), // + System.getenv("JAVA_HOME_" + version), // + System.getenv("JAVA_" + version) // ); - var home = sources.stream().map(Supplier::get).filter(Objects::nonNull).findFirst(); - // If no java home set then inspect Maven Toolchains configuration file... - return home.map(h -> Path.of(h)).or(() -> getJdkHomeFromMavenToolchains(version)); - } - - // https://maven.apache.org/guides/mini/guide-using-toolchains.html - static Optional getJdkHomeFromMavenToolchains(String version) { - var mavenToolChains = Path.of(System.getProperty("user.home"), ".m2", "toolchains.xml"); - if (!Files.isRegularFile(mavenToolChains)) { - return Optional.empty(); - } - try { - var builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - var document = builder.parse(mavenToolChains.toFile()); - var xpath = XPathFactory.newInstance().newXPath(); - var jdkHome = xpath.evaluate("//toolchains" // - + "/toolchain[descendant::type[text()='jdk']]" // - + "/provides[descendant::version[text()='" + version + "']]" // - + "/.." // - + "/configuration/jdkHome", - document); - if (!jdkHome.isBlank()) { - return Optional.of(Path.of(jdkHome)); - } - } - catch (Exception e) { - // ignore - } - return Optional.empty(); + return sources.filter(Objects::nonNull).findFirst().map(Path::of); } /** Load, here copy, modular jar files to the given target directory. */ diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java index 95f5d819fade..681f184d3391 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java @@ -56,13 +56,13 @@ void version() { @Test void nonExistingJdkVersionYieldsAnEmptyOptional() { - assertEquals(Optional.empty(), Helper.getJdkHomeFromMavenToolchains("does not exist")); + assertEquals(Optional.empty(), Helper.getJavaHome("does not exist")); } @ParameterizedTest - @ValueSource(ints = { 8, 9, 10, 11, 12, 13 }) - void checkMavenToolchainsPointingValidJdkInstallations(int version) { - var home = Helper.getJdkHomeFromMavenToolchains("" + version); + @ValueSource(ints = 8) + void checkJavaHome(int version) { + var home = Helper.getJavaHome(String.valueOf(version)); assumeTrue(home.isPresent(), "No 'jdk' element found in Maven toolchain for: " + version); assertTrue(Files.isDirectory(home.get())); } From 8c1ddc5106c224d3c8372bd13f6146aa142fb826 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 10 Oct 2020 18:05:47 +0200 Subject: [PATCH 0033/1433] Upgrade Spotless --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 407cb5025b07..8942b741e170 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,7 +49,7 @@ bnd.version=5.1.2 gradle.enterprise.plugin.version=3.4.1 versioning.plugin.version=2.14.0 versions.plugin.version=0.29.0 -spotless.plugin.version=5.5.1 +spotless.plugin.version=5.6.1 git-publish.plugin.version=2.1.3 kotlin.plugin.version=1.4.0 asciidoctor-pdf.version=1.5.3 From 0225bdacad82c4c6b438c27dd89f41b3e3740352 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 09:25:00 +0200 Subject: [PATCH 0034/1433] Build test code with Java 15 (#2446) Test code is now compiled with Java 15 language level. Thus, the default toolchain has been changed to Java 15. The build can be run with an older version of Java, though, as Gradle will discover/downloads matching toolchains automatically. LGTM is dropped as part of this PR because it doesn't support running on Java 15. The CodeQL analysis build now only compiles main classes. Co-authored-by: Christian Stein --- .github/workflows/codeql-analysis.yml | 14 ++++---- .github/workflows/cross-version.yml | 2 +- .github/workflows/main.yml | 22 ++++++------- .github/workflows/reproducible-build.yml | 4 +-- .lgtm.yml | 4 --- README.md | 4 +-- build.gradle.kts | 5 ++- .../src/main/kotlin/JavaLibraryExtension.kt | 2 +- .../java-toolchain-conventions.gradle.kts | 15 ++++++--- .../api/AssertLinesMatchAssertionsTests.java | 32 +++++++++++++++---- settings.gradle.kts | 4 +-- 11 files changed, 67 insertions(+), 41 deletions(-) delete mode 100644 .lgtm.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5247cf51f210..89f58eef355c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -41,7 +41,7 @@ jobs: - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - # Install and setup JDK 11 + # Install and setup JDK - name: Setup JDK 11 uses: actions/setup-java@v1 with: @@ -59,8 +59,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 + #- name: Autobuild + # uses: github/codeql-action/autobuild@v1 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -68,10 +68,10 @@ jobs: # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project # uses a compiled language - - #- run: | - # make bootstrap - # make release + - name: Build + run: | + ./gradlew --version + ./gradlew allMainClasses -PjavaToolchainVersion=11 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 6b1774a247d2..f25ce85cba03 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -18,7 +18,7 @@ jobs: openjdk: strategy: matrix: - jdk: [14, 15, 16] + jdk: [16] name: "OpenJDK ${{ matrix.jdk }}" runs-on: ubuntu-latest container: "junitteam/build:${{ matrix.jdk }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1fe43d5043d2..6cb9abaf282b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: linux: name: 'Linux' runs-on: ubuntu-latest - container: junitteam/build:latest + container: junitteam/build:15 steps: - uses: actions/checkout@v2 - name: Cache Gradle wrapper and dependencies @@ -74,10 +74,10 @@ jobs: - name: 'Prepare JDK8 env var' shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - - name: 'Set up JDK 11' + - name: 'Set up JDK 15' uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 - name: Prepare Gradle Enterprise credentials shell: bash run: | @@ -110,10 +110,10 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- - - name: 'Set up JDK 11' + - name: 'Set up JDK 15' uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 - name: Prepare Gradle Enterprise credentials run: | mkdir -p $HOME/.gradle/enterprise/ @@ -146,10 +146,10 @@ jobs: key: coverage-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | coverage-${{ runner.os }}-maven- - - name: 'Set up JDK 11' + - name: 'Set up JDK 15' uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 - name: Prepare Gradle Enterprise credentials run: | mkdir -p /root/.gradle/enterprise/ @@ -182,10 +182,10 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: 'Set up JDK 11' + - name: 'Set up JDK 15' uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 - name: 'Publish' env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} @@ -209,10 +209,10 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: 'Set up JDK 11' + - name: 'Set up JDK 15' uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 - name: 'Upload Documentation' env: GRGIT_USER: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 7df4ae9e9610..c50b8a0baf47 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -27,10 +27,10 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: 'Set up JDK 11' + - name: 'Set up JDK 15' uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 - name: Prepare Gradle Enterprise credentials shell: bash run: | diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index eb5f4c9b7a25..000000000000 --- a/.lgtm.yml +++ /dev/null @@ -1,4 +0,0 @@ -extraction: - java: - index: - java_version: 11 diff --git a/README.md b/README.md index 5439f0bf54c0..014d1b8f6c32 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ so that local builds can reuse task outputs from previous CI builds. ## Building from Source -You need [JDK 11] to build JUnit 5. +You need [JDK 15] to build JUnit 5. All modules can be _built_ with the [Gradle Wrapper] using the following command. @@ -92,7 +92,7 @@ See also for releases and [Gradle Wrapper]: https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:using_wrapper [JaCoCo]: https://www.eclemma.org/jacoco/ [Javadoc]: https://junit.org/junit5/docs/current/api/ -[JDK 11]: https://jdk.java.net/11/ +[JDK 11]: https://jdk.java.net/15/ [Release Notes]: https://junit.org/junit5/docs/current/release-notes/ [Samples]: https://github.com/junit-team/junit5-samples [StackOverflow]: https://stackoverflow.com/questions/tagged/junit5 diff --git a/build.gradle.kts b/build.gradle.kts index 21721cdfe334..e3bfa95a1c9b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -140,7 +140,10 @@ subprojects { licenseHeaderFile(headerFile, "(package|import|open|module) ") importOrderFile(importOrderConfigFile) eclipse().configFile(javaFormatterConfigFile) - removeUnusedImports() + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_15)) { + // Doesn't work with Java 15 text blocks, see https://github.com/diffplug/spotless/issues/713 + removeUnusedImports() + } trimTrailingWhitespace() endWithNewline() } diff --git a/buildSrc/src/main/kotlin/JavaLibraryExtension.kt b/buildSrc/src/main/kotlin/JavaLibraryExtension.kt index 7c020478d6c3..86da500d0a5f 100644 --- a/buildSrc/src/main/kotlin/JavaLibraryExtension.kt +++ b/buildSrc/src/main/kotlin/JavaLibraryExtension.kt @@ -3,5 +3,5 @@ import org.gradle.api.JavaVersion @Suppress("UnstableApiUsage") open class JavaLibraryExtension { var mainJavaVersion: JavaVersion = Versions.jvmTarget - var testJavaVersion: JavaVersion = JavaVersion.VERSION_11 + var testJavaVersion: JavaVersion = JavaVersion.VERSION_15 } diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index e174a3660d1b..7fcb690a3f0f 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -1,16 +1,23 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile val javaToolchainVersion: String? by project +val defaultLanguageVersion = JavaLanguageVersion.of(15)!! +val javaLanguageVersion = javaToolchainVersion?.let { JavaLanguageVersion.of(it) } ?: defaultLanguageVersion project.pluginManager.withPlugin("java") { val extension = the() val javaToolchainService = the() - extension.toolchain { - languageVersion.set(JavaLanguageVersion.of(javaToolchainVersion?.toInt() ?: 11)) - } + extension.toolchain.languageVersion.set(javaLanguageVersion) + val compiler = javaToolchainService.compilerFor(extension.toolchain) tasks.withType().configureEach { doFirst { - kotlinOptions.jdkHome = javaToolchainService.compilerFor(extension.toolchain).get().metadata.installationPath.asFile.absolutePath + kotlinOptions.jdkHome = compiler.get().metadata.installationPath.asFile.absolutePath } } + tasks.withType().configureEach { + javaCompiler.set(compiler) + } + tasks.withType().configureEach { + javaLauncher.set(javaToolchainService.launcherFor(extension.toolchain)) + } } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java index 775c46372572..521f07585d6d 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java @@ -285,16 +285,36 @@ void assertLinesMatchSameListInstance() { @Test void assertLinesMatchPlainEqualLists() { - List expected = List.of("first line", "second line", "third line", "last line"); - List actual = List.of("first line", "second line", "third line", "last line"); - assertLinesMatch(expected, actual); + var expected = """ + first line + second line + third line + last line + """; + var actual = """ + first line + second line + third line + last line + """; + assertLinesMatch(expected.lines(), actual.lines()); } @Test void assertLinesMatchUsingRegexPatterns() { - List expected = List.of("^first.+line", "second\\s*line", "th.rd l.ne", "last line$"); - List actual = List.of("first line", "second line", "third line", "last line"); - assertLinesMatch(expected, actual); + var expected = """ + ^first.+line + second\\s*line + th.rd l.ne + last line$ + """; + var actual = """ + first line + second line + third line + last line + """; + assertLinesMatch(expected.lines(), actual.lines()); } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 0d548d7b34ff..cb92e1578417 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -58,8 +58,8 @@ buildCache { } val javaVersion = JavaVersion.current() -require(javaVersion.isJava11Compatible) { - "The JUnit 5 build requires Java 11 or higher. Currently executing with Java ${javaVersion.majorVersion}." +require(javaVersion.isJava9Compatible) { + "The JUnit 5 build requires Java 9 or higher. Currently executing with Java ${javaVersion.majorVersion}." } rootProject.name = "junit5" From 4955990214f966e8564d6da65afb72f3d2cb2fc3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 09:32:17 +0200 Subject: [PATCH 0035/1433] Fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 014d1b8f6c32..7751939d85d3 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ See also for releases and [Gradle Wrapper]: https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:using_wrapper [JaCoCo]: https://www.eclemma.org/jacoco/ [Javadoc]: https://junit.org/junit5/docs/current/api/ -[JDK 11]: https://jdk.java.net/15/ +[JDK 15]: https://jdk.java.net/15/ [Release Notes]: https://junit.org/junit5/docs/current/release-notes/ [Samples]: https://github.com/junit-team/junit5-samples [StackOverflow]: https://stackoverflow.com/questions/tagged/junit5 From c01da2de56cfc4d6745ea43c74f00a4ce11f6ac8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 11:16:50 +0200 Subject: [PATCH 0036/1433] Remove unnecessary empty array arguments --- .../java/org/junit/platform/commons/util/ClassUtilsTests.java | 2 +- .../org/junit/platform/commons/util/ReflectionUtilsTests.java | 1 - .../org/junit/platform/launcher/core/DefaultLauncherTests.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java index 601edf728f1a..5aa80642e595 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java @@ -34,7 +34,7 @@ void nullSafeToStringWithDefaultMapper() { @Test void nullSafeToStringWithCustomMapper() { assertEquals("", nullSafeToString(Class::getSimpleName, (Class[]) null)); - assertEquals("", nullSafeToString(Class::getSimpleName, new Class[0])); + assertEquals("", nullSafeToString(Class::getSimpleName)); assertEquals("String", nullSafeToString(Class::getSimpleName, String.class)); assertEquals("String, Integer", nullSafeToString(Class::getSimpleName, String.class, Integer.class)); assertEquals("String, null, Integer", diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java index 64e9bdddc4df..dbcc8e6b94ec 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java @@ -192,7 +192,6 @@ void newInstance() { // @formatter:off assertThat(ReflectionUtils.newInstance(C.class, "one", "two")).isNotNull(); assertThat(ReflectionUtils.newInstance(C.class)).isNotNull(); - assertThat(ReflectionUtils.newInstance(C.class, new Object[0])).isNotNull(); assertThrows(PreconditionViolationException.class, () -> ReflectionUtils.newInstance(C.class, "one", null)); assertThrows(PreconditionViolationException.class, () -> ReflectionUtils.newInstance(C.class, null, "two")); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java index 415294ae4627..f0cd69a98c11 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java @@ -115,7 +115,7 @@ void registerTestExecutionListenersWithEmptyArray() { var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> launcher.registerTestExecutionListeners(new TestExecutionListener[0])); + () -> launcher.registerTestExecutionListeners()); assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); } From 61a5e0f84a2056f26b4d4d3c6a90f0a6f15c7dad Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 11:17:15 +0200 Subject: [PATCH 0037/1433] Remove unnecessary explicit type conversion --- .../src/test/java/org/junit/platform/engine/UniqueIdTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java index 6c545f374ede..c3cf0b56b22b 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java @@ -153,7 +153,7 @@ void ensureDefaultUniqueIdFormatDecodingEncodesSegmentParts() { @Test void ensureDefaultUniqueIdFormatCanHandleAllCharacters() { for (char c = 0; c < Character.MAX_VALUE; c++) { - String value = "foo " + String.valueOf(c) + " bar"; + String value = "foo " + c + " bar"; UniqueId uniqueId = UniqueId.parse(UniqueId.root("type", value).toString()); Segment segment = uniqueId.getSegments().get(0); assertEquals(value, segment.getValue()); From 8ee7d9aa4f560eea6c1d30f16bf5b71c8ed168f8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 11:17:23 +0200 Subject: [PATCH 0038/1433] Remove unnecessary cast --- .../platform/commons/support/AnnotationSupportTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java index 560d6c71444b..810654073da5 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java @@ -227,7 +227,7 @@ void findAnnotatedFieldValuesPreconditions() { () -> AnnotationSupport.findAnnotatedFieldValues(this, null)); assertPreconditionViolationException("Class", - () -> AnnotationSupport.findAnnotatedFieldValues((Class) null, FieldMarker.class)); + () -> AnnotationSupport.findAnnotatedFieldValues(null, FieldMarker.class)); assertPreconditionViolationException("annotationType", () -> AnnotationSupport.findAnnotatedFieldValues(Probe.class, null)); @@ -239,7 +239,7 @@ void findAnnotatedFieldValuesPreconditions() { () -> AnnotationSupport.findAnnotatedFieldValues(this, FieldMarker.class, null)); assertPreconditionViolationException("Class", - () -> AnnotationSupport.findAnnotatedFieldValues((Class) null, FieldMarker.class, Number.class)); + () -> AnnotationSupport.findAnnotatedFieldValues(null, FieldMarker.class, Number.class)); assertPreconditionViolationException("annotationType", () -> AnnotationSupport.findAnnotatedFieldValues(Probe.class, null, Number.class)); assertPreconditionViolationException("fieldType", From 0bcf3afcd1b0de71a4f9b27cbb151cdef6ce4b49 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 11:20:07 +0200 Subject: [PATCH 0039/1433] Use lambda --- .../junit/platform/commons/util/CollectionUtilsTests.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java index eeb9404d20e7..ba2656d8dd3a 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java @@ -165,13 +165,7 @@ public Stream stream() { @SuppressWarnings("unchecked") void toStreamWithIterable() { - Iterable input = new Iterable<>() { - - @Override - public Iterator iterator() { - return asList("foo", "bar").iterator(); - } - }; + Iterable input = () -> asList("foo", "bar").iterator(); Stream result = (Stream) CollectionUtils.toStream(input); From 85b3c2690902d7c1019468e4c30fe7ee845d2c51 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 11:21:02 +0200 Subject: [PATCH 0040/1433] Use method references --- .../junit/platform/commons/util/ReflectionUtilsTests.java | 2 +- .../platform/engine/support/descriptor/ClassSourceTests.java | 2 +- .../junit/platform/launcher/core/DefaultLauncherTests.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java index dbcc8e6b94ec..4b259be2152b 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java @@ -752,7 +752,7 @@ void findNestedClassesWithInvalidNestedClassFile(LogRecordListener listener) thr assertEquals(fqcn, classWithInvalidNestedClassFile.getName()); NoClassDefFoundError noClassDefFoundError = assertThrows(NoClassDefFoundError.class, - () -> classWithInvalidNestedClassFile.getDeclaredClasses()); + classWithInvalidNestedClassFile::getDeclaredClasses); assertEquals("tests/NestedInterfaceGroovyTests$NestedInterface$1", noClassDefFoundError.getMessage()); assertThat(findNestedClasses(classWithInvalidNestedClassFile)).isEmpty(); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java index 2f2f7e30097d..c9ef68082966 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java @@ -54,7 +54,7 @@ void classSourceFromName() { assertThat(source.getClassName()).isEqualTo(testClassName); assertThat(source.getPosition()).isEmpty(); - var exception = assertThrows(PreconditionViolationException.class, () -> source.getJavaClass()); + var exception = assertThrows(PreconditionViolationException.class, source::getJavaClass); assertThat(exception).hasMessage("Could not load class with name: " + testClassName); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java index f0cd69a98c11..5a1f49960103 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java @@ -86,7 +86,8 @@ class DefaultLauncherTests { @Test void constructLauncherWithoutAnyEngines() { - Throwable exception = assertThrows(PreconditionViolationException.class, () -> createLauncher()); + Throwable exception = assertThrows(PreconditionViolationException.class, + LauncherFactoryForTestingPurposesOnly::createLauncher); assertThat(exception).hasMessageContaining("Cannot create Launcher without at least one TestEngine"); } @@ -115,7 +116,7 @@ void registerTestExecutionListenersWithEmptyArray() { var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> launcher.registerTestExecutionListeners()); + launcher::registerTestExecutionListeners); assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); } From f0279c5676852c8fd4a0c2391f913b52c7a1a418 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 11:22:38 +0200 Subject: [PATCH 0041/1433] Use expression lambdas --- .../commons/util/CollectionUtilsTests.java | 14 +++++--------- .../platform/commons/util/FunctionUtilsTests.java | 8 ++------ .../commons/util/ToStringBuilderTests.java | 8 ++------ .../AbstractLauncherDiscoveryListenerTests.java | 14 ++++++-------- 4 files changed, 15 insertions(+), 29 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java index ba2656d8dd3a..ce0671e2aac9 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java @@ -47,17 +47,14 @@ class CollectionUtilsTests { @Test void getOnlyElementWithNullCollection() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> { - CollectionUtils.getOnlyElement(null); - }); + var exception = assertThrows(PreconditionViolationException.class, () -> CollectionUtils.getOnlyElement(null)); assertEquals("collection must not be null", exception.getMessage()); } @Test void getOnlyElementWithEmptyCollection() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> { - CollectionUtils.getOnlyElement(emptySet()); - }); + var exception = assertThrows(PreconditionViolationException.class, + () -> CollectionUtils.getOnlyElement(emptySet())); assertEquals("collection must contain exactly one element: []", exception.getMessage()); } @@ -70,9 +67,8 @@ void getOnlyElementWithSingleElementCollection() { @Test void getOnlyElementWithMultiElementCollection() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> { - CollectionUtils.getOnlyElement(asList("foo", "bar")); - }); + var exception = assertThrows(PreconditionViolationException.class, + () -> CollectionUtils.getOnlyElement(asList("foo", "bar"))); assertEquals("collection must contain exactly one element: [foo, bar]", exception.getMessage()); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java index 60f4f5a7250f..d76472b95553 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java @@ -30,17 +30,13 @@ class FunctionUtilsTests { @Test void whereWithNullFunction() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> { - FunctionUtils.where(null, o -> true); - }); + var exception = assertThrows(PreconditionViolationException.class, () -> FunctionUtils.where(null, o -> true)); assertEquals("function must not be null", exception.getMessage()); } @Test void whereWithNullPredicate() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, () -> { - FunctionUtils.where(o -> o, null); - }); + var exception = assertThrows(PreconditionViolationException.class, () -> FunctionUtils.where(o -> o, null)); assertEquals("predicate must not be null", exception.getMessage()); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java index 98b3716c6bc6..9ce48ce795ab 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java @@ -28,16 +28,12 @@ class ToStringBuilderTests { @Test void withNullObject() { - assertThrows(PreconditionViolationException.class, () -> { - new ToStringBuilder((Object) null); - }); + assertThrows(PreconditionViolationException.class, () -> new ToStringBuilder((Object) null)); } @Test void withNullClass() { - assertThrows(PreconditionViolationException.class, () -> { - new ToStringBuilder((Class) null); - }); + assertThrows(PreconditionViolationException.class, () -> new ToStringBuilder((Class) null)); } @Test diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java index 9c9f88f140e2..f102928d4c9e 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java @@ -24,10 +24,9 @@ protected TestEngineStub createEngineThatCannotResolveAnything(String engineId) return new TestEngineStub(engineId) { @Override public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) { - discoveryRequest.getSelectorsByType(DiscoverySelector.class).forEach(selector -> { - discoveryRequest.getDiscoveryListener().selectorProcessed(uniqueId, selector, - SelectorResolutionResult.unresolved()); - }); + discoveryRequest.getSelectorsByType(DiscoverySelector.class) // + .forEach(selector -> discoveryRequest.getDiscoveryListener().selectorProcessed(uniqueId, + selector, SelectorResolutionResult.unresolved())); return new EngineDescriptor(uniqueId, "Some Engine"); } }; @@ -37,10 +36,9 @@ protected TestEngineStub createEngineThatFailsToResolveAnything(String engineId, return new TestEngineStub(engineId) { @Override public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) { - discoveryRequest.getSelectorsByType(DiscoverySelector.class).forEach(selector -> { - discoveryRequest.getDiscoveryListener().selectorProcessed(uniqueId, selector, - SelectorResolutionResult.failed(rootCause)); - }); + discoveryRequest.getSelectorsByType(DiscoverySelector.class) // + .forEach(selector -> discoveryRequest.getDiscoveryListener().selectorProcessed(uniqueId, + selector, SelectorResolutionResult.failed(rootCause))); return new EngineDescriptor(uniqueId, "Some Engine"); } }; From 869f5b45647867227c97b6fb4e840f49df639227 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 11:29:35 +0200 Subject: [PATCH 0042/1433] Use var --- .../junit/jupiter/extensions/Heavyweight.java | 7 +- .../platform/commons/function/TryTests.java | 64 ++--- .../support/AnnotationSupportTests.java | 19 +- .../support/PreconditionAssertions.java | 4 +- .../support/ReflectionSupportTests.java | 23 +- .../commons/util/AnnotationUtilsTests.java | 88 ++++--- .../commons/util/ClassLoaderUtilsTests.java | 9 +- .../ClassNamePatternFilterUtilsTests.java | 4 +- .../commons/util/ClasspathScannerTests.java | 77 +++---- .../commons/util/CollectionUtilsTests.java | 42 ++-- .../commons/util/FunctionUtilsTests.java | 4 +- .../commons/util/PackageUtilsTests.java | 12 +- .../commons/util/PreconditionsTests.java | 97 ++++---- .../commons/util/ReflectionUtilsTests.java | 122 +++++----- ...nUtilsWithGenericTypeHierarchiesTests.java | 10 +- .../commons/util/SerializationUtils.java | 8 +- .../platform/console/ConsoleDetailsTests.java | 51 ++-- .../ConsoleLauncherExecutionResultTests.java | 10 +- .../ConsoleLauncherIntegrationTests.java | 4 +- .../console/ConsoleLauncherTests.java | 36 +-- .../console/ConsoleLauncherWrapper.java | 12 +- .../PicocliCommandLineOptionsParserTests.java | 22 +- .../tasks/ConsoleTestExecutorTests.java | 36 +-- ...CustomContextClassLoaderExecutorTests.java | 13 +- .../tasks/DiscoveryRequestCreatorTests.java | 79 +++---- .../tasks/FlatPrintingListenerTests.java | 14 +- .../platform/console/tasks/TreeNodeTests.java | 8 +- .../console/tasks/TreePrinterTests.java | 6 +- .../tasks/VerboseTreeListenerTests.java | 18 +- .../engine/FilterCompositionTests.java | 8 +- .../junit/platform/engine/TestTagTests.java | 3 +- .../platform/engine/UniqueIdFormatTests.java | 8 +- .../junit/platform/engine/UniqueIdTests.java | 78 +++---- .../discovery/ClassNameFilterTests.java | 20 +- .../engine/discovery/ClassSelectorTests.java | 4 +- .../discovery/DiscoverySelectorsTests.java | 218 +++++++++--------- .../engine/discovery/FilePositionTests.java | 21 +- .../engine/discovery/MethodSelectorTests.java | 4 +- .../discovery/PackageNameFilterTests.java | 12 +- .../PrefixedConfigurationParametersTests.java | 8 +- .../AbstractTestDescriptorTests.java | 19 +- .../descriptor/AbstractTestSourceTests.java | 12 +- .../ClasspathResourceSourceTests.java | 24 +- .../descriptor/CompositeTestSourceTests.java | 10 +- .../descriptor/DefaultUriSourceTests.java | 10 +- .../descriptor/DemoClassTestDescriptor.java | 2 +- .../descriptor/DemoMethodTestDescriptor.java | 2 +- .../support/descriptor/FilePositionTests.java | 21 +- .../descriptor/FileSystemSourceTests.java | 32 +-- .../support/descriptor/MethodSourceTests.java | 57 +++-- .../descriptor/PackageSourceTests.java | 12 +- .../hierarchical/CompositeLockTests.java | 27 ++- ...elExecutionConfigurationStrategyTests.java | 14 +- .../HierarchicalTestExecutorTests.java | 178 +++++++------- .../hierarchical/LockManagerTests.java | 16 +- .../NodeTreeWalkerIntegrationTests.java | 36 ++- .../ParallelExecutionIntegrationTests.java | 51 ++-- .../support/hierarchical/SingleLockTests.java | 4 +- .../hierarchical/SingleTestExecutorTests.java | 11 +- .../hierarchical/ThrowableCollectorTests.java | 17 +- .../platform/launcher/TagFilterTests.java | 28 ++- .../launcher/TestIdentifierTests.java | 6 +- .../platform/launcher/TestPlanTests.java | 6 +- .../launcher/TestPostDiscoveryTagFilter.java | 2 +- .../launcher/core/DefaultLauncherTests.java | 153 ++++++------ .../EngineDiscoveryResultValidatorTests.java | 10 +- .../core/ExecutionListenerAdapterTests.java | 19 +- .../launcher/core/LauncherConfigTests.java | 16 +- .../LauncherConfigurationParametersTests.java | 9 +- .../LauncherDiscoveryRequestBuilderTests.java | 77 +++---- .../launcher/core/LauncherFactoryTests.java | 76 +++--- ...TestExecutionListenerIntegrationTests.java | 30 ++- .../launcher/core/StreamInterceptorTests.java | 16 +- .../TestExecutionListenerRegistryTests.java | 31 ++- .../listeners/SummaryGenerationTests.java | 77 +++---- .../tagexpression/ParserErrorTests.java | 2 +- .../tagexpression/TagExpressionsTests.java | 2 +- .../launcher/tagexpression/TokenTests.java | 10 +- .../legacy/LegacyReportingUtilsTests.java | 20 +- ...egacyXmlReportGeneratingListenerTests.java | 90 ++++---- .../legacy/xml/XmlReportAssertions.java | 7 +- .../legacy/xml/XmlReportDataTests.java | 28 ++- .../legacy/xml/XmlReportWriterTests.java | 80 +++---- .../runner/JUnitPlatformRunnerTests.java | 217 +++++++++-------- .../platform/testkit/engine/EventsTests.java | 22 +- .../engine/ExecutionsIntegrationTests.java | 12 +- .../NestedContainerEventConditionTests.java | 11 +- 87 files changed, 1392 insertions(+), 1503 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java index 201ba12a292b..fce622ec973e 100644 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java +++ b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java @@ -18,7 +18,6 @@ import org.junit.jupiter.api.extension.BeforeEachCallback; import org.junit.jupiter.api.extension.ExtensionContext; -import org.junit.jupiter.api.extension.ExtensionContext.Store; import org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource; import org.junit.jupiter.api.extension.ParameterContext; import org.junit.jupiter.api.extension.ParameterResolver; @@ -37,9 +36,9 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon @Override public Object resolveParameter(ParameterContext parameterContext, ExtensionContext context) { - ExtensionContext engineContext = context.getRoot(); - Store store = engineContext.getStore(ExtensionContext.Namespace.GLOBAL); - ResourceValue resource = store.getOrComputeIfAbsent(ResourceValue.class); + var engineContext = context.getRoot(); + var store = engineContext.getStore(ExtensionContext.Namespace.GLOBAL); + var resource = store.getOrComputeIfAbsent(ResourceValue.class); resource.usages.incrementAndGet(); return resource; } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java b/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java index ba7e32d29f25..3521213e8c09 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java @@ -24,73 +24,73 @@ public class TryTests { @Test void successfulTriesCanBeTransformed() throws Exception { - Try t = Try.success("foo"); + var success = Try.success("foo"); - assertThat(t.get()).isEqualTo("foo"); - assertThat(t.getOrThrow(RuntimeException::new)).isEqualTo("foo"); - assertThat(t.toOptional()).contains("foo"); + assertThat(success.get()).isEqualTo("foo"); + assertThat(success.getOrThrow(RuntimeException::new)).isEqualTo("foo"); + assertThat(success.toOptional()).contains("foo"); - assertThat(t.andThen(v -> { + assertThat(success.andThen(v -> { assertThat(v).isEqualTo("foo"); return Try.success("bar"); }).get()).isEqualTo("bar"); - assertThat(t.andThenTry(v -> { + assertThat(success.andThenTry(v -> { assertThat(v).isEqualTo("foo"); return "bar"; }).get()).isEqualTo("bar"); - assertThat(t.orElse(() -> fail("should not be called"))).isSameAs(t); - assertThat(t.orElseTry(() -> fail("should not be called"))).isSameAs(t); + assertThat(success.orElse(() -> fail("should not be called"))).isSameAs(success); + assertThat(success.orElseTry(() -> fail("should not be called"))).isSameAs(success); - AtomicReference value = new AtomicReference<>(); - assertThat(t.ifSuccess(value::set)).isSameAs(t); + var value = new AtomicReference(); + assertThat(success.ifSuccess(value::set)).isSameAs(success); assertThat(value.get()).isEqualTo("foo"); - assertThat(t.ifFailure(cause -> fail("should not be called"))).isSameAs(t); + assertThat(success.ifFailure(cause -> fail("should not be called"))).isSameAs(success); } @Test void failedTriesCanBeTransformed() throws Exception { - JUnitException cause = new JUnitException("foo"); - Try t = Try.failure(cause); + var cause = new JUnitException("foo"); + var failure = Try.failure(cause); - assertThat(assertThrows(JUnitException.class, t::get)).isSameAs(cause); - assertThat(assertThrows(RuntimeException.class, () -> t.getOrThrow(RuntimeException::new))).isInstanceOf( + assertThat(assertThrows(JUnitException.class, failure::get)).isSameAs(cause); + assertThat(assertThrows(RuntimeException.class, () -> failure.getOrThrow(RuntimeException::new))).isInstanceOf( RuntimeException.class).hasCause(cause); - assertThat(t.toOptional()).isEmpty(); + assertThat(failure.toOptional()).isEmpty(); - assertThat(t.andThen(v -> fail("should not be called"))).isSameAs(t); - assertThat(t.andThenTry(v -> fail("should not be called"))).isSameAs(t); + assertThat(failure.andThen(v -> fail("should not be called"))).isSameAs(failure); + assertThat(failure.andThenTry(v -> fail("should not be called"))).isSameAs(failure); - assertThat(t.orElse(() -> Try.success("bar")).get()).isEqualTo("bar"); - assertThat(t.orElseTry(() -> "bar").get()).isEqualTo("bar"); + assertThat(failure.orElse(() -> Try.success("bar")).get()).isEqualTo("bar"); + assertThat(failure.orElseTry(() -> "bar").get()).isEqualTo("bar"); - assertThat(t.ifSuccess(v -> fail("should not be called"))).isSameAs(t); - AtomicReference exception = new AtomicReference<>(); - assertThat(t.ifFailure(exception::set)).isSameAs(t); + assertThat(failure.ifSuccess(v -> fail("should not be called"))).isSameAs(failure); + var exception = new AtomicReference(); + assertThat(failure.ifFailure(exception::set)).isSameAs(failure); assertThat(exception.get()).isSameAs(cause); } @Test void successfulTriesCanStoreNull() throws Exception { - Try t = Try.success(null); - assertThat(t.get()).isNull(); - assertThat(t.getOrThrow(RuntimeException::new)).isNull(); - assertThat(t.toOptional()).isEmpty(); + var success = Try.success(null); + assertThat(success.get()).isNull(); + assertThat(success.getOrThrow(RuntimeException::new)).isNull(); + assertThat(success.toOptional()).isEmpty(); } @Test void triesWithSameContentAreEqual() { - Exception cause = new Exception(); + var cause = new Exception(); Callable failingCallable = () -> { throw cause; }; - Try success = Try.call(() -> "foo"); + var success = Try.call(() -> "foo"); assertThat(success).isEqualTo(success).hasSameHashCodeAs(success); assertThat(success).isEqualTo(Try.success("foo")); assertThat(success).isNotEqualTo(Try.failure(cause)); - Try failure = Try.call(failingCallable); + var failure = Try.call(failingCallable); assertThat(failure).isEqualTo(failure).hasSameHashCodeAs(failure); assertThat(failure).isNotEqualTo(Try.success("foo")); assertThat(failure).isEqualTo(Try.failure(cause)); @@ -100,12 +100,12 @@ void triesWithSameContentAreEqual() { void methodPreconditionsAreChecked() { assertThrows(JUnitException.class, () -> Try.call(null)); - Try success = Try.success("foo"); + var success = Try.success("foo"); assertThrows(JUnitException.class, () -> success.andThen(null)); assertThrows(JUnitException.class, () -> success.andThenTry(null)); assertThrows(JUnitException.class, () -> success.ifSuccess(null)); - Try failure = Try.failure(new Exception()); + var failure = Try.failure(new Exception()); assertThrows(JUnitException.class, () -> failure.orElse(null)); assertThrows(JUnitException.class, () -> failure.orElseTry(null)); assertThrows(JUnitException.class, () -> failure.ifFailure(null)); diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java index 810654073da5..42d46cc57c26 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java @@ -20,7 +20,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import java.lang.reflect.Method; import java.util.Optional; import org.junit.jupiter.api.Tag; @@ -36,15 +35,15 @@ class AnnotationSupportTests { @Test void isAnnotatedPreconditions() { - Optional> optional = Optional.of(Probe.class); + var optional = Optional.of(Probe.class); assertPreconditionViolationException("annotationType", () -> AnnotationSupport.isAnnotated(optional, null)); assertPreconditionViolationException("annotationType", () -> AnnotationSupport.isAnnotated(Probe.class, null)); } @Test void isAnnotatedDelegates() { - Class element = Probe.class; - Optional> optional = Optional.of(element); + var element = Probe.class; + var optional = Optional.of(element); assertEquals(AnnotationUtils.isAnnotated(optional, Tag.class), AnnotationSupport.isAnnotated(optional, Tag.class)); @@ -59,7 +58,7 @@ void isAnnotatedDelegates() { @Test void findAnnotationPreconditions() { - Optional> optional = Optional.of(Probe.class); + var optional = Optional.of(Probe.class); assertPreconditionViolationException("annotationType", () -> AnnotationSupport.findAnnotation(optional, null)); assertPreconditionViolationException("annotationType", () -> AnnotationSupport.findAnnotation(Probe.class, null)); @@ -67,8 +66,8 @@ void findAnnotationPreconditions() { @Test void findAnnotationDelegates() { - Class element = Probe.class; - Optional> optional = Optional.of(element); + var element = Probe.class; + var optional = Optional.of(element); assertEquals(AnnotationUtils.findAnnotation(optional, Tag.class), AnnotationSupport.findAnnotation(optional, Tag.class)); @@ -132,7 +131,7 @@ void findAnnotatedMethodsDelegates() { @Test void findRepeatableAnnotationsDelegates() throws Throwable { - Method bMethod = Probe.class.getDeclaredMethod("bMethod"); + var bMethod = Probe.class.getDeclaredMethod("bMethod"); assertEquals(AnnotationUtils.findRepeatableAnnotations(bMethod, Tag.class), AnnotationSupport.findRepeatableAnnotations(bMethod, Tag.class)); Object expected = assertThrows(PreconditionViolationException.class, @@ -185,7 +184,7 @@ void findAnnotatedFieldsPreconditions() { @Test void findAnnotatedFieldValuesForNonStaticFields() { - Fields instance = new Fields(); + var instance = new Fields(); assertThat(AnnotationSupport.findAnnotatedFieldValues(instance, Tag.class)).isEmpty(); @@ -203,7 +202,7 @@ void findAnnotatedFieldValuesForStaticFields() { @Test void findAnnotatedFieldValuesForNonStaticFieldsByType() { - Fields instance = new Fields(); + var instance = new Fields(); assertThat(AnnotationSupport.findAnnotatedFieldValues(instance, FieldMarker.class, Number.class)).isEmpty(); diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java b/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java index dde5d1bb4c2e..bb51916cd308 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java @@ -22,12 +22,12 @@ class PreconditionAssertions { static void assertPreconditionViolationException(String name, Executable executable) { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, executable); + var exception = assertThrows(PreconditionViolationException.class, executable); assertEquals(name + " must not be null", exception.getMessage()); } static void assertPreconditionViolationExceptionForString(String name, Executable executable) { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, executable); + var exception = assertThrows(PreconditionViolationException.class, executable); assertEquals(name + " must not be null or blank", exception.getMessage()); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java index d62f0d566e4d..2938b258f553 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java @@ -19,7 +19,6 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.net.URI; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; @@ -80,9 +79,9 @@ List findAllClassesInClasspathRootDelegates() throws Throwable { List paths = new ArrayList<>(); paths.add(Path.of(".").toRealPath()); paths.addAll(ReflectionUtils.getAllClasspathRootDirectories()); - for (Path path : paths) { - URI root = path.toUri(); - String displayName = root.getPath(); + for (var path : paths) { + var root = path.toUri(); + var displayName = root.getPath(); if (displayName.length() > 42) { displayName = "..." + displayName.substring(displayName.length() - 42); } @@ -95,7 +94,7 @@ List findAllClassesInClasspathRootDelegates() throws Throwable { @Test void findAllClassesInClasspathRootPreconditions() { - URI path = Path.of(".").toUri(); + var path = Path.of(".").toUri(); assertPreconditionViolationException("root", () -> ReflectionSupport.findAllClassesInClasspathRoot(null, allTypes, allNames)); assertPreconditionViolationException("class predicate", @@ -133,7 +132,7 @@ void findAllClassesInModuleDelegates() { @Test void findAllClassesInModulePreconditions() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> ReflectionSupport.findAllClassesInModule(null, allTypes, allNames)); assertEquals("Module name must not be null or empty", exception.getMessage()); assertPreconditionViolationException("class predicate", @@ -159,7 +158,7 @@ void newInstancePreconditions() { @Test void invokeMethodDelegates() throws Exception { - Method method = Boolean.class.getMethod("valueOf", String.class); + var method = Boolean.class.getMethod("valueOf", String.class); assertEquals(ReflectionUtils.invokeMethod(method, null, "true"), ReflectionSupport.invokeMethod(method, null, "true")); } @@ -168,8 +167,8 @@ void invokeMethodDelegates() throws Exception { void invokeMethodPreconditions() throws Exception { assertPreconditionViolationException("Method", () -> ReflectionSupport.invokeMethod(null, null, "true")); - Method method = Boolean.class.getMethod("toString"); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var method = Boolean.class.getMethod("toString"); + var exception = assertThrows(PreconditionViolationException.class, () -> ReflectionSupport.invokeMethod(method, null)); assertEquals("Cannot invoke non-static method [" + method.toGenericString() + "] on a null target.", exception.getMessage()); @@ -203,11 +202,11 @@ void findFieldsPreconditions() { @Test void tryToReadFieldValueDelegates() throws Exception { - Field staticField = getClass().getDeclaredField("staticField"); + var staticField = getClass().getDeclaredField("staticField"); assertEquals(ReflectionUtils.tryToReadFieldValue(staticField, null), ReflectionSupport.tryToReadFieldValue(staticField, null)); - Field instanceField = getClass().getDeclaredField("instanceField"); + var instanceField = getClass().getDeclaredField("instanceField"); assertEquals(ReflectionUtils.tryToReadFieldValue(instanceField, this), ReflectionSupport.tryToReadFieldValue(instanceField, this)); } @@ -216,7 +215,7 @@ void tryToReadFieldValueDelegates() throws Exception { void tryToReadFieldValuePreconditions() throws Exception { assertPreconditionViolationException("Field", () -> ReflectionSupport.tryToReadFieldValue(null, this)); - Field instanceField = getClass().getDeclaredField("instanceField"); + var instanceField = getClass().getDeclaredField("instanceField"); Exception exception = assertThrows(PreconditionViolationException.class, () -> ReflectionSupport.tryToReadFieldValue(instanceField, null)); assertThat(exception)// diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java index 5d52fe42e79b..319b15eb26d4 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java @@ -37,7 +37,6 @@ import java.lang.annotation.Target; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Field; -import java.lang.reflect.Method; import java.math.BigDecimal; import java.util.List; import java.util.Optional; @@ -129,19 +128,19 @@ void findAnnotationMetaPresentOnImplementedInterface() { @Test void findAnnotationDirectlyPresentOnMethod() throws Exception { - Method method = Annotation2Class.class.getDeclaredMethod("method"); + var method = Annotation2Class.class.getDeclaredMethod("method"); assertThat(findAnnotation(method, Annotation1.class)).isPresent(); } @Test void findAnnotationMetaPresentOnMethod() throws Exception { - Method method = ComposedAnnotationClass.class.getDeclaredMethod("method"); + var method = ComposedAnnotationClass.class.getDeclaredMethod("method"); assertThat(findAnnotation(method, Annotation1.class)).isPresent(); } @Test void findAnnotationMetaPresentOnOptionalMethod() throws Exception { - Method method = ComposedAnnotationClass.class.getDeclaredMethod("method"); + var method = ComposedAnnotationClass.class.getDeclaredMethod("method"); assertThat(findAnnotation(Optional.of(method), Annotation1.class)).isPresent(); } @@ -177,7 +176,7 @@ void isAnnotatedWhenMetaPresentOnMethod() throws Exception { @Test void findRepeatableAnnotationsForNotRepeatableAnnotation() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> findRepeatableAnnotations(getClass(), Inherited.class)); assertThat(exception.getMessage()).isEqualTo(Inherited.class.getName() + " must be @Repeatable"); @@ -322,21 +321,21 @@ void findAnnotatedMethodsForAnnotationThatIsNotPresent() { @Test void findAnnotatedMethodsForAnnotationOnMethodsInClassUsingHierarchyDownMode() throws Exception { - Method method2 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method2"); - Method method3 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method3"); + var method2 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method2"); + var method3 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method3"); - List methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation2.class, TOP_DOWN); + var methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation2.class, TOP_DOWN); assertThat(methods).containsOnly(method2, method3); } @Test void findAnnotatedMethodsForAnnotationOnMethodsInClassHierarchyUsingHierarchyUpMode() throws Exception { - Method method1 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method1"); - Method method3 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method3"); - Method superMethod = SuperclassWithAnnotatedMethod.class.getDeclaredMethod("superMethod"); + var method1 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method1"); + var method3 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method3"); + var superMethod = SuperclassWithAnnotatedMethod.class.getDeclaredMethod("superMethod"); - List methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation1.class, BOTTOM_UP); + var methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation1.class, BOTTOM_UP); assertEquals(3, methods.size()); assertThat(methods.subList(0, 2)).containsOnly(method1, method3); @@ -345,11 +344,11 @@ void findAnnotatedMethodsForAnnotationOnMethodsInClassHierarchyUsingHierarchyUpM @Test void findAnnotatedMethodsForAnnotationUsedInClassAndSuperclassHierarchyDown() throws Exception { - Method method1 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method1"); - Method method3 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method3"); - Method superMethod = SuperclassWithAnnotatedMethod.class.getDeclaredMethod("superMethod"); + var method1 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method1"); + var method3 = ClassWithAnnotatedMethods.class.getDeclaredMethod("method3"); + var superMethod = SuperclassWithAnnotatedMethod.class.getDeclaredMethod("superMethod"); - List methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation1.class, TOP_DOWN); + var methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation1.class, TOP_DOWN); assertEquals(3, methods.size()); assertEquals(superMethod, methods.get(0)); @@ -358,9 +357,9 @@ void findAnnotatedMethodsForAnnotationUsedInClassAndSuperclassHierarchyDown() th @Test void findAnnotatedMethodsForAnnotationUsedInInterface() throws Exception { - Method interfaceMethod = InterfaceWithAnnotatedDefaultMethod.class.getDeclaredMethod("interfaceMethod"); + var interfaceMethod = InterfaceWithAnnotatedDefaultMethod.class.getDeclaredMethod("interfaceMethod"); - List methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation3.class, BOTTOM_UP); + var methods = findAnnotatedMethods(ClassWithAnnotatedMethods.class, Annotation3.class, BOTTOM_UP); assertThat(methods).containsExactly(interfaceMethod); } @@ -392,23 +391,21 @@ void findAnnotatedFieldsForAnnotationThatIsNotPresent() { @Test void findAnnotatedFieldsForAnnotationOnFieldsInClassUsingHierarchyDownMode() throws Exception { - Field field2 = ClassWithAnnotatedFields.class.getDeclaredField("field2"); - Field field3 = ClassWithAnnotatedFields.class.getDeclaredField("field3"); + var field2 = ClassWithAnnotatedFields.class.getDeclaredField("field2"); + var field3 = ClassWithAnnotatedFields.class.getDeclaredField("field3"); - List fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation2.class, isStringField, - TOP_DOWN); + var fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation2.class, isStringField, TOP_DOWN); assertThat(fields).containsOnly(field2, field3); } @Test void findAnnotatedFieldsForAnnotationOnFieldsInClassHierarchyUsingHierarchyUpMode() throws Exception { - Field field1 = ClassWithAnnotatedFields.class.getDeclaredField("field1"); - Field field3 = ClassWithAnnotatedFields.class.getDeclaredField("field3"); - Field superField = SuperclassWithAnnotatedField.class.getDeclaredField("superField"); + var field1 = ClassWithAnnotatedFields.class.getDeclaredField("field1"); + var field3 = ClassWithAnnotatedFields.class.getDeclaredField("field3"); + var superField = SuperclassWithAnnotatedField.class.getDeclaredField("superField"); - List fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation1.class, isStringField, - BOTTOM_UP); + var fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation1.class, isStringField, BOTTOM_UP); assertEquals(3, fields.size()); assertThat(fields.subList(0, 2)).containsOnly(field1, field3); @@ -417,12 +414,11 @@ void findAnnotatedFieldsForAnnotationOnFieldsInClassHierarchyUsingHierarchyUpMod @Test void findAnnotatedFieldsForAnnotationUsedInClassAndSuperclassHierarchyDown() throws Exception { - Field field1 = ClassWithAnnotatedFields.class.getDeclaredField("field1"); - Field field3 = ClassWithAnnotatedFields.class.getDeclaredField("field3"); - Field superField = SuperclassWithAnnotatedField.class.getDeclaredField("superField"); + var field1 = ClassWithAnnotatedFields.class.getDeclaredField("field1"); + var field3 = ClassWithAnnotatedFields.class.getDeclaredField("field3"); + var superField = SuperclassWithAnnotatedField.class.getDeclaredField("superField"); - List fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation1.class, isStringField, - TOP_DOWN); + var fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation1.class, isStringField, TOP_DOWN); assertEquals(3, fields.size()); assertEquals(superField, fields.get(0)); @@ -431,10 +427,9 @@ void findAnnotatedFieldsForAnnotationUsedInClassAndSuperclassHierarchyDown() thr @Test void findAnnotatedFieldsForAnnotationUsedInInterface() throws Exception { - Field interfaceField = InterfaceWithAnnotatedField.class.getDeclaredField("interfaceField"); + var interfaceField = InterfaceWithAnnotatedField.class.getDeclaredField("interfaceField"); - List fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation3.class, isStringField, - BOTTOM_UP); + var fields = findAnnotatedFields(ClassWithAnnotatedFields.class, Annotation3.class, isStringField, BOTTOM_UP); assertThat(fields).containsExactly(interfaceField); } @@ -442,11 +437,11 @@ void findAnnotatedFieldsForAnnotationUsedInInterface() throws Exception { @Test void findAnnotatedFieldsForShadowedFields() throws Exception { Class clazz = ClassWithShadowedAnnotatedFields.class; - Field interfaceField = clazz.getDeclaredField("interfaceField"); - Field superField = clazz.getDeclaredField("superField"); - Field field1 = clazz.getDeclaredField("field1"); - Field field2 = clazz.getDeclaredField("field2"); - Field field3 = clazz.getDeclaredField("field3"); + var interfaceField = clazz.getDeclaredField("interfaceField"); + var superField = clazz.getDeclaredField("superField"); + var field1 = clazz.getDeclaredField("field1"); + var field2 = clazz.getDeclaredField("field2"); + var field3 = clazz.getDeclaredField("field3"); assertThat(findShadowingAnnotatedFields(Annotation1.class)).containsExactly(superField, field1, field3); assertThat(findShadowingAnnotatedFields(Annotation2.class)).containsExactly(field2, field3); @@ -479,28 +474,28 @@ void findPublicAnnotatedFieldsForNullAnnotationType() { @Test void findPublicAnnotatedFieldsForPrivateField() { - List fields = findPublicAnnotatedFields(getClass(), Boolean.class, Annotation1.class); + var fields = findPublicAnnotatedFields(getClass(), Boolean.class, Annotation1.class); assertNotNull(fields); assertEquals(0, fields.size()); } @Test void findPublicAnnotatedFieldsForDirectlyAnnotatedFieldOfWrongFieldType() { - List fields = findPublicAnnotatedFields(getClass(), BigDecimal.class, Annotation1.class); + var fields = findPublicAnnotatedFields(getClass(), BigDecimal.class, Annotation1.class); assertNotNull(fields); assertEquals(0, fields.size()); } @Test void findPublicAnnotatedFieldsForDirectlyAnnotatedField() { - List fields = findPublicAnnotatedFields(getClass(), String.class, Annotation1.class); + var fields = findPublicAnnotatedFields(getClass(), String.class, Annotation1.class); assertNotNull(fields); assertIterableEquals(asList("directlyAnnotatedField"), asNames(fields)); } @Test void findPublicAnnotatedFieldsForMetaAnnotatedField() { - List fields = findPublicAnnotatedFields(getClass(), Number.class, Annotation1.class); + var fields = findPublicAnnotatedFields(getClass(), Number.class, Annotation1.class); assertNotNull(fields); assertEquals(1, fields.size()); assertIterableEquals(asList("metaAnnotatedField"), asNames(fields)); @@ -508,15 +503,14 @@ void findPublicAnnotatedFieldsForMetaAnnotatedField() { @Test void findPublicAnnotatedFieldsForDirectlyAnnotatedFieldInInterface() { - List fields = findPublicAnnotatedFields(InterfaceWithAnnotatedFields.class, String.class, - Annotation1.class); + var fields = findPublicAnnotatedFields(InterfaceWithAnnotatedFields.class, String.class, Annotation1.class); assertNotNull(fields); assertIterableEquals(asList("foo"), asNames(fields)); } @Test void findPublicAnnotatedFieldsForDirectlyAnnotatedFieldsInClassAndInterface() { - List fields = findPublicAnnotatedFields(ClassWithPublicAnnotatedFieldsFromInterface.class, String.class, + var fields = findPublicAnnotatedFields(ClassWithPublicAnnotatedFieldsFromInterface.class, String.class, Annotation1.class); assertNotNull(fields); assertThat(asNames(fields)).containsExactlyInAnyOrder("foo", "bar"); diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java index 2f775c2f1870..13e296cfb8f1 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java @@ -28,8 +28,8 @@ class ClassLoaderUtilsTests { @Test void getDefaultClassLoaderWithExplicitContextClassLoader() { - ClassLoader original = Thread.currentThread().getContextClassLoader(); - ClassLoader mock = mock(ClassLoader.class); + var original = Thread.currentThread().getContextClassLoader(); + var mock = mock(ClassLoader.class); Thread.currentThread().setContextClassLoader(mock); try { assertSame(mock, ClassLoaderUtils.getDefaultClassLoader()); @@ -41,7 +41,7 @@ void getDefaultClassLoaderWithExplicitContextClassLoader() { @Test void getDefaultClassLoaderWithNullContextClassLoader() { - ClassLoader original = Thread.currentThread().getContextClassLoader(); + var original = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(null); try { assertSame(ClassLoader.getSystemClassLoader(), ClassLoaderUtils.getDefaultClassLoader()); @@ -53,8 +53,7 @@ void getDefaultClassLoaderWithNullContextClassLoader() { @Test void getLocationFromNullFails() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> ClassLoaderUtils.getLocation(null)); + var exception = assertThrows(PreconditionViolationException.class, () -> ClassLoaderUtils.getLocation(null)); assertEquals("object must not be null", exception.getMessage()); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java index 41d68968c48b..b240c08618d0 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java @@ -115,7 +115,7 @@ void alwaysDisabledListeners(String pattern) { //@formatter:on @ParameterizedTest void alwaysEnabledClass(String pattern) { - List executionConditions = asList(new AVanillaEmpty(), new BVanillaEmpty()); + var executionConditions = asList(new AVanillaEmpty(), new BVanillaEmpty()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isNotEmpty(); } @@ -131,7 +131,7 @@ void alwaysEnabledClass(String pattern) { //@formatter:on @ParameterizedTest void alwaysDisabledClass(String pattern) { - List executionConditions = asList(new AVanillaEmpty(), new BVanillaEmpty()); + var executionConditions = asList(new AVanillaEmpty(), new BVanillaEmpty()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isEmpty(); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java index 11b8f50bd12a..38f9c0304da3 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java @@ -115,9 +115,8 @@ void scanForClassesInClasspathRootWhenGenericRuntimeExceptionOccurs(LogRecordLis } private void assertClassesScannedWhenExceptionIsThrown(Predicate> filter) throws Exception { - ClassFilter classFilter = ClassFilter.of(filter); - List> classes = this.classpathScanner.scanForClassesInClasspathRoot(getTestClasspathRoot(), - classFilter); + var classFilter = ClassFilter.of(filter); + var classes = this.classpathScanner.scanForClassesInClasspathRoot(getTestClasspathRoot(), classFilter); assertThat(classes.size()).isGreaterThanOrEqualTo(150); } @@ -138,7 +137,7 @@ void scanForClassesInClasspathRootWhenOutOfMemoryErrorOccurs() { } return true; }; - ClassFilter classFilter = ClassFilter.of(outOfMemoryErrorSimulationFilter); + var classFilter = ClassFilter.of(outOfMemoryErrorSimulationFilter); assertThrows(OutOfMemoryError.class, () -> this.classpathScanner.scanForClassesInClasspathRoot(getTestClasspathRoot(), classFilter)); @@ -155,14 +154,13 @@ void scanForClassesInClasspathRootWithinJarWithSpacesInPath() throws Exception { } private void scanForClassesInClasspathRootWithinJarFile(String resourceName) throws Exception { - URL jarfile = getClass().getResource(resourceName); + var jarfile = getClass().getResource(resourceName); - try (URLClassLoader classLoader = new URLClassLoader(new URL[] { jarfile })) { - ClasspathScanner classpathScanner = new ClasspathScanner(() -> classLoader, - ReflectionUtils::tryToLoadClass); + try (var classLoader = new URLClassLoader(new URL[] { jarfile })) { + var classpathScanner = new ClasspathScanner(() -> classLoader, ReflectionUtils::tryToLoadClass); - List> classes = classpathScanner.scanForClassesInClasspathRoot(jarfile.toURI(), allClasses); - List classNames = classes.stream().map(Class::getName).collect(Collectors.toList()); + var classes = classpathScanner.scanForClassesInClasspathRoot(jarfile.toURI(), allClasses); + var classNames = classes.stream().map(Class::getName).collect(Collectors.toList()); assertThat(classNames).hasSize(3) // .contains("org.junit.platform.jartest.notincluded.NotIncluded", "org.junit.platform.jartest.included.recursive.RecursivelyIncluded", @@ -172,7 +170,7 @@ private void scanForClassesInClasspathRootWithinJarFile(String resourceName) thr @Test void scanForClassesInPackage() { - List> classes = classpathScanner.scanForClassesInPackage("org.junit.platform.commons", allClasses); + var classes = classpathScanner.scanForClassesInPackage("org.junit.platform.commons", allClasses); assertThat(classes.size()).isGreaterThanOrEqualTo(20); assertTrue(classes.contains(NestedClassToBeFound.class)); assertTrue(classes.contains(MemberClassToBeFound.class)); @@ -180,16 +178,14 @@ void scanForClassesInPackage() { @Test void findAllClassesInPackageWithinJarFile() throws Exception { - URL jarfile = getClass().getResource("/jartest.jar"); + var jarfile = getClass().getResource("/jartest.jar"); - try (URLClassLoader classLoader = new URLClassLoader(new URL[] { jarfile })) { - ClasspathScanner classpathScanner = new ClasspathScanner(() -> classLoader, - ReflectionUtils::tryToLoadClass); + try (var classLoader = new URLClassLoader(new URL[] { jarfile })) { + var classpathScanner = new ClasspathScanner(() -> classLoader, ReflectionUtils::tryToLoadClass); - List> classes = classpathScanner.scanForClassesInPackage("org.junit.platform.jartest.included", - allClasses); + var classes = classpathScanner.scanForClassesInPackage("org.junit.platform.jartest.included", allClasses); assertThat(classes).hasSize(2); - List classNames = classes.stream().map(Class::getSimpleName).collect(Collectors.toList()); + var classNames = classes.stream().map(Class::getSimpleName).collect(Collectors.toList()); assertTrue(classNames.contains("Included")); assertTrue(classNames.contains("RecursivelyIncluded")); } @@ -197,8 +193,8 @@ void findAllClassesInPackageWithinJarFile() throws Exception { @Test void scanForClassesInDefaultPackage() { - ClassFilter classFilter = ClassFilter.of(this::inDefaultPackage); - List> classes = classpathScanner.scanForClassesInPackage("", classFilter); + var classFilter = ClassFilter.of(this::inDefaultPackage); + var classes = classpathScanner.scanForClassesInPackage("", classFilter); assertThat(classes.size()).as("number of classes found in default package").isGreaterThanOrEqualTo(1); assertTrue(classes.stream().allMatch(this::inDefaultPackage)); @@ -207,8 +203,8 @@ void scanForClassesInDefaultPackage() { @Test void scanForClassesInPackageWithFilter() { - ClassFilter thisClassOnly = ClassFilter.of(clazz -> clazz == ClasspathScannerTests.class); - List> classes = classpathScanner.scanForClassesInPackage("org.junit.platform.commons", thisClassOnly); + var thisClassOnly = ClassFilter.of(clazz -> clazz == ClasspathScannerTests.class); + var classes = classpathScanner.scanForClassesInPackage("org.junit.platform.commons", thisClassOnly); assertSame(ClasspathScannerTests.class, classes.get(0)); } @@ -232,15 +228,15 @@ void scanForClassesInPackageForNullClassFilter() { @Test void scanForClassesInPackageWhenIOExceptionOccurs() { - ClasspathScanner scanner = new ClasspathScanner(ThrowingClassLoader::new, ReflectionUtils::tryToLoadClass); - List> classes = scanner.scanForClassesInPackage("org.junit.platform.commons", allClasses); + var scanner = new ClasspathScanner(ThrowingClassLoader::new, ReflectionUtils::tryToLoadClass); + var classes = scanner.scanForClassesInPackage("org.junit.platform.commons", allClasses); assertThat(classes).isEmpty(); } @Test void scanForClassesInPackageOnlyLoadsClassesThatAreIncludedByTheClassNameFilter() { Predicate classNameFilter = name -> ClasspathScannerTests.class.getName().equals(name); - ClassFilter classFilter = ClassFilter.of(classNameFilter, type -> true); + var classFilter = ClassFilter.of(classNameFilter, type -> true); classpathScanner.scanForClassesInPackage("org.junit.platform.commons", classFilter); @@ -249,19 +245,19 @@ void scanForClassesInPackageOnlyLoadsClassesThatAreIncludedByTheClassNameFilter( @Test void findAllClassesInClasspathRoot() throws Exception { - ClassFilter thisClassOnly = ClassFilter.of(clazz -> clazz == ClasspathScannerTests.class); - URI root = getTestClasspathRoot(); - List> classes = classpathScanner.scanForClassesInClasspathRoot(root, thisClassOnly); + var thisClassOnly = ClassFilter.of(clazz -> clazz == ClasspathScannerTests.class); + var root = getTestClasspathRoot(); + var classes = classpathScanner.scanForClassesInClasspathRoot(root, thisClassOnly); assertSame(ClasspathScannerTests.class, classes.get(0)); } @Test void findAllClassesInDefaultPackageInClasspathRoot() throws Exception { - ClassFilter classFilter = ClassFilter.of(this::inDefaultPackage); - List> classes = classpathScanner.scanForClassesInClasspathRoot(getTestClasspathRoot(), classFilter); + var classFilter = ClassFilter.of(this::inDefaultPackage); + var classes = classpathScanner.scanForClassesInClasspathRoot(getTestClasspathRoot(), classFilter); assertEquals(1, classes.size(), "number of classes found in default package"); - Class testClass = classes.get(0); + var testClass = classes.get(0); assertTrue(inDefaultPackage(testClass)); assertEquals("DefaultPackageTestCase", testClass.getName()); } @@ -272,25 +268,25 @@ void doesNotLoopInfinitelyWithCircularSymlinks(@TempDir Path tempDir) throws Exc // Abort if running on Microsoft Windows since we are testing symbolic links assumeFalse(System.getProperty("os.name").toLowerCase().contains("win")); - Path directory = Files.createDirectory(tempDir.resolve("directory")); - Path symlink1 = Files.createSymbolicLink(tempDir.resolve("symlink1"), directory); + var directory = Files.createDirectory(tempDir.resolve("directory")); + var symlink1 = Files.createSymbolicLink(tempDir.resolve("symlink1"), directory); Files.createSymbolicLink(directory.resolve("symlink2"), symlink1); - List> classes = classpathScanner.scanForClassesInClasspathRoot(symlink1.toUri(), allClasses); + var classes = classpathScanner.scanForClassesInClasspathRoot(symlink1.toUri(), allClasses); assertThat(classes).isEmpty(); } private boolean inDefaultPackage(Class clazz) { // OpenJDK returns NULL for the default package. - Package pkg = clazz.getPackage(); + var pkg = clazz.getPackage(); return pkg == null || "".equals(clazz.getPackage().getName()); } @Test void findAllClassesInClasspathRootWithFilter() throws Exception { - URI root = getTestClasspathRoot(); - List> classes = classpathScanner.scanForClassesInClasspathRoot(root, allClasses); + var root = getTestClasspathRoot(); + var classes = classpathScanner.scanForClassesInClasspathRoot(root, allClasses); assertThat(classes.size()).isGreaterThanOrEqualTo(20); assertTrue(classes.contains(ClasspathScannerTests.class)); @@ -316,9 +312,8 @@ void findAllClassesInClasspathRootForNullClassFilter() { @Test void onlyLoadsClassesInClasspathRootThatAreIncludedByTheClassNameFilter() throws Exception { - ClassFilter classFilter = ClassFilter.of(name -> ClasspathScannerTests.class.getName().equals(name), - type -> true); - URI root = getTestClasspathRoot(); + var classFilter = ClassFilter.of(name -> ClasspathScannerTests.class.getName().equals(name), type -> true); + var root = getTestClasspathRoot(); classpathScanner.scanForClassesInClasspathRoot(root, classFilter); @@ -326,7 +321,7 @@ void onlyLoadsClassesInClasspathRootThatAreIncludedByTheClassNameFilter() throws } private URI getTestClasspathRoot() throws Exception { - URL location = getClass().getProtectionDomain().getCodeSource().getLocation(); + var location = getClass().getProtectionDomain().getCodeSource().getLocation(); return location.toURI(); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java index ce0671e2aac9..cf4e2572acab 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java @@ -25,8 +25,6 @@ import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; -import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.DoubleStream; import java.util.stream.IntStream; @@ -60,8 +58,8 @@ void getOnlyElementWithEmptyCollection() { @Test void getOnlyElementWithSingleElementCollection() { - Object expected = new Object(); - Object actual = CollectionUtils.getOnlyElement(singleton(expected)); + var expected = new Object(); + var actual = CollectionUtils.getOnlyElement(singleton(expected)); assertSame(expected, actual); } @@ -74,7 +72,7 @@ void getOnlyElementWithMultiElementCollection() { @Test void toUnmodifiableListThrowsOnMutation() { - List numbers = Stream.of(1).collect(toUnmodifiableList()); + var numbers = Stream.of(1).collect(toUnmodifiableList()); assertThrows(UnsupportedOperationException.class, numbers::clear); } @@ -95,9 +93,9 @@ void toStreamWithUnsupportedObjectType() { @Test void toStreamWithExistingStream() { - Stream input = Stream.of("foo"); + var input = Stream.of("foo"); - Stream result = CollectionUtils.toStream(input); + var result = CollectionUtils.toStream(input); assertThat(result).isSameAs(input); } @@ -105,9 +103,9 @@ void toStreamWithExistingStream() { @Test @SuppressWarnings("unchecked") void toStreamWithDoubleStream() { - DoubleStream input = DoubleStream.of(42.23); + var input = DoubleStream.of(42.23); - Stream result = (Stream) CollectionUtils.toStream(input); + var result = (Stream) CollectionUtils.toStream(input); assertThat(result).containsExactly(42.23); } @@ -115,9 +113,9 @@ void toStreamWithDoubleStream() { @Test @SuppressWarnings("unchecked") void toStreamWithIntStream() { - IntStream input = IntStream.of(23, 42); + var input = IntStream.of(23, 42); - Stream result = (Stream) CollectionUtils.toStream(input); + var result = (Stream) CollectionUtils.toStream(input); assertThat(result).containsExactly(23, 42); } @@ -125,9 +123,9 @@ void toStreamWithIntStream() { @Test @SuppressWarnings("unchecked") void toStreamWithLongStream() { - LongStream input = LongStream.of(23L, 42L); + var input = LongStream.of(23L, 42L); - Stream result = (Stream) CollectionUtils.toStream(input); + var result = (Stream) CollectionUtils.toStream(input); assertThat(result).containsExactly(23L, 42L); } @@ -135,7 +133,7 @@ void toStreamWithLongStream() { @Test @SuppressWarnings({ "unchecked", "serial" }) void toStreamWithCollection() { - AtomicBoolean collectionStreamClosed = new AtomicBoolean(false); + var collectionStreamClosed = new AtomicBoolean(false); Collection input = new ArrayList<>() { { @@ -149,8 +147,8 @@ public Stream stream() { } }; - try (Stream stream = (Stream) CollectionUtils.toStream(input)) { - List result = stream.collect(toList()); + try (var stream = (Stream) CollectionUtils.toStream(input)) { + var result = stream.collect(toList()); assertThat(result).containsExactly("foo", "bar"); } @@ -163,7 +161,7 @@ void toStreamWithIterable() { Iterable input = () -> asList("foo", "bar").iterator(); - Stream result = (Stream) CollectionUtils.toStream(input); + var result = (Stream) CollectionUtils.toStream(input); assertThat(result).containsExactly("foo", "bar"); } @@ -171,9 +169,9 @@ void toStreamWithIterable() { @Test @SuppressWarnings("unchecked") void toStreamWithIterator() { - Iterator input = asList("foo", "bar").iterator(); + var input = asList("foo", "bar").iterator(); - Stream result = (Stream) CollectionUtils.toStream(input); + var result = (Stream) CollectionUtils.toStream(input); assertThat(result).containsExactly("foo", "bar"); } @@ -181,7 +179,7 @@ void toStreamWithIterator() { @Test @SuppressWarnings("unchecked") void toStreamWithArray() { - Stream result = (Stream) CollectionUtils.toStream(new String[] { "foo", "bar" }); + var result = (Stream) CollectionUtils.toStream(new String[] { "foo", "bar" }); assertThat(result).containsExactly("foo", "bar"); } @@ -213,8 +211,8 @@ Stream toStreamWithPrimitiveArrays() { private void toStreamWithPrimitiveArray(Object primitiveArray) { assertTrue(primitiveArray.getClass().isArray()); assertTrue(primitiveArray.getClass().getComponentType().isPrimitive()); - Object[] result = CollectionUtils.toStream(primitiveArray).toArray(); - for (int i = 0; i < result.length; i++) { + var result = CollectionUtils.toStream(primitiveArray).toArray(); + for (var i = 0; i < result.length; i++) { assertEquals(Array.get(primitiveArray, i), result[i]); } } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java index d76472b95553..2d4f03a75262 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java @@ -16,8 +16,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -import java.util.function.Predicate; - import org.junit.jupiter.api.Test; import org.junit.platform.commons.PreconditionViolationException; @@ -42,7 +40,7 @@ void whereWithNullPredicate() { @Test void whereWithChecksPredicateAgainstResultOfFunction() { - Predicate combinedPredicate = FunctionUtils.where(String::length, isEqual(3)); + var combinedPredicate = FunctionUtils.where(String::length, isEqual(3)); assertFalse(combinedPredicate.test("fo")); assertTrue(combinedPredicate.test("foo")); assertFalse(combinedPredicate.test("fooo")); diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java index 8a9e9b2d94e6..224e946ec771 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java @@ -66,14 +66,14 @@ void assertPackageNameIsValidForInvalidPackageNames() { @Test void getAttributeWithNullType() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> PackageUtils.getAttribute(null, p -> "any")); assertEquals("type must not be null", exception.getMessage()); } @Test void getAttributeWithNullFunction() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> PackageUtils.getAttribute(getClass(), (Function) null)); assertEquals("function must not be null", exception.getMessage()); } @@ -85,7 +85,7 @@ void getAttributeWithFunctionReturningNullIsEmpty() { @Test void getAttributeFromDefaultPackageMemberIsEmpty() throws Exception { - Class classInDefaultPackage = ReflectionUtils.tryToLoadClass("DefaultPackageTestCase").get(); + var classInDefaultPackage = ReflectionUtils.tryToLoadClass("DefaultPackageTestCase").get(); assertFalse(PackageUtils.getAttribute(classInDefaultPackage, Package::getSpecificationTitle).isPresent()); } @@ -106,21 +106,21 @@ private Executable isPresent(Function function) { @Test void getAttributeWithNullTypeAndName() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> PackageUtils.getAttribute(null, "foo")); assertEquals("type must not be null", exception.getMessage()); } @Test void getAttributeWithNullName() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> PackageUtils.getAttribute(getClass(), (String) null)); assertEquals("name must not be blank", exception.getMessage()); } @Test void getAttributeWithEmptyName() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> PackageUtils.getAttribute(getClass(), "")); assertEquals("name must not be blank", exception.getMessage()); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java index c554ebf5f444..e49b9a362d9f 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java @@ -37,43 +37,41 @@ class PreconditionsTests { @Test void notNullPassesForNonNullObject() { - Object object = new Object(); - Object nonNullObject = notNull(object, "message"); + var object = new Object(); + var nonNullObject = notNull(object, "message"); assertSame(object, nonNullObject); } @Test void notNullThrowsForNullObject() { - String message = "argument is null"; + var message = "argument is null"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notNull(null, message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notNull(null, message)); assertEquals(message, exception.getMessage()); } @Test void notNullThrowsForNullObjectAndMessageSupplier() { - String message = "argument is null"; + var message = "argument is null"; Object object = null; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notNull(object, () -> message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notNull(object, () -> message)); assertEquals(message, exception.getMessage()); } @Test void notEmptyPassesForNonEmptyArray() { - String[] array = new String[] { "a", "b", "c" }; - String[] nonEmptyArray = notEmpty(array, () -> "should not fail"); + var array = new String[] { "a", "b", "c" }; + var nonEmptyArray = notEmpty(array, () -> "should not fail"); assertSame(array, nonEmptyArray); } @Test void notEmptyPassesForNonEmptyCollection() { Collection collection = Arrays.asList("a", "b", "c"); - Collection nonEmptyCollection = notEmpty(collection, () -> "should not fail"); + var nonEmptyCollection = notEmpty(collection, () -> "should not fail"); assertSame(collection, nonEmptyCollection); } @@ -89,19 +87,18 @@ void notEmptyPassesForCollectionWithNullElements() { @Test void notEmptyThrowsForNullArray() { - String message = "array is empty"; + var message = "array is empty"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notEmpty((Object[]) null, message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notEmpty((Object[]) null, message)); assertEquals(message, exception.getMessage()); } @Test void notEmptyThrowsForNullCollection() { - String message = "collection is empty"; + var message = "collection is empty"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> notEmpty((Collection) null, message)); assertEquals(message, exception.getMessage()); @@ -109,20 +106,18 @@ void notEmptyThrowsForNullCollection() { @Test void notEmptyThrowsForEmptyArray() { - String message = "array is empty"; + var message = "array is empty"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notEmpty(new Object[0], message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notEmpty(new Object[0], message)); assertEquals(message, exception.getMessage()); } @Test void notEmptyThrowsForEmptyCollection() { - String message = "collection is empty"; + var message = "collection is empty"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notEmpty(emptyList(), message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notEmpty(emptyList(), message)); assertEquals(message, exception.getMessage()); } @@ -147,15 +142,15 @@ void containsNoNullElementsPassesForCollectionThatIsNullOrEmpty() { @Test void containsNoNullElementsPassesForArrayContainingNonNullElements() { - String[] input = new String[] { "a", "b", "c" }; - String[] output = containsNoNullElements(input, "message"); + var input = new String[] { "a", "b", "c" }; + var output = containsNoNullElements(input, "message"); assertSame(input, output); } @Test void containsNoNullElementsPassesForCollectionContainingNonNullElements() { Collection input = Arrays.asList("a", "b", "c"); - Collection output = containsNoNullElements(input, "message"); + var output = containsNoNullElements(input, "message"); assertSame(input, output); output = containsNoNullElements(input, () -> "message"); @@ -164,10 +159,10 @@ void containsNoNullElementsPassesForCollectionContainingNonNullElements() { @Test void containsNoNullElementsThrowsForArrayContainingNullElements() { - String message = "array contains null elements"; + var message = "array contains null elements"; Object[] array = { new Object(), null, new Object() }; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> containsNoNullElements(array, message)); assertEquals(message, exception.getMessage()); @@ -175,9 +170,9 @@ void containsNoNullElementsThrowsForArrayContainingNullElements() { @Test void containsNoNullElementsThrowsForCollectionContainingNullElements() { - String message = "collection contains null elements"; + var message = "collection contains null elements"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> containsNoNullElements(singletonList(null), message)); assertEquals(message, exception.getMessage()); @@ -185,67 +180,61 @@ void containsNoNullElementsThrowsForCollectionContainingNullElements() { @Test void notBlankPassesForNonBlankString() { - String string = "abc"; - String nonBlankString = notBlank(string, "message"); + var string = "abc"; + var nonBlankString = notBlank(string, "message"); assertSame(string, nonBlankString); } @Test void notBlankThrowsForNullString() { - String message = "string shouldn't be blank"; + var message = "string shouldn't be blank"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notBlank(null, message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notBlank(null, message)); assertEquals(message, exception.getMessage()); } @Test void notBlankThrowsForNullStringWithMessageSupplier() { - String message = "string shouldn't be blank"; + var message = "string shouldn't be blank"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notBlank(null, () -> message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notBlank(null, () -> message)); assertEquals(message, exception.getMessage()); } @Test void notBlankThrowsForEmptyString() { - String message = "string shouldn't be blank"; + var message = "string shouldn't be blank"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notBlank("", message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notBlank("", message)); assertEquals(message, exception.getMessage()); } @Test void notBlankThrowsForEmptyStringWithMessageSupplier() { - String message = "string shouldn't be blank"; + var message = "string shouldn't be blank"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notBlank("", () -> message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notBlank("", () -> message)); assertEquals(message, exception.getMessage()); } @Test void notBlankThrowsForBlankString() { - String message = "string shouldn't be blank"; + var message = "string shouldn't be blank"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notBlank(" ", message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notBlank(" ", message)); assertEquals(message, exception.getMessage()); } @Test void notBlankThrowsForBlankStringWithMessageSupplier() { - String message = "string shouldn't be blank"; + var message = "string shouldn't be blank"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> notBlank(" ", () -> message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notBlank(" ", () -> message)); assertEquals(message, exception.getMessage()); } @@ -262,20 +251,18 @@ void conditionPassesForTruePredicateWithMessageSupplier() { @Test void conditionThrowsForFalsePredicate() { - String message = "condition does not hold"; + var message = "condition does not hold"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> condition(false, message)); + var exception = assertThrows(PreconditionViolationException.class, () -> condition(false, message)); assertEquals(message, exception.getMessage()); } @Test void conditionThrowsForFalsePredicateWithMessageSupplier() { - String message = "condition does not hold"; + var message = "condition does not hold"; - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> condition(false, () -> message)); + var exception = assertThrows(PreconditionViolationException.class, () -> condition(false, () -> message)); assertEquals(message, exception.getMessage()); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java index 4b259be2152b..d1ae36e6df88 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java @@ -42,8 +42,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Optional; -import java.util.Set; import java.util.function.Predicate; import java.util.logging.Level; import java.util.logging.LogRecord; @@ -181,7 +179,7 @@ void getAllAssignmentCompatibleClassesWithNullClass() { @Test void getAllAssignmentCompatibleClasses() { - Set> superclasses = ReflectionUtils.getAllAssignmentCompatibleClasses(B.class); + var superclasses = ReflectionUtils.getAllAssignmentCompatibleClasses(B.class); assertThat(superclasses).containsExactly(B.class, InterfaceC.class, InterfaceA.class, InterfaceB.class, A.class, InterfaceD.class, Object.class); assertTrue(superclasses.stream().allMatch(clazz -> clazz.isAssignableFrom(B.class))); @@ -198,7 +196,7 @@ void newInstance() { assertThrows(PreconditionViolationException.class, () -> ReflectionUtils.newInstance(C.class, null, null)); assertThrows(PreconditionViolationException.class, () -> ReflectionUtils.newInstance(C.class, ((Object[]) null))); - RuntimeException exception = assertThrows(RuntimeException.class, () -> ReflectionUtils.newInstance(Exploder.class)); + var exception = assertThrows(RuntimeException.class, () -> ReflectionUtils.newInstance(Exploder.class)); assertThat(exception).hasMessage("boom"); // @formatter:on } @@ -237,7 +235,7 @@ void tryToReadFieldValueOfNonexistentInstanceField() { void readFieldValueOfExistingStaticField() throws Exception { assertThat(readFieldValue(MyClass.class, "staticField", null)).contains(42); - Field field = MyClass.class.getDeclaredField("staticField"); + var field = MyClass.class.getDeclaredField("staticField"); assertThat(readFieldValue(field)).contains(42); assertThat(readFieldValue(field, null)).contains(42); } @@ -246,7 +244,7 @@ void readFieldValueOfExistingStaticField() throws Exception { void tryToReadFieldValueOfExistingStaticField() throws Exception { assertThat(tryToReadFieldValue(MyClass.class, "staticField", null).get()).isEqualTo(42); - Field field = MyClass.class.getDeclaredField("staticField"); + var field = MyClass.class.getDeclaredField("staticField"); assertThat(tryToReadFieldValue(field).get()).isEqualTo(42); assertThat(tryToReadFieldValue(field, null).get()).isEqualTo(42); } @@ -254,17 +252,17 @@ void tryToReadFieldValueOfExistingStaticField() throws Exception { @Test @SuppressWarnings("deprecation") void readFieldValueOfExistingInstanceField() throws Exception { - MyClass instance = new MyClass(42); + var instance = new MyClass(42); assertThat(readFieldValue(MyClass.class, "instanceField", instance)).contains(42); - Field field = MyClass.class.getDeclaredField("instanceField"); + var field = MyClass.class.getDeclaredField("instanceField"); assertThat(readFieldValue(field, instance)).contains(42); } @Test @SuppressWarnings("deprecation") void attemptToReadFieldValueOfExistingInstanceFieldAsStaticField() throws Exception { - Field field = MyClass.class.getDeclaredField("instanceField"); + var field = MyClass.class.getDeclaredField("instanceField"); Exception exception = assertThrows(PreconditionViolationException.class, () -> readFieldValue(field, null)); assertThat(exception)// .hasMessageStartingWith("Cannot read non-static field")// @@ -273,10 +271,10 @@ void attemptToReadFieldValueOfExistingInstanceFieldAsStaticField() throws Except @Test void tryToReadFieldValueOfExistingInstanceField() throws Exception { - MyClass instance = new MyClass(42); + var instance = new MyClass(42); assertThat(tryToReadFieldValue(MyClass.class, "instanceField", instance).get()).isEqualTo(42); - Field field = MyClass.class.getDeclaredField("instanceField"); + var field = MyClass.class.getDeclaredField("instanceField"); assertThat(tryToReadFieldValue(field, instance).get()).isEqualTo(42); assertThrows(PreconditionViolationException.class, () -> tryToReadFieldValue(field, null).get()); } @@ -417,14 +415,14 @@ void invokeMethodPreconditions() { @Test void invokePublicMethod() throws Exception { - InvocationTracker tracker = new InvocationTracker(); + var tracker = new InvocationTracker(); invokeMethod(InvocationTracker.class.getDeclaredMethod("publicMethod"), tracker); assertTrue(tracker.publicMethodInvoked); } @Test void invokePrivateMethod() throws Exception { - InvocationTracker tracker = new InvocationTracker(); + var tracker = new InvocationTracker(); invokeMethod(InvocationTracker.class.getDeclaredMethod("privateMethod"), tracker); assertTrue(tracker.privateMethodInvoked); } @@ -467,7 +465,7 @@ void tryToLoadClassWhenClassNotFoundException() { @Test @SuppressWarnings("deprecation") void loadClass() { - Optional> optional = ReflectionUtils.loadClass(Integer.class.getName()); + var optional = ReflectionUtils.loadClass(Integer.class.getName()); assertThat(optional).contains(Integer.class); } @@ -622,9 +620,9 @@ void getOutermostInstancePreconditions() { @Test @SuppressWarnings("deprecation") void getOutermostInstance() { - FirstClass firstClass = new FirstClass(); - FirstClass.SecondClass secondClass = firstClass.new SecondClass(); - FirstClass.SecondClass.ThirdClass thirdClass = secondClass.new ThirdClass(); + var firstClass = new FirstClass(); + var secondClass = firstClass.new SecondClass(); + var thirdClass = secondClass.new ThirdClass(); assertThat(ReflectionUtils.getOutermostInstance(thirdClass, FirstClass.SecondClass.ThirdClass.class))// .contains(thirdClass); @@ -636,11 +634,11 @@ void getOutermostInstance() { @Test void getAllClasspathRootDirectories(@TempDir Path tempDirectory) throws Exception { - Path root1 = tempDirectory.resolve("root1").toAbsolutePath(); - Path root2 = tempDirectory.resolve("root2").toAbsolutePath(); - String testClassPath = root1 + File.pathSeparator + root2; + var root1 = tempDirectory.resolve("root1").toAbsolutePath(); + var root2 = tempDirectory.resolve("root2").toAbsolutePath(); + var testClassPath = root1 + File.pathSeparator + root2; - String originalClassPath = System.setProperty("java.class.path", testClassPath); + var originalClassPath = System.setProperty("java.class.path", testClassPath); try { createDirectories(root1, root2); @@ -744,20 +742,20 @@ private void assertNestedCycle(Class start, Class from, Class to) { @Test @TrackLogRecords void findNestedClassesWithInvalidNestedClassFile(LogRecordListener listener) throws Exception { - URL jarUrl = getClass().getResource("/gh-1436-invalid-nested-class-file.jar"); + var jarUrl = getClass().getResource("/gh-1436-invalid-nested-class-file.jar"); - try (URLClassLoader classLoader = new URLClassLoader(new URL[] { jarUrl })) { - String fqcn = "tests.NestedInterfaceGroovyTests"; - Class classWithInvalidNestedClassFile = classLoader.loadClass(fqcn); + try (var classLoader = new URLClassLoader(new URL[] { jarUrl })) { + var fqcn = "tests.NestedInterfaceGroovyTests"; + var classWithInvalidNestedClassFile = classLoader.loadClass(fqcn); assertEquals(fqcn, classWithInvalidNestedClassFile.getName()); - NoClassDefFoundError noClassDefFoundError = assertThrows(NoClassDefFoundError.class, + var noClassDefFoundError = assertThrows(NoClassDefFoundError.class, classWithInvalidNestedClassFile::getDeclaredClasses); assertEquals("tests/NestedInterfaceGroovyTests$NestedInterface$1", noClassDefFoundError.getMessage()); assertThat(findNestedClasses(classWithInvalidNestedClassFile)).isEmpty(); // @formatter:off - String logMessage = listener.stream(ReflectionUtils.class, Level.FINE) + var logMessage = listener.stream(ReflectionUtils.class, Level.FINE) .findFirst() .map(LogRecord::getMessage) .orElse("didn't find log record"); @@ -864,7 +862,7 @@ void findMethodByParameterTypes() throws Exception { @Test void findMethodByParameterTypesInGenericInterface() { Class ifc = InterfaceWithGenericDefaultMethod.class; - Optional method = findMethod(ifc, "foo", Number.class); + var method = findMethod(ifc, "foo", Number.class); assertThat(method).isNotEmpty(); assertThat(method.get().getName()).isEqualTo("foo"); } @@ -875,7 +873,7 @@ void findMethodByParameterTypesInGenericInterface() { @Test void findMethodByParameterTypesInGenericInterfaceViaParameterizedSubclass() { Class clazz = InterfaceWithGenericDefaultMethodImpl.class; - Optional method = findMethod(clazz, "foo", Long.class); + var method = findMethod(clazz, "foo", Long.class); assertThat(method).isNotEmpty(); assertThat(method.get().getName()).isEqualTo("foo"); @@ -898,7 +896,7 @@ void findMethodByParameterTypesInGenericInterfaceViaParameterizedSubclass() { void findMethodByParameterTypesWithOverloadedMethodNextToGenericDefaultMethod() { Class clazz = InterfaceWithGenericDefaultMethodImpl.class; Class parameterType = Double.class; - Optional method = findMethod(clazz, "foo", parameterType); + var method = findMethod(clazz, "foo", parameterType); assertThat(method).isNotEmpty(); assertThat(method.get().getName()).isEqualTo("foo"); assertThat(method.get().getParameterTypes()[0]).isEqualTo(parameterType); @@ -931,15 +929,15 @@ void findMethodByParameterNamesWithMultidimensionalObjectArrayParameter() throws @Test void findMethodByParameterNamesWithParameterizedMapParameter() throws Exception { - String methodName = "methodWithParameterizedMap"; + var methodName = "methodWithParameterizedMap"; // standard, supported use case assertFindMethodByParameterNames(methodName, Map.class); // generic type info in parameter list - Method method = getClass().getDeclaredMethod(methodName, Map.class); - String genericParameterTypeName = method.getGenericParameterTypes()[0].getTypeName(); - JUnitException exception = assertThrows(JUnitException.class, + var method = getClass().getDeclaredMethod(methodName, Map.class); + var genericParameterTypeName = method.getGenericParameterTypes()[0].getTypeName(); + var exception = assertThrows(JUnitException.class, () -> findMethod(getClass(), methodName, genericParameterTypeName)); assertThat(exception).hasMessageStartingWith("Failed to load parameter type [java.util.Map parameterType) throws NoSuchMethodException { - Method method = getClass().getDeclaredMethod(methodName, parameterType); - Optional optional = findMethod(getClass(), methodName, parameterType.getName()); + var method = getClass().getDeclaredMethod(methodName, parameterType); + var optional = findMethod(getClass(), methodName, parameterType.getName()); assertThat(optional).contains(method); } @@ -982,7 +980,7 @@ private static void assertOneFooMethodIn(Class clazz) { @Test void findMethodsInObject() { - List methods = findMethods(Object.class, method -> true); + var methods = findMethods(Object.class, method -> true); assertNotNull(methods); assertTrue(methods.size() > 10); } @@ -1009,7 +1007,7 @@ void findMethodsIgnoresSyntheticMethods() { assertTrue(stream(ClassWithSyntheticMethod.class.getDeclaredMethods()).anyMatch(Method::isSynthetic), "ClassWithSyntheticMethod must actually contain at least one synthetic method."); - List methods = findMethods(ClassWithSyntheticMethod.class, method -> true); + var methods = findMethods(ClassWithSyntheticMethod.class, method -> true); assertThat(methods).isEmpty(); } @@ -1070,7 +1068,7 @@ void findMethodsWithShadowingUsingHierarchyUpMode() throws Exception { .containsExactly(MethodShadowingChild.class.getMethod("method5", Long.class), MethodShadowingParent.class.getMethod("method5", String.class)); - List methods = findMethods(MethodShadowingChild.class, method -> true, BOTTOM_UP); + var methods = findMethods(MethodShadowingChild.class, method -> true, BOTTOM_UP); assertEquals(6, methods.size()); assertThat(methods.subList(0, 3)).containsOnly(MethodShadowingChild.class.getMethod("method4", boolean.class), MethodShadowingChild.class.getMethod("method1", String.class), @@ -1097,7 +1095,7 @@ void findMethodsWithShadowingUsingHierarchyDownMode() throws Exception { .containsExactly(MethodShadowingParent.class.getMethod("method5", String.class), MethodShadowingChild.class.getMethod("method5", Long.class)); - List methods = findMethods(MethodShadowingChild.class, method -> true, TOP_DOWN); + var methods = findMethods(MethodShadowingChild.class, method -> true, TOP_DOWN); assertEquals(6, methods.size()); assertEquals(MethodShadowingInterface.class.getMethod("method2", int.class, int.class), methods.get(0)); assertThat(methods.subList(1, 3)).containsOnly( @@ -1114,19 +1112,19 @@ void findMethodsWithStaticHidingUsingHierarchyUpMode() throws Exception { Class parent = StaticMethodHidingParent.class; Class child = StaticMethodHidingChild.class; - Method ifcMethod2 = ifc.getDeclaredMethod("method2", int.class, int.class); - Method childMethod1 = child.getDeclaredMethod("method1", String.class); - Method childMethod4 = child.getDeclaredMethod("method4", boolean.class); - Method childMethod5 = child.getDeclaredMethod("method5", Long.class); - Method parentMethod2 = parent.getDeclaredMethod("method2", int.class, int.class, int.class); - Method parentMethod5 = parent.getDeclaredMethod("method5", String.class); + var ifcMethod2 = ifc.getDeclaredMethod("method2", int.class, int.class); + var childMethod1 = child.getDeclaredMethod("method1", String.class); + var childMethod4 = child.getDeclaredMethod("method4", boolean.class); + var childMethod5 = child.getDeclaredMethod("method5", Long.class); + var parentMethod2 = parent.getDeclaredMethod("method2", int.class, int.class, int.class); + var parentMethod5 = parent.getDeclaredMethod("method5", String.class); assertThat(findMethods(child, methodContains1, BOTTOM_UP)).containsExactly(childMethod1); assertThat(findMethods(child, methodContains2, BOTTOM_UP)).containsExactly(parentMethod2, ifcMethod2); assertThat(findMethods(child, methodContains4, BOTTOM_UP)).containsExactly(childMethod4); assertThat(findMethods(child, methodContains5, BOTTOM_UP)).containsExactly(childMethod5, parentMethod5); - List methods = findMethods(child, method -> true, BOTTOM_UP); + var methods = findMethods(child, method -> true, BOTTOM_UP); assertEquals(6, methods.size()); assertThat(methods.subList(0, 3)).containsOnly(childMethod1, childMethod4, childMethod5); assertThat(methods.subList(3, 5)).containsOnly(parentMethod2, parentMethod5); @@ -1139,19 +1137,19 @@ void findMethodsWithStaticHidingUsingHierarchyDownMode() throws Exception { Class parent = StaticMethodHidingParent.class; Class child = StaticMethodHidingChild.class; - Method ifcMethod2 = ifc.getDeclaredMethod("method2", int.class, int.class); - Method childMethod1 = child.getDeclaredMethod("method1", String.class); - Method childMethod4 = child.getDeclaredMethod("method4", boolean.class); - Method childMethod5 = child.getDeclaredMethod("method5", Long.class); - Method parentMethod2 = parent.getDeclaredMethod("method2", int.class, int.class, int.class); - Method parentMethod5 = parent.getDeclaredMethod("method5", String.class); + var ifcMethod2 = ifc.getDeclaredMethod("method2", int.class, int.class); + var childMethod1 = child.getDeclaredMethod("method1", String.class); + var childMethod4 = child.getDeclaredMethod("method4", boolean.class); + var childMethod5 = child.getDeclaredMethod("method5", Long.class); + var parentMethod2 = parent.getDeclaredMethod("method2", int.class, int.class, int.class); + var parentMethod5 = parent.getDeclaredMethod("method5", String.class); assertThat(findMethods(child, methodContains1, TOP_DOWN)).containsExactly(childMethod1); assertThat(findMethods(child, methodContains2, TOP_DOWN)).containsExactly(ifcMethod2, parentMethod2); assertThat(findMethods(child, methodContains4, TOP_DOWN)).containsExactly(childMethod4); assertThat(findMethods(child, methodContains5, TOP_DOWN)).containsExactly(parentMethod5, childMethod5); - List methods = findMethods(child, method -> true, TOP_DOWN); + var methods = findMethods(child, method -> true, TOP_DOWN); assertEquals(6, methods.size()); assertEquals(ifcMethod2, methods.get(0)); assertThat(methods.subList(1, 3)).containsOnly(parentMethod2, parentMethod5); @@ -1163,7 +1161,7 @@ void findMethodsReturnsAllOverloadedMethodsThatAreNotShadowed() { Class clazz = InterfaceWithGenericDefaultMethodImpl.class; // Search for all foo(*) methods. - List methods = findMethods(clazz, isFooMethod); + var methods = findMethods(clazz, isFooMethod); // One might expect or desire that the signature for the generic foo(N) // default method would be "foo(java.lang.Long)" when looked up via the @@ -1177,8 +1175,8 @@ void findMethodsDoesNotReturnOverriddenDefaultMethods() { Class clazz = InterfaceWithOverriddenGenericDefaultMethodImpl.class; // Search for all foo(*) methods. - List methods = findMethods(clazz, isFooMethod); - List signatures = signaturesOf(methods); + var methods = findMethods(clazz, isFooMethod); + var signatures = signaturesOf(methods); // Although the subsequent assertion covers this case as well, this // assertion is in place to provide a more informative failure message. @@ -1202,18 +1200,18 @@ void findMethodsIgnoresBridgeMethods() throws Exception { assertTrue(PublicChildClass.class.getDeclaredMethod("method1").isBridge()); assertTrue(PublicChildClass.class.getDeclaredMethod("method3").isBridge()); - List methods = findMethods(PublicChildClass.class, method -> true); - List signatures = signaturesOf(methods); + var methods = findMethods(PublicChildClass.class, method -> true); + var signatures = signaturesOf(methods); assertThat(signatures).containsOnly("method1()", "method2()", "method3()", "otherMethod1()", "otherMethod2()"); assertEquals(0, methods.stream().filter(Method::isBridge).count()); } @Test void isGeneric() { - for (Method method : Generic.class.getMethods()) { + for (var method : Generic.class.getMethods()) { assertTrue(ReflectionUtils.isGeneric(method)); } - for (Method method : PublicClass.class.getMethods()) { + for (var method : PublicClass.class.getMethods()) { assertFalse(ReflectionUtils.isGeneric(method)); } } @@ -1305,7 +1303,7 @@ private Predicate isA(Class type) { } private static void createDirectories(Path... paths) throws IOException { - for (Path path : paths) { + for (var path : paths) { Files.createDirectory(path); } } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java index 496a925b92a0..d68b48a36ea4 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java @@ -44,7 +44,7 @@ public void foo(Long parameter) { } } - Method foo = findMethod(A.class, "foo", Long.class).orElseThrow(); + var foo = findMethod(A.class, "foo", Long.class).orElseThrow(); assertEquals(A.class, foo.getDeclaringClass()); } @@ -58,7 +58,7 @@ public void foo(Number parameter) { } } - Method foo = findMethod(A.class, "foo", Long.class).orElseThrow(); + var foo = findMethod(A.class, "foo", Long.class).orElseThrow(); assertEquals(A.class, foo.getDeclaringClass()); } @@ -79,7 +79,7 @@ public void foo(Number parameter) { } } - Method foo = findMethod(A.class, "foo", Long.class).orElseThrow(); + var foo = findMethod(A.class, "foo", Long.class).orElseThrow(); assertEquals(A.class, foo.getDeclaringClass()); } @@ -96,7 +96,7 @@ public void foo(@SuppressWarnings("unused") Number parameter) { class A extends AParent implements InterfaceGenericNumber { } - Method foo = findMethod(A.class, "foo", Long.class).orElseThrow(); + var foo = findMethod(A.class, "foo", Long.class).orElseThrow(); // ???????? assertEquals(A.class, foo.getDeclaringClass()); @@ -124,7 +124,7 @@ public void findMethodWithMostSpecificParameterTypeInHierarchy() { private void assertSpecificFooMethodFound(Class classToSearchIn, Class classWithMostSpecificMethod, Class parameterType) { - Method foo = findMethod(classToSearchIn, "foo", parameterType).orElseThrow(); + var foo = findMethod(classToSearchIn, "foo", parameterType).orElseThrow(); assertDeclaringClass(foo, classWithMostSpecificMethod); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java b/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java index a9d64dfdb054..04bd5cb509b9 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java @@ -20,19 +20,19 @@ public class SerializationUtils { @SuppressWarnings("unchecked") public static T serializeAndDeserialize(T object) throws Exception { - byte[] bytes = serialize(object); + var bytes = serialize(object); return (T) deserialize(bytes); } private static Object deserialize(byte[] bytes) throws Exception { - try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes))) { + try (var in = new ObjectInputStream(new ByteArrayInputStream(bytes))) { return in.readObject(); } } private static byte[] serialize(Object object) throws Exception { - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream)) { + try (var byteArrayOutputStream = new ByteArrayOutputStream(); + var objectOutputStream = new ObjectOutputStream(byteArrayOutputStream)) { objectOutputStream.writeObject(object); objectOutputStream.flush(); return byteArrayOutputStream.toByteArray(); diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java index 581265ea70e6..07a1b474cb98 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java @@ -22,12 +22,9 @@ import static org.junit.platform.commons.util.ReflectionUtils.getFullyQualifiedMethodName; import java.io.File; -import java.lang.reflect.Method; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; import java.nio.file.Files; -import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.EnumMap; @@ -77,17 +74,17 @@ List reports() { } private List scanContainerClassAndCreateDynamicTests(Class containerClass) { - String containerName = containerClass.getSimpleName().replace("TestCase", ""); + var containerName = containerClass.getSimpleName().replace("TestCase", ""); // String containerName = containerClass.getSimpleName(); List nodes = new ArrayList<>(); Map> map = new EnumMap<>(Details.class); - for (Method method : findMethods(containerClass, m -> m.isAnnotationPresent(Test.class))) { - String methodName = method.getName(); - Class[] types = method.getParameterTypes(); - for (Details details : Details.values()) { - List tests = map.computeIfAbsent(details, key -> new ArrayList<>()); - for (Theme theme : Theme.values()) { - String caption = containerName + "-" + methodName + "-" + details + "-" + theme; + for (var method : findMethods(containerClass, m -> m.isAnnotationPresent(Test.class))) { + var methodName = method.getName(); + var types = method.getParameterTypes(); + for (var details : Details.values()) { + var tests = map.computeIfAbsent(details, key -> new ArrayList<>()); + for (var theme : Theme.values()) { + var caption = containerName + "-" + methodName + "-" + details + "-" + theme; String[] args = { // "--include-engine", "junit-jupiter", // "--details", details.name(), // @@ -97,16 +94,16 @@ private List scanContainerClassAndCreateDynamicTests(Class conta "--include-classname", containerClass.getCanonicalName(), // "--select-method", getFullyQualifiedMethodName(containerClass, methodName, types) // }; - String displayName = methodName + "() " + theme.name(); - String dirName = "console/details/" + containerName.toLowerCase(); - String outName = caption + ".out.txt"; - Runner runner = new Runner(dirName, outName, args); - URI source = toUri(dirName, outName).orElse(null); + var displayName = methodName + "() " + theme.name(); + var dirName = "console/details/" + containerName.toLowerCase(); + var outName = caption + ".out.txt"; + var runner = new Runner(dirName, outName, args); + var source = toUri(dirName, outName).orElse(null); tests.add(dynamicTest(displayName, source, runner)); } } } - URI source = new File("src/test/resources/console/details").toURI(); + var source = new File("src/test/resources/console/details").toURI(); map.forEach((details, tests) -> nodes.add(dynamicContainer(details.name(), source, tests.stream()))); return nodes; } @@ -210,36 +207,36 @@ private Runner(String dirName, String outName, String... args) { @Override public void execute() throws Throwable { - ConsoleLauncherWrapper wrapper = new ConsoleLauncherWrapper(); - ConsoleLauncherWrapperResult result = wrapper.execute(Optional.empty(), args); + var wrapper = new ConsoleLauncherWrapper(); + var result = wrapper.execute(Optional.empty(), args); - Optional optionalUri = toUri(dirName, outName); + var optionalUri = toUri(dirName, outName); if (!optionalUri.isPresent()) { if (Boolean.getBoolean("org.junit.platform.console.ConsoleDetailsTests.writeResultOut")) { // do not use Files.createTempDirectory(prefix) as we want one folder for one container - Path temp = Paths.get(System.getProperty("java.io.tmpdir"), dirName.replace('/', '-')); + var temp = Paths.get(System.getProperty("java.io.tmpdir"), dirName.replace('/', '-')); Files.createDirectories(temp); - Path path = Files.write(temp.resolve(outName), result.out.getBytes(UTF_8)); + var path = Files.write(temp.resolve(outName), result.out.getBytes(UTF_8)); assumeTrue(false, format("resource `%s` not found\nwrote console stdout to: %s/%s", dirName, outName, path)); } fail("could not load resource named `" + dirName + "/" + outName + "`"); } - Path path = Paths.get(optionalUri.get()); + var path = Paths.get(optionalUri.get()); assumeTrue(Files.exists(path), "path does not exist: " + path); assumeTrue(Files.isReadable(path), "can not read: " + path); - List expectedLines = Files.readAllLines(path, UTF_8); - List actualLines = asList(result.out.split("\\R")); + var expectedLines = Files.readAllLines(path, UTF_8); + var actualLines = asList(result.out.split("\\R")); assertLinesMatch(expectedLines, actualLines); } } static Optional toUri(String dirName, String outName) { - String resourceName = dirName + "/" + outName; - URL url = ConsoleDetailsTests.class.getClassLoader().getResource(resourceName); + var resourceName = dirName + "/" + outName; + var url = ConsoleDetailsTests.class.getClassLoader().getResource(resourceName); if (url == null) { return Optional.empty(); } diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java index 83a2610445aa..bf37a87b39af 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java @@ -30,7 +30,7 @@ class ConsoleLauncherExecutionResultTests { void hasStatusCode0ForNoTotalFailures() { when(summary.getTotalFailureCount()).thenReturn(0L); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); assertThat(exitCode).isEqualTo(0); } @@ -39,7 +39,7 @@ void hasStatusCode0ForNoTotalFailures() { void hasStatusCode1ForForAnyFailure() { when(summary.getTotalFailureCount()).thenReturn(1L); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); assertThat(exitCode).isEqualTo(1); } @@ -52,7 +52,7 @@ void hasStatusCode2ForNoTestsAndHasOptionFailIfNoTestsFound() { options.setFailIfNoTests(true); when(summary.getTestsFoundCount()).thenReturn(0L); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); assertThat(exitCode).isEqualTo(2); } @@ -66,7 +66,7 @@ void hasStatusCode0ForTestsAndHasOptionFailIfNoTestsFound() { when(summary.getTestsFoundCount()).thenReturn(1L); when(summary.getTotalFailureCount()).thenReturn(0L); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); assertThat(exitCode).isEqualTo(0); } @@ -79,7 +79,7 @@ void hasStatusCode0ForNoTestsAndNotFailIfNoTestsFound() { options.setFailIfNoTests(false); when(summary.getTestsFoundCount()).thenReturn(0L); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(summary, options); assertThat(exitCode).isEqualTo(0); } diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java index 415dff814abe..073bb1c63360 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java @@ -25,7 +25,7 @@ class ConsoleLauncherIntegrationTests { @Test void executeWithoutArgumentsFailsAndPrintsHelpInformation() { - ConsoleLauncherWrapperResult result = new ConsoleLauncherWrapper().execute(-1); + var result = new ConsoleLauncherWrapper().execute(-1); assertAll("empty args array results in display of help information and an exception stacktrace", // () -> assertTrue(result.out.contains("help information")), // () -> assertTrue(result.err.contains("No arguments were supplied to the ConsoleLauncher")) // @@ -42,7 +42,7 @@ void executeWithoutExcludeClassnameOptionDoesNotExcludeClassesAndMustIncludeAllC void executeWithExcludeClassnameOptionExcludesClasses() { String[] args = { "-e", "junit-jupiter", "-p", "org.junit.platform.console.subpackage", "--exclude-classname", "^org\\.junit\\.platform\\.console\\.subpackage\\..*" }; - ConsoleLauncherWrapperResult result = new ConsoleLauncherWrapper().execute(args); + var result = new ConsoleLauncherWrapper().execute(args); assertAll("all subpackage test classes are excluded by the class name filter", // () -> assertArrayEquals(args, result.args), // () -> assertEquals(0, result.code), // diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java index 3f658049fdb0..363197658cd1 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java @@ -36,14 +36,14 @@ class ConsoleLauncherTests { @Test void displayHelp() { - CommandLineOptions options = new CommandLineOptions(); + var options = new CommandLineOptions(); options.setDisplayHelp(true); - CommandLineOptionsParser commandLineOptionsParser = mock(CommandLineOptionsParser.class); + var commandLineOptionsParser = mock(CommandLineOptionsParser.class); when(commandLineOptionsParser.parse(any())).thenReturn(options); - ConsoleLauncher consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); - int exitCode = consoleLauncher.execute("--help").getExitCode(); + var consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); + var exitCode = consoleLauncher.execute("--help").getExitCode(); assertEquals(0, exitCode); verify(commandLineOptionsParser).parse("--help"); @@ -51,15 +51,15 @@ void displayHelp() { @Test void displayBanner() { - CommandLineOptions options = new CommandLineOptions(); + var options = new CommandLineOptions(); options.setBannerDisabled(false); options.setDisplayHelp(true); - CommandLineOptionsParser commandLineOptionsParser = mock(CommandLineOptionsParser.class); + var commandLineOptionsParser = mock(CommandLineOptionsParser.class); when(commandLineOptionsParser.parse(any())).thenReturn(options); - ConsoleLauncher consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); - int exitCode = consoleLauncher.execute("--help").getExitCode(); + var consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); + var exitCode = consoleLauncher.execute("--help").getExitCode(); assertEquals(0, exitCode); assertLinesMatch( @@ -69,15 +69,15 @@ void displayBanner() { @Test void disableBanner() { - CommandLineOptions options = new CommandLineOptions(); + var options = new CommandLineOptions(); options.setBannerDisabled(true); options.setDisplayHelp(true); - CommandLineOptionsParser commandLineOptionsParser = mock(CommandLineOptionsParser.class); + var commandLineOptionsParser = mock(CommandLineOptionsParser.class); when(commandLineOptionsParser.parse(any())).thenReturn(options); - ConsoleLauncher consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); - int exitCode = consoleLauncher.execute("--help", "--disable-banner").getExitCode(); + var consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); + var exitCode = consoleLauncher.execute("--help", "--disable-banner").getExitCode(); assertEquals(0, exitCode); assertLinesMatch(List.of(), stringWriter.toString().lines().collect(Collectors.toList())); @@ -85,11 +85,11 @@ void disableBanner() { @Test void executeWithUnknownCommandLineOption() { - CommandLineOptionsParser commandLineOptionsParser = mock(CommandLineOptionsParser.class); + var commandLineOptionsParser = mock(CommandLineOptionsParser.class); when(commandLineOptionsParser.parse(any())).thenReturn(new CommandLineOptions()); - ConsoleLauncher consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); - int exitCode = consoleLauncher.execute("--all").getExitCode(); + var consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); + var exitCode = consoleLauncher.execute("--all").getExitCode(); assertEquals(-1, exitCode); verify(commandLineOptionsParser).parse("--all"); @@ -97,11 +97,11 @@ void executeWithUnknownCommandLineOption() { @Test void executeWithSupportedCommandLineOption() { - CommandLineOptionsParser commandLineOptionsParser = mock(CommandLineOptionsParser.class); + var commandLineOptionsParser = mock(CommandLineOptionsParser.class); when(commandLineOptionsParser.parse(any())).thenReturn(new CommandLineOptions()); - ConsoleLauncher consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); - int exitCode = consoleLauncher.execute("--scan-classpath").getExitCode(); + var consoleLauncher = new ConsoleLauncher(commandLineOptionsParser, printSink, printSink); + var exitCode = consoleLauncher.execute("--scan-classpath").getExitCode(); assertEquals(-1, exitCode); verify(commandLineOptionsParser).parse("--scan-classpath"); diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java index 7f004b08903e..e010155592c8 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java @@ -37,8 +37,8 @@ class ConsoleLauncherWrapper { } private ConsoleLauncherWrapper(CommandLineOptionsParser parser) { - PrintWriter outWriter = new PrintWriter(out, false); - PrintWriter errWriter = new PrintWriter(err, false); + var outWriter = new PrintWriter(out, false); + var errWriter = new PrintWriter(err, false); this.consoleLauncher = new ConsoleLauncher(parser, outWriter, errWriter); } @@ -52,10 +52,10 @@ public ConsoleLauncherWrapperResult execute(int expectedExitCode, String... args } public ConsoleLauncherWrapperResult execute(Optional expectedCode, String... args) { - ConsoleLauncherExecutionResult result = consoleLauncher.execute(args); - int code = result.getExitCode(); - String outText = out.toString(); - String errText = err.toString(); + var result = consoleLauncher.execute(args); + var code = result.getExitCode(); + var outText = out.toString(); + var errText = err.toString(); if (expectedCode.isPresent()) { int expectedValue = expectedCode.get(); assertAll("wrapped execution failed:\n" + outText + "\n", // diff --git a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java index 38b3edd9c2ca..ceb39694e10c 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java @@ -31,10 +31,8 @@ import java.io.Writer; import java.net.URI; import java.nio.file.Files; -import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; -import java.util.List; import java.util.Optional; import java.util.function.Predicate; @@ -51,7 +49,7 @@ class PicocliCommandLineOptionsParserTests { @Test void parseNoArguments() { String[] noArguments = {}; - CommandLineOptions options = createParser().parse(noArguments); + var options = createParser().parse(noArguments); // @formatter:off assertAll( @@ -272,7 +270,7 @@ void parseInvalidExcludedEngines() { @ParameterizedTest @EnumSource void parseValidAdditionalClasspathEntries(ArgsType type) { - Path dir = Paths.get("."); + var dir = Paths.get("."); // @formatter:off assertAll( () -> assertEquals(singletonList(dir), type.parseArgLine("-cp .").getAdditionalClasspathEntries()), @@ -297,7 +295,7 @@ void parseInvalidAdditionalClasspathEntries() { @ParameterizedTest @EnumSource void parseValidXmlReportsDirs(ArgsType type) { - Path dir = Paths.get("build", "test-results"); + var dir = Paths.get("build", "test-results"); // @formatter:off assertAll( () -> assertEquals(Optional.of(dir), type.parseArgLine("--reports-dir build/test-results").getReportsDir()), @@ -483,7 +481,7 @@ void parseInvalidClasspathResourceSelectors() { @ParameterizedTest @EnumSource void parseClasspathScanningEntries(ArgsType type) { - Path dir = Paths.get("."); + var dir = Paths.get("."); // @formatter:off assertAll( () -> assertTrue(type.parseArgLine("--scan-class-path").isScanClasspath()), @@ -537,7 +535,7 @@ void parseInvalidConfigurationParametersWithDuplicateKey(ArgsType type) { @Test void printHelpOutputsHelpOption() { - StringWriter writer = new StringWriter(); + var writer = new StringWriter(); createParser().printHelp(writer, true); @@ -546,7 +544,7 @@ void printHelpOutputsHelpOption() { @Test void printHelpPreservesOriginalIOException() { - Writer writer = new Writer() { + var writer = new Writer() { @Override public void write(char[] cbuf, int off, int len) throws IOException { @@ -562,8 +560,8 @@ public void close() { } }; - CommandLineOptionsParser parser = createParser(); - RuntimeException exception = assertThrows(RuntimeException.class, () -> parser.printHelp(writer, true)); + var parser = createParser(); + var exception = assertThrows(RuntimeException.class, () -> parser.printHelp(writer, true)); assertThat(exception).hasCauseInstanceOf(IOException.class); assertThat(exception.getCause()).hasMessage("Something went wrong"); @@ -595,9 +593,9 @@ CommandLineOptions parseArgLine(String argLine) { }, atFile { CommandLineOptions parseArgLine(String argLine) throws IOException { - Path atFile = Files.createTempFile("junit-launcher-args", ".txt"); + var atFile = Files.createTempFile("junit-launcher-args", ".txt"); try { - List lines = Arrays.asList(split(argLine)); + var lines = Arrays.asList(split(argLine)); Files.write(atFile, lines); return createParser().parse("@" + atFile); } diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java index 0cda0b7c2b53..df1ab72617a5 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java @@ -51,7 +51,7 @@ void printsSummary() throws Exception { dummyTestEngine.addTest("succeedingTest", SUCCEEDING_TEST); dummyTestEngine.addTest("failingTest", FAILING_BLOCK); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); task.execute(new PrintWriter(stringWriter)); assertThat(stringWriter.toString()).contains("Test run finished after", "2 tests found", "0 tests skipped", @@ -64,7 +64,7 @@ void printsDetailsIfTheyAreNotHidden() throws Exception { dummyTestEngine.addTest("failingTest", FAILING_BLOCK); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); task.execute(new PrintWriter(stringWriter)); assertThat(stringWriter.toString()).contains("Test execution started."); @@ -76,7 +76,7 @@ void printsNoDetailsIfTheyAreHidden() throws Exception { dummyTestEngine.addTest("failingTest", FAILING_BLOCK); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); task.execute(new PrintWriter(stringWriter)); assertThat(stringWriter.toString()).doesNotContain("Test execution started."); @@ -89,7 +89,7 @@ void printsFailuresEvenIfDetailsAreHidden() throws Exception { dummyTestEngine.addTest("failingTest", FAILING_BLOCK); dummyTestEngine.addContainer("failingContainer", FAILING_BLOCK); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); task.execute(new PrintWriter(stringWriter)); assertThat(stringWriter.toString()).contains("Failures (2)", "failingTest", "failingContainer"); @@ -99,8 +99,8 @@ void printsFailuresEvenIfDetailsAreHidden() throws Exception { void hasStatusCode0ForSucceedingTest() throws Exception { dummyTestEngine.addTest("succeedingTest", SUCCEEDING_TEST); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); assertThat(exitCode).isEqualTo(0); } @@ -109,8 +109,8 @@ void hasStatusCode0ForSucceedingTest() throws Exception { void hasStatusCode1ForFailingTest() throws Exception { dummyTestEngine.addTest("failingTest", FAILING_BLOCK); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); assertThat(exitCode).isEqualTo(1); } @@ -119,8 +119,8 @@ void hasStatusCode1ForFailingTest() throws Exception { void hasStatusCode1ForFailingContainer() throws Exception { dummyTestEngine.addContainer("failingContainer", FAILING_BLOCK); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); assertThat(exitCode).isEqualTo(1); } @@ -132,8 +132,8 @@ void hasStatusCode1ForFailingContainer() throws Exception { void hasStatusCode2ForNoTestsAndHasOptionFailIfNoTestsFound() throws Exception { options.setFailIfNoTests(true); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); assertThat(exitCode).isEqualTo(2); } @@ -143,8 +143,8 @@ void hasStatusCode2ForNoTestsAndHasOptionFailIfNoTestsFound() throws Exception { */ @Test void hasStatusCode0ForNoTestsAndNotFailIfNoTestsFound() throws Exception { - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); - int exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var exitCode = ConsoleLauncherExecutionResult.computeExitCode(task.execute(dummyWriter()), options); assertThat(exitCode).isEqualTo(0); } @@ -153,11 +153,11 @@ void hasStatusCode0ForNoTestsAndNotFailIfNoTestsFound() throws Exception { void usesCustomClassLoaderIfAdditionalClassPathEntriesArePresent() throws Exception { options.setAdditionalClasspathEntries(singletonList(Paths.get("."))); - ClassLoader oldClassLoader = getDefaultClassLoader(); + var oldClassLoader = getDefaultClassLoader(); dummyTestEngine.addTest("failingTest", () -> assertSame(oldClassLoader, getDefaultClassLoader(), "should fail")); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); task.execute(new PrintWriter(stringWriter)); assertThat(stringWriter.toString()).contains("failingTest", "should fail", "1 tests failed"); @@ -167,11 +167,11 @@ void usesCustomClassLoaderIfAdditionalClassPathEntriesArePresent() throws Except void usesSameClassLoaderIfNoAdditionalClassPathEntriesArePresent() throws Exception { options.setAdditionalClasspathEntries(emptyList()); - ClassLoader oldClassLoader = getDefaultClassLoader(); + var oldClassLoader = getDefaultClassLoader(); dummyTestEngine.addTest("failingTest", () -> assertNotSame(oldClassLoader, getDefaultClassLoader(), "should fail")); - ConsoleTestExecutor task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); + var task = new ConsoleTestExecutor(options, () -> createLauncher(dummyTestEngine)); task.execute(new PrintWriter(stringWriter)); assertThat(stringWriter.toString()).contains("failingTest", "should fail", "1 tests failed"); diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java index 00f9ad804e67..058d20c5f971 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java @@ -29,8 +29,8 @@ class CustomContextClassLoaderExecutorTests { @Test void invokeWithoutCustomClassLoaderDoesNotSetClassLoader() throws Exception { - ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); - CustomContextClassLoaderExecutor executor = new CustomContextClassLoaderExecutor(Optional.empty()); + var originalClassLoader = Thread.currentThread().getContextClassLoader(); + var executor = new CustomContextClassLoaderExecutor(Optional.empty()); int result = executor.invoke(() -> { assertSame(originalClassLoader, Thread.currentThread().getContextClassLoader()); @@ -43,10 +43,9 @@ void invokeWithoutCustomClassLoaderDoesNotSetClassLoader() throws Exception { @Test void invokeWithCustomClassLoaderSetsCustomAndResetsToOriginal() throws Exception { - ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); + var originalClassLoader = Thread.currentThread().getContextClassLoader(); ClassLoader customClassLoader = URLClassLoader.newInstance(new URL[0]); - CustomContextClassLoaderExecutor executor = new CustomContextClassLoaderExecutor( - Optional.of(customClassLoader)); + var executor = new CustomContextClassLoaderExecutor(Optional.of(customClassLoader)); int result = executor.invoke(() -> { assertSame(customClassLoader, Thread.currentThread().getContextClassLoader()); @@ -59,7 +58,7 @@ void invokeWithCustomClassLoaderSetsCustomAndResetsToOriginal() throws Exception @Test void invokeWithCustomClassLoaderAndEnsureItIsClosedAfterUsage() throws Exception { - AtomicBoolean closed = new AtomicBoolean(false); + var closed = new AtomicBoolean(false); ClassLoader localClassLoader = new URLClassLoader(new URL[0]) { @Override public void close() throws IOException { @@ -67,7 +66,7 @@ public void close() throws IOException { super.close(); } }; - CustomContextClassLoaderExecutor executor = new CustomContextClassLoaderExecutor(Optional.of(localClassLoader)); + var executor = new CustomContextClassLoaderExecutor(Optional.of(localClassLoader)); int result = executor.invoke(() -> 4711); diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java index 1435efe61475..cf7dc7a23d12 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java @@ -21,7 +21,6 @@ import java.io.File; import java.net.URI; import java.nio.file.Paths; -import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.stream.Stream; @@ -29,7 +28,6 @@ import org.junit.jupiter.api.Test; import org.junit.platform.commons.PreconditionViolationException; import org.junit.platform.console.options.CommandLineOptions; -import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.Filter; import org.junit.platform.engine.discovery.ClassNameFilter; import org.junit.platform.engine.discovery.ClassSelector; @@ -41,9 +39,7 @@ import org.junit.platform.engine.discovery.PackageNameFilter; import org.junit.platform.engine.discovery.PackageSelector; import org.junit.platform.engine.discovery.UriSelector; -import org.junit.platform.launcher.EngineFilter; import org.junit.platform.launcher.LauncherDiscoveryRequest; -import org.junit.platform.launcher.PostDiscoveryFilter; /** * @since 1.0 @@ -56,9 +52,9 @@ class DiscoveryRequestCreatorTests { void convertsScanClasspathOptionWithoutExplicitRootDirectories() { options.setScanClasspath(true); - LauncherDiscoveryRequest request = convert(); + var request = convert(); - List classpathRootSelectors = request.getSelectorsByType(ClasspathRootSelector.class); + var classpathRootSelectors = request.getSelectorsByType(ClasspathRootSelector.class); // @formatter:off assertThat(classpathRootSelectors).extracting(ClasspathRootSelector::getClasspathRoot) .hasAtLeastOneElementOfType(URI.class) @@ -71,9 +67,9 @@ void convertsScanClasspathOptionWithExplicitRootDirectories() { options.setScanClasspath(true); options.setSelectedClasspathEntries(asList(Paths.get("."), Paths.get(".."))); - LauncherDiscoveryRequest request = convert(); + var request = convert(); - List classpathRootSelectors = request.getSelectorsByType(ClasspathRootSelector.class); + var classpathRootSelectors = request.getSelectorsByType(ClasspathRootSelector.class); // @formatter:off assertThat(classpathRootSelectors).extracting(ClasspathRootSelector::getClasspathRoot) .containsExactly(new File(".").toURI(), new File("..").toURI()); @@ -85,9 +81,9 @@ void convertsScanClasspathOptionWithAdditionalClasspathEntries() { options.setScanClasspath(true); options.setAdditionalClasspathEntries(asList(Paths.get("."), Paths.get(".."))); - LauncherDiscoveryRequest request = convert(); + var request = convert(); - List classpathRootSelectors = request.getSelectorsByType(ClasspathRootSelector.class); + var classpathRootSelectors = request.getSelectorsByType(ClasspathRootSelector.class); // @formatter:off assertThat(classpathRootSelectors).extracting(ClasspathRootSelector::getClasspathRoot) .contains(new File(".").toURI(), new File("..").toURI()); @@ -108,9 +104,9 @@ void doesNotSupportScanClasspathAndExplicitSelectors() { void convertsDefaultIncludeClassNamePatternOption() { options.setScanClasspath(true); - LauncherDiscoveryRequest request = convert(); + var request = convert(); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(filters).hasSize(1); assertExcludes(filters.get(0), STANDARD_INCLUDE_PATTERN); } @@ -120,9 +116,9 @@ void convertsExplicitIncludeClassNamePatternOption() { options.setScanClasspath(true); options.setIncludedClassNamePatterns(asList("Foo.*Bar", "Bar.*Foo")); - LauncherDiscoveryRequest request = convert(); + var request = convert(); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(filters).hasSize(1); assertIncludes(filters.get(0), "Foo.*Bar"); assertIncludes(filters.get(0), "Bar.*Foo"); @@ -134,9 +130,9 @@ void includeSelectedClassesAndMethodsRegardlessOfClassNamePatterns() { options.setSelectedMethods(asList("com.acme.Foo#m()")); options.setIncludedClassNamePatterns(asList("Foo.*Bar")); - LauncherDiscoveryRequest request = convert(); + var request = convert(); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(filters).hasSize(1); assertIncludes(filters.get(0), "SomeTest"); assertIncludes(filters.get(0), "com.acme.Foo"); @@ -148,9 +144,9 @@ void convertsExcludeClassNamePatternOption() { options.setScanClasspath(true); options.setExcludedClassNamePatterns(asList("Foo.*Bar", "Bar.*Foo")); - LauncherDiscoveryRequest request = convert(); + var request = convert(); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(filters).hasSize(2); assertExcludes(filters.get(1), "Foo.*Bar"); assertExcludes(filters.get(1), "Bar.*Foo"); @@ -162,8 +158,8 @@ void convertsPackageOptions() { options.setIncludedPackages(asList("org.junit.included1", "org.junit.included2", "org.junit.included3")); options.setExcludedPackages(asList("org.junit.excluded1")); - LauncherDiscoveryRequest request = convert(); - List packageNameFilters = request.getFiltersByType(PackageNameFilter.class); + var request = convert(); + var packageNameFilters = request.getFiltersByType(PackageNameFilter.class); assertThat(packageNameFilters).hasSize(2); assertIncludes(packageNameFilters.get(0), "org.junit.included1"); @@ -178,8 +174,8 @@ void convertsTagOptions() { options.setIncludedTagExpressions(asList("fast", "medium", "slow")); options.setExcludedTagExpressions(asList("slow")); - LauncherDiscoveryRequest request = convert(); - List postDiscoveryFilters = request.getPostDiscoveryFilters(); + var request = convert(); + var postDiscoveryFilters = request.getPostDiscoveryFilters(); assertThat(postDiscoveryFilters).hasSize(2); assertThat(postDiscoveryFilters.get(0).toString()).contains("TagFilter"); @@ -192,8 +188,8 @@ void convertsEngineOptions() { options.setIncludedEngines(asList("engine1", "engine2", "engine3")); options.setExcludedEngines(singletonList("engine2")); - LauncherDiscoveryRequest request = convert(); - List engineFilters = request.getEngineFilters(); + var request = convert(); + var engineFilters = request.getEngineFilters(); assertThat(engineFilters).hasSize(2); assertThat(engineFilters.get(0).toString()).contains("includes", "[engine1, engine2, engine3]"); @@ -204,8 +200,8 @@ void convertsEngineOptions() { void convertsUriSelectors() { options.setSelectedUris(asList(URI.create("a"), URI.create("b"))); - LauncherDiscoveryRequest request = convert(); - List uriSelectors = request.getSelectorsByType(UriSelector.class); + var request = convert(); + var uriSelectors = request.getSelectorsByType(UriSelector.class); assertThat(uriSelectors).extracting(UriSelector::getUri).containsExactly(URI.create("a"), URI.create("b")); } @@ -214,8 +210,8 @@ void convertsUriSelectors() { void convertsFileSelectors() { options.setSelectedFiles(asList("foo.txt", "bar.csv")); - LauncherDiscoveryRequest request = convert(); - List fileSelectors = request.getSelectorsByType(FileSelector.class); + var request = convert(); + var fileSelectors = request.getSelectorsByType(FileSelector.class); assertThat(fileSelectors).extracting(FileSelector::getRawPath).containsExactly("foo.txt", "bar.csv"); } @@ -224,8 +220,8 @@ void convertsFileSelectors() { void convertsDirectorySelectors() { options.setSelectedDirectories(asList("foo/bar", "bar/qux")); - LauncherDiscoveryRequest request = convert(); - List directorySelectors = request.getSelectorsByType(DirectorySelector.class); + var request = convert(); + var directorySelectors = request.getSelectorsByType(DirectorySelector.class); assertThat(directorySelectors).extracting(DirectorySelector::getRawPath).containsExactly("foo/bar", "bar/qux"); } @@ -234,8 +230,8 @@ void convertsDirectorySelectors() { void convertsPackageSelectors() { options.setSelectedPackages(asList("com.acme.foo", "com.example.bar")); - LauncherDiscoveryRequest request = convert(); - List packageSelectors = request.getSelectorsByType(PackageSelector.class); + var request = convert(); + var packageSelectors = request.getSelectorsByType(PackageSelector.class); assertThat(packageSelectors).extracting(PackageSelector::getPackageName).containsExactly("com.acme.foo", "com.example.bar"); @@ -245,8 +241,8 @@ void convertsPackageSelectors() { void convertsClassSelectors() { options.setSelectedClasses(asList("com.acme.Foo", "com.example.Bar")); - LauncherDiscoveryRequest request = convert(); - List classSelectors = request.getSelectorsByType(ClassSelector.class); + var request = convert(); + var classSelectors = request.getSelectorsByType(ClassSelector.class); assertThat(classSelectors).extracting(ClassSelector::getClassName).containsExactly("com.acme.Foo", "com.example.Bar"); @@ -256,8 +252,8 @@ void convertsClassSelectors() { void convertsMethodSelectors() { options.setSelectedMethods(asList("com.acme.Foo#m()", "com.example.Bar#method(java.lang.Object)")); - LauncherDiscoveryRequest request = convert(); - List methodSelectors = request.getSelectorsByType(MethodSelector.class); + var request = convert(); + var methodSelectors = request.getSelectorsByType(MethodSelector.class); assertThat(methodSelectors).hasSize(2); assertThat(methodSelectors.get(0).getClassName()).isEqualTo("com.acme.Foo"); @@ -272,9 +268,8 @@ void convertsMethodSelectors() { void convertsClasspathResourceSelectors() { options.setSelectedClasspathResources(asList("foo.csv", "com/example/bar.json")); - LauncherDiscoveryRequest request = convert(); - List classpathResourceSelectors = request.getSelectorsByType( - ClasspathResourceSelector.class); + var request = convert(); + var classpathResourceSelectors = request.getSelectorsByType(ClasspathResourceSelector.class); assertThat(classpathResourceSelectors).extracting( ClasspathResourceSelector::getClasspathResourceName).containsExactly("foo.csv", "com/example/bar.json"); @@ -285,8 +280,8 @@ void convertsConfigurationParameters() { options.setScanClasspath(true); options.setConfigurationParameters(mapOf(entry("foo", "bar"), entry("baz", "true"))); - LauncherDiscoveryRequest request = convert(); - ConfigurationParameters configurationParameters = request.getConfigurationParameters(); + var request = convert(); + var configurationParameters = request.getConfigurationParameters(); assertThat(configurationParameters.size()).isEqualTo(2); assertThat(configurationParameters.get("foo")).contains("bar"); @@ -294,7 +289,7 @@ void convertsConfigurationParameters() { } private LauncherDiscoveryRequest convert() { - DiscoveryRequestCreator creator = new DiscoveryRequestCreator(); + var creator = new DiscoveryRequestCreator(); return creator.toDiscoveryRequest(options); } diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java index db741ff6253c..d745ad2ad638 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java @@ -34,9 +34,9 @@ class FlatPrintingListenerTests { @Test void executionSkipped() { - StringWriter stringWriter = new StringWriter(); + var stringWriter = new StringWriter(); listener(stringWriter).executionSkipped(newTestIdentifier(), "Test" + EOL + "disabled"); - String[] lines = lines(stringWriter); + var lines = lines(stringWriter); assertEquals(3, lines.length); assertAll("lines in the output", // @@ -47,9 +47,9 @@ void executionSkipped() { @Test void reportingEntryPublished() { - StringWriter stringWriter = new StringWriter(); + var stringWriter = new StringWriter(); listener(stringWriter).reportingEntryPublished(newTestIdentifier(), ReportEntry.from("foo", "bar")); - String[] lines = lines(stringWriter); + var lines = lines(stringWriter); assertEquals(2, lines.length); assertAll("lines in the output", // @@ -60,9 +60,9 @@ void reportingEntryPublished() { @Test void executionFinishedWithFailure() { - StringWriter stringWriter = new StringWriter(); + var stringWriter = new StringWriter(); listener(stringWriter).executionFinished(newTestIdentifier(), failed(new AssertionError("Boom!"))); - String[] lines = lines(stringWriter); + var lines = lines(stringWriter); assertAll("lines in the output", // () -> assertEquals("Finished: demo-test ([engine:demo-engine])", lines[0]), // @@ -74,7 +74,7 @@ private FlatPrintingListener listener(StringWriter stringWriter) { } private static TestIdentifier newTestIdentifier() { - TestDescriptorStub testDescriptor = new TestDescriptorStub(UniqueId.forEngine("demo-engine"), "demo-test"); + var testDescriptor = new TestDescriptorStub(UniqueId.forEngine("demo-engine"), "demo-test"); return TestIdentifier.from(testDescriptor); } diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java index b9e79a62efb7..de7a1f3a00ff 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java @@ -43,7 +43,7 @@ void caption() { @Test void childrenCanBeAddedConcurrently() throws Exception { - TreeNode treeNode = new TreeNode("root"); + var treeNode = new TreeNode("root"); runConcurrently(() -> { for (long i = 0; i < ITEMS_PER_THREAD; i++) { @@ -56,7 +56,7 @@ void childrenCanBeAddedConcurrently() throws Exception { @Test void reportEntriesCanBeAddedConcurrently() throws Exception { - TreeNode treeNode = new TreeNode("root"); + var treeNode = new TreeNode("root"); runConcurrently(() -> { for (long i = 0; i < ITEMS_PER_THREAD; i++) { @@ -71,7 +71,7 @@ private void runConcurrently(Runnable action) throws InterruptedException { ExecutorService executor = new ThreadPoolExecutor(NUM_THREADS, NUM_THREADS, 10, SECONDS, new ArrayBlockingQueue<>(NUM_THREADS)); try { - CyclicBarrier barrier = new CyclicBarrier(NUM_THREADS); + var barrier = new CyclicBarrier(NUM_THREADS); for (long i = 0; i < NUM_THREADS; i++) { executor.submit(() -> { await(barrier); @@ -81,7 +81,7 @@ private void runConcurrently(Runnable action) throws InterruptedException { } finally { executor.shutdown(); - boolean terminated = executor.awaitTermination(10, SECONDS); + var terminated = executor.awaitTermination(10, SECONDS); assertTrue(terminated, "Executor was not terminated"); } } diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java index 96dd503c99c4..d4fa5dea23a5 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java @@ -58,7 +58,7 @@ void emptyTree() { @Test void emptyEngines() { - TreeNode root = new TreeNode(""); + var root = new TreeNode(""); root.addChild(new TreeNode(identifier("e-0", "engine zero"), "none")); root.addChild(new TreeNode(identifier("e-1", "engine one")).setResult(successful())); root.addChild(new TreeNode(identifier("e-2", "engine two")).setResult(failed(null))); @@ -77,8 +77,8 @@ void emptyEngines() { @Test // https://github.com/junit-team/junit5/issues/786 void printNodeHandlesNullMessageThrowableGracefully() { - TestExecutionResult result = TestExecutionResult.failed(new NullPointerException()); - TreeNode node = new TreeNode(identifier("NPE", "test()")).setResult(result); + var result = TestExecutionResult.failed(new NullPointerException()); + var node = new TreeNode(identifier("NPE", "test()")).setResult(result); new TreePrinter(out, Theme.ASCII, true).print(node); assertLinesMatch(Arrays.asList(".", "+-- test() [X] java.lang.NullPointerException"), actual()); } diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java index f4fdcabd901f..a69451ee122a 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java @@ -33,9 +33,9 @@ class VerboseTreeListenerTests { @Test void executionSkipped() { - StringWriter stringWriter = new StringWriter(); + var stringWriter = new StringWriter(); listener(stringWriter).executionSkipped(newTestIdentifier(), "Test" + EOL + "disabled"); - String[] lines = lines(stringWriter); + var lines = lines(stringWriter); assertLinesMatch(List.of( // "+-- %c ool test", // @@ -49,18 +49,18 @@ void executionSkipped() { @Test void reportingEntryPublished() { - StringWriter stringWriter = new StringWriter(); + var stringWriter = new StringWriter(); listener(stringWriter).reportingEntryPublished(newTestIdentifier(), ReportEntry.from("foo", "bar")); - String[] lines = lines(stringWriter); + var lines = lines(stringWriter); assertLinesMatch(List.of(" reports: ReportEntry \\[timestamp = .+, foo = 'bar'\\]"), List.of(lines)); } @Test void executionFinishedWithFailure() { - StringWriter stringWriter = new StringWriter(); + var stringWriter = new StringWriter(); listener(stringWriter).executionFinished(newTestIdentifier(), failed(new AssertionError("Boom!"))); - String[] lines = lines(stringWriter); + var lines = lines(stringWriter); assertLinesMatch(List.of(" caught: java.lang.AssertionError: Boom!", // ">> STACKTRACE >>", // @@ -70,9 +70,9 @@ void executionFinishedWithFailure() { @Test void failureMessageWithFormatSpecifier() { - StringWriter stringWriter = new StringWriter(); + var stringWriter = new StringWriter(); listener(stringWriter).executionFinished(newTestIdentifier(), failed(new AssertionError("%crash"))); - String[] lines = lines(stringWriter); + var lines = lines(stringWriter); assertLinesMatch(List.of(" caught: java.lang.AssertionError: %crash", // ">> STACKTRACE >>", // @@ -85,7 +85,7 @@ private VerboseTreePrintingListener listener(StringWriter stringWriter) { } private static TestIdentifier newTestIdentifier() { - TestDescriptorStub testDescriptor = new TestDescriptorStub(UniqueId.forEngine("demo-engine"), "%c ool test"); + var testDescriptor = new TestDescriptorStub(UniqueId.forEngine("demo-engine"), "%c ool test"); return TestIdentifier.from(testDescriptor); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java b/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java index 47cb0a887184..b3728eb20426 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java @@ -32,7 +32,7 @@ class FilterCompositionTests { @Test void composingNoFiltersCreatesFilterThatIncludesEverything() { - Filter composedFilter = Filter.composeFilters(); + var composedFilter = Filter.composeFilters(); assertTrue(composedFilter.apply(String.class).included()); assertTrue(composedFilter.toPredicate().test(String.class)); @@ -43,7 +43,7 @@ void composingNoFiltersCreatesFilterThatIncludesEverything() { @Test void composingSingleFilterWillReturnTheOriginalOne() { Filter singleFilter = ClassNameFilter.includeClassNamePatterns(".*ring.*"); - Filter composed = Filter.composeFilters(singleFilter); + var composed = Filter.composeFilters(singleFilter); assertSame(singleFilter, composed); } @@ -52,7 +52,7 @@ void composingMultipleFiltersIsAConjunctionOfFilters() { Filter firstFilter = ClassNameFilter.includeClassNamePatterns(".*ring.*"); Filter secondFilter = ClassNameFilter.includeClassNamePatterns(".*Join.*"); - Filter composed = Filter.composeFilters(firstFilter, secondFilter); + var composed = Filter.composeFilters(firstFilter, secondFilter); assertFalse(composed.apply("java.lang.String").included()); assertFalse(composed.toPredicate().test("java.lang.String")); @@ -65,7 +65,7 @@ void aFilterComposedOfMultipleFiltersHasReadableDescription() { Filter firstFilter = new FilterStub<>(o -> excluded("wrong"), () -> "1st"); Filter secondFilter = new FilterStub<>(o -> included("right"), () -> "2nd"); - Filter composed = Filter.composeFilters(firstFilter, secondFilter); + var composed = Filter.composeFilters(firstFilter, secondFilter); assertFalse(composed.apply(String.class).included()); assertEquals("(1st) and (2nd)", composed.toString()); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java b/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java index 076d9588f127..2352bf19381d 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java @@ -97,8 +97,7 @@ private static void nope(String tag) { } private void assertSyntaxViolation(String tag) { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> TestTag.create(tag)); + var exception = assertThrows(PreconditionViolationException.class, () -> TestTag.create(tag)); assertThat(exception).hasMessageStartingWith("Tag name"); assertThat(exception).hasMessageEndingWith("must be syntactically valid"); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java index faa213b44915..851990fbdef0 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java @@ -39,14 +39,14 @@ void engineIdOnly() { @Test void withTwoSegments() { - UniqueId classId = engineId.append("class", "org.junit.MyClass"); + var classId = engineId.append("class", "org.junit.MyClass"); assertEquals("[engine:junit-jupiter]/[class:org.junit.MyClass]", classId.toString()); assertEquals(format.format(classId), classId.toString()); } @Test void withManySegments() { - UniqueId uniqueId = engineId.append("t1", "v1").append("t2", "v2").append("t3", "v3"); + var uniqueId = engineId.append("t1", "v1").append("t2", "v2").append("t3", "v3"); assertEquals("[engine:junit-jupiter]/[t1:v1]/[t2:v2]/[t3:v3]", uniqueId.toString()); assertEquals(format.format(uniqueId), uniqueId.toString()); } @@ -120,7 +120,7 @@ default void parseMalformedUid() { @Test default void parseEngineUid() { - UniqueId parsedId = getFormat().parse(getEngineUid()); + var parsedId = getFormat().parse(getEngineUid()); assertSegment(parsedId.getSegments().get(0), "engine", "junit-jupiter"); assertEquals(getEngineUid(), getFormat().format(parsedId)); assertEquals(getEngineUid(), parsedId.toString()); @@ -128,7 +128,7 @@ default void parseEngineUid() { @Test default void parseMethodUid() { - UniqueId parsedId = getFormat().parse(getMethodUid()); + var parsedId = getFormat().parse(getMethodUid()); assertSegment(parsedId.getSegments().get(0), "engine", "junit-jupiter"); assertSegment(parsedId.getSegments().get(1), "class", "MyClass"); assertSegment(parsedId.getSegments().get(2), "method", "myMethod"); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java index c3cf0b56b22b..ae9bb0850d7c 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java @@ -41,7 +41,7 @@ class Creation { @Test void uniqueIdCanBeCreatedFromEngineId() { - UniqueId uniqueId = UniqueId.forEngine(ENGINE_ID); + var uniqueId = UniqueId.forEngine(ENGINE_ID); assertEquals("[engine:junit-jupiter]", uniqueId.toString()); assertSegment(uniqueId.getSegments().get(0), "engine", "junit-jupiter"); @@ -49,16 +49,16 @@ void uniqueIdCanBeCreatedFromEngineId() { @Test void retrievingOptionalEngineId() { - UniqueId uniqueIdWithEngine = UniqueId.forEngine(ENGINE_ID); + var uniqueIdWithEngine = UniqueId.forEngine(ENGINE_ID); assertThat(uniqueIdWithEngine.getEngineId()).contains("junit-jupiter"); - UniqueId uniqueIdWithoutEngine = UniqueId.root("root", "avalue"); + var uniqueIdWithoutEngine = UniqueId.root("root", "avalue"); assertEquals(Optional.empty(), uniqueIdWithoutEngine.getEngineId()); } @Test void uniqueIdCanBeCreatedFromTypeAndValue() { - UniqueId uniqueId = UniqueId.root("aType", "aValue"); + var uniqueId = UniqueId.root("aType", "aValue"); assertEquals("[aType:aValue]", uniqueId.toString()); assertSegment(uniqueId.getSegments().get(0), "aType", "aValue"); @@ -66,15 +66,15 @@ void uniqueIdCanBeCreatedFromTypeAndValue() { @Test void rootSegmentCanBeRetrieved() { - UniqueId uniqueId = UniqueId.root("aType", "aValue"); + var uniqueId = UniqueId.root("aType", "aValue"); assertThat(uniqueId.getRoot()).contains(new Segment("aType", "aValue")); } @Test void appendingOneSegment() { - UniqueId engineId = UniqueId.root("engine", ENGINE_ID); - UniqueId classId = engineId.append("class", "org.junit.MyClass"); + var engineId = UniqueId.root("engine", ENGINE_ID); + var classId = engineId.append("class", "org.junit.MyClass"); assertThat(classId.getSegments()).hasSize(2); assertSegment(classId.getSegments().get(0), "engine", ENGINE_ID); @@ -83,7 +83,7 @@ void appendingOneSegment() { @Test void appendingSegmentLeavesOriginalUnchanged() { - UniqueId uniqueId = UniqueId.root("engine", ENGINE_ID); + var uniqueId = UniqueId.root("engine", ENGINE_ID); uniqueId.append("class", "org.junit.MyClass"); assertThat(uniqueId.getSegments()).hasSize(1); @@ -92,8 +92,8 @@ void appendingSegmentLeavesOriginalUnchanged() { @Test void appendingSeveralSegments() { - UniqueId engineId = UniqueId.root("engine", ENGINE_ID); - UniqueId uniqueId = engineId.append("t1", "v1").append("t2", "v2").append("t3", "v3"); + var engineId = UniqueId.root("engine", ENGINE_ID); + var uniqueId = engineId.append("t1", "v1").append("t2", "v2").append("t3", "v3"); assertThat(uniqueId.getSegments()).hasSize(4); assertSegment(uniqueId.getSegments().get(0), "engine", ENGINE_ID); @@ -104,7 +104,7 @@ void appendingSeveralSegments() { @Test void appendingSegmentInstance() { - UniqueId uniqueId = UniqueId.forEngine(ENGINE_ID).append("t1", "v1"); + var uniqueId = UniqueId.forEngine(ENGINE_ID).append("t1", "v1"); uniqueId = uniqueId.append(new Segment("t2", "v2")); @@ -116,7 +116,7 @@ void appendingSegmentInstance() { @Test void appendingNullIsNotAllowed() { - UniqueId uniqueId = UniqueId.forEngine(ENGINE_ID); + var uniqueId = UniqueId.forEngine(ENGINE_ID); assertThrows(PreconditionViolationException.class, () -> uniqueId.append(null)); assertThrows(PreconditionViolationException.class, () -> uniqueId.append(null, "foo")); @@ -132,20 +132,20 @@ class ParsingAndFormatting { @Test void ensureDefaultUniqueIdFormatIsUsedForParsing() { - UniqueId parsedDirectly = UniqueId.parse(uniqueIdString); - UniqueId parsedViaFormat = UniqueIdFormat.getDefault().parse(uniqueIdString); + var parsedDirectly = UniqueId.parse(uniqueIdString); + var parsedViaFormat = UniqueIdFormat.getDefault().parse(uniqueIdString); assertEquals(parsedViaFormat, parsedDirectly); } @Test void ensureDefaultUniqueIdFormatIsUsedForFormatting() { - UniqueId parsedDirectly = UniqueId.parse("[engine:junit-jupiter]/[class:MyClass]/[method:myMethod]"); + var parsedDirectly = UniqueId.parse("[engine:junit-jupiter]/[class:MyClass]/[method:myMethod]"); assertEquals("[engine:junit-jupiter]/[class:MyClass]/[method:myMethod]", parsedDirectly.toString()); } @Test void ensureDefaultUniqueIdFormatDecodingEncodesSegmentParts() { - UniqueId.Segment segment = UniqueId.parse("[%5B+%25+%5D):(%3A+%2B+%2F]").getSegments().get(0); + var segment = UniqueId.parse("[%5B+%25+%5D):(%3A+%2B+%2F]").getSegments().get(0); assertEquals("[ % ])", segment.getType()); assertEquals("(: + /", segment.getValue()); } @@ -153,9 +153,9 @@ void ensureDefaultUniqueIdFormatDecodingEncodesSegmentParts() { @Test void ensureDefaultUniqueIdFormatCanHandleAllCharacters() { for (char c = 0; c < Character.MAX_VALUE; c++) { - String value = "foo " + c + " bar"; - UniqueId uniqueId = UniqueId.parse(UniqueId.root("type", value).toString()); - Segment segment = uniqueId.getSegments().get(0); + var value = "foo " + c + " bar"; + var uniqueId = UniqueId.parse(UniqueId.root("type", value).toString()); + var segment = uniqueId.getSegments().get(0); assertEquals(value, segment.getValue()); } } @@ -172,8 +172,8 @@ class EqualsContract { @Test void sameEnginesAreEqual() { - UniqueId id1 = UniqueId.root("engine", "junit-jupiter"); - UniqueId id2 = UniqueId.root("engine", "junit-jupiter"); + var id1 = UniqueId.root("engine", "junit-jupiter"); + var id2 = UniqueId.root("engine", "junit-jupiter"); assertTrue(id1.equals(id2)); assertTrue(id2.equals(id1)); @@ -182,8 +182,8 @@ void sameEnginesAreEqual() { @Test void differentEnginesAreNotEqual() { - UniqueId id1 = UniqueId.root("engine", "junit-vintage"); - UniqueId id2 = UniqueId.root("engine", "junit-jupiter"); + var id1 = UniqueId.root("engine", "junit-vintage"); + var id2 = UniqueId.root("engine", "junit-jupiter"); assertFalse(id1.equals(id2)); assertFalse(id2.equals(id1)); @@ -191,8 +191,8 @@ void differentEnginesAreNotEqual() { @Test void uniqueIdWithSameSegmentsAreEqual() { - UniqueId id1 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); - UniqueId id2 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); + var id1 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); + var id2 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); assertTrue(id1.equals(id2)); assertTrue(id2.equals(id1)); @@ -201,8 +201,8 @@ void uniqueIdWithSameSegmentsAreEqual() { @Test void differentOrderOfSegmentsAreNotEqual() { - UniqueId id1 = UniqueId.root("engine", "junit-jupiter").append("t2", "v2").append("t1", "v1"); - UniqueId id2 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); + var id1 = UniqueId.root("engine", "junit-jupiter").append("t2", "v2").append("t1", "v1"); + var id2 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); assertFalse(id1.equals(id2)); assertFalse(id2.equals(id1)); @@ -210,8 +210,8 @@ void differentOrderOfSegmentsAreNotEqual() { @Test void additionalSegmentMakesItNotEqual() { - UniqueId id1 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1"); - UniqueId id2 = id1.append("t2", "v2"); + var id1 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1"); + var id2 = id1.append("t2", "v2"); assertFalse(id1.equals(id2)); assertFalse(id2.equals(id1)); @@ -223,23 +223,23 @@ class Prefixing { @Test void nullIsNotAPrefix() { - UniqueId id = UniqueId.forEngine(ENGINE_ID); + var id = UniqueId.forEngine(ENGINE_ID); assertThrows(PreconditionViolationException.class, () -> id.hasPrefix(null)); } @Test void uniqueIdIsPrefixForItself() { - UniqueId id = UniqueId.forEngine(ENGINE_ID).append("t1", "v1").append("t2", "v2"); + var id = UniqueId.forEngine(ENGINE_ID).append("t1", "v1").append("t2", "v2"); assertTrue(id.hasPrefix(id)); } @Test void uniqueIdIsPrefixForUniqueIdWithAdditionalSegments() { - UniqueId id1 = UniqueId.forEngine(ENGINE_ID); - UniqueId id2 = id1.append("t1", "v1"); - UniqueId id3 = id2.append("t2", "v2"); + var id1 = UniqueId.forEngine(ENGINE_ID); + var id2 = id1.append("t1", "v1"); + var id3 = id2.append("t2", "v2"); assertFalse(id1.hasPrefix(id2)); assertFalse(id1.hasPrefix(id3)); @@ -251,8 +251,8 @@ void uniqueIdIsPrefixForUniqueIdWithAdditionalSegments() { @Test void completelyUnrelatedUniqueIdsAreNotPrefixesForEachOther() { - UniqueId id1 = UniqueId.forEngine("foo"); - UniqueId id2 = UniqueId.forEngine("bar"); + var id1 = UniqueId.forEngine("foo"); + var id2 = UniqueId.forEngine("bar"); assertFalse(id1.hasPrefix(id2)); assertFalse(id2.hasPrefix(id1)); @@ -265,7 +265,7 @@ class LastSegment { @Test void returnsLastSegment() { - UniqueId uniqueId = UniqueId.forEngine("foo"); + var uniqueId = UniqueId.forEngine("foo"); assertSame(uniqueId.getSegments().get(0), uniqueId.getLastSegment()); uniqueId = UniqueId.forEngine("foo").append("type", "bar"); @@ -274,10 +274,10 @@ void returnsLastSegment() { @Test void removesLastSegment() { - UniqueId uniqueId = UniqueId.forEngine("foo"); + var uniqueId = UniqueId.forEngine("foo"); assertThrows(PreconditionViolationException.class, uniqueId::removeLastSegment); - UniqueId newUniqueId = uniqueId.append("type", "bar").removeLastSegment(); + var newUniqueId = uniqueId.append("type", "bar").removeLastSegment(); assertEquals(uniqueId, newUniqueId); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java index e9895dfe8f00..82ca3a17fb4d 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java @@ -38,9 +38,9 @@ void includeClassNamePatternsChecksPreconditions() { @Test void includeClassNamePatternsWithSinglePattern() { - String regex = "^java\\.lang\\..*"; + var regex = "^java\\.lang\\..*"; - ClassNameFilter filter = ClassNameFilter.includeClassNamePatterns(regex); + var filter = ClassNameFilter.includeClassNamePatterns(regex); assertThat(filter).hasToString( "IncludeClassNameFilter that includes class names that match one of the following regular expressions: '" @@ -59,10 +59,10 @@ void includeClassNamePatternsWithSinglePattern() { @Test void includeClassNamePatternsWithMultiplePatterns() { - String firstRegex = "^java\\.lang\\..*"; - String secondRegex = "^java\\.util\\..*"; + var firstRegex = "^java\\.lang\\..*"; + var secondRegex = "^java\\.util\\..*"; - ClassNameFilter filter = ClassNameFilter.includeClassNamePatterns(firstRegex, secondRegex); + var filter = ClassNameFilter.includeClassNamePatterns(firstRegex, secondRegex); assertThat(filter).hasToString( "IncludeClassNameFilter that includes class names that match one of the following regular expressions: '" @@ -100,9 +100,9 @@ void excludeClassNamePatternsChecksPreconditions() { @Test void excludeClassNamePatternsWithSinglePattern() { - String regex = "^java\\.lang\\..*"; + var regex = "^java\\.lang\\..*"; - ClassNameFilter filter = ClassNameFilter.excludeClassNamePatterns(regex); + var filter = ClassNameFilter.excludeClassNamePatterns(regex); assertThat(filter).hasToString( "ExcludeClassNameFilter that excludes class names that match one of the following regular expressions: '" @@ -122,10 +122,10 @@ void excludeClassNamePatternsWithSinglePattern() { @Test void excludeClassNamePatternsWithMultiplePatterns() { - String firstRegex = "^java\\.lang\\..*"; - String secondRegex = "^java\\.util\\..*"; + var firstRegex = "^java\\.lang\\..*"; + var secondRegex = "^java\\.util\\..*"; - ClassNameFilter filter = ClassNameFilter.excludeClassNamePatterns(firstRegex, secondRegex); + var filter = ClassNameFilter.excludeClassNamePatterns(firstRegex, secondRegex); assertThat(filter).hasToString( "ExcludeClassNameFilter that excludes class names that match one of the following regular expressions: '" diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java index 1f182c100c3a..d4bc907069df 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java @@ -36,9 +36,9 @@ void equalsAndHashCode() { @Test void preservesOriginalExceptionWhenTryingToLoadClass() { - ClassSelector selector = new ClassSelector("org.example.TestClass"); + var selector = new ClassSelector("org.example.TestClass"); - PreconditionViolationException e = assertThrows(PreconditionViolationException.class, selector::getJavaClass); + var e = assertThrows(PreconditionViolationException.class, selector::getJavaClass); assertThat(e).hasMessage("Could not load class with name: org.example.TestClass").hasCauseInstanceOf( ClassNotFoundException.class); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java index 153cd6014990..cd3d1705410a 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java @@ -64,9 +64,9 @@ void selectUriByName() { assertViolatesPrecondition(() -> selectUri(" ")); assertViolatesPrecondition(() -> selectUri("foo:")); - String uri = "https://junit.org"; + var uri = "https://junit.org"; - UriSelector selector = selectUri(uri); + var selector = selectUri(uri); assertEquals(uri, selector.getUri().toString()); } @@ -75,9 +75,9 @@ void selectUriByURI() throws Exception { assertViolatesPrecondition(() -> selectUri((URI) null)); assertViolatesPrecondition(() -> selectUri(" ")); - URI uri = new URI("https://junit.org"); + var uri = new URI("https://junit.org"); - UriSelector selector = selectUri(uri); + var selector = selectUri(uri); assertEquals(uri, selector.getUri()); } @@ -86,9 +86,9 @@ void selectFileByName() { assertViolatesPrecondition(() -> selectFile((String) null)); assertViolatesPrecondition(() -> selectFile(" ")); - String path = "src/test/resources/do_not_delete_me.txt"; + var path = "src/test/resources/do_not_delete_me.txt"; - FileSelector selector = selectFile(path); + var selector = selectFile(path); assertEquals(path, selector.getRawPath()); assertEquals(new File(path), selector.getFile()); assertEquals(Paths.get(path), selector.getPath()); @@ -96,13 +96,13 @@ void selectFileByName() { @Test void selectFileByNameAndPosition() { - FilePosition filePosition = FilePosition.from(12, 34); + var filePosition = FilePosition.from(12, 34); assertViolatesPrecondition(() -> selectFile((String) null, filePosition)); assertViolatesPrecondition(() -> selectFile(" ", filePosition)); - String path = "src/test/resources/do_not_delete_me.txt"; + var path = "src/test/resources/do_not_delete_me.txt"; - FileSelector selector = selectFile(path, filePosition); + var selector = selectFile(path, filePosition); assertEquals(path, selector.getRawPath()); assertEquals(new File(path), selector.getFile()); assertEquals(Paths.get(path), selector.getPath()); @@ -114,12 +114,12 @@ void selectFileByFileReference() throws Exception { assertViolatesPrecondition(() -> selectFile((File) null)); assertViolatesPrecondition(() -> selectFile(new File("bogus/nonexistent.txt"))); - File currentDir = new File(".").getCanonicalFile(); - File relativeDir = new File("..", currentDir.getName()); - File file = new File(relativeDir, "src/test/resources/do_not_delete_me.txt"); - String path = file.getCanonicalFile().getPath(); + var currentDir = new File(".").getCanonicalFile(); + var relativeDir = new File("..", currentDir.getName()); + var file = new File(relativeDir, "src/test/resources/do_not_delete_me.txt"); + var path = file.getCanonicalFile().getPath(); - FileSelector selector = selectFile(file); + var selector = selectFile(file); assertEquals(path, selector.getRawPath()); assertEquals(file.getCanonicalFile(), selector.getFile()); assertEquals(Paths.get(path), selector.getPath()); @@ -127,16 +127,16 @@ void selectFileByFileReference() throws Exception { @Test void selectFileByFileReferenceAndPosition() throws Exception { - FilePosition filePosition = FilePosition.from(12, 34); + var filePosition = FilePosition.from(12, 34); assertViolatesPrecondition(() -> selectFile((File) null, filePosition)); assertViolatesPrecondition(() -> selectFile(new File("bogus/nonexistent.txt"), filePosition)); - File currentDir = new File(".").getCanonicalFile(); - File relativeDir = new File("..", currentDir.getName()); - File file = new File(relativeDir, "src/test/resources/do_not_delete_me.txt"); - String path = file.getCanonicalFile().getPath(); + var currentDir = new File(".").getCanonicalFile(); + var relativeDir = new File("..", currentDir.getName()); + var file = new File(relativeDir, "src/test/resources/do_not_delete_me.txt"); + var path = file.getCanonicalFile().getPath(); - FileSelector selector = selectFile(file, filePosition); + var selector = selectFile(file, filePosition); assertEquals(path, selector.getRawPath()); assertEquals(file.getCanonicalFile(), selector.getFile()); assertEquals(Paths.get(path), selector.getPath()); @@ -148,9 +148,9 @@ void selectDirectoryByName() { assertViolatesPrecondition(() -> selectDirectory((String) null)); assertViolatesPrecondition(() -> selectDirectory(" ")); - String path = "src/test/resources"; + var path = "src/test/resources"; - DirectorySelector selector = selectDirectory(path); + var selector = selectDirectory(path); assertEquals(path, selector.getRawPath()); assertEquals(new File(path), selector.getDirectory()); assertEquals(Paths.get(path), selector.getPath()); @@ -161,12 +161,12 @@ void selectDirectoryByFileReference() throws Exception { assertViolatesPrecondition(() -> selectDirectory((File) null)); assertViolatesPrecondition(() -> selectDirectory(new File("bogus/nonexistent"))); - File currentDir = new File(".").getCanonicalFile(); - File relativeDir = new File("..", currentDir.getName()); - File directory = new File(relativeDir, "src/test/resources"); - String path = directory.getCanonicalFile().getPath(); + var currentDir = new File(".").getCanonicalFile(); + var relativeDir = new File("..", currentDir.getName()); + var directory = new File(relativeDir, "src/test/resources"); + var path = directory.getCanonicalFile().getPath(); - DirectorySelector selector = selectDirectory(directory); + var selector = selectDirectory(directory); assertEquals(path, selector.getRawPath()); assertEquals(directory.getCanonicalFile(), selector.getDirectory()); assertEquals(Paths.get(path), selector.getPath()); @@ -180,7 +180,7 @@ void selectClasspathResources() { assertViolatesPrecondition(() -> selectClasspathResource("\t")); // with unnecessary "/" prefix - ClasspathResourceSelector selector = selectClasspathResource("/foo/bar/spec.xml"); + var selector = selectClasspathResource("/foo/bar/spec.xml"); assertEquals("foo/bar/spec.xml", selector.getClasspathResourceName()); // standard use case @@ -190,14 +190,14 @@ void selectClasspathResources() { @Test void selectClasspathResourcesWithFilePosition() { - FilePosition filePosition = FilePosition.from(12, 34); + var filePosition = FilePosition.from(12, 34); assertViolatesPrecondition(() -> selectClasspathResource(null, filePosition)); assertViolatesPrecondition(() -> selectClasspathResource("", filePosition)); assertViolatesPrecondition(() -> selectClasspathResource(" ", filePosition)); assertViolatesPrecondition(() -> selectClasspathResource("\t", filePosition)); // with unnecessary "/" prefix - ClasspathResourceSelector selector = selectClasspathResource("/foo/bar/spec.xml", filePosition); + var selector = selectClasspathResource("/foo/bar/spec.xml", filePosition); assertEquals("foo/bar/spec.xml", selector.getClasspathResourceName()); assertEquals(FilePosition.from(12, 34), selector.getPosition().get()); @@ -209,7 +209,7 @@ void selectClasspathResourcesWithFilePosition() { @Test void selectModuleByName() { - ModuleSelector selector = selectModule("java.base"); + var selector = selectModule("java.base"); assertEquals("java.base", selector.getModuleName()); } @@ -222,8 +222,8 @@ void selectModuleByNamePreconditions() { @Test void selectModulesByNames() { - List selectors = selectModules(new HashSet<>(Arrays.asList("a", "b"))); - List names = selectors.stream().map(ModuleSelector::getModuleName).collect(Collectors.toList()); + var selectors = selectModules(new HashSet<>(Arrays.asList("a", "b"))); + var names = selectors.stream().map(ModuleSelector::getModuleName).collect(Collectors.toList()); assertThat(names).containsExactlyInAnyOrder("b", "a"); } @@ -235,13 +235,13 @@ void selectModulesByNamesPreconditions() { @Test void selectPackageByName() { - PackageSelector selector = selectPackage(getClass().getPackage().getName()); + var selector = selectPackage(getClass().getPackage().getName()); assertEquals(getClass().getPackage().getName(), selector.getPackageName()); } @Test void selectClassByName() { - ClassSelector selector = selectClass(getClass().getName()); + var selector = selectClass(getClass().getName()); assertEquals(getClass(), selector.getJavaClass()); } @@ -287,7 +287,7 @@ void selectMethodByClassMethodNameAndMethodParameterTypesPreconditions() { @Test void selectMethodByClassAndMethodPreconditions() { - Method method = getClass().getDeclaredMethods()[0]; + var method = getClass().getDeclaredMethods()[0]; assertViolatesPrecondition(() -> selectMethod(null, method)); assertViolatesPrecondition(() -> selectMethod(getClass(), (Method) null)); } @@ -319,94 +319,94 @@ static Stream invalidFullyQualifiedMethodNames() { @Test void selectMethodByFullyQualifiedName() throws Exception { Class clazz = getClass(); - Method method = clazz.getDeclaredMethod("myTest"); + var method = clazz.getDeclaredMethod("myTest"); assertSelectMethodByFullyQualifiedName(clazz, method); } @Test void selectMethodByFullyQualifiedNameForDefaultMethodInInterface() throws Exception { Class clazz = TestCaseWithDefaultMethod.class; - Method method = clazz.getMethod("myTest"); + var method = clazz.getMethod("myTest"); assertSelectMethodByFullyQualifiedName(clazz, method); } @Test void selectMethodByFullyQualifiedNameWithPrimitiveParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int.class); + var method = getClass().getDeclaredMethod("myTest", int.class); assertSelectMethodByFullyQualifiedName(getClass(), method, int.class, "int"); } @Test void selectMethodByFullyQualifiedNameWithPrimitiveParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int.class); + var method = getClass().getDeclaredMethod("myTest", int.class); assertSelectMethodByFullyQualifiedName(getClass(), method, "int", "int"); } @Test void selectMethodByFullyQualifiedNameWithObjectParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String.class); + var method = getClass().getDeclaredMethod("myTest", String.class); assertSelectMethodByFullyQualifiedName(getClass(), method, String.class, String.class.getName()); } @Test void selectMethodByFullyQualifiedNameWithObjectParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String.class); + var method = getClass().getDeclaredMethod("myTest", String.class); assertSelectMethodByFullyQualifiedName(getClass(), method, "java.lang.String", String.class.getName()); } @Test void selectMethodByFullyQualifiedNameWithPrimitiveArrayParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int[].class); + var method = getClass().getDeclaredMethod("myTest", int[].class); assertSelectMethodByFullyQualifiedName(getClass(), method, int[].class, int[].class.getName()); } @Test void selectMethodByFullyQualifiedNameWithPrimitiveArrayParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int[].class); + var method = getClass().getDeclaredMethod("myTest", int[].class); assertSelectMethodByFullyQualifiedName(getClass(), method, "int[]", "int[]"); } @Test void selectMethodByFullyQualifiedNameWithObjectArrayParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String[].class); + var method = getClass().getDeclaredMethod("myTest", String[].class); assertSelectMethodByFullyQualifiedName(getClass(), method, String[].class, String[].class.getName()); } @Test void selectMethodByFullyQualifiedNameWithObjectArrayParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String[].class); + var method = getClass().getDeclaredMethod("myTest", String[].class); assertSelectMethodByFullyQualifiedName(getClass(), method, "java.lang.String[]", "java.lang.String[]"); } @Test void selectMethodByFullyQualifiedNameWithTwoDimensionalPrimitiveArrayParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int[][].class); + var method = getClass().getDeclaredMethod("myTest", int[][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, int[][].class, int[][].class.getName()); } @Test void selectMethodByFullyQualifiedNameWithTwoDimensionalPrimitiveArrayParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int[][].class); + var method = getClass().getDeclaredMethod("myTest", int[][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, "int[][]", "int[][]"); } @Test void selectMethodByFullyQualifiedNameWithTwoDimensionalObjectArrayParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String[][].class); + var method = getClass().getDeclaredMethod("myTest", String[][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, String[][].class, String[][].class.getName()); } @Test void selectMethodByFullyQualifiedNameWithTwoDimensionalObjectArrayParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String[][].class); + var method = getClass().getDeclaredMethod("myTest", String[][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, "java.lang.String[][]", "java.lang.String[][]"); } @Test void selectMethodByFullyQualifiedNameWithMultidimensionalPrimitiveArrayParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int[][][][][].class); + var method = getClass().getDeclaredMethod("myTest", int[][][][][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, int[][][][][].class, int[][][][][].class.getName()); } @@ -414,13 +414,13 @@ void selectMethodByFullyQualifiedNameWithMultidimensionalPrimitiveArrayParameter void selectMethodByFullyQualifiedNameWithMultidimensionalPrimitiveArrayParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", int[][][][][].class); + var method = getClass().getDeclaredMethod("myTest", int[][][][][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, "int[][][][][]", "int[][][][][]"); } @Test void selectMethodByFullyQualifiedNameWithMultidimensionalObjectArrayParameter() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", Double[][][][][].class); + var method = getClass().getDeclaredMethod("myTest", Double[][][][][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, Double[][][][][].class, Double[][][][][].class.getName()); } @@ -429,21 +429,21 @@ void selectMethodByFullyQualifiedNameWithMultidimensionalObjectArrayParameter() void selectMethodByFullyQualifiedNameWithMultidimensionalObjectArrayParameterUsingSourceCodeSyntax() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", Double[][][][][].class); + var method = getClass().getDeclaredMethod("myTest", Double[][][][][].class); assertSelectMethodByFullyQualifiedName(getClass(), method, "java.lang.Double[][][][][]", "java.lang.Double[][][][][]"); } @Test void selectMethodByFullyQualifiedNameEndingInOpeningParenthesis() { - String className = "org.example.MyClass"; + var className = "org.example.MyClass"; // The following bizarre method name is not permissible in Java source // code; however, it's permitted by the JVM -- for example, in Groovy // or Kotlin source code using back ticks. - String methodName = ")--("; - String fqmn = className + "#" + methodName; + var methodName = ")--("; + var fqmn = className + "#" + methodName; - MethodSelector selector = selectMethod(fqmn); + var selector = selectMethod(fqmn); assertEquals(className, selector.getClassName()); assertEquals(methodName, selector.getMethodName()); assertEquals("", selector.getMethodParameterTypes()); @@ -454,11 +454,11 @@ void selectMethodByFullyQualifiedNameEndingInOpeningParenthesis() { */ @Test void selectMethodByFullyQualifiedNameContainingHashtags() { - String className = "org.example.CalculatorSpec"; - String methodName = "#a plus #b equals #c"; - String fqmn = className + "#" + methodName; + var className = "org.example.CalculatorSpec"; + var methodName = "#a plus #b equals #c"; + var fqmn = className + "#" + methodName; - MethodSelector selector = selectMethod(fqmn); + var selector = selectMethod(fqmn); assertEquals(className, selector.getClassName()); assertEquals(methodName, selector.getMethodName()); assertEquals("", selector.getMethodParameterTypes()); @@ -469,12 +469,12 @@ void selectMethodByFullyQualifiedNameContainingHashtags() { */ @Test void selectMethodByFullyQualifiedNameContainingHashtagsAndWithParameterList() { - String className = "org.example.CalculatorSpec"; - String methodName = "#a plus #b equals #c"; - String methodParameters = "int, int, int"; - String fqmn = String.format("%s#%s(%s)", className, methodName, methodParameters); + var className = "org.example.CalculatorSpec"; + var methodName = "#a plus #b equals #c"; + var methodParameters = "int, int, int"; + var fqmn = String.format("%s#%s(%s)", className, methodName, methodParameters); - MethodSelector selector = selectMethod(fqmn); + var selector = selectMethod(fqmn); assertEquals(className, selector.getClassName()); assertEquals(methodName, selector.getMethodName()); assertEquals(methodParameters, selector.getMethodParameterTypes()); @@ -485,11 +485,11 @@ void selectMethodByFullyQualifiedNameContainingHashtagsAndWithParameterList() { */ @Test void selectMethodByFullyQualifiedNameContainingParentheses() { - String className = "org.example.KotlinTestCase"; - String methodName = "🦆 ~|~test with a really, (really) terrible name & that needs to be changed!~|~"; - String fqmn = className + "#" + methodName; + var className = "org.example.KotlinTestCase"; + var methodName = "🦆 ~|~test with a really, (really) terrible name & that needs to be changed!~|~"; + var fqmn = className + "#" + methodName; - MethodSelector selector = selectMethod(fqmn); + var selector = selectMethod(fqmn); assertEquals(className, selector.getClassName()); assertEquals(methodName, selector.getMethodName()); @@ -501,11 +501,11 @@ void selectMethodByFullyQualifiedNameContainingParentheses() { */ @Test void selectMethodByFullyQualifiedNameEndingWithParentheses() { - String className = "org.example.KotlinTestCase"; - String methodName = "test name ends with parentheses()"; - String fqmn = className + "#" + methodName + "()"; + var className = "org.example.KotlinTestCase"; + var methodName = "test name ends with parentheses()"; + var fqmn = className + "#" + methodName + "()"; - MethodSelector selector = selectMethod(fqmn); + var selector = selectMethod(fqmn); assertEquals(className, selector.getClassName()); assertEquals(methodName, selector.getMethodName()); @@ -517,12 +517,12 @@ void selectMethodByFullyQualifiedNameEndingWithParentheses() { */ @Test void selectMethodByFullyQualifiedNameEndingWithParenthesesAndWithParameterList() { - String className = "org.example.KotlinTestCase"; - String methodName = "test name ends with parentheses()"; - String methodParameters = "int, int, int"; - String fqmn = String.format("%s#%s(%s)", className, methodName, methodParameters); + var className = "org.example.KotlinTestCase"; + var methodName = "test name ends with parentheses()"; + var methodParameters = "int, int, int"; + var fqmn = String.format("%s#%s(%s)", className, methodName, methodParameters); - MethodSelector selector = selectMethod(fqmn); + var selector = selectMethod(fqmn); assertEquals(className, selector.getClassName()); assertEquals(methodName, selector.getMethodName()); @@ -530,7 +530,7 @@ void selectMethodByFullyQualifiedNameEndingWithParenthesesAndWithParameterList() } private void assertSelectMethodByFullyQualifiedName(Class clazz, Method method) { - MethodSelector selector = selectMethod(fqmn(clazz, method.getName())); + var selector = selectMethod(fqmn(clazz, method.getName())); assertEquals(method, selector.getJavaMethod()); assertEquals(clazz, selector.getJavaClass()); assertEquals(clazz.getName(), selector.getClassName()); @@ -541,7 +541,7 @@ private void assertSelectMethodByFullyQualifiedName(Class clazz, Method metho private void assertSelectMethodByFullyQualifiedName(Class clazz, Method method, Class parameterType, String expectedParameterTypes) { - MethodSelector selector = selectMethod(fqmn(parameterType)); + var selector = selectMethod(fqmn(parameterType)); assertEquals(method, selector.getJavaMethod()); assertEquals(clazz, selector.getJavaClass()); assertEquals(clazz.getName(), selector.getClassName()); @@ -552,7 +552,7 @@ private void assertSelectMethodByFullyQualifiedName(Class clazz, Method metho private void assertSelectMethodByFullyQualifiedName(Class clazz, Method method, String parameterName, String expectedParameterTypes) { - MethodSelector selector = selectMethod(fqmnWithParamNames(parameterName)); + var selector = selectMethod(fqmnWithParamNames(parameterName)); assertEquals(method, selector.getJavaMethod()); assertEquals(clazz, selector.getJavaClass()); assertEquals(clazz.getName(), selector.getClassName()); @@ -562,9 +562,9 @@ private void assertSelectMethodByFullyQualifiedName(Class clazz, Method metho @Test void selectMethodByClassAndMethodName() throws Exception { - Method method = getClass().getDeclaredMethod("myTest"); + var method = getClass().getDeclaredMethod("myTest"); - MethodSelector selector = selectMethod(getClass(), "myTest"); + var selector = selectMethod(getClass(), "myTest"); assertEquals(getClass(), selector.getJavaClass()); assertEquals(getClass().getName(), selector.getClassName()); assertEquals(method, selector.getJavaMethod()); @@ -574,9 +574,9 @@ void selectMethodByClassAndMethodName() throws Exception { @Test void selectMethodByClassAndMethodNameWithParameterTypes() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String.class); + var method = getClass().getDeclaredMethod("myTest", String.class); - MethodSelector selector = selectMethod(getClass(), "myTest", String.class.getName()); + var selector = selectMethod(getClass(), "myTest", String.class.getName()); assertEquals(getClass(), selector.getJavaClass()); assertEquals(getClass().getName(), selector.getClassName()); assertEquals(method, selector.getJavaMethod()); @@ -586,9 +586,9 @@ void selectMethodByClassAndMethodNameWithParameterTypes() throws Exception { @Test void selectMethodWithParametersByMethodReference() throws Exception { - Method method = getClass().getDeclaredMethod("myTest", String.class); + var method = getClass().getDeclaredMethod("myTest", String.class); - MethodSelector selector = selectMethod(getClass(), method); + var selector = selectMethod(getClass(), method); assertEquals(method, selector.getJavaMethod()); assertEquals(getClass(), selector.getJavaClass()); assertEquals(getClass().getName(), selector.getClassName()); @@ -598,17 +598,17 @@ void selectMethodWithParametersByMethodReference() throws Exception { @Test void selectClassByNameForSpockSpec() { - String className = "org.example.CalculatorSpec"; - ClassSelector selector = selectClass(className); + var className = "org.example.CalculatorSpec"; + var selector = selectClass(className); assertEquals(className, selector.getClassName()); } @Test void selectMethodByClassAndNameForSpockSpec() { - String className = "org.example.CalculatorSpec"; - String methodName = "#a plus #b equals #c"; + var className = "org.example.CalculatorSpec"; + var methodName = "#a plus #b equals #c"; - MethodSelector selector = selectMethod(className, methodName); + var selector = selectMethod(className, methodName); assertEquals(className, selector.getClassName()); assertEquals(methodName, selector.getMethodName()); assertEquals("", selector.getMethodParameterTypes()); @@ -616,31 +616,31 @@ void selectMethodByClassAndNameForSpockSpec() { @Test void selectClasspathRootsWithNonExistingDirectory() { - List selectors = selectClasspathRoots(singleton(Paths.get("some", "local", "path"))); + var selectors = selectClasspathRoots(singleton(Paths.get("some", "local", "path"))); assertThat(selectors).isEmpty(); } @Test void selectClasspathRootsWithNonExistingJarFile() { - List selectors = selectClasspathRoots(singleton(Paths.get("some.jar"))); + var selectors = selectClasspathRoots(singleton(Paths.get("some.jar"))); assertThat(selectors).isEmpty(); } @Test void selectClasspathRootsWithExistingDirectory(@TempDir Path tempDir) { - List selectors = selectClasspathRoots(singleton(tempDir)); + var selectors = selectClasspathRoots(singleton(tempDir)); assertThat(selectors).extracting(ClasspathRootSelector::getClasspathRoot).containsExactly(tempDir.toUri()); } @Test void selectClasspathRootsWithExistingJarFile() throws Exception { - URI jarUri = getClass().getResource("/jartest.jar").toURI(); - Path jarFile = Paths.get(jarUri); + var jarUri = getClass().getResource("/jartest.jar").toURI(); + var jarFile = Paths.get(jarUri); - List selectors = selectClasspathRoots(singleton(jarFile)); + var selectors = selectClasspathRoots(singleton(jarFile)); assertThat(selectors).extracting(ClasspathRootSelector::getClasspathRoot).containsExactly(jarUri); } @@ -655,7 +655,7 @@ class NestedClassAndMethodSelectors { @Test void selectNestedClassByClassNames() { - NestedClassSelector selector = selectNestedClass(List.of(enclosingClassName), nestedClassName); + var selector = selectNestedClass(List.of(enclosingClassName), nestedClassName); assertThat(selector.getEnclosingClasses()).containsOnly(ClassWithNestedInnerClass.class); assertThat(selector.getNestedClass()).isEqualTo(AbstractClassWithNestedInnerClass.NestedClass.class); @@ -666,8 +666,7 @@ void selectNestedClassByClassNames() { @Test void selectDoubleNestedClassByClassNames() { - NestedClassSelector selector = selectNestedClass(List.of(enclosingClassName, nestedClassName), - doubleNestedClassName); + var selector = selectNestedClass(List.of(enclosingClassName, nestedClassName), doubleNestedClassName); assertThat(selector.getEnclosingClasses()).containsExactly(ClassWithNestedInnerClass.class, AbstractClassWithNestedInnerClass.NestedClass.class); @@ -689,8 +688,7 @@ void selectNestedClassPreconditions() { @Test void selectNestedMethodByEnclosingClassNamesAndMethodName() throws Exception { - NestedMethodSelector selector = selectNestedMethod(List.of(enclosingClassName), nestedClassName, - methodName); + var selector = selectNestedMethod(List.of(enclosingClassName), nestedClassName, methodName); assertThat(selector.getEnclosingClasses()).containsOnly(ClassWithNestedInnerClass.class); assertThat(selector.getNestedClass()).isEqualTo(AbstractClassWithNestedInnerClass.NestedClass.class); @@ -703,7 +701,7 @@ void selectNestedMethodByEnclosingClassNamesAndMethodName() throws Exception { @Test void selectNestedMethodByEnclosingClassesAndMethodName() throws Exception { - NestedMethodSelector selector = selectNestedMethod(List.of(ClassWithNestedInnerClass.class), + var selector = selectNestedMethod(List.of(ClassWithNestedInnerClass.class), AbstractClassWithNestedInnerClass.NestedClass.class, methodName); assertThat(selector.getEnclosingClasses()).containsOnly(ClassWithNestedInnerClass.class); @@ -717,7 +715,7 @@ void selectNestedMethodByEnclosingClassesAndMethodName() throws Exception { @Test void selectNestedMethodByEnclosingClassNamesAndMethodNameWithParameterTypes() throws Exception { - NestedMethodSelector selector = selectNestedMethod(List.of(enclosingClassName), nestedClassName, methodName, + var selector = selectNestedMethod(List.of(enclosingClassName), nestedClassName, methodName, String.class.getName()); assertThat(selector.getEnclosingClasses()).containsOnly(ClassWithNestedInnerClass.class); @@ -732,9 +730,9 @@ void selectNestedMethodByEnclosingClassNamesAndMethodNameWithParameterTypes() th @Test void selectDoubleNestedMethodByEnclosingClassNamesAndMethodName() throws Exception { - String doubleNestedMethodName = "doubleNestedTest"; - NestedMethodSelector selector = selectNestedMethod(List.of(enclosingClassName, nestedClassName), - doubleNestedClassName, doubleNestedMethodName); + var doubleNestedMethodName = "doubleNestedTest"; + var selector = selectNestedMethod(List.of(enclosingClassName, nestedClassName), doubleNestedClassName, + doubleNestedMethodName); assertThat(selector.getEnclosingClasses()).containsExactly(ClassWithNestedInnerClass.class, AbstractClassWithNestedInnerClass.NestedClass.class); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java index 71bcafb3ff39..63fcaca67e50 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java @@ -15,7 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.params.provider.Arguments.arguments; -import java.util.Optional; import java.util.stream.Stream; import org.junit.jupiter.api.DisplayName; @@ -44,7 +43,7 @@ void preconditions() { @Test @DisplayName("create FilePosition from factory method with line number") void filePositionFromLine() { - FilePosition filePosition = FilePosition.from(42); + var filePosition = FilePosition.from(42); assertThat(filePosition.getLine()).isEqualTo(42); assertThat(filePosition.getColumn()).isEmpty(); @@ -53,7 +52,7 @@ void filePositionFromLine() { @Test @DisplayName("create FilePosition from factory method with line number and column number") void filePositionFromLineAndColumn() { - FilePosition filePosition = FilePosition.from(42, 99); + var filePosition = FilePosition.from(42, 99); assertThat(filePosition.getLine()).isEqualTo(42); assertThat(filePosition.getColumn()).contains(99); @@ -65,10 +64,10 @@ void filePositionFromLineAndColumn() { @ParameterizedTest @MethodSource void filePositionFromQuery(String query, int expectedLine, int expectedColumn) { - Optional optionalFilePosition = FilePosition.fromQuery(query); + var optionalFilePosition = FilePosition.fromQuery(query); if (optionalFilePosition.isPresent()) { - FilePosition filePosition = optionalFilePosition.get(); + var filePosition = optionalFilePosition.get(); assertThat(filePosition.getLine()).isEqualTo(expectedLine); assertThat(filePosition.getColumn().orElse(-1)).isEqualTo(expectedColumn); @@ -99,9 +98,9 @@ static Stream filePositionFromQuery() { @Test @DisplayName("equals() and hashCode() with column number cached by Integer.valueOf()") void equalsAndHashCode() { - FilePosition same = FilePosition.from(42, 99); - FilePosition sameSame = FilePosition.from(42, 99); - FilePosition different = FilePosition.from(1, 2); + var same = FilePosition.from(42, 99); + var sameSame = FilePosition.from(42, 99); + var different = FilePosition.from(1, 2); assertEqualsAndHashCode(same, sameSame, different); } @@ -109,9 +108,9 @@ void equalsAndHashCode() { @Test @DisplayName("equals() and hashCode() with column number not cached by Integer.valueOf()") void equalsAndHashCodeWithColumnNumberNotCachedByJavaLangIntegerDotValueOf() { - FilePosition same = FilePosition.from(42, 99999); - FilePosition sameSame = FilePosition.from(42, 99999); - FilePosition different = FilePosition.from(1, 2); + var same = FilePosition.from(42, 99999); + var sameSame = FilePosition.from(42, 99999); + var different = FilePosition.from(1, 2); assertEqualsAndHashCode(same, sameSame, different); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java index 65ee7f1766b2..9729b108232a 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java @@ -40,9 +40,9 @@ void equalsAndHashCode() { @Test void preservesOriginalExceptionWhenTryingToLoadClass() { - MethodSelector selector = new MethodSelector("TestClass", "method", "int, boolean"); + var selector = new MethodSelector("TestClass", "method", "int, boolean"); - PreconditionViolationException e = assertThrows(PreconditionViolationException.class, selector::getJavaClass); + var e = assertThrows(PreconditionViolationException.class, selector::getJavaClass); assertThat(e).hasMessage("Could not load class with name: TestClass").hasCauseInstanceOf( ClassNotFoundException.class); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java index 80fec35f8ebc..ef672c456ac7 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java @@ -38,9 +38,9 @@ void includePackageChecksPreconditions() { @Test void includePackageWithMultiplePackages() { - String includedPackage1 = "java.lang"; - String includedPackage2 = "java.util"; - PackageNameFilter filter = PackageNameFilter.includePackageNames(includedPackage1, includedPackage2); + var includedPackage1 = "java.lang"; + var includedPackage2 = "java.util"; + var filter = PackageNameFilter.includePackageNames(includedPackage1, includedPackage2); assertThat(filter).hasToString( "IncludePackageNameFilter that includes packages whose names are either equal to or start with one of the following: '" @@ -89,9 +89,9 @@ void excludePackageChecksPreconditions() { @Test void excludePackageWithMultiplePackages() { - String excludedPackage1 = "java.lang"; - String excludedPackage2 = "java.util"; - PackageNameFilter filter = PackageNameFilter.excludePackageNames(excludedPackage1, excludedPackage2); + var excludedPackage1 = "java.lang"; + var excludedPackage2 = "java.util"; + var filter = PackageNameFilter.excludePackageNames(excludedPackage1, excludedPackage2); assertThat(filter).hasToString( "ExcludePackageNameFilter that excludes packages whose names are either equal to or start with one of the following: '" diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java index 63ef574c6f08..21941cb49a16 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java @@ -48,7 +48,7 @@ void preconditions() { @Test void delegatesGetCalls() { when(delegate.get(any())).thenReturn(Optional.of("result")); - PrefixedConfigurationParameters parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); + var parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); assertThat(parameters.get("qux")).contains("result"); @@ -58,7 +58,7 @@ void delegatesGetCalls() { @Test void delegatesGetBooleanCalls() { when(delegate.getBoolean(any())).thenReturn(Optional.of(true)); - PrefixedConfigurationParameters parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); + var parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); assertThat(parameters.getBoolean("qux")).contains(true); @@ -68,7 +68,7 @@ void delegatesGetBooleanCalls() { @Test void delegatesGetWithTransformerCalls() { when(delegate.get(any(), any())).thenReturn(Optional.of("QUX")); - PrefixedConfigurationParameters parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); + var parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); Function transformer = String::toUpperCase; assertThat(parameters.get("qux", transformer)).contains("QUX"); @@ -79,7 +79,7 @@ void delegatesGetWithTransformerCalls() { @Test void delegatesSizeCalls() { when(delegate.size()).thenReturn(42); - PrefixedConfigurationParameters parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); + var parameters = new PrefixedConfigurationParameters(delegate, "foo.bar."); assertThat(parameters.size()).isEqualTo(42); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java index 477f1bceb419..522e08115b11 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.BeforeEach; @@ -39,11 +38,11 @@ class AbstractTestDescriptorTests { @BeforeEach void initTree() { engineDescriptor = new EngineDescriptor(UniqueId.forEngine("testEngine"), "testEngine"); - GroupDescriptor group1 = new GroupDescriptor(UniqueId.root("group", "group1")); + var group1 = new GroupDescriptor(UniqueId.root("group", "group1")); engineDescriptor.addChild(group1); - GroupDescriptor group2 = new GroupDescriptor(UniqueId.root("group", "group2")); + var group2 = new GroupDescriptor(UniqueId.root("group", "group2")); engineDescriptor.addChild(group2); - GroupDescriptor group11 = new GroupDescriptor(UniqueId.root("group", "group1-1")); + var group11 = new GroupDescriptor(UniqueId.root("group", "group1-1")); group1.addChild(group11); group1.addChild(new LeafDescriptor(UniqueId.root("leaf", "leaf1-1"))); @@ -56,17 +55,17 @@ void initTree() { @Test void removeRootFromHierarchyFails() { - JUnitException e = assertThrows(JUnitException.class, () -> engineDescriptor.removeFromHierarchy()); + var e = assertThrows(JUnitException.class, () -> engineDescriptor.removeFromHierarchy()); assertTrue(e.toString().contains("cannot remove the root of a hierarchy")); } @Test void removeFromHierarchyClearsParentFromAllChildren() { - TestDescriptor group = engineDescriptor.getChildren().iterator().next(); + var group = engineDescriptor.getChildren().iterator().next(); assertSame(engineDescriptor, group.getParent().orElseThrow(Error::new)); assertTrue(group.getChildren().stream().allMatch(d -> d.getParent().orElseThrow(Error::new) == group)); - Set formerChildren = group.getChildren(); + var formerChildren = group.getChildren(); group.removeFromHierarchy(); assertFalse(group.getParent().isPresent()); @@ -77,7 +76,7 @@ void removeFromHierarchyClearsParentFromAllChildren() { @Test void setParentToOtherInstance() { TestDescriptor newEngine = new EngineDescriptor(UniqueId.forEngine("newEngine"), "newEngine"); - TestDescriptor group = engineDescriptor.getChildren().iterator().next(); + var group = engineDescriptor.getChildren().iterator().next(); assertSame(engineDescriptor, group.getParent().orElseThrow(Error::new)); group.setParent(newEngine); assertSame(newEngine, group.getParent().orElseThrow(Error::new)); @@ -85,7 +84,7 @@ void setParentToOtherInstance() { @Test void setParentToNull() { - TestDescriptor group = engineDescriptor.getChildren().iterator().next(); + var group = engineDescriptor.getChildren().iterator().next(); assertTrue(group.getParent().isPresent()); group.setParent(null); assertFalse(group.getParent().isPresent()); @@ -117,7 +116,7 @@ void pruneLeaf() { @Test void pruneGroup() { - final AtomicInteger countVisited = new AtomicInteger(); + final var countVisited = new AtomicInteger(); TestDescriptor.Visitor visitor = descriptor -> { if (descriptor.getUniqueId().equals(UniqueId.root("group", "group1"))) descriptor.removeFromHierarchy(); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java index b9e6fea58ced..3ebb2a2105e5 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java @@ -58,8 +58,8 @@ Stream assertSerializable() throws Exception { private void assertSerializable(T instance) { try { Class type = instance.getClass(); - byte[] serialized = serialize(instance); - Object deserialized = deserialize(serialized); + var serialized = serialize(instance); + var deserialized = deserialize(serialized); assertTrue(type.isAssignableFrom(deserialized.getClass())); assertEquals(instance, deserialized); @@ -70,15 +70,15 @@ private void assertSerializable(T instance) { } private byte[] serialize(Object obj) throws Exception { - ByteArrayOutputStream b = new ByteArrayOutputStream(); - ObjectOutputStream o = new ObjectOutputStream(b); + var b = new ByteArrayOutputStream(); + var o = new ObjectOutputStream(b); o.writeObject(obj); return b.toByteArray(); } private Object deserialize(byte[] bytes) throws Exception { - ByteArrayInputStream b = new ByteArrayInputStream(bytes); - ObjectInputStream o = new ObjectInputStream(b); + var b = new ByteArrayInputStream(bytes); + var o = new ObjectInputStream(b); return o.readObject(); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java index 303baa1b1080..7d65a66ea152 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java @@ -50,7 +50,7 @@ void preconditions() { @Test void resourceWithoutPosition() { - ClasspathResourceSource source = ClasspathResourceSource.from(FOO_RESOURCE); + var source = ClasspathResourceSource.from(FOO_RESOURCE); assertThat(source).isNotNull(); assertThat(source.getClasspathResourceName()).isEqualTo(FOO_RESOURCE); @@ -59,7 +59,7 @@ void resourceWithoutPosition() { @Test void resourceWithLeadingSlashWithoutPosition() { - ClasspathResourceSource source = ClasspathResourceSource.from("/" + FOO_RESOURCE); + var source = ClasspathResourceSource.from("/" + FOO_RESOURCE); assertThat(source).isNotNull(); assertThat(source.getClasspathResourceName()).isEqualTo(FOO_RESOURCE); @@ -68,8 +68,8 @@ void resourceWithLeadingSlashWithoutPosition() { @Test void resourceWithPosition() { - FilePosition position = FilePosition.from(42, 23); - ClasspathResourceSource source = ClasspathResourceSource.from(FOO_RESOURCE, position); + var position = FilePosition.from(42, 23); + var source = ClasspathResourceSource.from(FOO_RESOURCE, position); assertThat(source).isNotNull(); assertThat(source.getClasspathResourceName()).isEqualTo(FOO_RESOURCE); @@ -78,7 +78,7 @@ void resourceWithPosition() { @Test void resourcefromUriWithoutPosition() { - ClasspathResourceSource source = ClasspathResourceSource.from(FOO_RESOURCE_URI); + var source = ClasspathResourceSource.from(FOO_RESOURCE_URI); assertThat(source).isNotNull(); assertThat(source.getClasspathResourceName()).isEqualTo(FOO_RESOURCE); @@ -87,9 +87,9 @@ void resourcefromUriWithoutPosition() { @Test void resourceFromUriWithLineNumber() { - FilePosition position = FilePosition.from(42); - URI uri = URI.create(FOO_RESOURCE_URI + "?line=42"); - ClasspathResourceSource source = ClasspathResourceSource.from(uri); + var position = FilePosition.from(42); + var uri = URI.create(FOO_RESOURCE_URI + "?line=42"); + var source = ClasspathResourceSource.from(uri); assertThat(source).isNotNull(); assertThat(source.getClasspathResourceName()).isEqualTo(FOO_RESOURCE); @@ -98,9 +98,9 @@ void resourceFromUriWithLineNumber() { @Test void resourceFromUriWithLineAndColumnNumbers() { - FilePosition position = FilePosition.from(42, 23); - URI uri = URI.create(FOO_RESOURCE_URI + "?line=42&foo=bar&column=23"); - ClasspathResourceSource source = ClasspathResourceSource.from(uri); + var position = FilePosition.from(42, 23); + var uri = URI.create(FOO_RESOURCE_URI + "?line=42&foo=bar&column=23"); + var source = ClasspathResourceSource.from(uri); assertThat(source).isNotNull(); assertThat(source.getClasspathResourceName()).isEqualTo(FOO_RESOURCE); @@ -112,7 +112,7 @@ void equalsAndHashCode() { assertEqualsAndHashCode(ClasspathResourceSource.from(FOO_RESOURCE), ClasspathResourceSource.from(FOO_RESOURCE), ClasspathResourceSource.from(BAR_RESOURCE)); - FilePosition position = FilePosition.from(42, 23); + var position = FilePosition.from(42, 23); assertEqualsAndHashCode(ClasspathResourceSource.from(FOO_RESOURCE, position), ClasspathResourceSource.from(FOO_RESOURCE, position), ClasspathResourceSource.from(BAR_RESOURCE, position)); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java index 27e6c870eb03..526386711d3b 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java @@ -33,8 +33,8 @@ class CompositeTestSourceTests extends AbstractTestSourceTests { @Override Stream createSerializableInstances() { - FileSource fileSource = FileSource.from(new File("sample.instance")); - ClassSource classSource = ClassSource.from(getClass()); + var fileSource = FileSource.from(new File("sample.instance")); + var classSource = ClassSource.from(getClass()); List sources = new ArrayList<>(Arrays.asList(fileSource, classSource)); return Stream.of(CompositeTestSource.from(sources)); } @@ -51,10 +51,10 @@ void createCompositeTestSourceFromEmptyList() { @Test void createCompositeTestSourceFromClassAndFileSources() { - FileSource fileSource = FileSource.from(new File("example.test")); - ClassSource classSource = ClassSource.from(getClass()); + var fileSource = FileSource.from(new File("example.test")); + var classSource = ClassSource.from(getClass()); List sources = new ArrayList<>(Arrays.asList(fileSource, classSource)); - CompositeTestSource compositeTestSource = CompositeTestSource.from(sources); + var compositeTestSource = CompositeTestSource.from(sources); assertThat(compositeTestSource.getSources().size()).isEqualTo(2); assertThat(compositeTestSource.getSources()).contains(fileSource, classSource); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java index 0727a794cae4..11ba87897b92 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java @@ -39,21 +39,21 @@ void nullSourceUriYieldsException() { @Test void getterReturnsSameUriInstanceAsSuppliedToTheConstructor() throws Exception { - URI expected = new URI("foo.txt"); - URI actual = new DefaultUriSource(expected).getUri(); + var expected = new URI("foo.txt"); + var actual = new DefaultUriSource(expected).getUri(); assertSame(expected, actual); } @Test void equalsAndHashCode() throws Exception { - URI uri1 = new URI("foo.txt"); - URI uri2 = new URI("bar.txt"); + var uri1 = new URI("foo.txt"); + var uri2 = new URI("bar.txt"); assertEqualsAndHashCode(new DefaultUriSource(uri1), new DefaultUriSource(uri1), new DefaultUriSource(uri2)); } @Test void testToString() { - String actual = new DefaultUriSource(URI.create("foo.txt")).toString(); + var actual = new DefaultUriSource(URI.create("foo.txt")).toString(); assertEquals("DefaultUriSource [uri = foo.txt]", actual); } } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java index beb5b6e92e8f..01307356383c 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java @@ -45,7 +45,7 @@ public Set getTags() { return findRepeatableAnnotations(this.testClass, Tag.class).stream() .map(Tag::value) .filter(tag -> { - boolean isValid = TestTag.isValid(tag); + var isValid = TestTag.isValid(tag); if (!isValid) { // TODO [#242] Replace logging with precondition check once we have a proper mechanism for // handling validation exceptions during the TestEngine discovery phase. diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java index b262a6e6612b..1401d34997a8 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java @@ -52,7 +52,7 @@ public Set getTags() { Set methodTags = findRepeatableAnnotations(this.testMethod, Tag.class).stream() .map(Tag::value) .filter(tag -> { - boolean isValid = TestTag.isValid(tag); + var isValid = TestTag.isValid(tag); if (!isValid) { // TODO [#242] Replace logging with precondition check once we have a proper mechanism for // handling validation exceptions during the TestEngine discovery phase. diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java index dff01fc599d4..c93dc0cf98c5 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java @@ -15,7 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.params.provider.Arguments.arguments; -import java.util.Optional; import java.util.stream.Stream; import org.junit.jupiter.api.DisplayName; @@ -48,7 +47,7 @@ void preconditions() { @Test @DisplayName("create FilePosition from factory method with line number") void filePositionFromLine() { - FilePosition filePosition = FilePosition.from(42); + var filePosition = FilePosition.from(42); assertThat(filePosition.getLine()).isEqualTo(42); assertThat(filePosition.getColumn()).isEmpty(); @@ -57,7 +56,7 @@ void filePositionFromLine() { @Test @DisplayName("create FilePosition from factory method with line number and column number") void filePositionFromLineAndColumn() { - FilePosition filePosition = FilePosition.from(42, 99); + var filePosition = FilePosition.from(42, 99); assertThat(filePosition.getLine()).isEqualTo(42); assertThat(filePosition.getColumn()).contains(99); @@ -69,10 +68,10 @@ void filePositionFromLineAndColumn() { @ParameterizedTest @MethodSource void filePositionFromQuery(String query, int expectedLine, int expectedColumn) { - Optional optionalFilePosition = FilePosition.fromQuery(query); + var optionalFilePosition = FilePosition.fromQuery(query); if (optionalFilePosition.isPresent()) { - FilePosition filePosition = optionalFilePosition.get(); + var filePosition = optionalFilePosition.get(); assertThat(filePosition.getLine()).isEqualTo(expectedLine); assertThat(filePosition.getColumn().orElse(-1)).isEqualTo(expectedColumn); @@ -103,9 +102,9 @@ static Stream filePositionFromQuery() { @Test @DisplayName("equals() and hashCode() with column number cached by Integer.valueOf()") void equalsAndHashCode() { - FilePosition same = FilePosition.from(42, 99); - FilePosition sameSame = FilePosition.from(42, 99); - FilePosition different = FilePosition.from(1, 2); + var same = FilePosition.from(42, 99); + var sameSame = FilePosition.from(42, 99); + var different = FilePosition.from(1, 2); assertEqualsAndHashCode(same, sameSame, different); } @@ -113,9 +112,9 @@ void equalsAndHashCode() { @Test @DisplayName("equals() and hashCode() with column number not cached by Integer.valueOf()") void equalsAndHashCodeWithColumnNumberNotCachedByJavaLangIntegerDotValueOf() { - FilePosition same = FilePosition.from(42, 99999); - FilePosition sameSame = FilePosition.from(42, 99999); - FilePosition different = FilePosition.from(1, 2); + var same = FilePosition.from(42, 99999); + var sameSame = FilePosition.from(42, 99999); + var different = FilePosition.from(1, 2); assertEqualsAndHashCode(same, sameSame, different); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java index fc9d30a44b09..41debcde238f 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java @@ -40,10 +40,10 @@ void nullSourceFileOrDirectoryYieldsException() { @Test void directory() throws Exception { - File canonicalDir = new File(".").getCanonicalFile(); - File relativeDir = new File("..", canonicalDir.getName()); + var canonicalDir = new File(".").getCanonicalFile(); + var relativeDir = new File("..", canonicalDir.getName()); - DirectorySource source = DirectorySource.from(relativeDir); + var source = DirectorySource.from(relativeDir); assertThat(source.getUri()).isEqualTo(canonicalDir.toURI()); assertThat(source.getFile()).isEqualTo(canonicalDir); @@ -51,12 +51,12 @@ void directory() throws Exception { @Test void fileWithoutPosition() throws Exception { - File canonicalDir = new File(".").getCanonicalFile(); - File relativeDir = new File("..", canonicalDir.getName()); - File relativeFile = new File(relativeDir, "test.txt"); - File canonicalFile = relativeFile.getCanonicalFile(); + var canonicalDir = new File(".").getCanonicalFile(); + var relativeDir = new File("..", canonicalDir.getName()); + var relativeFile = new File(relativeDir, "test.txt"); + var canonicalFile = relativeFile.getCanonicalFile(); - FileSource source = FileSource.from(relativeFile); + var source = FileSource.from(relativeFile); assertThat(source.getUri()).isEqualTo(canonicalFile.toURI()); assertThat(source.getFile()).isEqualTo(canonicalFile); @@ -65,9 +65,9 @@ void fileWithoutPosition() throws Exception { @Test void fileWithPosition() { - File file = new File("test.txt"); - FilePosition position = FilePosition.from(42, 23); - FileSource source = FileSource.from(file, position); + var file = new File("test.txt"); + var position = FilePosition.from(42, 23); + var source = FileSource.from(file, position); assertThat(source.getUri()).isEqualTo(file.getAbsoluteFile().toURI()); assertThat(source.getFile()).isEqualTo(file.getAbsoluteFile()); @@ -76,19 +76,19 @@ void fileWithPosition() { @Test void equalsAndHashCodeForFileSource() { - File file1 = new File("foo.txt"); - File file2 = new File("bar.txt"); + var file1 = new File("foo.txt"); + var file2 = new File("bar.txt"); assertEqualsAndHashCode(FileSource.from(file1), FileSource.from(file1), FileSource.from(file2)); - FilePosition position = FilePosition.from(42, 23); + var position = FilePosition.from(42, 23); assertEqualsAndHashCode(FileSource.from(file1, position), FileSource.from(file1, position), FileSource.from(file2, position)); } @Test void equalsAndHashCodeForDirectorySource() { - File dir1 = new File("."); - File dir2 = new File(".."); + var dir1 = new File("."); + var dir2 = new File(".."); assertEqualsAndHashCode(DirectorySource.from(dir1), DirectorySource.from(dir1), DirectorySource.from(dir2)); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java index e44d570a2957..78248a31e21b 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java @@ -39,8 +39,8 @@ Stream createSerializableInstances() throws Exception { @Test void methodSource() throws Exception { - Method testMethod = getMethod("method1"); - MethodSource source = MethodSource.from(testMethod); + var testMethod = getMethod("method1"); + var source = MethodSource.from(testMethod); assertThat(source.getClassName()).isEqualTo(getClass().getName()); assertThat(source.getMethodName()).isEqualTo(testMethod.getName()); @@ -51,8 +51,8 @@ void methodSource() throws Exception { @Test void equalsAndHashCodeForMethodSource() throws Exception { - Method method1 = getMethod("method1"); - Method method2 = getMethod("method2"); + var method1 = getMethod("method1"); + var method2 = getMethod("method2"); assertEqualsAndHashCode(MethodSource.from(method1), MethodSource.from(method1), MethodSource.from(method2)); } @@ -88,7 +88,7 @@ void instantiationWithNullClassOrMethodShouldThrowPreconditionViolationException @Test void instantiationWithClassAndMethodShouldResultInACorrectObject() throws Exception { - MethodSource source = MethodSource.from(String.class, + var source = MethodSource.from(String.class, String.class.getDeclaredMethod("lastIndexOf", String.class, int.class)); assertEquals(String.class.getName(), source.getClassName()); assertEquals("lastIndexOf", source.getMethodName()); @@ -97,7 +97,7 @@ void instantiationWithClassAndMethodShouldResultInACorrectObject() throws Except @Test void instantiationWithClassAndMethodAsStringAndParamsAsClassVarargsShouldResultInACorrectObject() { - MethodSource source = MethodSource.from(String.class.getName(), "lastIndexOf", String.class, int.class); + var source = MethodSource.from(String.class.getName(), "lastIndexOf", String.class, int.class); assertEquals(String.class.getName(), source.getClassName()); assertEquals("lastIndexOf", source.getMethodName()); assertEquals("java.lang.String, int", source.getMethodParameterTypes()); @@ -156,113 +156,112 @@ void twoEqualMethodsWithUnequalParametersShouldHaveUnequalMethodSourceHashCodes( @Test void aReflectedMethodsClassNameShouldBeConsistent() throws Exception { - Method m = String.class.getDeclaredMethod("valueOf", int.class); + var m = String.class.getDeclaredMethod("valueOf", int.class); assertEquals("java.lang.String", MethodSource.from(m).getClassName()); } @Test void aReflectedMethodsMethodNameShouldBeConsistent() throws Exception { - Method m = String.class.getDeclaredMethod("valueOf", int.class); + var m = String.class.getDeclaredMethod("valueOf", int.class); assertEquals("valueOf", MethodSource.from(m).getMethodName()); } @Test void aReflectedMethodsParameterTypesShouldBeConsistent() throws Exception { - Method m = String.class.getDeclaredMethod("valueOf", float.class); + var m = String.class.getDeclaredMethod("valueOf", float.class); assertEquals("float", MethodSource.from(m).getMethodParameterTypes()); } @Test void twoEqualReflectedMethodsShouldHaveEqualMethodSourceObjects() throws Exception { - Method m1 = String.class.getDeclaredMethod("valueOf", int.class); - Method m2 = String.class.getDeclaredMethod("valueOf", int.class); + var m1 = String.class.getDeclaredMethod("valueOf", int.class); + var m2 = String.class.getDeclaredMethod("valueOf", int.class); assertEquals(MethodSource.from(m1), MethodSource.from(m2)); } @Test void twoEqualReflectedMethodsShouldHaveEqualMethodSourceHashCodes() throws Exception { - Method m1 = String.class.getDeclaredMethod("valueOf", int.class); - Method m2 = String.class.getDeclaredMethod("valueOf", int.class); + var m1 = String.class.getDeclaredMethod("valueOf", int.class); + var m2 = String.class.getDeclaredMethod("valueOf", int.class); assertEquals(MethodSource.from(m1).hashCode(), MethodSource.from(m2).hashCode()); } @Test void twoUnequalReflectedMethodsShouldNotHaveEqualMethodSourceObjects() throws Exception { - Method m1 = String.class.getDeclaredMethod("valueOf", int.class); - Method m2 = Byte.class.getDeclaredMethod("byteValue"); + var m1 = String.class.getDeclaredMethod("valueOf", int.class); + var m2 = Byte.class.getDeclaredMethod("byteValue"); assertNotEquals(MethodSource.from(m1), MethodSource.from(m2)); } @Test void twoUnequalReflectedMethodsShouldNotHaveEqualMethodSourceHashCodes() throws Exception { - Method m1 = String.class.getDeclaredMethod("valueOf", int.class); - Method m2 = Byte.class.getDeclaredMethod("byteValue"); + var m1 = String.class.getDeclaredMethod("valueOf", int.class); + var m2 = Byte.class.getDeclaredMethod("byteValue"); assertNotEquals(MethodSource.from(m1).hashCode(), MethodSource.from(m2).hashCode()); } @Test void getJavaClassFromString() { - MethodSource source = MethodSource.from(getClass().getName(), "method1"); + var source = MethodSource.from(getClass().getName(), "method1"); assertThat(source.getJavaClass()).isEqualTo(getClass()); } @Test void getJavaClassShouldThrowExceptionIfClassNotFound() { - MethodSource source = MethodSource.from(getClass().getName() + "X", "method1"); + var source = MethodSource.from(getClass().getName() + "X", "method1"); assertThrows(PreconditionViolationException.class, source::getJavaClass); } @Test void getJavaMethodShouldReturnGivenMethodIfOverloadExists() throws Exception { - Method testMethod = getMethod("method3"); - MethodSource source = MethodSource.from(testMethod); + var testMethod = getMethod("method3"); + var source = MethodSource.from(testMethod); assertThat(source.getJavaMethod()).isEqualTo(testMethod); } @Test void getJavaMethodFromStringShouldFindVoidMethod() throws Exception { - Method testMethod = getClass().getDeclaredMethod("methodVoid"); - MethodSource source = MethodSource.from(getClass().getName(), testMethod.getName()); + var testMethod = getClass().getDeclaredMethod("methodVoid"); + var source = MethodSource.from(getClass().getName(), testMethod.getName()); assertThat(source.getJavaMethod()).isEqualTo(testMethod); } @Test void getJavaMethodFromStringShouldFindMethodWithParameter() throws Exception { - Method testMethod = getClass().getDeclaredMethod("method3", Integer.TYPE); - MethodSource source = MethodSource.from(getClass().getName(), testMethod.getName(), - testMethod.getParameterTypes()); + var testMethod = getClass().getDeclaredMethod("method3", Integer.TYPE); + var source = MethodSource.from(getClass().getName(), testMethod.getName(), testMethod.getParameterTypes()); assertThat(source.getJavaMethod()).isEqualTo(testMethod); } @Test void getJavaMethodFromStringShouldThrowExceptionIfParameterTypesAreNotSupplied() { - MethodSource source = MethodSource.from(getClass().getName(), "method3"); + var source = MethodSource.from(getClass().getName(), "method3"); assertThrows(PreconditionViolationException.class, source::getJavaMethod); } @Test void getJavaMethodFromStringShouldThrowExceptionIfParameterTypesDoNotMatch() { - MethodSource source = MethodSource.from(getClass().getName(), "method3", Double.TYPE); + var source = MethodSource.from(getClass().getName(), "method3", Double.TYPE); assertThrows(PreconditionViolationException.class, source::getJavaMethod); } @Test void getJavaMethodFromStringShouldThrowExceptionIfMethodDoesNotExist() { - MethodSource source = MethodSource.from(getClass().getName(), "methodX"); + var source = MethodSource.from(getClass().getName(), "methodX"); assertThrows(PreconditionViolationException.class, source::getJavaMethod); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java index f5c2a064e3eb..0ef5b8ab69cd 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java @@ -48,24 +48,24 @@ void packageSourceFromNullPackageReference() { @Test void packageSourceFromPackageName() { - String testPackage = getClass().getPackage().getName(); - PackageSource source = PackageSource.from(testPackage); + var testPackage = getClass().getPackage().getName(); + var source = PackageSource.from(testPackage); assertThat(source.getPackageName()).isEqualTo(testPackage); } @Test void packageSourceFromPackageReference() { - Package testPackage = getClass().getPackage(); - PackageSource source = PackageSource.from(testPackage); + var testPackage = getClass().getPackage(); + var source = PackageSource.from(testPackage); assertThat(source.getPackageName()).isEqualTo(testPackage.getName()); } @Test void equalsAndHashCodeForPackageSource() { - Package pkg1 = getClass().getPackage(); - Package pkg2 = String.class.getPackage(); + var pkg1 = getClass().getPackage(); + var pkg2 = String.class.getPackage(); assertEqualsAndHashCode(PackageSource.from(pkg1), PackageSource.from(pkg1), PackageSource.from(pkg2)); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java index 69809502ec2a..ba253affcf6a 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java @@ -22,7 +22,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.function.Executable; -import org.mockito.InOrder; /** * @since 1.3 @@ -32,12 +31,12 @@ class CompositeLockTests { @Test @SuppressWarnings("resource") void acquiresAllLocksInOrder() throws Exception { - Lock lock1 = mock(Lock.class); - Lock lock2 = mock(Lock.class); + var lock1 = mock(Lock.class); + var lock2 = mock(Lock.class); new CompositeLock(asList(lock1, lock2)).acquire(); - InOrder inOrder = inOrder(lock1, lock2); + var inOrder = inOrder(lock1, lock2); inOrder.verify(lock1).lockInterruptibly(); inOrder.verify(lock2).lockInterruptibly(); } @@ -45,12 +44,12 @@ void acquiresAllLocksInOrder() throws Exception { @Test @SuppressWarnings("resource") void releasesAllLocksInReverseOrder() throws Exception { - Lock lock1 = mock(Lock.class); - Lock lock2 = mock(Lock.class); + var lock1 = mock(Lock.class); + var lock2 = mock(Lock.class); new CompositeLock(asList(lock1, lock2)).acquire().close(); - InOrder inOrder = inOrder(lock1, lock2); + var inOrder = inOrder(lock1, lock2); inOrder.verify(lock2).unlock(); inOrder.verify(lock1).unlock(); } @@ -58,12 +57,12 @@ void releasesAllLocksInReverseOrder() throws Exception { @Test @SuppressWarnings("resource") void releasesLocksInReverseOrderWhenInterruptedDuringAcquire() throws Exception { - CountDownLatch firstTwoLocksWereLocked = new CountDownLatch(2); - Lock firstLock = mockLock("firstLock", firstTwoLocksWereLocked::countDown); - Lock secondLock = mockLock("secondLock", firstTwoLocksWereLocked::countDown); - Lock unavailableLock = mockLock("unavailableLock", new CountDownLatch(1)::await); + var firstTwoLocksWereLocked = new CountDownLatch(2); + var firstLock = mockLock("firstLock", firstTwoLocksWereLocked::countDown); + var secondLock = mockLock("secondLock", firstTwoLocksWereLocked::countDown); + var unavailableLock = mockLock("unavailableLock", new CountDownLatch(1)::await); - Thread thread = new Thread(() -> { + var thread = new Thread(() -> { try { new CompositeLock(asList(firstLock, secondLock, unavailableLock)).acquire(); } @@ -76,14 +75,14 @@ void releasesLocksInReverseOrderWhenInterruptedDuringAcquire() throws Exception thread.interrupt(); thread.join(); - InOrder inOrder = inOrder(firstLock, secondLock); + var inOrder = inOrder(firstLock, secondLock); inOrder.verify(secondLock).unlock(); inOrder.verify(firstLock).unlock(); verify(unavailableLock, never()).unlock(); } private Lock mockLock(String name, Executable lockAction) throws InterruptedException { - Lock lock = mock(Lock.class, name); + var lock = mock(Lock.class, name); doAnswer(invocation -> { lockAction.execute(); return null; diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java index 010e8ae12b4f..c8db3d759403 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java @@ -42,7 +42,7 @@ void fixedStrategyCreatesValidConfiguration() { when(configParams.get("fixed.parallelism")).thenReturn(Optional.of("42")); ParallelExecutionConfigurationStrategy strategy = DefaultParallelExecutionConfigurationStrategy.FIXED; - ParallelExecutionConfiguration configuration = strategy.createConfiguration(configParams); + var configuration = strategy.createConfiguration(configParams); assertThat(configuration.getParallelism()).isEqualTo(42); assertThat(configuration.getCorePoolSize()).isEqualTo(42); @@ -56,9 +56,9 @@ void dynamicStrategyCreatesValidConfiguration() { when(configParams.get("dynamic.factor")).thenReturn(Optional.of("2.0")); ParallelExecutionConfigurationStrategy strategy = DefaultParallelExecutionConfigurationStrategy.DYNAMIC; - ParallelExecutionConfiguration configuration = strategy.createConfiguration(configParams); + var configuration = strategy.createConfiguration(configParams); - int availableProcessors = Runtime.getRuntime().availableProcessors(); + var availableProcessors = Runtime.getRuntime().availableProcessors(); assertThat(configuration.getParallelism()).isEqualTo(availableProcessors * 2); assertThat(configuration.getCorePoolSize()).isEqualTo(availableProcessors * 2); assertThat(configuration.getMinimumRunnable()).isEqualTo(availableProcessors * 2); @@ -72,7 +72,7 @@ void customStrategyCreatesValidConfiguration() { Optional.of(CustomParallelExecutionConfigurationStrategy.class.getName())); ParallelExecutionConfigurationStrategy strategy = DefaultParallelExecutionConfigurationStrategy.CUSTOM; - ParallelExecutionConfiguration configuration = strategy.createConfiguration(configParams); + var configuration = strategy.createConfiguration(configParams); assertThat(configuration.getParallelism()).isEqualTo(1); assertThat(configuration.getCorePoolSize()).isEqualTo(4); @@ -110,9 +110,9 @@ void dynamicStrategyUsesDefaultWhenPropertyIsNotPresent() { when(configParams.get("dynamic.factor")).thenReturn(Optional.empty()); ParallelExecutionConfigurationStrategy strategy = DefaultParallelExecutionConfigurationStrategy.DYNAMIC; - ParallelExecutionConfiguration configuration = strategy.createConfiguration(configParams); + var configuration = strategy.createConfiguration(configParams); - int availableProcessors = Runtime.getRuntime().availableProcessors(); + var availableProcessors = Runtime.getRuntime().availableProcessors(); assertThat(configuration.getParallelism()).isEqualTo(availableProcessors); assertThat(configuration.getCorePoolSize()).isEqualTo(availableProcessors); assertThat(configuration.getMinimumRunnable()).isEqualTo(availableProcessors); @@ -149,7 +149,7 @@ void dynamicStrategyUsesAtLeastParallelismOfOneWhenPropertyIsTooSmall() { when(configParams.get("dynamic.factor")).thenReturn(Optional.of("0.00000000001")); ParallelExecutionConfigurationStrategy strategy = DefaultParallelExecutionConfigurationStrategy.DYNAMIC; - ParallelExecutionConfiguration configuration = strategy.createConfiguration(configParams); + var configuration = strategy.createConfiguration(configParams); assertThat(configuration.getParallelism()).isEqualTo(1); assertThat(configuration.getCorePoolSize()).isEqualTo(1); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java index 8e7031f5a612..aeac3287abad 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java @@ -32,13 +32,11 @@ import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; -import java.util.concurrent.Future; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.function.ThrowingConsumer; -import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.EngineExecutionListener; import org.junit.platform.engine.ExecutionRequest; import org.junit.platform.engine.TestDescriptor; @@ -49,7 +47,6 @@ import org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor; import org.junit.platform.launcher.core.ConfigurationParametersFactoryForTests; import org.mockito.ArgumentCaptor; -import org.mockito.InOrder; import org.mockito.Mock; import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; @@ -80,7 +77,7 @@ void init() { private HierarchicalTestExecutor createExecutor( HierarchicalTestExecutorService executorService) { - ExecutionRequest request = new ExecutionRequest(root, listener, null); + var request = new ExecutionRequest(root, listener, null); return new HierarchicalTestExecutor<>(request, rootContext, executorService, OpenTest4JAwareThrowableCollector::new); } @@ -88,11 +85,11 @@ private HierarchicalTestExecutor createExecutor( @Test void emptyRootDescriptor() throws Exception { - InOrder inOrder = inOrder(listener, root); + var inOrder = inOrder(listener, root); executor.execute(); - ArgumentCaptor rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(root).prepare(rootContext); inOrder.verify(root).shouldBeSkipped(rootContext); inOrder.verify(listener).executionStarted(root); @@ -106,14 +103,14 @@ void emptyRootDescriptor() throws Exception { @Test void rootDescriptorWithOneChildContainer() throws Exception { - MyContainer child = spy(new MyContainer(UniqueId.root("container", "child container"))); + var child = spy(new MyContainer(UniqueId.root("container", "child container"))); root.addChild(child); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); - ArgumentCaptor childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(listener).executionStarted(root); inOrder.verify(child).prepare(rootContext); inOrder.verify(child).shouldBeSkipped(rootContext); @@ -129,14 +126,14 @@ void rootDescriptorWithOneChildContainer() throws Exception { @Test void rootDescriptorWithOneChildLeaf() throws Exception { - MyLeaf child = spy(new MyLeaf(UniqueId.root("leaf", "child leaf"))); + var child = spy(new MyLeaf(UniqueId.root("leaf", "child leaf"))); root.addChild(child); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); - ArgumentCaptor aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(listener).executionStarted(root); inOrder.verify(child).prepare(rootContext); inOrder.verify(child).shouldBeSkipped(rootContext); @@ -151,11 +148,11 @@ void rootDescriptorWithOneChildLeaf() throws Exception { @Test void skippingAContainer() throws Exception { - MyContainer child = spy(new MyContainer(UniqueId.root("container", "child container"))); + var child = spy(new MyContainer(UniqueId.root("container", "child container"))); when(child.shouldBeSkipped(rootContext)).thenReturn(Node.SkipResult.skip("in test")); root.addChild(child); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); @@ -173,11 +170,11 @@ void skippingAContainer() throws Exception { @Test void skippingALeaf() throws Exception { - MyLeaf child = spy(new MyLeaf(UniqueId.root("leaf", "child leaf"))); + var child = spy(new MyLeaf(UniqueId.root("leaf", "child leaf"))); when(child.shouldBeSkipped(rootContext)).thenReturn(Node.SkipResult.skip("in test")); root.addChild(child); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); @@ -195,16 +192,16 @@ void skippingALeaf() throws Exception { @Test void exceptionInShouldBeSkipped() throws Exception { - MyContainer child = spy(new MyContainer(UniqueId.root("container", "child container"))); - RuntimeException anException = new RuntimeException("in skip"); + var child = spy(new MyContainer(UniqueId.root("container", "child container"))); + var anException = new RuntimeException("in skip"); when(child.shouldBeSkipped(rootContext)).thenThrow(anException); root.addChild(child); - InOrder inOrder = inOrder(listener, child); + var inOrder = inOrder(listener, child); executor.execute(); - ArgumentCaptor childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(listener).executionStarted(root); inOrder.verify(child).prepare(rootContext); inOrder.verify(child).shouldBeSkipped(rootContext); @@ -222,16 +219,16 @@ void exceptionInShouldBeSkipped() throws Exception { @Test void exceptionInContainerBeforeAll() throws Exception { - MyContainer child = spy(new MyContainer(UniqueId.root("container", "child container"))); + var child = spy(new MyContainer(UniqueId.root("container", "child container"))); root.addChild(child); - RuntimeException anException = new RuntimeException("in test"); + var anException = new RuntimeException("in test"); when(root.before(rootContext)).thenThrow(anException); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); - ArgumentCaptor rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(root).prepare(rootContext); inOrder.verify(root).shouldBeSkipped(rootContext); inOrder.verify(listener).executionStarted(root); @@ -248,17 +245,17 @@ void exceptionInContainerBeforeAll() throws Exception { @Test void exceptionInContainerAfterAllAndCleanUp() throws Exception { - MyLeaf child = spy(new MyLeaf(UniqueId.root("leaf", "child container"))); + var child = spy(new MyLeaf(UniqueId.root("leaf", "child container"))); root.addChild(child); - RuntimeException afterException = new RuntimeException("in after()"); + var afterException = new RuntimeException("in after()"); doThrow(afterException).when(root).after(rootContext); - RuntimeException cleanUpException = new RuntimeException("in cleanUp()"); + var cleanUpException = new RuntimeException("in cleanUp()"); doThrow(cleanUpException).when(root).cleanUp(rootContext); executor.execute(); - ArgumentCaptor rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); - InOrder inOrder = inOrder(listener, root, child); + var rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var inOrder = inOrder(listener, root, child); inOrder.verify(root).prepare(rootContext); inOrder.verify(root).shouldBeSkipped(rootContext); inOrder.verify(listener).executionStarted(root); @@ -278,13 +275,13 @@ void exceptionInContainerAfterAllAndCleanUp() throws Exception { @Test void exceptionInPrepare() throws Exception { - RuntimeException prepareException = new RuntimeException("in prepare()"); + var prepareException = new RuntimeException("in prepare()"); doThrow(prepareException).when(root).prepare(rootContext); executor.execute(); - ArgumentCaptor rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); - InOrder inOrder = inOrder(listener, root); + var rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var inOrder = inOrder(listener, root); inOrder.verify(root).prepare(rootContext); inOrder.verify(listener).executionStarted(root); inOrder.verify(listener).executionFinished(eq(root), rootExecutionResult.capture()); @@ -297,13 +294,13 @@ void exceptionInPrepare() throws Exception { @Test void exceptionInCleanUp() throws Exception { - RuntimeException cleanUpException = new RuntimeException("in cleanUp()"); + var cleanUpException = new RuntimeException("in cleanUp()"); doThrow(cleanUpException).when(root).cleanUp(rootContext); executor.execute(); - ArgumentCaptor rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); - InOrder inOrder = inOrder(listener, root); + var rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var inOrder = inOrder(listener, root); inOrder.verify(root).prepare(rootContext); inOrder.verify(root).shouldBeSkipped(rootContext); inOrder.verify(listener).executionStarted(root); @@ -320,15 +317,15 @@ void exceptionInCleanUp() throws Exception { @Test void exceptionInShouldBeSkippedAndCleanUp() throws Exception { - RuntimeException shouldBeSkippedException = new RuntimeException("in prepare()"); + var shouldBeSkippedException = new RuntimeException("in prepare()"); doThrow(shouldBeSkippedException).when(root).shouldBeSkipped(rootContext); - RuntimeException cleanUpException = new RuntimeException("in cleanUp()"); + var cleanUpException = new RuntimeException("in cleanUp()"); doThrow(cleanUpException).when(root).cleanUp(rootContext); executor.execute(); - ArgumentCaptor rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); - InOrder inOrder = inOrder(listener, root); + var rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var inOrder = inOrder(listener, root); inOrder.verify(root).prepare(rootContext); inOrder.verify(root).shouldBeSkipped(rootContext); inOrder.verify(root).cleanUp(rootContext); @@ -344,16 +341,16 @@ void exceptionInShouldBeSkippedAndCleanUp() throws Exception { @Test void exceptionInLeafExecute() throws Exception { - MyLeaf child = spy(new MyLeaf(UniqueId.root("leaf", "leaf"))); - RuntimeException anException = new RuntimeException("in test"); + var child = spy(new MyLeaf(UniqueId.root("leaf", "leaf"))); + var anException = new RuntimeException("in test"); when(child.execute(eq(rootContext), any())).thenThrow(anException); root.addChild(child); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); - ArgumentCaptor childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(listener).executionStarted(root); inOrder.verify(root).before(rootContext); inOrder.verify(listener).executionStarted(child); @@ -369,16 +366,16 @@ void exceptionInLeafExecute() throws Exception { @Test void abortInRootBeforeAll() throws Exception { - MyContainer child = spy(new MyContainer(UniqueId.root("container", "child container"))); + var child = spy(new MyContainer(UniqueId.root("container", "child container"))); root.addChild(child); - TestAbortedException anAbortedException = new TestAbortedException("in BeforeAll"); + var anAbortedException = new TestAbortedException("in BeforeAll"); when(root.before(rootContext)).thenThrow(anAbortedException); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); - ArgumentCaptor rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var rootExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(root).prepare(rootContext); inOrder.verify(root).shouldBeSkipped(rootContext); inOrder.verify(listener).executionStarted(root); @@ -395,16 +392,16 @@ void abortInRootBeforeAll() throws Exception { @Test void abortInChildContainerBeforeAll() throws Exception { - MyContainer child = spy(new MyContainer(UniqueId.root("container", "child container"))); + var child = spy(new MyContainer(UniqueId.root("container", "child container"))); root.addChild(child); - TestAbortedException anAbortedException = new TestAbortedException("in BeforeAll"); + var anAbortedException = new TestAbortedException("in BeforeAll"); when(child.before(rootContext)).thenThrow(anAbortedException); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); - ArgumentCaptor childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(root).prepare(rootContext); inOrder.verify(root).shouldBeSkipped(rootContext); @@ -425,16 +422,16 @@ void abortInChildContainerBeforeAll() throws Exception { @Test void abortInLeafExecute() throws Exception { - MyLeaf child = spy(new MyLeaf(UniqueId.root("leaf", "leaf"))); - TestAbortedException anAbortedException = new TestAbortedException("in test"); + var child = spy(new MyLeaf(UniqueId.root("leaf", "leaf"))); + var anAbortedException = new TestAbortedException("in test"); when(child.execute(eq(rootContext), any())).thenThrow(anAbortedException); root.addChild(child); - InOrder inOrder = inOrder(listener, root, child); + var inOrder = inOrder(listener, root, child); executor.execute(); - ArgumentCaptor childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(listener).executionStarted(root); inOrder.verify(root).before(rootContext); inOrder.verify(listener).executionStarted(child); @@ -450,18 +447,18 @@ void abortInLeafExecute() throws Exception { @Test void executesDynamicTestDescriptors() throws Exception { - UniqueId leafUniqueId = UniqueId.root("leaf", "child leaf"); - MyLeaf child = spy(new MyLeaf(leafUniqueId)); - MyLeaf dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); + var leafUniqueId = UniqueId.root("leaf", "child leaf"); + var child = spy(new MyLeaf(leafUniqueId)); + var dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); when(child.execute(any(), any())).thenAnswer(execute(dynamicTestDescriptor)); root.addChild(child); - InOrder inOrder = inOrder(listener, root, child, dynamicTestDescriptor); + var inOrder = inOrder(listener, root, child, dynamicTestDescriptor); executor.execute(); - ArgumentCaptor aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(listener).executionStarted(root); inOrder.verify(child).prepare(rootContext); inOrder.verify(child).shouldBeSkipped(rootContext); @@ -483,11 +480,10 @@ void executesDynamicTestDescriptors() throws Exception { @Test void executesDynamicTestDescriptorsUsingContainerAndTestType() throws Exception { - MyContainerAndTestTestCase child = spy( - new MyContainerAndTestTestCase(root.getUniqueId().append("c&t", "child"))); - MyContainerAndTestTestCase dynamicContainerAndTest = spy( + var child = spy(new MyContainerAndTestTestCase(root.getUniqueId().append("c&t", "child"))); + var dynamicContainerAndTest = spy( new MyContainerAndTestTestCase(child.getUniqueId().append("c&t", "dynamicContainerAndTest"))); - MyLeaf dynamicLeaf = spy(new MyLeaf(dynamicContainerAndTest.getUniqueId().append("test", "dynamicLeaf"))); + var dynamicLeaf = spy(new MyLeaf(dynamicContainerAndTest.getUniqueId().append("test", "dynamicLeaf"))); root.addChild(child); when(child.execute(any(), any())).thenAnswer(execute(dynamicContainerAndTest)); @@ -496,11 +492,11 @@ void executesDynamicTestDescriptorsUsingContainerAndTestType() throws Exception throw new AssertionError("test fails"); }); - InOrder inOrder = inOrder(listener, root, child, dynamicContainerAndTest, dynamicLeaf); + var inOrder = inOrder(listener, root, child, dynamicContainerAndTest, dynamicLeaf); executor.execute(); - ArgumentCaptor aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(listener).executionStarted(root); inOrder.verify(child).prepare(rootContext); @@ -532,18 +528,18 @@ void executesDynamicTestDescriptorsUsingContainerAndTestType() throws Exception @Test void executesDynamicTestDescriptorsWithCustomListener() { - UniqueId leafUniqueId = UniqueId.root("leaf", "child leaf"); - MyLeaf child = spy(new MyLeaf(leafUniqueId)); - MyLeaf dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); + var leafUniqueId = UniqueId.root("leaf", "child leaf"); + var child = spy(new MyLeaf(leafUniqueId)); + var dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); root.addChild(child); - EngineExecutionListener anotherListener = mock(EngineExecutionListener.class); + var anotherListener = mock(EngineExecutionListener.class); when(child.execute(any(), any())).thenAnswer( useDynamicTestExecutor(executor -> executor.execute(dynamicTestDescriptor, anotherListener))); executor.execute(); - InOrder inOrder = inOrder(listener, anotherListener, root, child, dynamicTestDescriptor); + var inOrder = inOrder(listener, anotherListener, root, child, dynamicTestDescriptor); inOrder.verify(anotherListener).dynamicTestRegistered(dynamicTestDescriptor); inOrder.verify(anotherListener).executionStarted(dynamicTestDescriptor); inOrder.verify(dynamicTestDescriptor).execute(eq(rootContext), any()); @@ -554,16 +550,16 @@ void executesDynamicTestDescriptorsWithCustomListener() { @Test void canAbortExecutionOfDynamicChild() throws Exception { - UniqueId leafUniqueId = UniqueId.root("leaf", "child leaf"); - MyLeaf child = spy(new MyLeaf(leafUniqueId)); - MyLeaf dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); + var leafUniqueId = UniqueId.root("leaf", "child leaf"); + var child = spy(new MyLeaf(leafUniqueId)); + var dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); root.addChild(child); var startedLatch = new CountDownLatch(1); var interrupted = new CompletableFuture(); when(child.execute(any(), any())).thenAnswer(useDynamicTestExecutor(executor -> { - Future future = executor.execute(dynamicTestDescriptor, EngineExecutionListener.NOOP); + var future = executor.execute(dynamicTestDescriptor, EngineExecutionListener.NOOP); startedLatch.await(); future.cancel(true); executor.awaitFinished(); @@ -581,7 +577,7 @@ void canAbortExecutionOfDynamicChild() throws Exception { } }); - ConfigurationParameters parameters = ConfigurationParametersFactoryForTests.create(Map.of(// + var parameters = ConfigurationParametersFactoryForTests.create(Map.of(// DefaultParallelExecutionConfigurationStrategy.CONFIG_STRATEGY_PROPERTY_NAME, "fixed", // DefaultParallelExecutionConfigurationStrategy.CONFIG_FIXED_PARALLELISM_PROPERTY_NAME, "2")); @@ -610,8 +606,8 @@ private Answer useDynamicTestExecutor(ThrowingConsumer childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(child).execute(eq(rootContext), any()); inOrder.verify(child).after(eq(rootContext)); inOrder.verify(listener).executionFinished(eq(child), childExecutionResult.capture()); @@ -660,9 +656,9 @@ void exceptionInAfterDoesNotHideEarlierException() throws Exception { @Test void dynamicTestDescriptorsMustNotDeclareExclusiveResources() { - UniqueId leafUniqueId = UniqueId.root("leaf", "child leaf"); - MyLeaf child = spy(new MyLeaf(leafUniqueId)); - MyLeaf dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); + var leafUniqueId = UniqueId.root("leaf", "child leaf"); + var child = spy(new MyLeaf(leafUniqueId)); + var dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); when(dynamicTestDescriptor.getExclusiveResources()).thenReturn( singleton(new ExclusiveResource("foo", LockMode.READ))); @@ -671,11 +667,11 @@ void dynamicTestDescriptorsMustNotDeclareExclusiveResources() { executor.execute(); - ArgumentCaptor aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var aTestExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); verify(listener).executionStarted(dynamicTestDescriptor); verify(listener).executionFinished(eq(dynamicTestDescriptor), aTestExecutionResult.capture()); - TestExecutionResult executionResult = aTestExecutionResult.getValue(); + var executionResult = aTestExecutionResult.getValue(); assertThat(executionResult.getStatus()).isEqualTo(FAILED); assertThat(executionResult.getThrowable()).isPresent(); assertThat(executionResult.getThrowable().get()).hasMessageContaining( @@ -685,18 +681,18 @@ void dynamicTestDescriptorsMustNotDeclareExclusiveResources() { @Test void exceptionInAfterIsReportedInsteadOfEarlierTestAbortedException() throws Exception { - MyLeaf child = spy(new MyLeaf(UniqueId.root("leaf", "leaf"))); + var child = spy(new MyLeaf(UniqueId.root("leaf", "leaf"))); Exception exceptionInExecute = new TestAbortedException("execute"); Exception exceptionInAfter = new RuntimeException("after"); doThrow(exceptionInExecute).when(child).execute(eq(rootContext), any()); doThrow(exceptionInAfter).when(child).after(eq(rootContext)); root.addChild(child); - InOrder inOrder = inOrder(listener, child); + var inOrder = inOrder(listener, child); executor.execute(); - ArgumentCaptor childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); + var childExecutionResult = ArgumentCaptor.forClass(TestExecutionResult.class); inOrder.verify(child).execute(eq(rootContext), any()); inOrder.verify(child).after(eq(rootContext)); inOrder.verify(listener).executionFinished(eq(child), childExecutionResult.capture()); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java index 061a3945a072..25e359e2ed0d 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java @@ -40,7 +40,7 @@ class LockManagerTests { void returnsNopLockWithoutExclusiveResources() { Collection resources = emptySet(); - List locks = getLocks(resources, NopLock.class); + var locks = getLocks(resources, NopLock.class); assertThat(locks).isEmpty(); } @@ -49,7 +49,7 @@ void returnsNopLockWithoutExclusiveResources() { void returnsSingleLockForSingleExclusiveResource() { Collection resources = singleton(new ExclusiveResource("foo", READ)); - List locks = getLocks(resources, SingleLock.class); + var locks = getLocks(resources, SingleLock.class); assertThat(locks).hasSize(1); assertThat(locks.get(0)).isInstanceOf(ReadLock.class); @@ -61,7 +61,7 @@ void returnsCompositeLockForMultipleDifferentExclusiveResources() { new ExclusiveResource("a", READ), // new ExclusiveResource("b", READ_WRITE)); - List locks = getLocks(resources, CompositeLock.class); + var locks = getLocks(resources, CompositeLock.class); assertThat(locks).hasSize(2); assertThat(locks.get(0)).isInstanceOf(ReadLock.class); @@ -72,8 +72,8 @@ void returnsCompositeLockForMultipleDifferentExclusiveResources() { void reusesSameLockForExclusiveResourceWithSameKey() { Collection resources = singleton(new ExclusiveResource("foo", READ)); - List locks1 = getLocks(resources, SingleLock.class); - List locks2 = getLocks(resources, SingleLock.class); + var locks1 = getLocks(resources, SingleLock.class); + var locks2 = getLocks(resources, SingleLock.class); assertThat(locks1).hasSize(1); assertThat(locks2).hasSize(1); @@ -88,7 +88,7 @@ void returnsWriteLockForExclusiveResourceWithBothLockModes() { new ExclusiveResource("foo", READ_WRITE), // new ExclusiveResource("bar", READ_WRITE)); - List locks = getLocks(resources, CompositeLock.class); + var locks = getLocks(resources, CompositeLock.class); assertThat(locks).hasSize(2); assertThat(locks.get(0)).isInstanceOf(WriteLock.class); @@ -104,7 +104,7 @@ void globalLockComesFirst(LockMode globalLockMode) { new ExclusiveResource(GLOBAL_KEY, globalLockMode), // new ExclusiveResource("bar", READ_WRITE)); - List locks = getLocks(resources, CompositeLock.class); + var locks = getLocks(resources, CompositeLock.class); assertThat(locks).hasSize(4); assertThat(locks.get(0)).isEqualTo(getSingleLock(GLOBAL_KEY, globalLockMode)); @@ -118,7 +118,7 @@ private Lock getSingleLock(String globalResourceLockKey, LockMode read) { } private List getLocks(Collection resources, Class type) { - ResourceLock lock = lockManager.getLockForResources(resources); + var lock = lockManager.getLockForResources(resources); assertThat(lock).isInstanceOf(type); return ResourceLockSupport.getLocks(lock); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java index 0b89ce795271..63ad8e7a60aa 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java @@ -20,7 +20,6 @@ import static org.junit.platform.engine.support.hierarchical.Node.ExecutionMode.SAME_THREAD; import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; -import java.util.Iterator; import java.util.List; import java.util.concurrent.locks.Lock; import java.util.function.Function; @@ -31,7 +30,6 @@ import org.junit.jupiter.engine.JupiterTestEngine; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.UniqueId; -import org.junit.platform.launcher.LauncherDiscoveryRequest; /** * @since 1.3 @@ -43,65 +41,65 @@ class NodeTreeWalkerIntegrationTests { @Test void pullUpExclusiveChildResourcesToTestClass() { - TestDescriptor engineDescriptor = discover(TestCaseWithResourceLock.class); + var engineDescriptor = discover(TestCaseWithResourceLock.class); - NodeExecutionAdvisor advisor = nodeTreeWalker.walk(engineDescriptor); + var advisor = nodeTreeWalker.walk(engineDescriptor); - TestDescriptor testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // .isEqualTo(List.of(getReadWriteLock("a"), getReadWriteLock("b"))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); - TestDescriptor testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()).isEqualTo(emptyList()); assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).contains(SAME_THREAD); } @Test void leavesResourceLockOnTestMethodWhenClassDoesNotUseResource() { - TestDescriptor engineDescriptor = discover(TestCaseWithoutResourceLock.class); + var engineDescriptor = discover(TestCaseWithoutResourceLock.class); - NodeExecutionAdvisor advisor = nodeTreeWalker.walk(engineDescriptor); + var advisor = nodeTreeWalker.walk(engineDescriptor); - TestDescriptor testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // .isEqualTo(List.of(getLock(GLOBAL_READ))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); assertThat(testClassDescriptor.getChildren()).hasSize(2); - Iterator children = testClassDescriptor.getChildren().iterator(); - TestDescriptor testMethodDescriptor = children.next(); + var children = testClassDescriptor.getChildren().iterator(); + var testMethodDescriptor = children.next(); assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()) // .isEqualTo(List.of(getReadWriteLock("a"))); assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).isEmpty(); - TestDescriptor nestedTestClassDescriptor = children.next(); + var nestedTestClassDescriptor = children.next(); assertThat(advisor.getResourceLock(nestedTestClassDescriptor)).extracting(allLocks()) // .isEqualTo(List.of(getReadWriteLock("b"), getReadWriteLock("c"))); assertThat(advisor.getForcedExecutionMode(nestedTestClassDescriptor)).isEmpty(); - TestDescriptor nestedTestMethodDescriptor = getOnlyElement(nestedTestClassDescriptor.getChildren()); + var nestedTestMethodDescriptor = getOnlyElement(nestedTestClassDescriptor.getChildren()); assertThat(advisor.getResourceLock(nestedTestMethodDescriptor)).extracting(allLocks()).isEqualTo(emptyList()); assertThat(advisor.getForcedExecutionMode(nestedTestMethodDescriptor)).contains(SAME_THREAD); } @Test void coarsensGlobalLockToEngineDescriptorChild() { - TestDescriptor engineDescriptor = discover(TestCaseWithGlobalLockRequiringChild.class); + var engineDescriptor = discover(TestCaseWithGlobalLockRequiringChild.class); - NodeExecutionAdvisor advisor = nodeTreeWalker.walk(engineDescriptor); + var advisor = nodeTreeWalker.walk(engineDescriptor); - TestDescriptor testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // .isEqualTo(List.of(getLock(GLOBAL_READ_WRITE))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); - TestDescriptor nestedTestClassDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + var nestedTestClassDescriptor = getOnlyElement(testClassDescriptor.getChildren()); assertThat(advisor.getResourceLock(nestedTestClassDescriptor)).extracting(allLocks()) // .isEqualTo(List.of(getLock(GLOBAL_READ))); assertThat(advisor.getForcedExecutionMode(nestedTestClassDescriptor)).contains(SAME_THREAD); - TestDescriptor testMethodDescriptor = getOnlyElement(nestedTestClassDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(nestedTestClassDescriptor.getChildren()); assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()) // .isEqualTo(List.of(getLock(GLOBAL_READ_WRITE))); assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).contains(SAME_THREAD); @@ -120,7 +118,7 @@ private Lock getLock(ExclusiveResource exclusiveResource) { } private TestDescriptor discover(Class testClass) { - LauncherDiscoveryRequest discoveryRequest = request().selectors(selectClass(testClass)).build(); + var discoveryRequest = request().selectors(selectClass(testClass)).build(); return new JupiterTestEngine().discover(discoveryRequest, UniqueId.forEngine("junit-jupiter")); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java index bbc550c649f5..c32d73105ee1 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java @@ -67,7 +67,6 @@ import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.engine.reporting.ReportEntry; -import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.testkit.engine.EngineExecutionResults; import org.junit.platform.testkit.engine.EngineTestKit; import org.junit.platform.testkit.engine.Event; @@ -79,10 +78,10 @@ class ParallelExecutionIntegrationTests { @Test void successfulParallelTest(TestReporter reporter) { - List events = executeConcurrently(3, SuccessfulParallelTestCase.class); + var events = executeConcurrently(3, SuccessfulParallelTestCase.class); - List startedTimestamps = getTimestampsFor(events, event(test(), started())); - List finishedTimestamps = getTimestampsFor(events, event(test(), finishedSuccessfully())); + var startedTimestamps = getTimestampsFor(events, event(test(), started())); + var finishedTimestamps = getTimestampsFor(events, event(test(), finishedSuccessfully())); reporter.publishEntry("startedTimestamps", startedTimestamps.toString()); reporter.publishEntry("finishedTimestamps", finishedTimestamps.toString()); @@ -95,13 +94,13 @@ void successfulParallelTest(TestReporter reporter) { @Test void failingTestWithoutLock() { - List events = executeConcurrently(3, FailingWithoutLockTestCase.class); + var events = executeConcurrently(3, FailingWithoutLockTestCase.class); assertThat(events.stream().filter(event(test(), finishedWithFailure())::matches)).hasSize(2); } @Test void successfulTestWithMethodLock() { - List events = executeConcurrently(3, SuccessfulWithMethodLockTestCase.class); + var events = executeConcurrently(3, SuccessfulWithMethodLockTestCase.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(3); assertThat(ThreadReporter.getThreadNames(events)).hasSize(3); @@ -109,7 +108,7 @@ void successfulTestWithMethodLock() { @Test void successfulTestWithClassLock() { - List events = executeConcurrently(3, SuccessfulWithClassLockTestCase.class); + var events = executeConcurrently(3, SuccessfulWithClassLockTestCase.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(3); assertThat(ThreadReporter.getThreadNames(events)).hasSize(1); @@ -117,7 +116,7 @@ void successfulTestWithClassLock() { @Test void testCaseWithFactory() { - List events = executeConcurrently(3, TestCaseWithTestFactory.class); + var events = executeConcurrently(3, TestCaseWithTestFactory.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(3); assertThat(ThreadReporter.getThreadNames(events)).hasSize(1); @@ -143,7 +142,7 @@ void customContextClassLoader() { @RepeatedTest(10) void mixingClassAndMethodLevelLocks() { - List events = executeConcurrently(4, TestCaseWithSortedLocks.class, TestCaseWithUnsortedLocks.class); + var events = executeConcurrently(4, TestCaseWithSortedLocks.class, TestCaseWithUnsortedLocks.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(6); assertThat(ThreadReporter.getThreadNames(events).count()).isLessThanOrEqualTo(2); @@ -151,7 +150,7 @@ void mixingClassAndMethodLevelLocks() { @RepeatedTest(10) void locksOnNestedTests() { - List events = executeConcurrently(3, TestCaseWithNestedLocks.class); + var events = executeConcurrently(3, TestCaseWithNestedLocks.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(6); assertThat(ThreadReporter.getThreadNames(events)).hasSize(1); @@ -159,10 +158,10 @@ void locksOnNestedTests() { @Test void afterHooksAreCalledAfterConcurrentDynamicTestsAreFinished() { - List events = executeConcurrently(3, ConcurrentDynamicTestCase.class); + var events = executeConcurrently(3, ConcurrentDynamicTestCase.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(1); - Map timestampedEvents = ConcurrentDynamicTestCase.events; + var timestampedEvents = ConcurrentDynamicTestCase.events; assertThat(timestampedEvents.get("afterEach")).isAfterOrEqualTo(timestampedEvents.get("dynamicTestFinished")); } @@ -172,14 +171,14 @@ void afterHooksAreCalledAfterConcurrentDynamicTestsAreFinished() { */ @Test void threadInterruptedByUserCode() { - List events = executeConcurrently(3, InterruptedThreadTestCase.class); + var events = executeConcurrently(3, InterruptedThreadTestCase.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(4); } @Test void executesTestTemplatesWithResourceLocksInSameThread() { - List events = executeConcurrently(2, ConcurrentTemplateTestCase.class); + var events = executeConcurrently(2, ConcurrentTemplateTestCase.class); assertThat(events.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(10); assertThat(ThreadReporter.getThreadNames(events)).hasSize(1); @@ -195,11 +194,11 @@ void executesClassesInParallelIfEnabledViaConfigurationParameter() { results.testEvents().assertStatistics(stats -> stats.succeeded(9)); assertThat(ThreadReporter.getThreadNames(results.allEvents().list())).hasSize(3); - TestDescriptor testClassA = findFirstTestDescriptor(results, container(ParallelClassesTestCaseA.class)); + var testClassA = findFirstTestDescriptor(results, container(ParallelClassesTestCaseA.class)); assertThat(ThreadReporter.getThreadNames(getEventsOfChildren(results, testClassA))).hasSize(1); - TestDescriptor testClassB = findFirstTestDescriptor(results, container(ParallelClassesTestCaseB.class)); + var testClassB = findFirstTestDescriptor(results, container(ParallelClassesTestCaseB.class)); assertThat(ThreadReporter.getThreadNames(getEventsOfChildren(results, testClassB))).hasSize(1); - TestDescriptor testClassC = findFirstTestDescriptor(results, container(ParallelClassesTestCaseC.class)); + var testClassC = findFirstTestDescriptor(results, container(ParallelClassesTestCaseC.class)); assertThat(ThreadReporter.getThreadNames(getEventsOfChildren(results, testClassC))).hasSize(1); } @@ -215,11 +214,11 @@ void executesMethodsInParallelIfEnabledViaConfigurationParameter() { results.testEvents().assertStatistics(stats -> stats.succeeded(9)); assertThat(ThreadReporter.getThreadNames(results.allEvents().list())).hasSizeGreaterThanOrEqualTo(3); - TestDescriptor testClassA = findFirstTestDescriptor(results, container(ParallelMethodsTestCaseA.class)); + var testClassA = findFirstTestDescriptor(results, container(ParallelMethodsTestCaseA.class)); assertThat(ThreadReporter.getThreadNames(getEventsOfChildren(results, testClassA))).hasSize(3); - TestDescriptor testClassB = findFirstTestDescriptor(results, container(ParallelMethodsTestCaseB.class)); + var testClassB = findFirstTestDescriptor(results, container(ParallelMethodsTestCaseB.class)); assertThat(ThreadReporter.getThreadNames(getEventsOfChildren(results, testClassB))).hasSize(3); - TestDescriptor testClassC = findFirstTestDescriptor(results, container(ParallelMethodsTestCaseC.class)); + var testClassC = findFirstTestDescriptor(results, container(ParallelMethodsTestCaseC.class)); assertThat(ThreadReporter.getThreadNames(getEventsOfChildren(results, testClassC))).hasSize(3); } @@ -372,7 +371,7 @@ private List executeConcurrently(int parallelism, Class... testClasses private EngineExecutionResults executeWithFixedParallelism(int parallelism, Map configParams, Class... testClasses) { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .selectors(Arrays.stream(testClasses).map(DiscoverySelectors::selectClass).collect(toList())) .configurationParameter(PARALLEL_EXECUTION_ENABLED_PROPERTY_NAME, String.valueOf(true)) .configurationParameter(PARALLEL_CONFIG_STRATEGY_PROPERTY_NAME, "fixed") @@ -505,8 +504,8 @@ static class TestCaseWithTestFactory { @TestFactory @Execution(SAME_THREAD) Stream testFactory(TestReporter testReporter) { - AtomicInteger sharedResource = new AtomicInteger(0); - CountDownLatch countDownLatch = new CountDownLatch(3); + var sharedResource = new AtomicInteger(0); + var countDownLatch = new CountDownLatch(3); return IntStream.range(0, 3).mapToObj(i -> dynamicTest("test " + i, () -> { incrementBlockAndCheck(sharedResource, countDownLatch); testReporter.publishEntry("thread", Thread.currentThread().getName()); @@ -759,13 +758,13 @@ static class ParallelMethodsTestCaseC extends ParallelMethodsTestCase { private static void incrementBlockAndCheck(AtomicInteger sharedResource, CountDownLatch countDownLatch) throws InterruptedException { - int value = incrementAndBlock(sharedResource, countDownLatch); + var value = incrementAndBlock(sharedResource, countDownLatch); assertEquals(value, sharedResource.get()); } private static int incrementAndBlock(AtomicInteger sharedResource, CountDownLatch countDownLatch) throws InterruptedException { - int value = sharedResource.incrementAndGet(); + var value = sharedResource.incrementAndGet(); countDownLatch.countDown(); countDownLatch.await(100, MILLISECONDS); return value; @@ -773,7 +772,7 @@ private static int incrementAndBlock(AtomicInteger sharedResource, CountDownLatc private static void storeAndBlockAndCheck(AtomicInteger sharedResource, CountDownLatch countDownLatch) throws InterruptedException { - int value = sharedResource.get(); + var value = sharedResource.get(); countDownLatch.countDown(); countDownLatch.await(100, MILLISECONDS); assertEquals(value, sharedResource.get()); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java index 9db0402d8b8e..c0fa0b930cd3 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java @@ -25,7 +25,7 @@ class SingleLockTests { @Test @SuppressWarnings("resource") void acquire() throws Exception { - ReentrantLock lock = new ReentrantLock(); + var lock = new ReentrantLock(); new SingleLock(lock).acquire(); @@ -35,7 +35,7 @@ void acquire() throws Exception { @Test @SuppressWarnings("resource") void release() throws Exception { - ReentrantLock lock = new ReentrantLock(); + var lock = new ReentrantLock(); new SingleLock(lock).acquire().close(); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java index 5b83a311a426..6b9daa061f18 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java @@ -19,7 +19,6 @@ import java.util.Optional; import org.junit.jupiter.api.Test; -import org.junit.platform.engine.TestExecutionResult; import org.opentest4j.TestAbortedException; /** @@ -30,7 +29,7 @@ class SingleTestExecutorTests { @Test void executeSafelySuccessful() { - TestExecutionResult result = new SingleTestExecutor().executeSafely(() -> { + var result = new SingleTestExecutor().executeSafely(() -> { }); assertEquals(SUCCESSFUL, result.getStatus()); @@ -39,9 +38,9 @@ void executeSafelySuccessful() { @Test void executeSafelyAborted() { - TestAbortedException testAbortedException = new TestAbortedException("assumption violated"); + var testAbortedException = new TestAbortedException("assumption violated"); - TestExecutionResult result = new SingleTestExecutor().executeSafely(() -> { + var result = new SingleTestExecutor().executeSafely(() -> { throw testAbortedException; }); @@ -51,9 +50,9 @@ void executeSafelyAborted() { @Test void executeSafelyFailed() { - AssertionError assertionError = new AssertionError("assumption violated"); + var assertionError = new AssertionError("assumption violated"); - TestExecutionResult result = new SingleTestExecutor().executeSafely(() -> { + var result = new SingleTestExecutor().executeSafely(() -> { throw assertionError; }); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java index 7f80d6c5e004..a7b9e34c4b3c 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java @@ -19,7 +19,6 @@ import java.util.Optional; import org.junit.jupiter.api.Test; -import org.junit.platform.engine.TestExecutionResult; /** * @since 1.6 @@ -28,10 +27,10 @@ class ThrowableCollectorTests { @Test void successfulExecution() { - ThrowableCollector collector = new ThrowableCollector(x -> true); + var collector = new ThrowableCollector(x -> true); collector.execute(() -> { }); - TestExecutionResult result = collector.toTestExecutionResult(); + var result = collector.toTestExecutionResult(); assertEquals(SUCCESSFUL, result.getStatus()); assertEquals(Optional.empty(), result.getThrowable()); @@ -39,13 +38,13 @@ void successfulExecution() { @Test void abortedExecution() { - CustomAbort customAbort = new CustomAbort(); + var customAbort = new CustomAbort(); - ThrowableCollector collector = new ThrowableCollector(CustomAbort.class::isInstance); + var collector = new ThrowableCollector(CustomAbort.class::isInstance); collector.execute(() -> { throw customAbort; }); - TestExecutionResult result = collector.toTestExecutionResult(); + var result = collector.toTestExecutionResult(); assertEquals(ABORTED, result.getStatus()); assertSame(customAbort, result.getThrowable().get()); @@ -53,13 +52,13 @@ void abortedExecution() { @Test void failedExecution() { - AssertionError assertionError = new AssertionError("assertion violated"); + var assertionError = new AssertionError("assertion violated"); - ThrowableCollector collector = new ThrowableCollector(CustomAbort.class::isInstance); + var collector = new ThrowableCollector(CustomAbort.class::isInstance); collector.execute(() -> { throw assertionError; }); - TestExecutionResult result = collector.toTestExecutionResult(); + var result = collector.toTestExecutionResult(); assertEquals(FAILED, result.getStatus()); assertSame(assertionError, result.getThrowable().get()); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java index 66fe9ebdc2a2..1880936bbe20 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java @@ -61,8 +61,7 @@ void includeTagsWithInvalidSyntax() { } private void assertSyntaxViolationForIncludes(String tag) { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> includeTags(tag)); + var exception = assertThrows(PreconditionViolationException.class, () -> includeTags(tag)); assertThat(exception).hasMessageStartingWith("Unable to parse tag expression"); } @@ -79,8 +78,7 @@ void excludeTagsWithInvalidSyntax() { } private void assertSyntaxViolationForExcludes(String tag) { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> excludeTags(tag)); + var exception = assertThrows(PreconditionViolationException.class, () -> excludeTags(tag)); assertThat(exception).hasMessageStartingWith("Unable to parse tag expression"); } @@ -96,7 +94,7 @@ void includeSingleTagAndWhitespace() { @Test void includeMultipleTags() { - PostDiscoveryFilter filter = includeTags("tag1", " tag2 "); + var filter = includeTags("tag1", " tag2 "); assertTrue(filter.apply(classWithBothTags).included()); assertTrue(filter.apply(classWithTag1).included()); @@ -119,22 +117,22 @@ void excludeSingleTagAndWhitespace() { @Test void excludeMultipleTags() { - PostDiscoveryFilter filter = excludeTags("tag1", " tag2 "); + var filter = excludeTags("tag1", " tag2 "); - String exclusionReason = "excluded because tags match tag expression(s): [tag1,tag2]"; + var exclusionReason = "excluded because tags match tag expression(s): [tag1,tag2]"; assertExcluded(filter.apply(classWithTag1), exclusionReason); assertExcluded(filter.apply(classWithTag1AndSurroundingWhitespace), exclusionReason); assertExcluded(filter.apply(classWithBothTags), exclusionReason); assertExcluded(filter.apply(classWithTag2), exclusionReason); - String inclusionReason = "included because tags do not match expression(s): [tag1,tag2]"; + var inclusionReason = "included because tags do not match expression(s): [tag1,tag2]"; assertIncluded(filter.apply(classWithDifferentTags), inclusionReason); assertIncluded(filter.apply(classWithNoTags), inclusionReason); } @Test void rejectSingleUnparsableTagExpressions() { - String brokenTagExpression = "tag & "; + var brokenTagExpression = "tag & "; RuntimeException expected = assertThrows(PreconditionViolationException.class, () -> TagFilter.includeTags(brokenTagExpression)); assertThat(expected).hasMessageStartingWith("Unable to parse tag expression \"" + brokenTagExpression + "\""); @@ -142,31 +140,31 @@ void rejectSingleUnparsableTagExpressions() { @Test void rejectUnparsableTagExpressionFromArray() { - String brokenTagExpression = "tag & "; + var brokenTagExpression = "tag & "; RuntimeException expected = assertThrows(PreconditionViolationException.class, () -> TagFilter.excludeTags(brokenTagExpression, "foo", "bar")); assertThat(expected).hasMessageStartingWith("Unable to parse tag expression \"" + brokenTagExpression + "\""); } private void includeSingleTag(PostDiscoveryFilter filter) { - String inclusionReason = "included because tags match expression(s): [tag1]"; + var inclusionReason = "included because tags match expression(s): [tag1]"; assertIncluded(filter.apply(classWithTag1), inclusionReason); assertIncluded(filter.apply(classWithTag1AndSurroundingWhitespace), inclusionReason); assertIncluded(filter.apply(classWithBothTags), inclusionReason); - String exclusionReason = "excluded because tags do not match tag expression(s): [tag1]"; + var exclusionReason = "excluded because tags do not match tag expression(s): [tag1]"; assertExcluded(filter.apply(classWithTag2), exclusionReason); assertExcluded(filter.apply(classWithDifferentTags), exclusionReason); assertExcluded(filter.apply(classWithNoTags), exclusionReason); } private void excludeSingleTag(PostDiscoveryFilter filter) { - String exclusionReason = "excluded because tags match tag expression(s): [tag1]"; + var exclusionReason = "excluded because tags match tag expression(s): [tag1]"; assertExcluded(filter.apply(classWithTag1), exclusionReason); assertExcluded(filter.apply(classWithTag1AndSurroundingWhitespace), exclusionReason); assertExcluded(filter.apply(classWithBothTags), exclusionReason); - String inclusionReason = "included because tags do not match expression(s): [tag1]"; + var inclusionReason = "included because tags do not match expression(s): [tag1]"; assertIncluded(filter.apply(classWithTag2), inclusionReason); assertIncluded(filter.apply(classWithDifferentTags), inclusionReason); assertIncluded(filter.apply(classWithNoTags), inclusionReason); @@ -221,7 +219,7 @@ private static class ClassWithNoTags { } private static TestDescriptor classTestDescriptor(String uniqueId, Class testClass) { - UniqueId rootUniqueId = UniqueId.root("class", uniqueId); + var rootUniqueId = UniqueId.root("class", uniqueId); return new DemoClassTestDescriptor(rootUniqueId, testClass); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java index c2f94557452a..8eacd6eecf57 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java @@ -32,7 +32,7 @@ class TestIdentifierTests { @Test void inheritsIdAndNamesFromDescriptor() { TestDescriptor testDescriptor = new TestDescriptorStub(UniqueId.root("aType", "uniqueId"), "displayName"); - TestIdentifier testIdentifier = TestIdentifier.from(testDescriptor); + var testIdentifier = TestIdentifier.from(testDescriptor); assertEquals("[aType:uniqueId]", testIdentifier.getUniqueId()); assertEquals("displayName", testIdentifier.getDisplayName()); @@ -41,7 +41,7 @@ void inheritsIdAndNamesFromDescriptor() { @Test void inheritsTypeFromDescriptor() { TestDescriptor descriptor = new TestDescriptorStub(UniqueId.root("aType", "uniqueId"), "displayName"); - TestIdentifier identifier = TestIdentifier.from(descriptor); + var identifier = TestIdentifier.from(descriptor); assertEquals(TestDescriptor.Type.TEST, identifier.getType()); assertTrue(identifier.isTest()); assertFalse(identifier.isContainer()); @@ -55,7 +55,7 @@ void inheritsTypeFromDescriptor() { @Test void serialization() throws Exception { - TestIdentifier identifier = serializeAndDeserialize(// + var identifier = serializeAndDeserialize(// new TestIdentifier("uniqueId", "displayName", ClassSource.from(TestIdentifierTests.class), singleton(TestTag.create("aTag")), TestDescriptor.Type.TEST, "parentId", "reportingName")); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java index 0284ee93ccd6..33844ba6ceb0 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java @@ -32,7 +32,7 @@ public Type getType() { } }); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); assertThat(testPlan.containsTests()).as("contains tests").isFalse(); } @@ -47,7 +47,7 @@ public Type getType() { } }); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); assertThat(testPlan.containsTests()).as("contains tests").isTrue(); } @@ -67,7 +67,7 @@ public boolean mayRegisterTests() { } }); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); assertThat(testPlan.containsTests()).as("contains tests").isTrue(); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java index 8730fce6b667..c2941901e504 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java @@ -17,7 +17,7 @@ public class TestPostDiscoveryTagFilter implements PostDiscoveryFilter { @Override public FilterResult apply(final TestDescriptor object) { - boolean include = object.getTags().stream().map(TestTag::getName).anyMatch("test-post-discovery"::equals); + var include = object.getTags().stream().map(TestTag::getName).anyMatch("test-post-discovery"::equals); return FilterResult.includedIf(include); } } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java index 5a1f49960103..282faaa595a9 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java @@ -33,8 +33,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import java.lang.reflect.Constructor; -import java.util.Optional; import java.util.logging.Level; import java.util.logging.LogRecord; @@ -46,9 +44,7 @@ import org.junit.platform.commons.PreconditionViolationException; import org.junit.platform.commons.logging.LogRecordListener; import org.junit.platform.commons.util.ExceptionUtils; -import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.EngineDiscoveryRequest; -import org.junit.platform.engine.EngineExecutionListener; import org.junit.platform.engine.ExecutionRequest; import org.junit.platform.engine.FilterResult; import org.junit.platform.engine.TestDescriptor; @@ -56,13 +52,11 @@ import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.support.descriptor.EngineDescriptor; -import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestDescriptor; import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine; import org.junit.platform.fakes.TestDescriptorStub; import org.junit.platform.fakes.TestEngineSpy; import org.junit.platform.fakes.TestEngineStub; import org.junit.platform.launcher.EngineDiscoveryResult; -import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.PostDiscoveryFilterStub; @@ -71,7 +65,6 @@ import org.junit.platform.launcher.TestPlan; import org.junit.platform.launcher.listeners.SummaryGeneratingListener; import org.mockito.ArgumentCaptor; -import org.mockito.InOrder; /** * @since 1.0 @@ -94,7 +87,7 @@ void constructLauncherWithoutAnyEngines() { @Test void constructLauncherWithMultipleTestEnginesWithDuplicateIds() { - JUnitException exception = assertThrows(JUnitException.class, + var exception = assertThrows(JUnitException.class, () -> createLauncher(new DemoHierarchicalTestEngine("dummy id"), new DemoHierarchicalTestEngine("dummy id"))); @@ -105,7 +98,7 @@ void constructLauncherWithMultipleTestEnginesWithDuplicateIds() { void registerTestExecutionListenersWithNullArray() { var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> launcher.registerTestExecutionListeners((TestExecutionListener[]) null)); assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); @@ -115,8 +108,7 @@ void registerTestExecutionListenersWithNullArray() { void registerTestExecutionListenersWithEmptyArray() { var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - launcher::registerTestExecutionListeners); + var exception = assertThrows(PreconditionViolationException.class, launcher::registerTestExecutionListeners); assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); } @@ -125,7 +117,7 @@ void registerTestExecutionListenersWithEmptyArray() { void registerTestExecutionListenersWithArrayContainingNullElements() { var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> launcher.registerTestExecutionListeners(new TestExecutionListener[] { null })); assertThat(exception).hasMessageContaining("individual listeners must not be null"); @@ -133,9 +125,9 @@ void registerTestExecutionListenersWithArrayContainingNullElements() { @Test void discoverEmptyTestPlanWithEngineWithoutAnyTests() { - Launcher launcher = createLauncher(new DemoHierarchicalTestEngine()); + var launcher = createLauncher(new DemoHierarchicalTestEngine()); - TestPlan testPlan = launcher.discover(request().build()); + var testPlan = launcher.discover(request().build()); assertThat(testPlan.getRoots()).hasSize(1); } @@ -167,7 +159,7 @@ void discoverErrorTestDescriptorForEngineThatThrowsInDiscoveryPhase(Class constructor = throwableClass.getDeclaredConstructor(String.class); + var constructor = throwableClass.getDeclaredConstructor(String.class); throw ExceptionUtils.throwAsUncheckedException(constructor.newInstance("ignored")); } catch (Exception ignored) { @@ -201,7 +193,7 @@ public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId private void assertDiscoveryFailed(TestEngine testEngine, LauncherDiscoveryListener discoveryListener) { var engineId = testEngine.getId(); - ArgumentCaptor failureCaptor = ArgumentCaptor.forClass(EngineDiscoveryResult.class); + var failureCaptor = ArgumentCaptor.forClass(EngineDiscoveryResult.class); verify(discoveryListener).engineDiscoveryFinished(eq(UniqueId.forEngine(engineId)), failureCaptor.capture()); var result = failureCaptor.getValue(); assertThat(result.getStatus()).isEqualTo(EngineDiscoveryResult.Status.FAILED); @@ -373,30 +365,30 @@ public void execute(ExecutionRequest request) { @Test void discoverTestPlanForSingleEngine() { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("myEngine"); + var engine = new DemoHierarchicalTestEngine("myEngine"); engine.addTest("test1", noOp); engine.addTest("test2", noOp); var launcher = createLauncher(engine); - TestPlan testPlan = launcher.discover(request().selectors(selectPackage("any")).build()); + var testPlan = launcher.discover(request().selectors(selectPackage("any")).build()); assertThat(testPlan.getRoots()).hasSize(1); - TestIdentifier rootIdentifier = testPlan.getRoots().iterator().next(); + var rootIdentifier = testPlan.getRoots().iterator().next(); assertThat(testPlan.getChildren(rootIdentifier.getUniqueId())).hasSize(2); assertThat(testPlan.getChildren("[engine:myEngine]")).hasSize(2); } @Test void discoverTestPlanForMultipleEngines() { - DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("engine1"); + var firstEngine = new DemoHierarchicalTestEngine("engine1"); TestDescriptor test1 = firstEngine.addTest("test1", noOp); - DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("engine2"); + var secondEngine = new DemoHierarchicalTestEngine("engine2"); TestDescriptor test2 = secondEngine.addTest("test2", noOp); var launcher = createLauncher(firstEngine, secondEngine); - TestPlan testPlan = launcher.discover( + var testPlan = launcher.discover( request().selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId())).build()); assertThat(testPlan.getRoots()).hasSize(2); @@ -406,15 +398,15 @@ void discoverTestPlanForMultipleEngines() { @Test void launcherWillNotExecuteEnginesIfNotIncludedByAnEngineFilter() { - DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("first"); + var firstEngine = new DemoHierarchicalTestEngine("first"); TestDescriptor test1 = firstEngine.addTest("test1", noOp); - DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("second"); + var secondEngine = new DemoHierarchicalTestEngine("second"); TestDescriptor test2 = secondEngine.addTest("test2", noOp); var launcher = createLauncher(firstEngine, secondEngine); // @formatter:off - TestPlan testPlan = launcher.discover( + var testPlan = launcher.discover( request() .selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId())) .filters(includeEngines("first")) @@ -422,22 +414,22 @@ void launcherWillNotExecuteEnginesIfNotIncludedByAnEngineFilter() { // @formatter:on assertThat(testPlan.getRoots()).hasSize(1); - TestIdentifier rootIdentifier = testPlan.getRoots().iterator().next(); + var rootIdentifier = testPlan.getRoots().iterator().next(); assertThat(testPlan.getChildren(rootIdentifier.getUniqueId())).hasSize(1); assertThat(testPlan.getChildren(UniqueId.forEngine("first").toString())).hasSize(1); } @Test void launcherWillExecuteAllEnginesExplicitlyIncludedViaSingleEngineFilter() { - DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("first"); + var firstEngine = new DemoHierarchicalTestEngine("first"); TestDescriptor test1 = firstEngine.addTest("test1", noOp); - DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("second"); + var secondEngine = new DemoHierarchicalTestEngine("second"); TestDescriptor test2 = secondEngine.addTest("test2", noOp); var launcher = createLauncher(firstEngine, secondEngine); // @formatter:off - TestPlan testPlan = launcher.discover( + var testPlan = launcher.discover( request() .selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId())) .filters(includeEngines("first", "second")) @@ -449,15 +441,15 @@ void launcherWillExecuteAllEnginesExplicitlyIncludedViaSingleEngineFilter() { @Test void launcherWillNotExecuteEnginesExplicitlyIncludedViaMultipleCompetingEngineFilters() { - DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("first"); + var firstEngine = new DemoHierarchicalTestEngine("first"); TestDescriptor test1 = firstEngine.addTest("test1", noOp); - DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("second"); + var secondEngine = new DemoHierarchicalTestEngine("second"); TestDescriptor test2 = secondEngine.addTest("test2", noOp); var launcher = createLauncher(firstEngine, secondEngine); // @formatter:off - TestPlan testPlan = launcher.discover( + var testPlan = launcher.discover( request() .selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId())) .filters(includeEngines("first"), includeEngines("second")) @@ -469,15 +461,15 @@ void launcherWillNotExecuteEnginesExplicitlyIncludedViaMultipleCompetingEngineFi @Test void launcherWillNotExecuteEnginesExplicitlyExcludedByAnEngineFilter() { - DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("first"); + var firstEngine = new DemoHierarchicalTestEngine("first"); TestDescriptor test1 = firstEngine.addTest("test1", noOp); - DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("second"); + var secondEngine = new DemoHierarchicalTestEngine("second"); TestDescriptor test2 = secondEngine.addTest("test2", noOp); var launcher = createLauncher(firstEngine, secondEngine); // @formatter:off - TestPlan testPlan = launcher.discover( + var testPlan = launcher.discover( request() .selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId())) .filters(excludeEngines("second")) @@ -485,24 +477,24 @@ void launcherWillNotExecuteEnginesExplicitlyExcludedByAnEngineFilter() { // @formatter:on assertThat(testPlan.getRoots()).hasSize(1); - TestIdentifier rootIdentifier = testPlan.getRoots().iterator().next(); + var rootIdentifier = testPlan.getRoots().iterator().next(); assertThat(testPlan.getChildren(rootIdentifier.getUniqueId())).hasSize(1); assertThat(testPlan.getChildren(UniqueId.forEngine("first").toString())).hasSize(1); } @Test void launcherWillExecuteEnginesHonoringBothIncludeAndExcludeEngineFilters() { - DemoHierarchicalTestEngine firstEngine = new DemoHierarchicalTestEngine("first"); + var firstEngine = new DemoHierarchicalTestEngine("first"); TestDescriptor test1 = firstEngine.addTest("test1", noOp); - DemoHierarchicalTestEngine secondEngine = new DemoHierarchicalTestEngine("second"); + var secondEngine = new DemoHierarchicalTestEngine("second"); TestDescriptor test2 = secondEngine.addTest("test2", noOp); - DemoHierarchicalTestEngine thirdEngine = new DemoHierarchicalTestEngine("third"); + var thirdEngine = new DemoHierarchicalTestEngine("third"); TestDescriptor test3 = thirdEngine.addTest("test3", noOp); var launcher = createLauncher(firstEngine, secondEngine, thirdEngine); // @formatter:off - TestPlan testPlan = launcher.discover( + var testPlan = launcher.discover( request() .selectors(selectUniqueId(test1.getUniqueId()), selectUniqueId(test2.getUniqueId()), selectUniqueId(test3.getUniqueId())) .filters(includeEngines("first", "second"), excludeEngines("second")) @@ -510,15 +502,15 @@ void launcherWillExecuteEnginesHonoringBothIncludeAndExcludeEngineFilters() { // @formatter:on assertThat(testPlan.getRoots()).hasSize(1); - TestIdentifier rootIdentifier = testPlan.getRoots().iterator().next(); + var rootIdentifier = testPlan.getRoots().iterator().next(); assertThat(testPlan.getChildren(rootIdentifier.getUniqueId())).hasSize(1); assertThat(testPlan.getChildren(UniqueId.forEngine("first").toString())).hasSize(1); } @Test void launcherAppliesPostDiscoveryFilters() { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("myEngine"); - DemoHierarchicalTestDescriptor test1 = engine.addTest("test1", noOp); + var engine = new DemoHierarchicalTestEngine("myEngine"); + var test1 = engine.addTest("test1", noOp); engine.addTest("test2", noOp); var launcher = createLauncher(engine); @@ -529,7 +521,7 @@ void launcherAppliesPostDiscoveryFilters() { PostDiscoveryFilter includeWithUniqueIdContains1 = new PostDiscoveryFilterStub( descriptor -> FilterResult.includedIf(descriptor.getUniqueId().toString().contains("1")), () -> "filter2"); - TestPlan testPlan = launcher.discover( // + var testPlan = launcher.discover( // request() // .selectors(selectPackage("any")) // .filters(includeWithUniqueIdContainsTest, includeWithUniqueIdContains1) // @@ -541,24 +533,24 @@ void launcherAppliesPostDiscoveryFilters() { @Test void withoutConfigurationParameters_LauncherPassesEmptyConfigurationParametersIntoTheExecutionRequest() { - TestEngineSpy engine = new TestEngineSpy(); + var engine = new TestEngineSpy(); var launcher = createLauncher(engine); launcher.execute(request().build()); - ConfigurationParameters configurationParameters = engine.requestForExecution.getConfigurationParameters(); + var configurationParameters = engine.requestForExecution.getConfigurationParameters(); assertThat(configurationParameters.get("key").isPresent()).isFalse(); assertThat(configurationParameters.size()).isEqualTo(0); } @Test void withConfigurationParameters_LauncherPassesPopulatedConfigurationParametersIntoTheExecutionRequest() { - TestEngineSpy engine = new TestEngineSpy(); + var engine = new TestEngineSpy(); var launcher = createLauncher(engine); launcher.execute(request().configurationParameter("key", "value").build()); - ConfigurationParameters configurationParameters = engine.requestForExecution.getConfigurationParameters(); + var configurationParameters = engine.requestForExecution.getConfigurationParameters(); assertThat(configurationParameters.size()).isEqualTo(1); assertThat(configurationParameters.get("key").isPresent()).isTrue(); assertThat(configurationParameters.get("key").get()).isEqualTo("value"); @@ -569,14 +561,14 @@ void withoutConfigurationParameters_LookupFallsBackToSystemProperty() { System.setProperty(FOO, BAR); try { - TestEngineSpy engine = new TestEngineSpy(); + var engine = new TestEngineSpy(); var launcher = createLauncher(engine); launcher.execute(request().build()); - ConfigurationParameters configurationParameters = engine.requestForExecution.getConfigurationParameters(); + var configurationParameters = engine.requestForExecution.getConfigurationParameters(); assertThat(configurationParameters.size()).isEqualTo(0); - Optional optionalFoo = configurationParameters.get(FOO); + var optionalFoo = configurationParameters.get(FOO); assertTrue(optionalFoo.isPresent(), "foo should have been picked up via system property"); assertEquals(BAR, optionalFoo.get(), "foo property"); } @@ -587,8 +579,8 @@ void withoutConfigurationParameters_LookupFallsBackToSystemProperty() { @Test void withAdditionalListener() { - TestEngineSpy engine = new TestEngineSpy(); - SummaryGeneratingListener listener = new SummaryGeneratingListener(); + var engine = new TestEngineSpy(); + var listener = new SummaryGeneratingListener(); var launcher = createLauncher(engine); launcher.execute(request().build(), listener); @@ -600,14 +592,13 @@ void withAdditionalListener() { @Test void prunesTestDescriptorsAfterApplyingPostDiscoveryFilters() { - TestEngineSpy engine = new TestEngineSpy() { + var engine = new TestEngineSpy() { @Override public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) { super.discover(discoveryRequest, uniqueId); - TestDescriptorStub engineDescriptor = new TestDescriptorStub(uniqueId, uniqueId.toString()); - TestDescriptorStub containerDescriptor = new TestDescriptorStub(uniqueId.append("container", "a"), - "container") { + var engineDescriptor = new TestDescriptorStub(uniqueId, uniqueId.toString()); + var containerDescriptor = new TestDescriptorStub(uniqueId.append("container", "a"), "container") { @Override public Type getType() { @@ -622,26 +613,26 @@ public Type getType() { }; var launcher = createLauncher(engine); - TestPlan testPlan = launcher.discover(request().filters( + var testPlan = launcher.discover(request().filters( (PostDiscoveryFilter) testDescriptor -> FilterResult.includedIf(testDescriptor.isContainer())).build()); assertThat(testPlan.getRoots()).hasSize(1); - TestIdentifier engineIdentifier = getOnlyElement(testPlan.getRoots()); + var engineIdentifier = getOnlyElement(testPlan.getRoots()); assertThat(testPlan.getChildren(engineIdentifier)).isEmpty(); } @Test void reportsDynamicTestDescriptorsCorrectly() { - UniqueId engineId = UniqueId.forEngine(TestEngineSpy.ID); - UniqueId containerAndTestId = engineId.append("c&t", "c&t"); - UniqueId dynamicTestId = containerAndTestId.append("test", "test"); + var engineId = UniqueId.forEngine(TestEngineSpy.ID); + var containerAndTestId = engineId.append("c&t", "c&t"); + var dynamicTestId = containerAndTestId.append("test", "test"); - TestEngineSpy engine = new TestEngineSpy() { + var engine = new TestEngineSpy() { @Override public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) { super.discover(discoveryRequest, uniqueId); - TestDescriptorStub engineDescriptor = new TestDescriptorStub(uniqueId, uniqueId.toString()); + var engineDescriptor = new TestDescriptorStub(uniqueId, uniqueId.toString()); engineDescriptor.addChild(new TestDescriptorStub(containerAndTestId, "c&t") { @Override @@ -655,13 +646,13 @@ public Type getType() { @Override public void execute(ExecutionRequest request) { super.execute(request); - EngineExecutionListener listener = request.getEngineExecutionListener(); + var listener = request.getEngineExecutionListener(); listener.executionStarted(request.getRootTestDescriptor()); - TestDescriptor containerAndTest = getOnlyElement(request.getRootTestDescriptor().getChildren()); + var containerAndTest = getOnlyElement(request.getRootTestDescriptor().getChildren()); listener.executionStarted(containerAndTest); - TestDescriptorStub dynamicTest = new TestDescriptorStub(dynamicTestId, "test"); + var dynamicTest = new TestDescriptorStub(dynamicTestId, "test"); dynamicTest.setParent(containerAndTest); listener.dynamicTestRegistered(dynamicTest); listener.executionStarted(dynamicTest); @@ -673,17 +664,17 @@ public void execute(ExecutionRequest request) { }; var launcher = createLauncher(engine); - TestExecutionListener listener = mock(TestExecutionListener.class); + var listener = mock(TestExecutionListener.class); launcher.execute(request().build(), listener); - InOrder inOrder = inOrder(listener); - ArgumentCaptor testPlanArgumentCaptor = ArgumentCaptor.forClass(TestPlan.class); + var inOrder = inOrder(listener); + var testPlanArgumentCaptor = ArgumentCaptor.forClass(TestPlan.class); inOrder.verify(listener).testPlanExecutionStarted(testPlanArgumentCaptor.capture()); - TestPlan testPlan = testPlanArgumentCaptor.getValue(); - TestIdentifier engineTestIdentifier = testPlan.getTestIdentifier(engineId.toString()); - TestIdentifier containerAndTestIdentifier = testPlan.getTestIdentifier(containerAndTestId.toString()); - TestIdentifier dynamicTestIdentifier = testPlan.getTestIdentifier(dynamicTestId.toString()); + var testPlan = testPlanArgumentCaptor.getValue(); + var engineTestIdentifier = testPlan.getTestIdentifier(engineId.toString()); + var containerAndTestIdentifier = testPlan.getTestIdentifier(containerAndTestId.toString()); + var dynamicTestIdentifier = testPlan.getTestIdentifier(dynamicTestId.toString()); assertThat(engineTestIdentifier.getParentId()).isEmpty(); assertThat(containerAndTestIdentifier.getParentId()).contains(engineId.toString()); assertThat(dynamicTestIdentifier.getParentId()).contains(containerAndTestId.toString()); @@ -700,7 +691,7 @@ public void execute(ExecutionRequest request) { @Test void launcherCanExecuteTestPlanExactlyOnce() { - TestEngine engine = mock(TestEngine.class); + var engine = mock(TestEngine.class); when(engine.getId()).thenReturn("some-engine"); when(engine.discover(any(), any())).thenAnswer(invocation -> { UniqueId uniqueId = invocation.getArgument(1); @@ -708,7 +699,7 @@ void launcherCanExecuteTestPlanExactlyOnce() { }); var launcher = createLauncher(engine); - TestPlan testPlan = launcher.discover(request().build()); + var testPlan = launcher.discover(request().build()); verify(engine, times(1)).discover(any(), any()); launcher.execute(testPlan); @@ -724,12 +715,12 @@ void launcherCanExecuteTestPlanExactlyOnce() { void testPlanWarnsWhenModified(LogRecordListener listener) { TestEngine engine = new TestEngineSpy(); var launcher = createLauncher(engine); - TestPlan testPlan = launcher.discover(request().build()); - TestIdentifier engineIdentifier = getOnlyElement(testPlan.getRoots()); - UniqueId engineUniqueId = UniqueId.parse(engineIdentifier.getUniqueId()); + var testPlan = launcher.discover(request().build()); + var engineIdentifier = getOnlyElement(testPlan.getRoots()); + var engineUniqueId = UniqueId.parse(engineIdentifier.getUniqueId()); assertThat(testPlan.getChildren(engineIdentifier)).hasSize(1); - TestIdentifier addedIdentifier = TestIdentifier.from( + var addedIdentifier = TestIdentifier.from( new TestDescriptorStub(engineUniqueId.append("test", "test2"), "test2")); testPlan.add(addedIdentifier); testPlan.add(addedIdentifier); @@ -744,7 +735,7 @@ void testPlanWarnsWhenModified(LogRecordListener listener) { @Test @TrackLogRecords void thirdPartyEngineUsingReservedEngineIdPrefixEmitsWarning(LogRecordListener listener) { - String id = "junit-using-reserved-prefix"; + var id = "junit-using-reserved-prefix"; createLauncher(new TestEngineStub(id)); assertThat(listener.stream(EngineIdValidator.class, Level.WARNING).map(LogRecord::getMessage)) // .containsExactly( diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java index 54a96f538680..9b6e453d3cef 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java @@ -27,7 +27,7 @@ class EngineDiscoveryResultValidatorTests { @Test void detectCycleWithDoubleRoot() { - TestDescriptorStub root = new TestDescriptorStub(UniqueId.forEngine("root"), "root"); + var root = new TestDescriptorStub(UniqueId.forEngine("root"), "root"); assertTrue(validator.isAcyclic(root)); root.addChild(root); @@ -36,8 +36,8 @@ void detectCycleWithDoubleRoot() { @Test void detectCycleWithDoubleGroup() { - UniqueId rootId = UniqueId.forEngine("root"); - TestDescriptorStub root = new TestDescriptorStub(rootId, "root"); + var rootId = UniqueId.forEngine("root"); + var root = new TestDescriptorStub(rootId, "root"); TestDescriptor group1 = new TestDescriptorStub(rootId.append("group", "1"), "1"); TestDescriptor group2 = new TestDescriptorStub(rootId.append("group", "2"), "2"); root.addChild(group1); @@ -50,8 +50,8 @@ void detectCycleWithDoubleGroup() { @Test void detectCycleWithDoubleTest() { - UniqueId rootId = UniqueId.forEngine("root"); - TestDescriptorStub root = new TestDescriptorStub(rootId, "root"); + var rootId = UniqueId.forEngine("root"); + var root = new TestDescriptorStub(rootId, "root"); TestDescriptor group1 = new TestDescriptorStub(rootId.append("group", "1"), "1"); TestDescriptor group2 = new TestDescriptorStub(rootId.append("group", "2"), "2"); root.addChild(group1); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java index a505c3d7f99f..a1e7eddc2d9a 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java @@ -13,7 +13,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import java.lang.reflect.Method; import java.util.Map; import org.junit.jupiter.api.Test; @@ -34,19 +33,17 @@ class ExecutionListenerAdapterTests { @Test void testReportingEntryPublished() { - TestDescriptor testDescriptor = getSampleMethodTestDescriptor(); + var testDescriptor = getSampleMethodTestDescriptor(); - LauncherDiscoveryResult discoveryResult = new LauncherDiscoveryResult( - Map.of(mock(TestEngine.class), testDescriptor), null); - InternalTestPlan testPlan = InternalTestPlan.from(discoveryResult); - TestIdentifier testIdentifier = testPlan.getTestIdentifier(testDescriptor.getUniqueId().toString()); + var discoveryResult = new LauncherDiscoveryResult(Map.of(mock(TestEngine.class), testDescriptor), null); + var testPlan = InternalTestPlan.from(discoveryResult); + var testIdentifier = testPlan.getTestIdentifier(testDescriptor.getUniqueId().toString()); //not yet spyable with mockito? -> https://github.com/mockito/mockito/issues/146 - MockTestExecutionListener testExecutionListener = new MockTestExecutionListener(); - ExecutionListenerAdapter executionListenerAdapter = new ExecutionListenerAdapter(testPlan, - testExecutionListener); + var testExecutionListener = new MockTestExecutionListener(); + var executionListenerAdapter = new ExecutionListenerAdapter(testPlan, testExecutionListener); - ReportEntry entry = ReportEntry.from("one", "two"); + var entry = ReportEntry.from("one", "two"); executionListenerAdapter.reportingEntryPublished(testDescriptor, entry); assertThat(testExecutionListener.entry).isEqualTo(entry); @@ -54,7 +51,7 @@ void testReportingEntryPublished() { } private TestDescriptor getSampleMethodTestDescriptor() { - Method localMethodNamedNothing = ReflectionUtils.findMethod(this.getClass(), "nothing", new Class[0]).get(); + var localMethodNamedNothing = ReflectionUtils.findMethod(this.getClass(), "nothing", new Class[0]).get(); return new DemoMethodTestDescriptor(UniqueId.root("method", "unique_id"), this.getClass(), localMethodNamedNothing); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java index d378ca86dac0..cd9e2a0e5b48 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java @@ -36,7 +36,7 @@ void preconditions() { () -> LauncherConfig.builder().addTestExecutionListeners((TestExecutionListener[]) null)); TestEngine engine = new TestEngineStub(); - TestExecutionListener listener = new TestExecutionListener() { + var listener = new TestExecutionListener() { }; assertThrows(PreconditionViolationException.class, () -> LauncherConfig.builder().addTestEngines(engine, engine, null)); @@ -46,7 +46,7 @@ void preconditions() { @Test void defaultConfig() { - LauncherConfig config = LauncherConfig.builder().build(); + var config = LauncherConfig.builder().build(); assertTrue(config.isTestEngineAutoRegistrationEnabled(), "Test engine auto-registration should be enabled by default"); @@ -60,14 +60,14 @@ void defaultConfig() { @Test void disableTestEngineAutoRegistration() { - LauncherConfig config = LauncherConfig.builder().enableTestEngineAutoRegistration(false).build(); + var config = LauncherConfig.builder().enableTestEngineAutoRegistration(false).build(); assertFalse(config.isTestEngineAutoRegistrationEnabled()); } @Test void disableTestExecutionListenerAutoRegistration() { - LauncherConfig config = LauncherConfig.builder().enableTestExecutionListenerAutoRegistration(false).build(); + var config = LauncherConfig.builder().enableTestExecutionListenerAutoRegistration(false).build(); assertFalse(config.isTestExecutionListenerAutoRegistrationEnabled()); } @@ -77,19 +77,19 @@ void addTestEngines() { TestEngine first = new TestEngineStub(); TestEngine second = new TestEngineStub(); - LauncherConfig config = LauncherConfig.builder().addTestEngines(first, second).build(); + var config = LauncherConfig.builder().addTestEngines(first, second).build(); assertThat(config.getAdditionalTestEngines()).containsOnly(first, second); } @Test void addTestExecutionListeners() { - TestExecutionListener first = new TestExecutionListener() { + var first = new TestExecutionListener() { }; - TestExecutionListener second = new TestExecutionListener() { + var second = new TestExecutionListener() { }; - LauncherConfig config = LauncherConfig.builder().addTestExecutionListeners(first, second).build(); + var config = LauncherConfig.builder().addTestExecutionListeners(first, second).build(); assertThat(config.getAdditionalTestExecutionListeners()).containsOnly(first, second); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java index dab8362882ec..29f144b96b2b 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java @@ -28,7 +28,6 @@ import org.junit.platform.commons.PreconditionViolationException; import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.discovery.DiscoverySelectors; -import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.listeners.SummaryGeneratingListener; /** @@ -121,10 +120,10 @@ void systemPropertyOverridesConfigFile() { @Test void getValueInExtensionContext() { - LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() // + var request = LauncherDiscoveryRequestBuilder.request() // .configurationParameter("thing", "one else!") // .selectors(DiscoverySelectors.selectClass(Something.class)).build(); - SummaryGeneratingListener summary = new SummaryGeneratingListener(); + var summary = new SummaryGeneratingListener(); LauncherFactory.create().execute(request, summary); assertEquals(0, summary.getSummary().getTestsFailedCount()); } @@ -138,7 +137,7 @@ void getWithSuccessfulTransformer() { @Test void getWithErroneousTransformer() { ConfigurationParameters configParams = fromMap(singletonMap(KEY, "42")); - JUnitException exception = assertThrows(JUnitException.class, () -> configParams.get(KEY, input -> { + var exception = assertThrows(JUnitException.class, () -> configParams.get(KEY, input -> { throw new RuntimeException("foo"); })); assertThat(exception).hasMessageContaining( @@ -168,7 +167,7 @@ private static LauncherConfigurationParameters fromMapAndFile(Map packageSelectors = discoveryRequest.getSelectorsByType(ModuleSelector.class).stream().map( + var packageSelectors = discoveryRequest.getSelectorsByType(ModuleSelector.class).stream().map( ModuleSelector::getModuleName).collect(toList()); assertThat(packageSelectors).contains("java.base"); } @@ -75,13 +72,13 @@ void modulesAreStoredInDiscoveryRequest() { @Test void packagesAreStoredInDiscoveryRequest() { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .selectors( selectPackage("org.junit.platform.engine") ).build(); // @formatter:on - List packageSelectors = discoveryRequest.getSelectorsByType(PackageSelector.class).stream().map( + var packageSelectors = discoveryRequest.getSelectorsByType(PackageSelector.class).stream().map( PackageSelector::getPackageName).collect(toList()); assertThat(packageSelectors).contains("org.junit.platform.engine"); } @@ -89,7 +86,7 @@ void packagesAreStoredInDiscoveryRequest() { @Test void classesAreStoredInDiscoveryRequest() { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .selectors( selectClass(LauncherDiscoveryRequestBuilderTests.class.getName()), selectClass(SampleTestClass.class) @@ -105,15 +102,15 @@ void classesAreStoredInDiscoveryRequest() { @Test void methodsByFullyQualifiedNameAreStoredInDiscoveryRequest() { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .selectors(selectMethod(fullyQualifiedMethodName())) .build(); // @formatter:on - List methodSelectors = discoveryRequest.getSelectorsByType(MethodSelector.class); + var methodSelectors = discoveryRequest.getSelectorsByType(MethodSelector.class); assertThat(methodSelectors).hasSize(1); - MethodSelector methodSelector = methodSelectors.get(0); + var methodSelector = methodSelectors.get(0); assertThat(methodSelector.getJavaClass()).isEqualTo(LauncherDiscoveryRequestBuilderTests.class); assertThat(methodSelector.getJavaMethod()).isEqualTo(fullyQualifiedMethod()); } @@ -121,18 +118,18 @@ void methodsByFullyQualifiedNameAreStoredInDiscoveryRequest() { @Test void methodsByNameAreStoredInDiscoveryRequest() throws Exception { Class testClass = SampleTestClass.class; - Method testMethod = testClass.getDeclaredMethod("test"); + var testMethod = testClass.getDeclaredMethod("test"); // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .selectors(selectMethod(SampleTestClass.class.getName(), "test")) .build(); // @formatter:on - List methodSelectors = discoveryRequest.getSelectorsByType(MethodSelector.class); + var methodSelectors = discoveryRequest.getSelectorsByType(MethodSelector.class); assertThat(methodSelectors).hasSize(1); - MethodSelector methodSelector = methodSelectors.get(0); + var methodSelector = methodSelectors.get(0); assertThat(methodSelector.getJavaClass()).isEqualTo(testClass); assertThat(methodSelector.getJavaMethod()).isEqualTo(testMethod); } @@ -140,37 +137,37 @@ void methodsByNameAreStoredInDiscoveryRequest() throws Exception { @Test void methodsByClassAreStoredInDiscoveryRequest() throws Exception { Class testClass = SampleTestClass.class; - Method testMethod = testClass.getDeclaredMethod("test"); + var testMethod = testClass.getDeclaredMethod("test"); // @formatter:off - DefaultDiscoveryRequest discoveryRequest = (DefaultDiscoveryRequest) request() + var discoveryRequest = (DefaultDiscoveryRequest) request() .selectors( selectMethod(testClass, "test") ).build(); // @formatter:on - List methodSelectors = discoveryRequest.getSelectorsByType(MethodSelector.class); + var methodSelectors = discoveryRequest.getSelectorsByType(MethodSelector.class); assertThat(methodSelectors).hasSize(1); - MethodSelector methodSelector = methodSelectors.get(0); + var methodSelector = methodSelectors.get(0); assertThat(methodSelector.getJavaClass()).isEqualTo(testClass); assertThat(methodSelector.getJavaMethod()).isEqualTo(testMethod); } @Test void uniqueIdsAreStoredInDiscoveryRequest() { - UniqueId id1 = UniqueId.forEngine("engine").append("foo", "id1"); - UniqueId id2 = UniqueId.forEngine("engine").append("foo", "id2"); + var id1 = UniqueId.forEngine("engine").append("foo", "id1"); + var id2 = UniqueId.forEngine("engine").append("foo", "id2"); // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .selectors( selectUniqueId(id1), selectUniqueId(id2) ).build(); // @formatter:on - List uniqueIds = discoveryRequest.getSelectorsByType(UniqueIdSelector.class).stream().map( + var uniqueIds = discoveryRequest.getSelectorsByType(UniqueIdSelector.class).stream().map( UniqueIdSelector::getUniqueId).map(Object::toString).collect(toList()); assertThat(uniqueIds).contains(id1.toString(), id2.toString()); @@ -187,14 +184,14 @@ void engineFiltersAreStoredInDiscoveryRequest() { TestEngine engine3 = new TestEngineStub("engine3"); // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .filters(includeEngines(engine1.getId(), engine2.getId())) .build(); // @formatter:on - List filters = discoveryRequest.getEngineFilters(); + var filters = discoveryRequest.getEngineFilters(); assertThat(filters).hasSize(1); - EngineFilter engineFilter = filters.get(0); + var engineFilter = filters.get(0); assertTrue(engineFilter.apply(engine1).included()); assertTrue(engineFilter.apply(engine2).included()); assertTrue(engineFilter.apply(engine3).excluded()); @@ -205,7 +202,7 @@ void discoveryFiltersAreStoredInDiscoveryRequest() { var filter1 = new DiscoveryFilterStub<>("filter1"); var filter2 = new DiscoveryFilterStub<>("filter2"); // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .filters(filter1, filter2) .build(); // @formatter:on @@ -219,7 +216,7 @@ void postDiscoveryFiltersAreStoredInDiscoveryRequest() { var postFilter1 = new PostDiscoveryFilterStub("postFilter1"); var postFilter2 = new PostDiscoveryFilterStub("postFilter2"); // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .filters(postFilter1, postFilter2) .build(); // @formatter:on @@ -244,47 +241,47 @@ class DiscoveryConfigurationParameterTests { @Test void withoutConfigurationParametersSet_NoConfigurationParametersAreStoredInDiscoveryRequest() { - LauncherDiscoveryRequest discoveryRequest = request().build(); + var discoveryRequest = request().build(); - ConfigurationParameters configParams = discoveryRequest.getConfigurationParameters(); + var configParams = discoveryRequest.getConfigurationParameters(); assertThat(configParams.get("key")).isNotPresent(); } @Test void configurationParameterAddedDirectly_isStoredInDiscoveryRequest() { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .configurationParameter("key", "value") .build(); // @formatter:on - ConfigurationParameters configParams = discoveryRequest.getConfigurationParameters(); + var configParams = discoveryRequest.getConfigurationParameters(); assertThat(configParams.get("key")).contains("value"); } @Test void configurationParameterAddedDirectlyTwice_overridesPreviousValueInDiscoveryRequest() { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .configurationParameter("key", "value") .configurationParameter("key", "value-new") .build(); // @formatter:on - ConfigurationParameters configParams = discoveryRequest.getConfigurationParameters(); + var configParams = discoveryRequest.getConfigurationParameters(); assertThat(configParams.get("key")).contains("value-new"); } @Test void multipleConfigurationParametersAddedDirectly_areStoredInDiscoveryRequest() { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .configurationParameter("key1", "value1") .configurationParameter("key2", "value2") .build(); // @formatter:on - ConfigurationParameters configParams = discoveryRequest.getConfigurationParameters(); + var configParams = discoveryRequest.getConfigurationParameters(); assertThat(configParams.get("key1")).contains("value1"); assertThat(configParams.get("key2")).contains("value2"); } @@ -292,12 +289,12 @@ void multipleConfigurationParametersAddedDirectly_areStoredInDiscoveryRequest() @Test void configurationParameterAddedByMap_isStoredInDiscoveryRequest() { // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .configurationParameters(singletonMap("key", "value")) .build(); // @formatter:on - ConfigurationParameters configParams = discoveryRequest.getConfigurationParameters(); + var configParams = discoveryRequest.getConfigurationParameters(); assertThat(configParams.get("key")).contains("value"); } @@ -308,12 +305,12 @@ void multipleConfigurationParametersAddedByMap_areStoredInDiscoveryRequest() { configurationParams.put("key2", "value2"); // @formatter:off - LauncherDiscoveryRequest discoveryRequest = request() + var discoveryRequest = request() .configurationParameters(configurationParams) .build(); // @formatter:on - ConfigurationParameters configParams = discoveryRequest.getConfigurationParameters(); + var configParams = discoveryRequest.getConfigurationParameters(); assertThat(configParams.get("key1")).contains("value1"); assertThat(configParams.get("key2")).contains("value2"); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java index 961b393b1016..a0b4f7f75445 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java @@ -18,9 +18,6 @@ import java.net.URL; import java.net.URLClassLoader; -import java.util.List; -import java.util.Optional; -import java.util.Set; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -28,9 +25,7 @@ import org.junit.platform.commons.PreconditionViolationException; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TagFilter; -import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestIdentifier; -import org.junit.platform.launcher.TestPlan; import org.junit.platform.launcher.listeners.AnotherUnusedTestExecutionListener; import org.junit.platform.launcher.listeners.NoopTestExecutionListener; import org.junit.platform.launcher.listeners.UnusedTestExecutionListener; @@ -47,17 +42,16 @@ void preconditions() { @Test void noopTestExecutionListenerIsLoadedViaServiceApi() { - DefaultLauncher launcher = (DefaultLauncher) LauncherFactory.create(); - List listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); - Optional listener = listeners.stream().filter( - NoopTestExecutionListener.class::isInstance).findFirst(); + var launcher = (DefaultLauncher) LauncherFactory.create(); + var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); + var listener = listeners.stream().filter(NoopTestExecutionListener.class::isInstance).findFirst(); assertThat(listener).isPresent(); } @Test void unusedTestExecutionListenerIsNotLoadedViaServiceApi() { - DefaultLauncher launcher = (DefaultLauncher) LauncherFactory.create(); - List listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); + var launcher = (DefaultLauncher) LauncherFactory.create(); + var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); assertThat(listeners).filteredOn(AnotherUnusedTestExecutionListener.class::isInstance).isEmpty(); assertThat(listeners).filteredOn(UnusedTestExecutionListener.class::isInstance).isEmpty(); @@ -66,14 +60,14 @@ void unusedTestExecutionListenerIsNotLoadedViaServiceApi() { @Test void create() { - LauncherDiscoveryRequest discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); + var discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); - TestPlan testPlan = LauncherFactory.create().discover(discoveryRequest); - Set roots = testPlan.getRoots(); + var testPlan = LauncherFactory.create().discover(discoveryRequest); + var roots = testPlan.getRoots(); assertThat(roots).hasSize(2); // @formatter:off - List ids = roots.stream() + var ids = roots.stream() .map(TestIdentifier::getUniqueId) .collect(toList()); // @formatter:on @@ -83,19 +77,19 @@ void create() { @Test void createWithConfig() { - LauncherDiscoveryRequest discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); + var discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); - LauncherConfig config = LauncherConfig.builder()// + var config = LauncherConfig.builder()// .enableTestEngineAutoRegistration(false)// .addTestEngines(new JupiterTestEngine())// .build(); - TestPlan testPlan = LauncherFactory.create(config).discover(discoveryRequest); - Set roots = testPlan.getRoots(); + var testPlan = LauncherFactory.create(config).discover(discoveryRequest); + var roots = testPlan.getRoots(); assertThat(roots).hasSize(1); // @formatter:off - List ids = roots.stream() + var ids = roots.stream() .map(TestIdentifier::getUniqueId) .collect(toList()); // @formatter:on @@ -105,37 +99,37 @@ void createWithConfig() { @Test void createWithPostDiscoveryFilters() { - LauncherDiscoveryRequest discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); + var discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); - LauncherConfig config = LauncherConfig.builder()// + var config = LauncherConfig.builder()// .addPostDiscoveryFilters(TagFilter.includeTags("test-post-discovery")).build(); - TestPlan testPlan = LauncherFactory.create(config).discover(discoveryRequest); - final Set vintage = testPlan.getChildren("[engine:junit-vintage]"); + var testPlan = LauncherFactory.create(config).discover(discoveryRequest); + final var vintage = testPlan.getChildren("[engine:junit-vintage]"); assertThat(vintage).isEmpty(); - final Set jupiter = testPlan.getChildren("[engine:junit-jupiter]"); + final var jupiter = testPlan.getChildren("[engine:junit-jupiter]"); assertThat(jupiter).hasSize(1); } @Test void applyPostDiscoveryFiltersViaServiceApi() { - final ClassLoader current = Thread.currentThread().getContextClassLoader(); + final var current = Thread.currentThread().getContextClassLoader(); try { - URL url = getClass().getClassLoader().getResource("testservices/"); - URLClassLoader classLoader = new URLClassLoader(new URL[] { url }, current); + var url = getClass().getClassLoader().getResource("testservices/"); + var classLoader = new URLClassLoader(new URL[] { url }, current); Thread.currentThread().setContextClassLoader(classLoader); - LauncherDiscoveryRequest discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); + var discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); - LauncherConfig config = LauncherConfig.builder()// + var config = LauncherConfig.builder()// .build(); - TestPlan testPlan = LauncherFactory.create(config).discover(discoveryRequest); - final Set vintage = testPlan.getChildren("[engine:junit-vintage]"); + var testPlan = LauncherFactory.create(config).discover(discoveryRequest); + final var vintage = testPlan.getChildren("[engine:junit-vintage]"); assertThat(vintage).isEmpty(); - final Set jupiter = testPlan.getChildren("[engine:junit-jupiter]"); + final var jupiter = testPlan.getChildren("[engine:junit-jupiter]"); assertThat(jupiter).hasSize(1); } finally { @@ -145,22 +139,22 @@ void applyPostDiscoveryFiltersViaServiceApi() { @Test void notApplyIfDisabledPostDiscoveryFiltersViaServiceApi() { - final ClassLoader current = Thread.currentThread().getContextClassLoader(); + final var current = Thread.currentThread().getContextClassLoader(); try { - URL url = getClass().getClassLoader().getResource("testservices/"); - URLClassLoader classLoader = new URLClassLoader(new URL[] { url }, current); + var url = getClass().getClassLoader().getResource("testservices/"); + var classLoader = new URLClassLoader(new URL[] { url }, current); Thread.currentThread().setContextClassLoader(classLoader); - LauncherDiscoveryRequest discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); + var discoveryRequest = createLauncherDiscoveryRequestForBothStandardEngineExampleClasses(); - LauncherConfig config = LauncherConfig.builder()// + var config = LauncherConfig.builder()// .enablePostDiscoveryFilterAutoRegistration(false).build(); - TestPlan testPlan = LauncherFactory.create(config).discover(discoveryRequest); - final Set vintage = testPlan.getChildren("[engine:junit-vintage]"); + var testPlan = LauncherFactory.create(config).discover(discoveryRequest); + final var vintage = testPlan.getChildren("[engine:junit-vintage]"); assertThat(vintage).hasSize(1); - final Set jupiter = testPlan.getChildren("[engine:junit-jupiter]"); + final var jupiter = testPlan.getChildren("[engine:junit-jupiter]"); assertThat(jupiter).hasSize(1); } finally { diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java index 8f4a358cfc0b..9c2e2cd99c33 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java @@ -46,12 +46,10 @@ import org.junit.platform.engine.reporting.ReportEntry; import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine; import org.junit.platform.launcher.LauncherConstants; -import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; import org.mockito.ArgumentCaptor; -import org.mockito.InOrder; /** * @since 1.3 @@ -62,9 +60,9 @@ class StreamInterceptingTestExecutionListenerIntegrationTests { @MethodSource("systemStreams") @ExtendWith(HiddenSystemOutAndErr.class) void interceptsStream(String configParam, Supplier printStreamSupplier, String reportKey) { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("engine"); + var engine = new DemoHierarchicalTestEngine("engine"); TestDescriptor test = engine.addTest("test", () -> printStreamSupplier.get().print("4567890")); - TestExecutionListener listener = mock(TestExecutionListener.class); + var listener = mock(TestExecutionListener.class); doAnswer(invocation -> { TestIdentifier testIdentifier = invocation.getArgument(0); if (testIdentifier.getUniqueId().equals(test.getUniqueId().toString())) { @@ -74,23 +72,23 @@ void interceptsStream(String configParam, Supplier printStreamSuppl }).when(listener).executionStarted(any()); var launcher = createLauncher(engine); - LauncherDiscoveryRequest discoveryRequest = request()// + var discoveryRequest = request()// .selectors(selectUniqueId(test.getUniqueId()))// .configurationParameter(configParam, String.valueOf(true))// .configurationParameter(LauncherConstants.CAPTURE_MAX_BUFFER_PROPERTY_NAME, String.valueOf(5))// .build(); launcher.execute(discoveryRequest, listener); - ArgumentCaptor testPlanArgumentCaptor = ArgumentCaptor.forClass(TestPlan.class); - InOrder inOrder = inOrder(listener); + var testPlanArgumentCaptor = ArgumentCaptor.forClass(TestPlan.class); + var inOrder = inOrder(listener); inOrder.verify(listener).testPlanExecutionStarted(testPlanArgumentCaptor.capture()); - TestPlan testPlan = testPlanArgumentCaptor.getValue(); - TestIdentifier testIdentifier = testPlan.getTestIdentifier(test.getUniqueId().toString()); + var testPlan = testPlanArgumentCaptor.getValue(); + var testIdentifier = testPlan.getTestIdentifier(test.getUniqueId().toString()); - ArgumentCaptor reportEntryArgumentCaptor = ArgumentCaptor.forClass(ReportEntry.class); + var reportEntryArgumentCaptor = ArgumentCaptor.forClass(ReportEntry.class); inOrder.verify(listener).reportingEntryPublished(same(testIdentifier), reportEntryArgumentCaptor.capture()); inOrder.verify(listener).executionFinished(testIdentifier, successful()); - ReportEntry reportEntry = reportEntryArgumentCaptor.getValue(); + var reportEntry = reportEntryArgumentCaptor.getValue(); assertThat(reportEntry.getKeyValuePairs()).containsExactly(entry(reportKey, "12345")); } @@ -100,18 +98,18 @@ void interceptsStream(String configParam, Supplier printStreamSuppl @ExtendWith(HiddenSystemOutAndErr.class) void doesNotInterceptStreamWhenAlreadyBeingIntercepted(String configParam, Supplier printStreamSupplier) { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("engine"); + var engine = new DemoHierarchicalTestEngine("engine"); TestDescriptor test = engine.addTest("test", () -> printStreamSupplier.get().print("1234567890")); assertThat(StreamInterceptor.registerStdout(1)).isPresent(); assertThat(StreamInterceptor.registerStderr(1)).isPresent(); var launcher = createLauncher(engine); - LauncherDiscoveryRequest discoveryRequest = request()// + var discoveryRequest = request()// .selectors(selectUniqueId(test.getUniqueId()))// .configurationParameter(configParam, String.valueOf(true))// .build(); - TestExecutionListener listener = mock(TestExecutionListener.class); + var listener = mock(TestExecutionListener.class); launcher.execute(discoveryRequest, listener); verify(listener, never()).reportingEntryPublished(any(), any()); @@ -135,7 +133,7 @@ static class HiddenSystemOutAndErr implements BeforeTestExecutionCallback, After @Override public void beforeTestExecution(ExtensionContext context) { - ExtensionContext.Store store = context.getStore(NAMESPACE); + var store = context.getStore(NAMESPACE); store.put("out", System.out); store.put("err", System.err); System.setOut(new PrintStream(new ByteArrayOutputStream())); @@ -144,7 +142,7 @@ public void beforeTestExecution(ExtensionContext context) { @Override public void afterTestExecution(ExtensionContext context) { - ExtensionContext.Store store = context.getStore(NAMESPACE); + var store = context.getStore(NAMESPACE); System.setOut(store.get("out", PrintStream.class)); System.setErr(store.get("err", PrintStream.class)); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java index 7351b718570f..3c9e9ee18aff 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java @@ -32,8 +32,8 @@ class StreamInterceptorTests { @Test void interceptsWriteOperationsToStreamPerThread() { - StreamInterceptor streamInterceptor = StreamInterceptor.register(targetStream, - newStream -> this.targetStream = newStream, 3).orElseThrow(RuntimeException::new); + var streamInterceptor = StreamInterceptor.register(targetStream, newStream -> this.targetStream = newStream, + 3).orElseThrow(RuntimeException::new); // @formatter:off IntStream.range(0, 1000) .parallel() @@ -47,10 +47,10 @@ void interceptsWriteOperationsToStreamPerThread() { @Test void unregisterRestoresOriginalStream() { - PrintStream originalStream = targetStream; + var originalStream = targetStream; - StreamInterceptor streamInterceptor = StreamInterceptor.register(targetStream, - newStream -> this.targetStream = newStream, 3).orElseThrow(RuntimeException::new); + var streamInterceptor = StreamInterceptor.register(targetStream, newStream -> this.targetStream = newStream, + 3).orElseThrow(RuntimeException::new); assertSame(streamInterceptor, targetStream); streamInterceptor.unregister(); @@ -59,7 +59,7 @@ void unregisterRestoresOriginalStream() { @Test void writeForwardsOperationsToOriginalStream() throws IOException { - PrintStream originalStream = targetStream; + var originalStream = targetStream; StreamInterceptor.register(targetStream, newStream -> this.targetStream = newStream, 2).orElseThrow( RuntimeException::new); @@ -73,8 +73,8 @@ void writeForwardsOperationsToOriginalStream() throws IOException { @Test void handlesNestedCaptures() { - StreamInterceptor streamInterceptor = StreamInterceptor.register(targetStream, - newStream -> this.targetStream = newStream, 100).orElseThrow(RuntimeException::new); + var streamInterceptor = StreamInterceptor.register(targetStream, newStream -> this.targetStream = newStream, + 100).orElseThrow(RuntimeException::new); String outermost, inner, innermost; diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java index 658a97496192..43fa30e1d431 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java @@ -14,7 +14,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.mock; -import java.lang.reflect.Method; import java.util.Collections; import java.util.logging.Level; import java.util.logging.LogRecord; @@ -46,7 +45,7 @@ void setUp() { @Test void shouldNotThrowExceptionButLogIfDynamicTestRegisteredListenerMethodFails(LogRecordListener logRecordListener) { - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); compositeTestExecutionListener.dynamicTestRegistered(testIdentifier); @@ -56,7 +55,7 @@ void shouldNotThrowExceptionButLogIfDynamicTestRegisteredListenerMethodFails(Log @Test void shouldNotThrowExceptionButLogIfExecutionStartedListenerMethodFails(LogRecordListener logRecordListener) { - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); compositeTestExecutionListener.executionStarted(testIdentifier); @@ -65,7 +64,7 @@ void shouldNotThrowExceptionButLogIfExecutionStartedListenerMethodFails(LogRecor @Test void shouldNotThrowExceptionButLogIfExecutionSkippedListenerMethodFails(LogRecordListener logRecordListener) { - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); compositeTestExecutionListener.executionSkipped(testIdentifier, "deliberately skipped container"); @@ -74,7 +73,7 @@ void shouldNotThrowExceptionButLogIfExecutionSkippedListenerMethodFails(LogRecor @Test void shouldNotThrowExceptionButLogIfExecutionFinishedListenerMethodFails(LogRecordListener logRecordListener) { - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); compositeTestExecutionListener.executionFinished(testIdentifier, mock(TestExecutionResult.class)); @@ -84,7 +83,7 @@ void shouldNotThrowExceptionButLogIfExecutionFinishedListenerMethodFails(LogReco @Test void shouldNotThrowExceptionButLogIfReportingEntryPublishedListenerMethodFails( LogRecordListener logRecordListener) { - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); compositeTestExecutionListener.reportingEntryPublished(testIdentifier, ReportEntry.from("one", "two")); @@ -95,7 +94,7 @@ void shouldNotThrowExceptionButLogIfReportingEntryPublishedListenerMethodFails( @Test void shouldNotThrowExceptionButLogIfTesPlanExecutionStartedListenerMethodFails( LogRecordListener logRecordListener) { - DemoMethodTestDescriptor testDescriptor = getDemoMethodTestDescriptor(); + var testDescriptor = getDemoMethodTestDescriptor(); compositeTestExecutionListener.testPlanExecutionStarted(TestPlan.from(Collections.singleton(testDescriptor))); @@ -106,7 +105,7 @@ void shouldNotThrowExceptionButLogIfTesPlanExecutionStartedListenerMethodFails( @Test void shouldNotThrowExceptionButLogIfTesPlanExecutionFinishedListenerMethodFails( LogRecordListener logRecordListener) { - DemoMethodTestDescriptor testDescriptor = getDemoMethodTestDescriptor(); + var testDescriptor = getDemoMethodTestDescriptor(); compositeTestExecutionListener.testPlanExecutionFinished(TestPlan.from(Collections.singleton(testDescriptor))); @@ -119,7 +118,7 @@ void shouldNotThrowExceptionButLogIfExecutionJustStartedEagerTestListenerMethodF LogRecordListener logRecordListener) { registry.registerListeners(new ThrowingEagerTestExecutionListener()); - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); compositeTestExecutionListener.executionStarted(testIdentifier); assertThatTestListenerErrorLogged(logRecordListener, ThrowingEagerTestExecutionListener.class, @@ -131,7 +130,7 @@ void shouldNotThrowExceptionButLogIfExecutionJustFinishedEagerTestListenerMethod LogRecordListener logRecordListener) { registry.registerListeners(new ThrowingEagerTestExecutionListener()); - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); compositeTestExecutionListener.executionFinished(testIdentifier, mock(TestExecutionResult.class)); assertThatTestListenerErrorLogged(logRecordListener, ThrowingEagerTestExecutionListener.class, @@ -140,14 +139,14 @@ void shouldNotThrowExceptionButLogIfExecutionJustFinishedEagerTestListenerMethod @Test void shouldThrowOutOfMemoryExceptionAndStopListenerWithoutLog(LogRecordListener logRecordListener) { - TestExecutionListenerRegistry registry = new TestExecutionListenerRegistry(); + var registry = new TestExecutionListenerRegistry(); registry.registerListeners(new TestExecutionListener() { @Override public void executionStarted(TestIdentifier testIdentifier) { throw new OutOfMemoryError(); } }); - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); assertThatThrownBy( () -> registry.getCompositeTestExecutionListener().executionStarted(testIdentifier)).isInstanceOf( OutOfMemoryError.class); @@ -157,14 +156,14 @@ public void executionStarted(TestIdentifier testIdentifier) { @Test void shouldThrowOutOfMemoryExceptionAndStopEagerListenerWithoutLog(LogRecordListener logRecordListener) { - TestExecutionListenerRegistry registry = new TestExecutionListenerRegistry(); + var registry = new TestExecutionListenerRegistry(); registry.registerListeners(new TestExecutionListenerRegistry.EagerTestExecutionListener() { @Override public void executionJustStarted(TestIdentifier testIdentifier) { throw new OutOfMemoryError(); } }); - TestIdentifier testIdentifier = getSampleMethodTestIdentifier(); + var testIdentifier = getSampleMethodTestIdentifier(); assertThatThrownBy( () -> registry.getCompositeTestExecutionListener().executionStarted(testIdentifier)).isInstanceOf( OutOfMemoryError.class); @@ -182,7 +181,7 @@ private void assertNotLogs(LogRecordListener logRecordListener) throws Assertion } private TestIdentifier getSampleMethodTestIdentifier() { - DemoMethodTestDescriptor demoMethodTestDescriptor = getDemoMethodTestDescriptor(); + var demoMethodTestDescriptor = getDemoMethodTestDescriptor(); return TestIdentifier.from(demoMethodTestDescriptor); } @@ -193,7 +192,7 @@ private void assertThatTestListenerErrorLogged(LogRecordListener logRecordListen } private DemoMethodTestDescriptor getDemoMethodTestDescriptor() { - Method method = ReflectionUtils.findMethod(this.getClass(), "getDemoMethodTestDescriptor", + var method = ReflectionUtils.findMethod(this.getClass(), "getDemoMethodTestDescriptor", new Class[0]).orElseThrow(); return new DemoMethodTestDescriptor(UniqueId.root("method", "unique_id"), this.getClass(), method); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java index 76b98ab6e661..e3e088e352fc 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java @@ -19,7 +19,6 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.util.Collections; -import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; @@ -46,7 +45,7 @@ void emptyReport() { assertEquals(0, listener.getSummary().getTestsFailedCount()); - String summaryString = summaryAsString(); + var summaryString = summaryAsString(); assertAll("summary", // () -> assertTrue(summaryString.contains("Test run finished after"), "test run"), // @@ -70,15 +69,15 @@ void emptyReport() { @Test void reportingCorrectCounts() { - TestIdentifier successfulContainer = createContainerIdentifier("c1"); - TestIdentifier failedContainer = createContainerIdentifier("c2"); - TestIdentifier abortedContainer = createContainerIdentifier("c3"); - TestIdentifier skippedContainer = createContainerIdentifier("c4"); + var successfulContainer = createContainerIdentifier("c1"); + var failedContainer = createContainerIdentifier("c2"); + var abortedContainer = createContainerIdentifier("c3"); + var skippedContainer = createContainerIdentifier("c4"); - TestIdentifier successfulTest = createTestIdentifier("t1"); - TestIdentifier failedTest = createTestIdentifier("t2"); - TestIdentifier abortedTest = createTestIdentifier("t3"); - TestIdentifier skippedTest = createTestIdentifier("t4"); + var successfulTest = createTestIdentifier("t1"); + var failedTest = createTestIdentifier("t2"); + var abortedTest = createTestIdentifier("t3"); + var skippedTest = createTestIdentifier("t4"); listener.testPlanExecutionStarted(testPlan); @@ -105,7 +104,7 @@ void reportingCorrectCounts() { listener.testPlanExecutionFinished(testPlan); - String summaryString = summaryAsString(); + var summaryString = summaryAsString(); try { assertAll("summary", // () -> assertTrue(summaryString.contains("4 containers found"), "containers found"), // @@ -131,20 +130,20 @@ void reportingCorrectCounts() { @Test void canGetListOfFailures() { - RuntimeException failedException = new RuntimeException("Pow!"); - TestDescriptorStub testDescriptor = new TestDescriptorStub(UniqueId.root("root", "1"), "failingTest") { + var failedException = new RuntimeException("Pow!"); + var testDescriptor = new TestDescriptorStub(UniqueId.root("root", "1"), "failingTest") { @Override public Optional getSource() { return Optional.of(ClassSource.from(Object.class)); } }; - TestIdentifier failingTest = TestIdentifier.from(testDescriptor); + var failingTest = TestIdentifier.from(testDescriptor); listener.testPlanExecutionStarted(testPlan); listener.executionStarted(failingTest); listener.executionFinished(failingTest, TestExecutionResult.failed(failedException)); listener.testPlanExecutionFinished(testPlan); - final List failures = listener.getSummary().getFailures(); + final var failures = listener.getSummary().getFailures(); assertThat(failures).hasSize(1); assertThat(failures.get(0).getException()).isEqualTo(failedException); assertThat(failures.get(0).getTestIdentifier()).isEqualTo(failingTest); @@ -152,20 +151,20 @@ public Optional getSource() { @Test void reportingCorrectFailures() { - IllegalArgumentException iaeCausedBy = new IllegalArgumentException("Illegal Argument Exception"); - RuntimeException failedException = new RuntimeException("Runtime Exception", iaeCausedBy); - NullPointerException npeSuppressed = new NullPointerException("Null Pointer Exception"); + var iaeCausedBy = new IllegalArgumentException("Illegal Argument Exception"); + var failedException = new RuntimeException("Runtime Exception", iaeCausedBy); + var npeSuppressed = new NullPointerException("Null Pointer Exception"); failedException.addSuppressed(npeSuppressed); - TestDescriptorStub testDescriptor = new TestDescriptorStub(UniqueId.root("root", "2"), "failingTest") { + var testDescriptor = new TestDescriptorStub(UniqueId.root("root", "2"), "failingTest") { @Override public Optional getSource() { return Optional.of(ClassSource.from(Object.class)); } }; - TestIdentifier failed = TestIdentifier.from(testDescriptor); - TestIdentifier aborted = TestIdentifier.from(new TestDescriptorStub(UniqueId.root("root", "3"), "abortedTest")); + var failed = TestIdentifier.from(testDescriptor); + var aborted = TestIdentifier.from(new TestDescriptorStub(UniqueId.root("root", "3"), "abortedTest")); listener.testPlanExecutionStarted(testPlan); listener.executionStarted(failed); @@ -177,7 +176,7 @@ public Optional getSource() { // An aborted test is not a failure assertEquals(1, listener.getSummary().getTestsFailedCount()); - String failuresString = failuresAsString(); + var failuresString = failuresAsString(); assertAll("failures", // () -> assertTrue(failuresString.contains("Failures (1)"), "test failures"), // () -> assertTrue(failuresString.contains(Object.class.getName()), "source"), // @@ -190,20 +189,20 @@ public Optional getSource() { @Test public void reportingCircularFailure() { - IllegalArgumentException iaeCausedBy = new IllegalArgumentException("Illegal Argument Exception"); - RuntimeException failedException = new RuntimeException("Runtime Exception", iaeCausedBy); - NullPointerException npeSuppressed = new NullPointerException("Null Pointer Exception"); + var iaeCausedBy = new IllegalArgumentException("Illegal Argument Exception"); + var failedException = new RuntimeException("Runtime Exception", iaeCausedBy); + var npeSuppressed = new NullPointerException("Null Pointer Exception"); failedException.addSuppressed(npeSuppressed); npeSuppressed.addSuppressed(iaeCausedBy); - TestDescriptorStub testDescriptor = new TestDescriptorStub(UniqueId.root("root", "2"), "failingTest") { + var testDescriptor = new TestDescriptorStub(UniqueId.root("root", "2"), "failingTest") { @Override public Optional getSource() { return Optional.of(ClassSource.from(Object.class)); } }; - TestIdentifier failed = TestIdentifier.from(testDescriptor); + var failed = TestIdentifier.from(testDescriptor); listener.testPlanExecutionStarted(testPlan); listener.executionStarted(failed); @@ -212,7 +211,7 @@ public Optional getSource() { assertEquals(1, listener.getSummary().getTestsFailedCount()); - String failuresString = failuresAsString(); + var failuresString = failuresAsString(); assertAll("failures", // () -> assertTrue(failuresString.contains("Suppressed: " + npeSuppressed), "Suppressed exception"), // () -> assertTrue(failuresString.contains("Circular reference: " + iaeCausedBy), "Circular reference"), // @@ -223,34 +222,32 @@ public Optional getSource() { @SuppressWarnings("deprecation") private TestIdentifier createTestIdentifier(String uniqueId) { - TestIdentifier identifier = TestIdentifier.from( - new TestDescriptorStub(UniqueId.root("test", uniqueId), uniqueId)); + var identifier = TestIdentifier.from(new TestDescriptorStub(UniqueId.root("test", uniqueId), uniqueId)); testPlan.add(identifier); return identifier; } @SuppressWarnings("deprecation") private TestIdentifier createContainerIdentifier(String uniqueId) { - TestIdentifier identifier = TestIdentifier.from( - new TestDescriptorStub(UniqueId.root("container", uniqueId), uniqueId) { - - @Override - public Type getType() { - return Type.CONTAINER; - } - }); + var identifier = TestIdentifier.from(new TestDescriptorStub(UniqueId.root("container", uniqueId), uniqueId) { + + @Override + public Type getType() { + return Type.CONTAINER; + } + }); testPlan.add(identifier); return identifier; } private String summaryAsString() { - StringWriter summaryWriter = new StringWriter(); + var summaryWriter = new StringWriter(); listener.getSummary().printTo(new PrintWriter(summaryWriter)); return summaryWriter.toString(); } private String failuresAsString() { - StringWriter failuresWriter = new StringWriter(); + var failuresWriter = new StringWriter(); listener.getSummary().printFailuresTo(new PrintWriter(failuresWriter)); return failuresWriter.toString(); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java index 5a2817934103..c26431e30fe4 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java @@ -96,7 +96,7 @@ private static Stream data() { private String parseErrorFromParsing(String tagExpression) { try { - ParseResult parseResult = parser.parse(tagExpression); + var parseResult = parser.parse(tagExpression); parseResult.tagExpressionOrThrow(RuntimeException::new); return null; } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java index 5d0d229494fa..76317c319023 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java @@ -47,7 +47,7 @@ void rejectInvalidTestTags() { @Test void tagEvaluation() { - TagExpression tagExpression = tag("foo"); + var tagExpression = tag("foo"); assertThat(tagExpression.evaluate(singleton(create("foo")))).isTrue(); assertThat(tagExpression.evaluate(singleton(create("not_foo")))).isFalse(); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java index 7ca3c5265f55..5bacfc948009 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java @@ -12,8 +12,6 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import java.util.List; - import org.junit.jupiter.api.Test; class TokenTests { @@ -41,10 +39,10 @@ void lastCharacterIndex() { @Test void concatenateTwoTokens() { - List tokens = new Tokenizer().tokenize(" ! foo"); - Token one = tokens.get(0); - Token two = tokens.get(1); - Token joined = one.concatenate(two); + var tokens = new Tokenizer().tokenize(" ! foo"); + var one = tokens.get(0); + var two = tokens.get(1); + var joined = one.concatenate(two); assertThat(joined.rawString).isEqualTo(" ! foo"); assertThat(joined.startIndex).isEqualTo(0); } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java index 26b54d071fe1..18dfc914de42 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java @@ -31,8 +31,8 @@ class LegacyReportingUtilsTests { @Test void legacyReportingClassNameForTestIdentifierWithoutClassSourceIsParentLegacyReportingName() { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("child", "bar"); - TestDescriptor testDescriptor = createTestDescriptor(uniqueId, "Bar", null); + var uniqueId = engineDescriptor.getUniqueId().append("child", "bar"); + var testDescriptor = createTestDescriptor(uniqueId, "Bar", null); engineDescriptor.addChild(testDescriptor); assertThat(getClassName(engineDescriptor.getUniqueId())).isEqualTo(""); @@ -44,17 +44,17 @@ void legacyReportingClassNameForTestIdentifierWithoutClassSourceIsParentLegacyRe @Test void legacyReportingClassNameForDescendantOfTestIdentifierWithClassSourceIsClassName() { - UniqueId classUniqueId = engineDescriptor.getUniqueId().append("class", "class"); - TestDescriptor classDescriptor = createTestDescriptor(classUniqueId, "Class", + var classUniqueId = engineDescriptor.getUniqueId().append("class", "class"); + var classDescriptor = createTestDescriptor(classUniqueId, "Class", ClassSource.from(LegacyReportingUtilsTests.class)); engineDescriptor.addChild(classDescriptor); - UniqueId subUniqueId = classUniqueId.append("sub", "baz"); - TestDescriptor subDescriptor = createTestDescriptor(subUniqueId, "Baz", null); + var subUniqueId = classUniqueId.append("sub", "baz"); + var subDescriptor = createTestDescriptor(subUniqueId, "Baz", null); classDescriptor.addChild(subDescriptor); - UniqueId subSubUniqueId = subUniqueId.append("subsub", "qux"); - TestDescriptor subSubDescriptor = createTestDescriptor(subSubUniqueId, "Qux", null); + var subSubUniqueId = subUniqueId.append("subsub", "qux"); + var subSubDescriptor = createTestDescriptor(subSubUniqueId, "Qux", null); subDescriptor.addChild(subSubDescriptor); assertThat(getClassName(engineDescriptor.getUniqueId())).isEqualTo(""); @@ -69,13 +69,13 @@ void legacyReportingClassNameForDescendantOfTestIdentifierWithClassSourceIsClass } private String getClassName(UniqueId uniqueId) { - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); return LegacyReportingUtils.getClassName(testPlan, testPlan.getTestIdentifier(uniqueId.toString())); } @SuppressWarnings("deprecation") private String getClassNameFromOldLocation(UniqueId uniqueId) { - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); return org.junit.platform.launcher.listeners.LegacyReportingUtils.getClassName(testPlan, testPlan.getTestIdentifier(uniqueId.toString())); } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java index 24e9d280e9e6..1ec5f63218c0 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java @@ -46,10 +46,8 @@ import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.reporting.ReportEntry; import org.junit.platform.engine.support.descriptor.EngineDescriptor; -import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestDescriptor; import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine; import org.junit.platform.fakes.TestDescriptorStub; -import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; import org.opentest4j.AssertionFailedError; @@ -63,13 +61,13 @@ class LegacyXmlReportGeneratingListenerTests { @Test void writesFileForSingleSucceedingTest(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("succeedingTest", "display<-->Name 😎", () -> { }); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -96,12 +94,12 @@ void writesFileForSingleSucceedingTest(@TempDir Path tempDirectory) throws Excep @Test void writesFileForSingleFailingTest(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("failingTest", () -> fail("expected to fail")); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -121,14 +119,14 @@ void writesFileForSingleFailingTest(@TempDir Path tempDirectory) throws Exceptio @Test void writesFileForSingleErroneousTest(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("failingTest", () -> { throw new RuntimeException("error occurred"); }); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -148,13 +146,13 @@ void writesFileForSingleErroneousTest(@TempDir Path tempDirectory) throws Except @Test void writesFileForSingleSkippedTest(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); - DemoHierarchicalTestDescriptor testDescriptor = engine.addTest("skippedTest", () -> fail("never called")); + var engine = new DemoHierarchicalTestEngine("dummy"); + var testDescriptor = engine.addTest("skippedTest", () -> fail("never called")); testDescriptor.markSkipped("should be skipped"); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -173,12 +171,12 @@ void writesFileForSingleSkippedTest(@TempDir Path tempDirectory) throws Exceptio @Test void writesFileForSingleAbortedTest(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("abortedTest", () -> assumeFalse(true, "deliberately aborted")); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -199,7 +197,7 @@ void writesFileForSingleAbortedTest(@TempDir Path tempDirectory) throws Exceptio @Test void measuresTimesInSeconds(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("firstTest", () -> { }); engine.addTest("secondTest", () -> { @@ -207,7 +205,7 @@ void measuresTimesInSeconds(@TempDir Path tempDirectory) throws Exception { executeTests(engine, tempDirectory, new IncrementingClock(0, Duration.ofMillis(333))); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off // start end @@ -225,13 +223,13 @@ void measuresTimesInSeconds(@TempDir Path tempDirectory) throws Exception { @Test void testWithImmeasurableTimeIsOutputCorrectly(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> { }); executeTests(engine, tempDirectory, Clock.fixed(Instant.EPOCH, ZoneId.systemDefault())); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -243,13 +241,13 @@ void testWithImmeasurableTimeIsOutputCorrectly(@TempDir Path tempDirectory) thro @Test void writesFileForSkippedContainer(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> fail("never called")); engine.getEngineDescriptor().markSkipped("should be skipped"); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -266,13 +264,13 @@ void writesFileForSkippedContainer(@TempDir Path tempDirectory) throws Exception @Test void writesFileForFailingContainer(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> fail("never called")); engine.getEngineDescriptor().setBeforeAllBehavior(() -> fail("failure before all tests")); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -290,13 +288,13 @@ void writesFileForFailingContainer(@TempDir Path tempDirectory) throws Exception @Test void writesSystemProperties(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> { }); executeTests(engine, tempDirectory); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -313,16 +311,16 @@ void writesSystemProperties(@TempDir Path tempDirectory) throws Exception { @Test void writesHostNameAndTimestamp(@TempDir Path tempDirectory) throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> { }); - LocalDateTime now = LocalDateTime.parse("2016-01-28T14:02:59.123"); - ZoneId zone = ZoneId.systemDefault(); + var now = LocalDateTime.parse("2016-01-28T14:02:59.123"); + var zone = ZoneId.systemDefault(); executeTests(engine, tempDirectory, Clock.fixed(ZonedDateTime.of(now, zone).toInstant(), zone)); - String content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); // @formatter:off assertThat(content) @@ -337,12 +335,11 @@ void writesHostNameAndTimestamp(@TempDir Path tempDirectory) throws Exception { @Test void printsExceptionWhenReportsDirCannotBeCreated(@TempDir Path tempDirectory) throws Exception { - Path reportsDir = tempDirectory.resolve("dummy.txt"); + var reportsDir = tempDirectory.resolve("dummy.txt"); Files.write(reportsDir, singleton("content")); - StringWriter out = new StringWriter(); - LegacyXmlReportGeneratingListener listener = new LegacyXmlReportGeneratingListener(reportsDir, - new PrintWriter(out)); + var out = new StringWriter(); + var listener = new LegacyXmlReportGeneratingListener(reportsDir, new PrintWriter(out)); listener.testPlanExecutionStarted(TestPlan.from(emptySet())); @@ -352,14 +349,13 @@ void printsExceptionWhenReportsDirCannotBeCreated(@TempDir Path tempDirectory) t @Test void printsExceptionWhenReportCouldNotBeWritten(@TempDir Path tempDirectory) throws Exception { - EngineDescriptor engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); + var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); - Path xmlFile = tempDirectory.resolve("TEST-engine.xml"); + var xmlFile = tempDirectory.resolve("TEST-engine.xml"); Files.createDirectories(xmlFile); - StringWriter out = new StringWriter(); - LegacyXmlReportGeneratingListener listener = new LegacyXmlReportGeneratingListener(tempDirectory, - new PrintWriter(out)); + var out = new StringWriter(); + var listener = new LegacyXmlReportGeneratingListener(tempDirectory, new PrintWriter(out)); listener.testPlanExecutionStarted(TestPlan.from(singleton(engineDescriptor))); listener.executionFinished(TestIdentifier.from(engineDescriptor), successful()); @@ -370,16 +366,15 @@ void printsExceptionWhenReportCouldNotBeWritten(@TempDir Path tempDirectory) thr @Test void writesReportEntriesToSystemOutElement(@TempDir Path tempDirectory, TestReporter testReporter) throws Exception { - EngineDescriptor engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); + var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - StringWriter out = new StringWriter(); - LegacyXmlReportGeneratingListener listener = new LegacyXmlReportGeneratingListener(tempDirectory, - new PrintWriter(out)); + var out = new StringWriter(); + var listener = new LegacyXmlReportGeneratingListener(tempDirectory, new PrintWriter(out)); listener.testPlanExecutionStarted(testPlan); - TestIdentifier testIdentifier = testPlan.getTestIdentifier("[child:test]"); + var testIdentifier = testPlan.getTestIdentifier("[child:test]"); listener.executionStarted(testIdentifier); listener.reportingEntryPublished(testIdentifier, ReportEntry.from("foo", "bar")); Map map = new LinkedHashMap<>(); @@ -389,7 +384,7 @@ void writesReportEntriesToSystemOutElement(@TempDir Path tempDirectory, TestRepo listener.executionFinished(testIdentifier, successful()); listener.executionFinished(testPlan.getTestIdentifier("[engine:engine]"), successful()); - String content = readValidXmlFile(tempDirectory.resolve("TEST-engine.xml")); + var content = readValidXmlFile(tempDirectory.resolve("TEST-engine.xml")); //testReporter.publishEntry("xml", content); // @formatter:off @@ -414,17 +409,16 @@ private void executeTests(TestEngine engine, Path tempDirectory) { } private void executeTests(TestEngine engine, Path tempDirectory, Clock clock) { - PrintWriter out = new PrintWriter(new StringWriter()); - LegacyXmlReportGeneratingListener reportListener = new LegacyXmlReportGeneratingListener( - tempDirectory.toString(), out, clock); - Launcher launcher = createLauncher(engine); + var out = new PrintWriter(new StringWriter()); + var reportListener = new LegacyXmlReportGeneratingListener(tempDirectory.toString(), out, clock); + var launcher = createLauncher(engine); launcher.registerTestExecutionListeners(reportListener); launcher.execute(request().selectors(selectUniqueId(UniqueId.forEngine(engine.getId()))).build()); } private String readValidXmlFile(Path xmlFile) throws Exception { assertTrue(Files.exists(xmlFile), () -> "File does not exist: " + xmlFile); - String content = new String(Files.readAllBytes(xmlFile), UTF_8); + var content = new String(Files.readAllBytes(xmlFile), UTF_8); assertValidAccordingToJenkinsSchema(content); return content; } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java index 3cb96bdd35f7..f9428edf52ac 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java @@ -13,7 +13,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.io.StringReader; -import java.net.URL; import javax.xml.XMLConstants; import javax.xml.transform.stream.StreamSource; @@ -31,7 +30,7 @@ class XmlReportAssertions { static void assertValidAccordingToJenkinsSchema(String content) throws Exception { try { // Schema is thread-safe, Validator is not - Validator validator = CachedSchema.JENKINS.newValidator(); + var validator = CachedSchema.JENKINS.newValidator(); validator.validate(new StreamSource(new StringReader(content))); } catch (SAXException e) { @@ -46,8 +45,8 @@ private enum CachedSchema { private final Schema schema; CachedSchema(String resourcePath) { - URL schemaFile = LegacyXmlReportGeneratingListener.class.getResource(resourcePath); - SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + var schemaFile = LegacyXmlReportGeneratingListener.class.getResource(resourcePath); + var schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); try { this.schema = schemaFactory.newSchema(schemaFile); } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java index 2d3a530027da..b23157d56dc6 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java @@ -16,10 +16,8 @@ import static org.junit.platform.engine.TestExecutionResult.successful; import java.time.Clock; -import java.util.Optional; import org.junit.jupiter.api.Test; -import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.support.descriptor.EngineDescriptor; import org.junit.platform.fakes.TestDescriptorStub; @@ -32,41 +30,41 @@ class XmlReportDataTests { @Test void resultOfTestIdentifierWithoutAnyReportedEventsIsEmpty() { - EngineDescriptor engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); + var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - Optional result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); assertThat(result).isEmpty(); } @Test void resultOfTestIdentifierWithoutReportedEventsIsFailureOfAncestor() { - EngineDescriptor engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); + var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - TestExecutionResult failureOfAncestor = failed(new RuntimeException("failed!")); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var failureOfAncestor = failed(new RuntimeException("failed!")); reportData.markFinished(testPlan.getTestIdentifier("[engine:engine]"), failureOfAncestor); - Optional result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); + var result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); assertThat(result).contains(failureOfAncestor); } @Test void resultOfTestIdentifierWithoutReportedEventsIsEmptyWhenAncestorWasSuccessful() { - EngineDescriptor engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); + var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier("[engine:engine]"), successful()); - Optional result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); + var result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); assertThat(result).isEmpty(); } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java index 3064734df1d1..bf0b797a958b 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java @@ -48,11 +48,11 @@ class XmlReportWriterTests { @Test void writesTestsuiteElementsWithoutTestcaseElementsWithoutAnyTests() throws Exception { - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - String content = writeXmlReport(testPlan, reportData); + var content = writeXmlReport(testPlan, reportData); assertValidAccordingToJenkinsSchema(content); //@formatter:off @@ -66,16 +66,16 @@ void writesTestsuiteElementsWithoutTestcaseElementsWithoutAnyTests() throws Exce @Test void writesReportEntry() throws Exception { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); - TestDescriptorStub testDescriptor = new TestDescriptorStub(uniqueId, "successfulTest"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var testDescriptor = new TestDescriptorStub(uniqueId, "successfulTest"); engineDescriptor.addChild(testDescriptor); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.addReportEntry(TestIdentifier.from(testDescriptor), ReportEntry.from("myKey", "myValue")); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), successful()); - String content = writeXmlReport(testPlan, reportData); + var content = writeXmlReport(testPlan, reportData); assertValidAccordingToJenkinsSchema(content); //@formatter:off @@ -90,13 +90,13 @@ void writesReportEntry() throws Exception { @Test void writesCapturedOutput() throws Exception { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); - TestDescriptorStub testDescriptor = new TestDescriptorStub(uniqueId, "successfulTest"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var testDescriptor = new TestDescriptorStub(uniqueId, "successfulTest"); engineDescriptor.addChild(testDescriptor); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - ReportEntry reportEntry = ReportEntry.from(Map.of( // + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var reportEntry = ReportEntry.from(Map.of( // STDOUT_REPORT_ENTRY_KEY, "normal output", // STDERR_REPORT_ENTRY_KEY, "error output", // "foo", "bar")); @@ -104,7 +104,7 @@ void writesCapturedOutput() throws Exception { reportData.addReportEntry(TestIdentifier.from(testDescriptor), ReportEntry.from(Map.of("baz", "qux"))); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), successful()); - String content = writeXmlReport(testPlan, reportData); + var content = writeXmlReport(testPlan, reportData); assertValidAccordingToJenkinsSchema(content); //@formatter:off @@ -132,14 +132,14 @@ void writesCapturedOutput() throws Exception { @Test void writesEmptySkippedElementForSkippedTestWithoutReason() throws Exception { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "skippedTest")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markSkipped(testPlan.getTestIdentifier(uniqueId.toString()), null); - String content = writeXmlReport(testPlan, reportData); + var content = writeXmlReport(testPlan, reportData); assertValidAccordingToJenkinsSchema(content); //@formatter:off @@ -159,19 +159,19 @@ public String getLegacyReportingName() { return "myEngine"; } }; - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "some fancy name") { @Override public String getLegacyReportingName() { return "failedTest"; } }); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(null)); - String content = writeXmlReport(testPlan, reportData); + var content = writeXmlReport(testPlan, reportData); assertValidAccordingToJenkinsSchema(content); //@formatter:off @@ -185,14 +185,14 @@ public String getLegacyReportingName() { @Test void omitsMessageAttributeForFailedTestWithThrowableWithoutMessage() throws Exception { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "failedTest")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(new NullPointerException())); - String content = writeXmlReport(testPlan, reportData); + var content = writeXmlReport(testPlan, reportData); assertValidAccordingToJenkinsSchema(content); //@formatter:off @@ -206,15 +206,15 @@ void omitsMessageAttributeForFailedTestWithThrowableWithoutMessage() throws Exce @Test void writesValidXmlEvenIfExceptionMessageContainsCData() throws Exception { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - AssertionError assertionError = new AssertionError(""); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var assertionError = new AssertionError(""); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); - String content = writeXmlReport(testPlan, reportData); + var content = writeXmlReport(testPlan, reportData); assertValidAccordingToJenkinsSchema(content); //@formatter:off @@ -229,12 +229,12 @@ void writesValidXmlEvenIfExceptionMessageContainsCData() throws Exception { @Test void escapesInvalidCharactersInSystemPropertiesAndExceptionMessages(TestInfo testInfo) throws Exception { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - AssertionError assertionError = new AssertionError("expected: but was: "); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var assertionError = new AssertionError("expected: but was: "); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); System.setProperty("foo.bar", "\1"); @@ -255,12 +255,12 @@ void escapesInvalidCharactersInSystemPropertiesAndExceptionMessages(TestInfo tes @Test void doesNotReopenCDataWithinCDataContent() throws Exception { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); + var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); - TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(singleton(engineDescriptor)); - XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - AssertionError assertionError = new AssertionError(""); + var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); + var assertionError = new AssertionError(""); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); Writer assertingWriter = new StringWriter() { @@ -294,7 +294,7 @@ static Stream stringPairs() { } private String writeXmlReport(TestPlan testPlan, XmlReportData reportData) throws Exception { - StringWriter out = new StringWriter(); + var out = new StringWriter(); writeXmlReport(testPlan, reportData, out); return out.toString(); } diff --git a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java index 32d5cb8b5be8..bbde830b43c5 100644 --- a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java @@ -38,17 +38,14 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import java.lang.reflect.Method; import java.util.Arrays; import java.util.List; -import java.util.Set; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.junit.platform.engine.EngineDiscoveryRequest; -import org.junit.platform.engine.EngineExecutionListener; import org.junit.platform.engine.ExecutionRequest; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestEngine; @@ -64,15 +61,12 @@ import org.junit.platform.engine.support.descriptor.ClassSource; import org.junit.platform.engine.support.descriptor.EngineDescriptor; import org.junit.platform.engine.support.descriptor.MethodSource; -import org.junit.platform.engine.support.hierarchical.DemoHierarchicalContainerDescriptor; import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestDescriptor; import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine; import org.junit.platform.fakes.TestDescriptorStub; import org.junit.platform.fakes.TestEngineStub; -import org.junit.platform.launcher.EngineFilter; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; -import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestPlan; import org.junit.platform.suite.api.ExcludeClassNamePatterns; import org.junit.platform.suite.api.ExcludeEngines; @@ -91,7 +85,6 @@ import org.junit.runner.notification.RunListener; import org.junit.runner.notification.RunNotifier; import org.mockito.ArgumentCaptor; -import org.mockito.InOrder; /** * Tests for the {@link JUnitPlatform} runner. @@ -110,11 +103,11 @@ void requestsClassSelectorForAnnotatedClassWhenNoAdditionalAnnotationsArePresent class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List selectors = request.getSelectorsByType(ClassSelector.class); + var selectors = request.getSelectorsByType(ClassSelector.class); assertThat(selectors).hasSize(1); - ClassSelector classSelector = getOnlyElement(selectors); + var classSelector = getOnlyElement(selectors); assertEquals(TestCase.class, classSelector.getJavaClass()); } @@ -125,9 +118,9 @@ void requestsClassSelectorsWhenSelectClassesAnnotationIsPresent() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List selectors = request.getSelectorsByType(ClassSelector.class); + var selectors = request.getSelectorsByType(ClassSelector.class); assertThat(selectors).hasSize(2); assertEquals(Short.class, selectors.get(0).getJavaClass()); assertEquals(Byte.class, selectors.get(1).getJavaClass()); @@ -140,9 +133,9 @@ void requestsPackageSelectorsWhenPackagesAnnotationIsPresent() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List selectors = request.getSelectorsByType(PackageSelector.class); + var selectors = request.getSelectorsByType(PackageSelector.class); assertThat(selectors).hasSize(2); assertEquals("foo", selectors.get(0).getPackageName()); assertEquals("bar", selectors.get(1).getPackageName()); @@ -155,12 +148,12 @@ void addsPackageFiltersToRequestWhenIncludePackageAnnotationIsPresent() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(PackageNameFilter.class); + var filters = request.getFiltersByType(PackageNameFilter.class); assertThat(filters).hasSize(1); - PackageNameFilter filter = filters.get(0); + var filter = filters.get(0); assertTrue(filter.apply("includedpackage1.TestClass").included()); assertTrue(filter.apply("includedpackage2.TestClass").included()); assertTrue(filter.apply("excludedpackage1.TestClass").excluded()); @@ -173,12 +166,12 @@ void addsPackageFiltersToRequestWhenExcludePackageAnnotationIsPresent() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(PackageNameFilter.class); + var filters = request.getFiltersByType(PackageNameFilter.class); assertThat(filters).hasSize(1); - PackageNameFilter filter = filters.get(0); + var filter = filters.get(0); assertTrue(filter.apply("includedpackage1.TestClass").included()); assertTrue(filter.apply("excludedpackage1.TestClass").excluded()); assertTrue(filter.apply("excludedpackage2.TestClass").excluded()); @@ -191,12 +184,12 @@ void addsTagFilterToRequestWhenIncludeTagsAnnotationIsPresent() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getPostDiscoveryFilters(); + var filters = request.getPostDiscoveryFilters(); assertThat(filters).hasSize(1); - PostDiscoveryFilter filter = filters.get(0); + var filter = filters.get(0); assertTrue(filter.apply(testDescriptorWithTags("foo")).included()); assertTrue(filter.apply(testDescriptorWithTags("bar")).included()); assertTrue(filter.apply(testDescriptorWithTags("baz")).excluded()); @@ -209,12 +202,12 @@ void addsTagFilterToRequestWhenExcludeTagsAnnotationIsPresent() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getPostDiscoveryFilters(); + var filters = request.getPostDiscoveryFilters(); assertThat(filters).hasSize(1); - PostDiscoveryFilter filter = filters.get(0); + var filter = filters.get(0); assertTrue(filter.apply(testDescriptorWithTags("foo")).excluded()); assertTrue(filter.apply(testDescriptorWithTags("bar")).excluded()); assertTrue(filter.apply(testDescriptorWithTags("baz")).included()); @@ -227,12 +220,12 @@ void includeTagsAcceptsTagExpressions() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getPostDiscoveryFilters(); + var filters = request.getPostDiscoveryFilters(); assertThat(filters).hasSize(1); - PostDiscoveryFilter filter = filters.get(0); + var filter = filters.get(0); assertTrue(filter.apply(testDescriptorWithTags("foo")).included()); assertTrue(filter.apply(testDescriptorWithTags("foo", "any_other_tag")).included()); assertTrue(filter.apply(testDescriptorWithTags("foo", "bar")).excluded()); @@ -247,12 +240,12 @@ void excludeTagsAcceptsTagExpressions() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getPostDiscoveryFilters(); + var filters = request.getPostDiscoveryFilters(); assertThat(filters).hasSize(1); - PostDiscoveryFilter filter = filters.get(0); + var filter = filters.get(0); assertTrue(filter.apply(testDescriptorWithTags("foo")).excluded()); assertTrue(filter.apply(testDescriptorWithTags("foo", "any_other_tag")).excluded()); assertTrue(filter.apply(testDescriptorWithTags("foo", "bar")).included()); @@ -273,18 +266,18 @@ class TestCase { TestEngine bazEngine = new TestEngineStub("baz"); TestEngine quuxEngine = new TestEngineStub("quux"); - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getEngineFilters(); + var filters = request.getEngineFilters(); assertThat(filters).hasSize(2); - EngineFilter includeFilter = filters.get(0); + var includeFilter = filters.get(0); assertTrue(includeFilter.apply(fooEngine).included()); assertTrue(includeFilter.apply(barEngine).included()); assertTrue(includeFilter.apply(bazEngine).included()); assertTrue(includeFilter.apply(quuxEngine).excluded()); - EngineFilter excludeFilter = filters.get(1); + var excludeFilter = filters.get(1); assertTrue(excludeFilter.apply(fooEngine).included()); assertTrue(excludeFilter.apply(barEngine).excluded()); assertTrue(excludeFilter.apply(bazEngine).included()); @@ -298,9 +291,9 @@ void addsDefaultClassNameFilterToRequestWhenFilterClassNameAnnotationIsNotPresen class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains(STANDARD_INCLUDE_PATTERN); } @@ -310,9 +303,9 @@ void addsDefaultClassNameFilterToRequestWhenFilterClassNameAnnotationIsNotPresen class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(filters).isEmpty(); } @@ -323,9 +316,9 @@ void addsSingleExplicitClassNameFilterToRequestWhenIncludeClassNamePatternsAnnot class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains(".*Foo"); } @@ -336,9 +329,9 @@ void addsSingleClassNameFilterToRequestWhenExcludeClassNamePatternsAnnotationIsP class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains(".*Foo"); } @@ -349,9 +342,9 @@ void addsMultipleExplicitClassNameFilterToRequestWhenIncludeClassNamePatternsAnn class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains(".*Foo", "Bar.*"); } @@ -362,9 +355,9 @@ void addsMultipleClassNameFilterToRequestWhenExcludeClassNamePatternsAnnotationI class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains(".*Foo", "Bar.*"); } @@ -375,9 +368,9 @@ void usesStandardIncludePatternWhenIncludeClassNamePatternsAnnotationIsPresentWi class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains(STANDARD_INCLUDE_PATTERN); } @@ -388,9 +381,9 @@ void doesNotAddClassNameFilterWhenIncludeClassNamePatternsAnnotationIsPresentWit class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(filters).isEmpty(); } @@ -401,9 +394,9 @@ void doesNotAddClassNameFilterWhenExcludeClassNamePatternsAnnotationIsPresentWit class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(filters).isEmpty(); } @@ -414,9 +407,9 @@ void trimsArgumentsOfIncludeClassNamePatternsAnnotation() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains("'foo'", "'bar'"); } @@ -427,9 +420,9 @@ void trimsArgumentsOfExcludeClassNamePatternsAnnotation() { class TestCase { } - LauncherDiscoveryRequest request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); + var request = instantiateRunnerAndCaptureGeneratedRequest(TestCase.class); - List filters = request.getFiltersByType(ClassNameFilter.class); + var filters = request.getFiltersByType(ClassNameFilter.class); assertThat(getOnlyElement(filters).toString()).contains("'foo'", "'bar'"); } @@ -441,14 +434,14 @@ void convertsTestIdentifiersIntoDescriptions() { TestDescriptor container2 = new TestDescriptorStub(UniqueId.root("root", "container2"), "container2"); container2.addChild(new TestDescriptorStub(UniqueId.root("root", "test2a"), "test2a")); container2.addChild(new TestDescriptorStub(UniqueId.root("root", "test2b"), "test2b")); - TestPlan testPlan = TestPlan.from(asList(container1, container2)); + var testPlan = TestPlan.from(asList(container1, container2)); - Launcher launcher = mock(Launcher.class); + var launcher = mock(Launcher.class); when(launcher.discover(any())).thenReturn(testPlan); - JUnitPlatform runner = new JUnitPlatform(TestClass.class, launcher); + var runner = new JUnitPlatform(TestClass.class, launcher); - Description runnerDescription = runner.getDescription(); + var runnerDescription = runner.getDescription(); assertEquals(createSuiteDescription(TestClass.class), runnerDescription); List containerDescriptions = runnerDescription.getChildren(); @@ -478,38 +471,38 @@ void appliesFilter() throws Exception { TestDescriptor originalParent2 = new TestDescriptorStub(UniqueId.root("root", "parent2"), "parent2"); originalParent2.addChild(new TestDescriptorStub(UniqueId.root("root", "leaf2a"), "leaf2a")); originalParent2.addChild(new TestDescriptorStub(UniqueId.root("root", "leaf2b"), "leaf2b")); - TestPlan fullTestPlan = TestPlan.from(asList(originalParent1, originalParent2)); + var fullTestPlan = TestPlan.from(asList(originalParent1, originalParent2)); TestDescriptor filteredParent = new TestDescriptorStub(UniqueId.root("root", "parent2"), "parent2"); filteredParent.addChild(new TestDescriptorStub(UniqueId.root("root", "leaf2b"), "leaf2b")); - TestPlan filteredTestPlan = TestPlan.from(singleton(filteredParent)); + var filteredTestPlan = TestPlan.from(singleton(filteredParent)); - Launcher launcher = mock(Launcher.class); - ArgumentCaptor captor = ArgumentCaptor.forClass(LauncherDiscoveryRequest.class); + var launcher = mock(Launcher.class); + var captor = ArgumentCaptor.forClass(LauncherDiscoveryRequest.class); when(launcher.discover(captor.capture())).thenReturn(fullTestPlan).thenReturn(filteredTestPlan); - JUnitPlatform runner = new JUnitPlatform(TestClass.class, launcher); + var runner = new JUnitPlatform(TestClass.class, launcher); runner.filter(matchMethodDescription(testDescription("[root:leaf2b]"))); - LauncherDiscoveryRequest lastDiscoveryRequest = captor.getValue(); - List uniqueIdSelectors = lastDiscoveryRequest.getSelectorsByType(UniqueIdSelector.class); + var lastDiscoveryRequest = captor.getValue(); + var uniqueIdSelectors = lastDiscoveryRequest.getSelectorsByType(UniqueIdSelector.class); assertEquals("[root:leaf2b]", getOnlyElement(uniqueIdSelectors).getUniqueId().toString()); - Description parentDescription = getOnlyElement(runner.getDescription().getChildren()); + var parentDescription = getOnlyElement(runner.getDescription().getChildren()); assertEquals(suiteDescription("[root:parent2]"), parentDescription); - Description testDescription = getOnlyElement(parentDescription.getChildren()); + var testDescription = getOnlyElement(parentDescription.getChildren()); assertEquals(testDescription("[root:leaf2b]"), testDescription); } @Test void throwsNoTestsRemainExceptionWhenNoTestIdentifierMatchesFilter() { - TestPlan testPlan = TestPlan.from(singleton(new TestDescriptorStub(UniqueId.root("root", "test"), "test"))); + var testPlan = TestPlan.from(singleton(new TestDescriptorStub(UniqueId.root("root", "test"), "test"))); - Launcher launcher = mock(Launcher.class); + var launcher = mock(Launcher.class); when(launcher.discover(any())).thenReturn(testPlan); - JUnitPlatform runner = new JUnitPlatform(TestClass.class, launcher); + var runner = new JUnitPlatform(TestClass.class, launcher); assertThrows(NoTestsRemainException.class, () -> runner.filter(matchMethodDescription(suiteDescription("[root:doesNotExist]")))); @@ -522,20 +515,20 @@ class Execution { @Test void notifiesRunListenerOfTestExecution() throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); + var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("failingTest", () -> fail("expected to fail")); engine.addTest("succeedingTest", () -> { }); engine.addTest("abortedTest", () -> assumeFalse(true)); engine.addTest("skippedTest", () -> fail("never called")).markSkipped("should be skipped"); - RunListener runListener = mock(RunListener.class); + var runListener = mock(RunListener.class); - RunNotifier notifier = new RunNotifier(); + var notifier = new RunNotifier(); notifier.addListener(runListener); new JUnitPlatform(TestClass.class, createLauncher(engine)).run(notifier); - InOrder inOrder = inOrder(runListener); + var inOrder = inOrder(runListener); inOrder.verify(runListener).testStarted(testDescription("[engine:dummy]/[test:failingTest]")); inOrder.verify(runListener).testFailure(any()); @@ -555,13 +548,13 @@ void notifiesRunListenerOfTestExecution() throws Exception { @Test void supportsDynamicTestRegistration() throws Exception { - RunListener runListener = mock(RunListener.class); - RunNotifier notifier = new RunNotifier(); + var runListener = mock(RunListener.class); + var notifier = new RunNotifier(); // notifier.addListener(new LoggingRunListener()); notifier.addListener(runListener); new JUnitPlatform(TestClass.class, createLauncher(new DynamicTestEngine())).run(notifier); - InOrder inOrder = inOrder(runListener); + var inOrder = inOrder(runListener); inOrder.verify(runListener).testStarted(testDescription("[engine:dynamic]/[container:1]/[test:1]")); inOrder.verify(runListener).testFinished(testDescription("[engine:dynamic]/[container:1]/[test:1]")); @@ -582,27 +575,27 @@ void supportsDynamicTestRegistration() throws Exception { @Test void reportsIgnoredEventsForLeavesWhenContainerIsSkipped() throws Exception { - UniqueId uniqueEngineId = UniqueId.forEngine("engine"); + var uniqueEngineId = UniqueId.forEngine("engine"); TestDescriptor engineDescriptor = new EngineDescriptor(uniqueEngineId, "engine"); TestDescriptor container = new TestDescriptorStub(UniqueId.root("root", "container"), "container"); container.addChild(new TestDescriptorStub(UniqueId.root("root", "leaf"), "leaf")); engineDescriptor.addChild(container); - TestEngine engine = mock(TestEngine.class); + var engine = mock(TestEngine.class); when(engine.getId()).thenReturn("engine"); when(engine.discover(any(), eq(uniqueEngineId))).thenReturn(engineDescriptor); doAnswer(invocation -> { ExecutionRequest request = invocation.getArgument(0); - EngineExecutionListener listener = request.getEngineExecutionListener(); + var listener = request.getEngineExecutionListener(); listener.executionStarted(engineDescriptor); listener.executionSkipped(container, "deliberately skipped container"); listener.executionFinished(engineDescriptor, successful()); return null; }).when(engine).execute(any()); - RunListener runListener = mock(RunListener.class); + var runListener = mock(RunListener.class); - RunNotifier notifier = new RunNotifier(); + var notifier = new RunNotifier(); notifier.addListener(runListener); new JUnitPlatform(TestClass.class, createLauncher(engine)).run(notifier); @@ -619,7 +612,7 @@ class Descriptions { @DisplayName("Suite with default display name") void descriptionForTestSuiteWithDefaultDisplayName() { Class testClass = TestSuiteWithDefaultDisplayName.class; - JUnitPlatform platformRunner = new JUnitPlatform(testClass, + var platformRunner = new JUnitPlatform(testClass, createLauncher(new DemoHierarchicalTestEngine("suite names"))); assertEquals(testClass.getName(), platformRunner.getDescription().getDisplayName()); @@ -628,7 +621,7 @@ void descriptionForTestSuiteWithDefaultDisplayName() { @Test @DisplayName("Suite with @SuiteDisplayName") void descriptionForTestSuiteWithCustomDisplayName() { - JUnitPlatform platformRunner = new JUnitPlatform(TestSuiteWithCustomDisplayName.class, + var platformRunner = new JUnitPlatform(TestSuiteWithCustomDisplayName.class, createLauncher(new DemoHierarchicalTestEngine("suite names"))); assertEquals("Sweeeeeeet Name!", platformRunner.getDescription().getDisplayName()); @@ -638,7 +631,7 @@ void descriptionForTestSuiteWithCustomDisplayName() { @DisplayName("Suite with @SuiteDisplayName and @UseTechnicalNames") void descriptionForTestSuiteWithCustomDisplayNameAndTechnicalNames() { Class testClass = TestSuiteWithCustomDisplayNameAndTechnicalNames.class; - JUnitPlatform platformRunner = new JUnitPlatform(testClass, + var platformRunner = new JUnitPlatform(testClass, createLauncher(new DemoHierarchicalTestEngine("suite names"))); assertEquals(testClass.getName(), platformRunner.getDescription().getDisplayName()); @@ -646,24 +639,24 @@ void descriptionForTestSuiteWithCustomDisplayNameAndTechnicalNames() { @Test void descriptionForJavaMethodAndClassSources() throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); - Method failingTest = getClass().getDeclaredMethod("failingTest"); - DemoHierarchicalContainerDescriptor containerDescriptor = engine.addContainer("uniqueContainerName", - "containerDisplayName", ClassSource.from(getClass())); + var engine = new DemoHierarchicalTestEngine("dummy"); + var failingTest = getClass().getDeclaredMethod("failingTest"); + var containerDescriptor = engine.addContainer("uniqueContainerName", "containerDisplayName", + ClassSource.from(getClass())); containerDescriptor.addChild( new DemoHierarchicalTestDescriptor(containerDescriptor.getUniqueId().append("test", "failingTest"), "testDisplayName", MethodSource.from(failingTest), () -> { })); - JUnitPlatform platformRunner = new JUnitPlatform(TestClass.class, createLauncher(engine)); + var platformRunner = new JUnitPlatform(TestClass.class, createLauncher(engine)); List children = platformRunner.getDescription().getChildren(); assertEquals(1, children.size()); - Description engineDescription = children.get(0); + var engineDescription = children.get(0); assertEquals("dummy", engineDescription.getDisplayName()); - Description containerDescription = getOnlyElement(engineDescription.getChildren()); - Description testDescription = getOnlyElement(containerDescription.getChildren()); + var containerDescription = getOnlyElement(engineDescription.getChildren()); + var testDescription = getOnlyElement(containerDescription.getChildren()); // @formatter:off assertAll( @@ -682,24 +675,24 @@ void descriptionForJavaMethodAndClassSources() throws Exception { @Test void descriptionForJavaMethodAndClassSourcesUsingTechnicalNames() throws Exception { - DemoHierarchicalTestEngine engine = new DemoHierarchicalTestEngine("dummy"); - Method failingTest = getClass().getDeclaredMethod("failingTest"); - DemoHierarchicalContainerDescriptor containerDescriptor = engine.addContainer("uniqueContainerName", - "containerDisplayName", ClassSource.from(getClass())); + var engine = new DemoHierarchicalTestEngine("dummy"); + var failingTest = getClass().getDeclaredMethod("failingTest"); + var containerDescriptor = engine.addContainer("uniqueContainerName", "containerDisplayName", + ClassSource.from(getClass())); containerDescriptor.addChild( new DemoHierarchicalTestDescriptor(containerDescriptor.getUniqueId().append("test", "failingTest"), "testDisplayName", MethodSource.from(failingTest), () -> { })); - JUnitPlatform platformRunner = new JUnitPlatform(TestClassWithTechnicalNames.class, createLauncher(engine)); + var platformRunner = new JUnitPlatform(TestClassWithTechnicalNames.class, createLauncher(engine)); List children = platformRunner.getDescription().getChildren(); assertEquals(1, children.size()); - Description engineDescription = children.get(0); + var engineDescription = children.get(0); assertEquals("dummy", engineDescription.getDisplayName()); - Description containerDescription = getOnlyElement(engineDescription.getChildren()); - Description testDescription = getOnlyElement(containerDescription.getChildren()); + var containerDescription = getOnlyElement(engineDescription.getChildren()); + var testDescription = getOnlyElement(containerDescription.getChildren()); // @formatter:off assertAll( @@ -733,15 +726,15 @@ private static Description testDescription(String uniqueId) { } private TestDescriptor testDescriptorWithTags(String... tag) { - TestDescriptor testDescriptor = mock(TestDescriptor.class); - Set tags = Arrays.stream(tag).map(TestTag::create).collect(toSet()); + var testDescriptor = mock(TestDescriptor.class); + var tags = Arrays.stream(tag).map(TestTag::create).collect(toSet()); when(testDescriptor.getTags()).thenReturn(tags); return testDescriptor; } private LauncherDiscoveryRequest instantiateRunnerAndCaptureGeneratedRequest(Class testClass) { - Launcher launcher = mock(Launcher.class); - ArgumentCaptor captor = ArgumentCaptor.forClass(LauncherDiscoveryRequest.class); + var launcher = mock(Launcher.class); + var captor = ArgumentCaptor.forClass(LauncherDiscoveryRequest.class); when(launcher.discover(captor.capture())).thenReturn(TestPlan.from(emptySet())); new JUnitPlatform(testClass, launcher); @@ -782,8 +775,8 @@ public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId @Override public void execute(ExecutionRequest request) { - EngineExecutionListener engineExecutionListener = request.getEngineExecutionListener(); - TestDescriptor root = request.getRootTestDescriptor(); + var engineExecutionListener = request.getEngineExecutionListener(); + var root = request.getRootTestDescriptor(); TestDescriptor container = new DemoContainerTestDescriptor(root.getUniqueId().append("container", "1"), "container #1"); @@ -792,7 +785,7 @@ public void execute(ExecutionRequest request) { engineExecutionListener.dynamicTestRegistered(container); engineExecutionListener.executionStarted(container); - UniqueId containerUid = container.getUniqueId(); + var containerUid = container.getUniqueId(); TestDescriptor dynamicTest1 = new DemoTestTestDescriptor(containerUid.append("test", "1"), "dynamic test #1"); diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java index e2cba9100c9b..cca1ddc6eddb 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java @@ -126,9 +126,9 @@ void assertEventsMatchLooselyWithBadConditionsOnlyFails() { event(engine(), skippedWithReason("other")) // ); - AssertJMultipleFailuresError error = assertThrows(AssertJMultipleFailuresError.class, willFail); + var error = assertThrows(AssertJMultipleFailuresError.class, willFail); - List failures = error.getFailures(); + var failures = error.getFailures(); assertEquals(2, failures.size()); assertEquals(AssertionError.class, failures.get(0).getClass()); assertEquals(AssertionError.class, failures.get(1).getClass()); @@ -142,9 +142,9 @@ void assertEventsMatchLooselyWithOneMatchingAndOneBadConditionFailsPartly() { event(engine(), finishedWithFailure()) // ); - AssertJMultipleFailuresError error = assertThrows(AssertJMultipleFailuresError.class, willFail); + var error = assertThrows(AssertJMultipleFailuresError.class, willFail); - List failures = error.getFailures(); + var failures = error.getFailures(); assertEquals(1, failures.size()); assertEquals(AssertionError.class, failures.get(0).getClass()); } @@ -170,7 +170,7 @@ void assertEventsMatchLooselyInOrderWithAllEventsInWrongOrderFails() { event(engine(), started()) // ); - AssertionFailedError error = assertThrows(AssertionFailedError.class, willFail); + var error = assertThrows(AssertionFailedError.class, willFail); assertTrue(error.getMessage().contains("Conditions are not in the correct order.")); } @@ -200,7 +200,7 @@ void assertEventsMatchLooselyInOrderWithASubsetInWrongOrderFails() { event(engine(), started()) // ); - AssertionFailedError error = assertThrows(AssertionFailedError.class, willFail); + var error = assertThrows(AssertionFailedError.class, willFail); assertTrue(error.getMessage().contains("Conditions are not in the correct order.")); } @@ -228,9 +228,9 @@ void assertEventsMatchLooselyInOrderWithBadConditionsOnlyFails() { event(engine(), skippedWithReason("other")) // ); - AssertJMultipleFailuresError error = assertThrows(AssertJMultipleFailuresError.class, willFail); + var error = assertThrows(AssertJMultipleFailuresError.class, willFail); - List failures = error.getFailures(); + var failures = error.getFailures(); assertEquals(2, failures.size()); assertEquals(AssertionError.class, failures.get(0).getClass()); assertEquals(AssertionError.class, failures.get(1).getClass()); @@ -244,7 +244,7 @@ void assertEventsMatchLooselyInOrderWithOneMatchingAndOneBadConditionFailsPartly event(engine(), finishedWithFailure()) // ); - AssertJMultipleFailuresError error = assertThrows(AssertJMultipleFailuresError.class, willFail); + var error = assertThrows(AssertJMultipleFailuresError.class, willFail); assertEquals(1, error.getFailures().size()); } @@ -265,7 +265,7 @@ void assertEventsMatchLooselyInOrderWithSecondAndLastEventInBadOrderFails() { event(engine(), skippedWithReason("reason1")) // ); - AssertionFailedError error = assertThrows(AssertionFailedError.class, willFail); + var error = assertThrows(AssertionFailedError.class, willFail); assertTrue(error.getMessage().contains("Conditions are not in the correct order.")); } @@ -280,7 +280,7 @@ void assertEventsMatchLooselyInOrderWithTooManyEventsFails() { event(engine(), finishedSuccessfully()), // event(engine(), finishedSuccessfully())); - AssertionError error = assertThrows(AssertionError.class, willFail); + var error = assertThrows(AssertionError.class, willFail); assertTrue(error.getMessage().endsWith("to be less than or equal to 4 but was 6")); } diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java index 86a68cd75fa3..89fbca886766 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java @@ -27,7 +27,7 @@ class ExecutionsIntegrationTests { @Test void executionsFromSkippedTestEvents() { - Events testEvents = getTestEvents(); + var testEvents = getTestEvents(); // We expect 1 for both of the following cases, since an Execution can // be created for a "skipped event even if "started" and "finished" events @@ -38,7 +38,7 @@ void executionsFromSkippedTestEvents() { @Test void executionsFromStartedTestEvents() { - Events testEvents = getTestEvents(); + var testEvents = getTestEvents(); // We expect 3 if the executions are created BEFORE filtering out "finished" events. assertThat(testEvents.executions().started().count()).isEqualTo(3); @@ -48,7 +48,7 @@ void executionsFromStartedTestEvents() { @Test void executionsFromFinishedTestEvents() { - Events testEvents = getTestEvents(); + var testEvents = getTestEvents(); // We expect 3 if the executions are created BEFORE filtering out "started" events. assertThat(testEvents.executions().finished().count()).isEqualTo(3); @@ -58,7 +58,7 @@ void executionsFromFinishedTestEvents() { @Test void executionsFromSucceededTestEvents() { - Events testEvents = getTestEvents(); + var testEvents = getTestEvents(); // We expect 1 if the executions are created BEFORE filtering out "finished" events. assertThat(testEvents.executions().succeeded().count()).isEqualTo(1); @@ -68,7 +68,7 @@ void executionsFromSucceededTestEvents() { @Test void executionsFromAbortedTestEvents() { - Events testEvents = getTestEvents(); + var testEvents = getTestEvents(); // We expect 1 if the executions are created BEFORE filtering out "started" events. assertThat(testEvents.executions().aborted().count()).isEqualTo(1); @@ -78,7 +78,7 @@ void executionsFromAbortedTestEvents() { @Test void executionsFromFailedTestEvents() { - Events testEvents = getTestEvents(); + var testEvents = getTestEvents(); // We expect 1 if the executions are created BEFORE filtering out "started" events. assertThat(testEvents.executions().failed().count()).isEqualTo(1); diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java index 3bb5fb4e2e31..bced3458a194 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java @@ -26,7 +26,6 @@ import java.util.HashMap; -import org.assertj.core.api.Condition; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.platform.commons.PreconditionViolationException; @@ -53,13 +52,13 @@ void preconditions() { @Test void nestedContainerChecksSuppliedClassAndAllEnclosingClasses() { - UniqueId uniqueId = UniqueId.root("top-level", getClass().getName())// + var uniqueId = UniqueId.root("top-level", getClass().getName())// .append("nested", ATestCase.class.getSimpleName())// .append("nested", BTestCase.class.getSimpleName())// .append("nested", CTestCase.class.getSimpleName()); - Event event = createEvent(uniqueId); + var event = createEvent(uniqueId); - Condition condition = nestedContainer(HashMap.Entry.class); + var condition = nestedContainer(HashMap.Entry.class); assertThat(condition.matches(event)).isFalse(); assertThat(condition.toString()).contains(// "is a container", "with uniqueId substring 'Map'", "with uniqueId substring 'Entry'"); @@ -73,11 +72,11 @@ void nestedContainerChecksSuppliedClassAndAllEnclosingClasses() { } private Event createEvent(UniqueId uniqueId) { - TestDescriptor testDescriptor = mock(TestDescriptor.class); + var testDescriptor = mock(TestDescriptor.class); when(testDescriptor.isContainer()).thenReturn(true); when(testDescriptor.getUniqueId()).thenReturn(uniqueId); - Event event = mock(Event.class); + var event = mock(Event.class); when(event.getTestDescriptor()).thenReturn(testDescriptor); return event; } From 3bac39a38e26d42071dbd6f40994ca022be2ec9d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 13:04:56 +0200 Subject: [PATCH 0043/1433] Use Java 11 Files APIs --- .../org/junit/platform/console/ConsoleDetailsTests.java | 7 ++++--- .../legacy/xml/LegacyXmlReportGeneratingListenerTests.java | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java index 07a1b474cb98..bef06659d8ce 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java @@ -43,6 +43,7 @@ import org.junit.jupiter.api.function.Executable; import org.junit.platform.console.options.Details; import org.junit.platform.console.options.Theme; +import org.opentest4j.TestAbortedException; /** * @since 1.0 @@ -211,13 +212,13 @@ public void execute() throws Throwable { var result = wrapper.execute(Optional.empty(), args); var optionalUri = toUri(dirName, outName); - if (!optionalUri.isPresent()) { + if (optionalUri.isEmpty()) { if (Boolean.getBoolean("org.junit.platform.console.ConsoleDetailsTests.writeResultOut")) { // do not use Files.createTempDirectory(prefix) as we want one folder for one container var temp = Paths.get(System.getProperty("java.io.tmpdir"), dirName.replace('/', '-')); Files.createDirectories(temp); - var path = Files.write(temp.resolve(outName), result.out.getBytes(UTF_8)); - assumeTrue(false, + var path = Files.writeString(temp.resolve(outName), result.out); + throw new TestAbortedException( format("resource `%s` not found\nwrote console stdout to: %s/%s", dirName, outName, path)); } fail("could not load resource named `" + dirName + "/" + outName + "`"); diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java index 1ec5f63218c0..6b2927a09584 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java @@ -10,7 +10,6 @@ package org.junit.platform.reporting.legacy.xml; -import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Collections.emptySet; import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; @@ -418,7 +417,7 @@ private void executeTests(TestEngine engine, Path tempDirectory, Clock clock) { private String readValidXmlFile(Path xmlFile) throws Exception { assertTrue(Files.exists(xmlFile), () -> "File does not exist: " + xmlFile); - var content = new String(Files.readAllBytes(xmlFile), UTF_8); + var content = Files.readString(xmlFile); assertValidAccordingToJenkinsSchema(content); return content; } From e14b3ec0c8073bfc55a0d9cce18ca1a556091e88 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 13:06:28 +0200 Subject: [PATCH 0044/1433] Convert field to local variable --- .../src/test/java/org/junit/platform/engine/UniqueIdTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java index ae9bb0850d7c..a8f8a3baed10 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java @@ -128,10 +128,9 @@ void appendingNullIsNotAllowed() { @Nested class ParsingAndFormatting { - private final String uniqueIdString = "[engine:junit-jupiter]/[class:MyClass]/[method:myMethod]"; - @Test void ensureDefaultUniqueIdFormatIsUsedForParsing() { + var uniqueIdString = "[engine:junit-jupiter]/[class:MyClass]/[method:myMethod]"; var parsedDirectly = UniqueId.parse(uniqueIdString); var parsedViaFormat = UniqueIdFormat.getDefault().parse(uniqueIdString); assertEquals(parsedViaFormat, parsedDirectly); From 56fca8c8b250046338eec3e04a09f8b3c02c4673 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 13:08:25 +0200 Subject: [PATCH 0045/1433] Fix assertion --- .../platform/engine/support/descriptor/MethodSourceTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java index 78248a31e21b..001cfd77dfe7 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java @@ -151,7 +151,7 @@ void twoEqualMethodsWithEqualParametersShouldHaveEqualMethodSourceHashCodes() { @Test void twoEqualMethodsWithUnequalParametersShouldHaveUnequalMethodSourceHashCodes() { assertNotEquals(MethodSource.from("TestClass1", "testMethod1", "int, String").hashCode(), - MethodSource.from("TestClass1", "testMethod1", "float, int, String")); + MethodSource.from("TestClass1", "testMethod1", "float, int, String").hashCode()); } @Test From cb5f5adc33caae5a20c352b513d18613ff53fc06 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 13:09:48 +0200 Subject: [PATCH 0046/1433] Simplify assertions --- .../junit/platform/engine/UniqueIdTests.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java index a8f8a3baed10..bbaf6b15d107 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java @@ -13,6 +13,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -174,8 +175,8 @@ void sameEnginesAreEqual() { var id1 = UniqueId.root("engine", "junit-jupiter"); var id2 = UniqueId.root("engine", "junit-jupiter"); - assertTrue(id1.equals(id2)); - assertTrue(id2.equals(id1)); + assertEquals(id2, id1); + assertEquals(id1, id2); assertEquals(id1.hashCode(), id2.hashCode()); } @@ -184,8 +185,8 @@ void differentEnginesAreNotEqual() { var id1 = UniqueId.root("engine", "junit-vintage"); var id2 = UniqueId.root("engine", "junit-jupiter"); - assertFalse(id1.equals(id2)); - assertFalse(id2.equals(id1)); + assertNotEquals(id2, id1); + assertNotEquals(id1, id2); } @Test @@ -193,8 +194,8 @@ void uniqueIdWithSameSegmentsAreEqual() { var id1 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); var id2 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); - assertTrue(id1.equals(id2)); - assertTrue(id2.equals(id1)); + assertEquals(id2, id1); + assertEquals(id1, id2); assertEquals(id1.hashCode(), id2.hashCode()); } @@ -203,8 +204,8 @@ void differentOrderOfSegmentsAreNotEqual() { var id1 = UniqueId.root("engine", "junit-jupiter").append("t2", "v2").append("t1", "v1"); var id2 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1").append("t2", "v2"); - assertFalse(id1.equals(id2)); - assertFalse(id2.equals(id1)); + assertNotEquals(id2, id1); + assertNotEquals(id1, id2); } @Test @@ -212,8 +213,8 @@ void additionalSegmentMakesItNotEqual() { var id1 = UniqueId.root("engine", "junit-jupiter").append("t1", "v1"); var id2 = id1.append("t2", "v2"); - assertFalse(id1.equals(id2)); - assertFalse(id2.equals(id1)); + assertNotEquals(id2, id1); + assertNotEquals(id1, id2); } } From 67c524b1546c779e1e2cf3ddf17a528593795862 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 13:12:01 +0200 Subject: [PATCH 0047/1433] Remove unnecessary throws clause --- .../platform/commons/support/ReflectionSupportTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java index 2938b258f553..8262a31b7a07 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java @@ -224,7 +224,7 @@ void tryToReadFieldValuePreconditions() throws Exception { } @Test - void findMethodDelegates() throws Exception { + void findMethodDelegates() { assertEquals(ReflectionUtils.findMethod(Boolean.class, "valueOf", String.class.getName()), ReflectionSupport.findMethod(Boolean.class, "valueOf", String.class.getName())); @@ -233,7 +233,7 @@ void findMethodDelegates() throws Exception { } @Test - void findMethodPreconditions() throws Exception { + void findMethodPreconditions() { assertPreconditionViolationException("Class", () -> ReflectionSupport.findMethod(null, "valueOf", String.class.getName())); assertPreconditionViolationExceptionForString("Method name", @@ -280,13 +280,13 @@ void findMethodsPreconditions() { } @Test - void findNestedClassesDelegates() throws Exception { + void findNestedClassesDelegates() { assertEquals(ReflectionUtils.findNestedClasses(ClassWithNestedClasses.class, ReflectionUtils::isStatic), ReflectionSupport.findNestedClasses(ClassWithNestedClasses.class, ReflectionUtils::isStatic)); } @Test - void findNestedClassesPreconditions() throws Exception { + void findNestedClassesPreconditions() { assertPreconditionViolationException("Class", () -> ReflectionSupport.findNestedClasses(null, ReflectionUtils::isStatic)); assertPreconditionViolationException("Predicate", From 45ae93109754e733224376b0137b306042d2629b Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 13:16:05 +0200 Subject: [PATCH 0048/1433] Fix typos --- .../engine/support/descriptor/ClasspathResourceSourceTests.java | 2 +- .../org/junit/platform/launcher/core/DefaultLauncherTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java index 7d65a66ea152..82eca17f5c7d 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java @@ -77,7 +77,7 @@ void resourceWithPosition() { } @Test - void resourcefromUriWithoutPosition() { + void resourceFromUriWithoutPosition() { var source = ClasspathResourceSource.from(FOO_RESOURCE_URI); assertThat(source).isNotNull(); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java index 282faaa595a9..08468c284c9e 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java @@ -273,7 +273,7 @@ public void execute(ExecutionRequest request) { } @Test - void reportsEngineExecutionFailuresForSucessfullyFinishedEngine() { + void reportsEngineExecutionFailuresForSuccessfullyFinishedEngine() { var rootCause = new RuntimeException("something went horribly wrong"); var engine = new TestEngineStub() { @Override From 5fc06c3b07765503b3fd34d507b6c4fed57cf5cb Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 18:04:22 +0200 Subject: [PATCH 0049/1433] Use Java 9 collection factory methods --- .../commons/util/AnnotationUtilsTests.java | 11 +- .../ClassNamePatternFilterUtilsTests.java | 13 +- .../commons/util/CollectionUtilsTests.java | 15 +- .../commons/util/PackageUtilsTests.java | 7 +- .../commons/util/PreconditionsTests.java | 12 +- .../platform/console/ConsoleDetailsTests.java | 3 +- .../PicocliCommandLineOptionsParserTests.java | 249 +++++++++--------- .../tasks/ConsoleTestExecutorTests.java | 7 +- .../tasks/DiscoveryRequestCreatorTests.java | 45 ++-- .../console/tasks/TreePrinterTests.java | 10 +- .../discovery/DiscoverySelectorsTests.java | 23 +- .../descriptor/CompositeTestSourceTests.java | 13 +- .../hierarchical/CompositeLockTests.java | 8 +- .../HierarchicalTestExecutorTests.java | 4 +- .../hierarchical/LockManagerTests.java | 18 +- .../NodeTreeWalkerIntegrationTests.java | 5 +- .../launcher/TestIdentifierTests.java | 7 +- .../platform/launcher/TestPlanTests.java | 9 +- .../LauncherConfigurationParametersTests.java | 28 +- .../LauncherDiscoveryRequestBuilderTests.java | 3 +- .../TestExecutionListenerRegistryTests.java | 6 +- .../listeners/SummaryGenerationTests.java | 4 +- .../tagexpression/TagExpressionsTests.java | 29 +- .../legacy/LegacyReportingUtilsTests.java | 7 +- ...egacyXmlReportGeneratingListenerTests.java | 11 +- .../legacy/xml/XmlReportDataTests.java | 8 +- .../legacy/xml/XmlReportWriterTests.java | 20 +- .../runner/JUnitPlatformRunnerTests.java | 14 +- 28 files changed, 279 insertions(+), 310 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java index 319b15eb26d4..76d9c9fd9862 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java @@ -10,7 +10,6 @@ package org.junit.platform.commons.util; -import static java.util.Arrays.asList; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -239,7 +238,7 @@ void findRepeatableAnnotationsWithComposedTagBeforeContainer() { } private void assertTagsFound(Class clazz, String... tags) { - assertEquals(asList(tags), + assertEquals(List.of(tags), findRepeatableAnnotations(clazz, Tag.class).stream().map(Tag::value).collect(toList()), () -> "Tags found for class " + clazz.getName()); } @@ -297,7 +296,7 @@ void findInheritedRepeatableAnnotationsWithMultipleComposedAnnotationsOnSupercla } private void assertExtensionsFound(Class clazz, String... tags) { - assertEquals(asList(tags), + assertEquals(List.of(tags), findRepeatableAnnotations(clazz, ExtendWith.class).stream().map(ExtendWith::value).collect(toList()), () -> "Extensions found for class " + clazz.getName()); } @@ -490,7 +489,7 @@ void findPublicAnnotatedFieldsForDirectlyAnnotatedFieldOfWrongFieldType() { void findPublicAnnotatedFieldsForDirectlyAnnotatedField() { var fields = findPublicAnnotatedFields(getClass(), String.class, Annotation1.class); assertNotNull(fields); - assertIterableEquals(asList("directlyAnnotatedField"), asNames(fields)); + assertIterableEquals(List.of("directlyAnnotatedField"), asNames(fields)); } @Test @@ -498,14 +497,14 @@ void findPublicAnnotatedFieldsForMetaAnnotatedField() { var fields = findPublicAnnotatedFields(getClass(), Number.class, Annotation1.class); assertNotNull(fields); assertEquals(1, fields.size()); - assertIterableEquals(asList("metaAnnotatedField"), asNames(fields)); + assertIterableEquals(List.of("metaAnnotatedField"), asNames(fields)); } @Test void findPublicAnnotatedFieldsForDirectlyAnnotatedFieldInInterface() { var fields = findPublicAnnotatedFields(InterfaceWithAnnotatedFields.class, String.class, Annotation1.class); assertNotNull(fields); - assertIterableEquals(asList("foo"), asNames(fields)); + assertIterableEquals(List.of("foo"), asNames(fields)); } @Test diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java index b240c08618d0..0567ae3eaeea 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java @@ -10,7 +10,6 @@ package org.junit.platform.commons.util; -import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; import java.util.List; @@ -47,7 +46,7 @@ class ClassNamePatternFilterUtilsTests { //@formatter:on @ParameterizedTest void alwaysEnabledConditions(String pattern) { - List executionConditions = asList(new AExecutionConditionClass(), + List executionConditions = List.of(new AExecutionConditionClass(), new BExecutionConditionClass()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isNotEmpty(); @@ -64,7 +63,7 @@ void alwaysEnabledConditions(String pattern) { //@formatter:on @ParameterizedTest void alwaysDisabledConditions(String pattern) { - List executionConditions = asList(new AExecutionConditionClass(), + List executionConditions = List.of(new AExecutionConditionClass(), new BExecutionConditionClass()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isEmpty(); @@ -81,7 +80,7 @@ void alwaysDisabledConditions(String pattern) { //@formatter:on @ParameterizedTest void alwaysEnabledListeners(String pattern) { - List executionConditions = asList(new ATestExecutionListenerClass(), + List executionConditions = List.of(new ATestExecutionListenerClass(), new BTestExecutionListenerClass()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isNotEmpty(); @@ -98,7 +97,7 @@ void alwaysEnabledListeners(String pattern) { //@formatter:on @ParameterizedTest void alwaysDisabledListeners(String pattern) { - List executionConditions = asList(new ATestExecutionListenerClass(), + List executionConditions = List.of(new ATestExecutionListenerClass(), new BTestExecutionListenerClass()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isEmpty(); @@ -115,7 +114,7 @@ void alwaysDisabledListeners(String pattern) { //@formatter:on @ParameterizedTest void alwaysEnabledClass(String pattern) { - var executionConditions = asList(new AVanillaEmpty(), new BVanillaEmpty()); + var executionConditions = List.of(new AVanillaEmpty(), new BVanillaEmpty()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isNotEmpty(); } @@ -131,7 +130,7 @@ void alwaysEnabledClass(String pattern) { //@formatter:on @ParameterizedTest void alwaysDisabledClass(String pattern) { - var executionConditions = asList(new AVanillaEmpty(), new BVanillaEmpty()); + var executionConditions = List.of(new AVanillaEmpty(), new BVanillaEmpty()); assertThat(executionConditions).filteredOn( ClassNamePatternFilterUtils.excludeMatchingClasses(pattern)).isEmpty(); } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java index cf4e2572acab..d836fdf7bc52 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java @@ -10,9 +10,6 @@ package org.junit.platform.commons.util; -import static java.util.Arrays.asList; -import static java.util.Collections.emptySet; -import static java.util.Collections.singleton; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -25,6 +22,8 @@ import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; +import java.util.List; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.DoubleStream; import java.util.stream.IntStream; @@ -52,21 +51,21 @@ void getOnlyElementWithNullCollection() { @Test void getOnlyElementWithEmptyCollection() { var exception = assertThrows(PreconditionViolationException.class, - () -> CollectionUtils.getOnlyElement(emptySet())); + () -> CollectionUtils.getOnlyElement(Set.of())); assertEquals("collection must contain exactly one element: []", exception.getMessage()); } @Test void getOnlyElementWithSingleElementCollection() { var expected = new Object(); - var actual = CollectionUtils.getOnlyElement(singleton(expected)); + var actual = CollectionUtils.getOnlyElement(Set.of(expected)); assertSame(expected, actual); } @Test void getOnlyElementWithMultiElementCollection() { var exception = assertThrows(PreconditionViolationException.class, - () -> CollectionUtils.getOnlyElement(asList("foo", "bar"))); + () -> CollectionUtils.getOnlyElement(List.of("foo", "bar"))); assertEquals("collection must contain exactly one element: [foo, bar]", exception.getMessage()); } @@ -159,7 +158,7 @@ public Stream stream() { @SuppressWarnings("unchecked") void toStreamWithIterable() { - Iterable input = () -> asList("foo", "bar").iterator(); + Iterable input = () -> List.of("foo", "bar").iterator(); var result = (Stream) CollectionUtils.toStream(input); @@ -169,7 +168,7 @@ void toStreamWithIterable() { @Test @SuppressWarnings("unchecked") void toStreamWithIterator() { - var input = asList("foo", "bar").iterator(); + var input = List.of("foo", "bar").iterator(); var result = (Stream) CollectionUtils.toStream(input); diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java index 224e946ec771..cc30ab49ee16 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java @@ -16,7 +16,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.DynamicTest.dynamicTest; -import java.util.Arrays; import java.util.List; import java.util.function.Function; @@ -91,13 +90,15 @@ void getAttributeFromDefaultPackageMemberIsEmpty() throws Exception { @TestFactory List attributesFromValueWrapperClassArePresent() { - return Arrays.asList(dynamicTest("getName", isPresent(Package::getName)), + return List.of( // + dynamicTest("getName", isPresent(Package::getName)), dynamicTest("getImplementationTitle", isPresent(Package::getImplementationTitle)), dynamicTest("getImplementationVendor", isPresent(Package::getImplementationVendor)), dynamicTest("getImplementationVersion", isPresent(Package::getImplementationVersion)), dynamicTest("getSpecificationTitle", isPresent(Package::getSpecificationTitle)), dynamicTest("getSpecificationVendor", isPresent(Package::getSpecificationVendor)), - dynamicTest("getSpecificationVersion", isPresent(Package::getSpecificationVersion))); + dynamicTest("getSpecificationVersion", isPresent(Package::getSpecificationVersion)) // + ); } private Executable isPresent(Function function) { diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java index e49b9a362d9f..edfedaec8a90 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java @@ -10,7 +10,6 @@ package org.junit.platform.commons.util; -import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertSame; @@ -21,7 +20,6 @@ import static org.junit.platform.commons.util.Preconditions.notEmpty; import static org.junit.platform.commons.util.Preconditions.notNull; -import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -70,7 +68,7 @@ void notEmptyPassesForNonEmptyArray() { @Test void notEmptyPassesForNonEmptyCollection() { - Collection collection = Arrays.asList("a", "b", "c"); + Collection collection = List.of("a", "b", "c"); var nonEmptyCollection = notEmpty(collection, () -> "should not fail"); assertSame(collection, nonEmptyCollection); } @@ -117,7 +115,7 @@ void notEmptyThrowsForEmptyArray() { void notEmptyThrowsForEmptyCollection() { var message = "collection is empty"; - var exception = assertThrows(PreconditionViolationException.class, () -> notEmpty(emptyList(), message)); + var exception = assertThrows(PreconditionViolationException.class, () -> notEmpty(List.of(), message)); assertEquals(message, exception.getMessage()); } @@ -134,10 +132,10 @@ void containsNoNullElementsPassesForArrayThatIsNullOrEmpty() { @Test void containsNoNullElementsPassesForCollectionThatIsNullOrEmpty() { containsNoNullElements((List) null, "collection is null"); - containsNoNullElements(emptyList(), "collection is empty"); + containsNoNullElements(List.of(), "collection is empty"); containsNoNullElements((List) null, () -> "collection is null"); - containsNoNullElements(emptyList(), () -> "collection is empty"); + containsNoNullElements(List.of(), () -> "collection is empty"); } @Test @@ -149,7 +147,7 @@ void containsNoNullElementsPassesForArrayContainingNonNullElements() { @Test void containsNoNullElementsPassesForCollectionContainingNonNullElements() { - Collection input = Arrays.asList("a", "b", "c"); + var input = List.of("a", "b", "c"); var output = containsNoNullElements(input, "message"); assertSame(input, output); diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java index bef06659d8ce..4e39a4a3a802 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java @@ -12,7 +12,6 @@ import static java.lang.String.format; import static java.nio.charset.StandardCharsets.UTF_8; -import static java.util.Arrays.asList; import static org.junit.jupiter.api.Assertions.assertLinesMatch; import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeTrue; @@ -229,7 +228,7 @@ public void execute() throws Throwable { assumeTrue(Files.isReadable(path), "can not read: " + path); var expectedLines = Files.readAllLines(path, UTF_8); - var actualLines = asList(result.out.split("\\R")); + var actualLines = List.of(result.out.split("\\R")); assertLinesMatch(expectedLines, actualLines); } diff --git a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java index ceb39694e10c..a4a61fb4a0d3 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java @@ -10,11 +10,6 @@ package org.junit.platform.console.options; -import static java.util.Arrays.asList; -import static java.util.Arrays.stream; -import static java.util.Collections.emptyList; -import static java.util.Collections.emptyMap; -import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; import static org.junit.jupiter.api.Assertions.assertAll; @@ -32,9 +27,11 @@ import java.net.URI; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.Arrays; +import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.function.Predicate; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -57,22 +54,22 @@ void parseNoArguments() { () -> assertFalse(options.isDisplayHelp()), () -> assertEquals(CommandLineOptions.DEFAULT_DETAILS, options.getDetails()), () -> assertFalse(options.isScanClasspath()), - () -> assertEquals(singletonList(STANDARD_INCLUDE_PATTERN), options.getIncludedClassNamePatterns()), - () -> assertEquals(emptyList(), options.getExcludedClassNamePatterns()), - () -> assertEquals(emptyList(), options.getIncludedPackages()), - () -> assertEquals(emptyList(), options.getExcludedPackages()), - () -> assertEquals(emptyList(), options.getIncludedTagExpressions()), - () -> assertEquals(emptyList(), options.getExcludedTagExpressions()), - () -> assertEquals(emptyList(), options.getAdditionalClasspathEntries()), + () -> assertEquals(List.of(STANDARD_INCLUDE_PATTERN), options.getIncludedClassNamePatterns()), + () -> assertEquals(List.of(), options.getExcludedClassNamePatterns()), + () -> assertEquals(List.of(), options.getIncludedPackages()), + () -> assertEquals(List.of(), options.getExcludedPackages()), + () -> assertEquals(List.of(), options.getIncludedTagExpressions()), + () -> assertEquals(List.of(), options.getExcludedTagExpressions()), + () -> assertEquals(List.of(), options.getAdditionalClasspathEntries()), () -> assertEquals(Optional.empty(), options.getReportsDir()), - () -> assertEquals(emptyList(), options.getSelectedUris()), - () -> assertEquals(emptyList(), options.getSelectedFiles()), - () -> assertEquals(emptyList(), options.getSelectedDirectories()), - () -> assertEquals(emptyList(), options.getSelectedModules()), - () -> assertEquals(emptyList(), options.getSelectedPackages()), - () -> assertEquals(emptyList(), options.getSelectedMethods()), - () -> assertEquals(emptyList(), options.getSelectedClasspathEntries()), - () -> assertEquals(emptyMap(), options.getConfigurationParameters()) + () -> assertEquals(List.of(), options.getSelectedUris()), + () -> assertEquals(List.of(), options.getSelectedFiles()), + () -> assertEquals(List.of(), options.getSelectedDirectories()), + () -> assertEquals(List.of(), options.getSelectedModules()), + () -> assertEquals(List.of(), options.getSelectedPackages()), + () -> assertEquals(List.of(), options.getSelectedMethods()), + () -> assertEquals(List.of(), options.getSelectedClasspathEntries()), + () -> assertEquals(Map.of(), options.getConfigurationParameters()) ); // @formatter:on } @@ -132,9 +129,9 @@ void parseInvalidDetailsTheme() { void parseValidIncludeClassNamePatterns(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList(".*Test"), type.parseArgLine("-n .*Test").getIncludedClassNamePatterns()), - () -> assertEquals(asList(".*Test", ".*Tests"), type.parseArgLine("--include-classname .*Test --include-classname .*Tests").getIncludedClassNamePatterns()), - () -> assertEquals(singletonList(".*Test"), type.parseArgLine("--include-classname=.*Test").getIncludedClassNamePatterns()) + () -> assertEquals(List.of(".*Test"), type.parseArgLine("-n .*Test").getIncludedClassNamePatterns()), + () -> assertEquals(List.of(".*Test", ".*Tests"), type.parseArgLine("--include-classname .*Test --include-classname .*Tests").getIncludedClassNamePatterns()), + () -> assertEquals(List.of(".*Test"), type.parseArgLine("--include-classname=.*Test").getIncludedClassNamePatterns()) ); // @formatter:on } @@ -144,17 +141,16 @@ void parseValidIncludeClassNamePatterns(ArgsType type) { void parseValidExcludeClassNamePatterns(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList(".*Test"), type.parseArgLine("-N .*Test").getExcludedClassNamePatterns()), - () -> assertEquals(asList(".*Test", ".*Tests"), type.parseArgLine("--exclude-classname .*Test --exclude-classname .*Tests").getExcludedClassNamePatterns()), - () -> assertEquals(singletonList(".*Test"), type.parseArgLine("--exclude-classname=.*Test").getExcludedClassNamePatterns()) + () -> assertEquals(List.of(".*Test"), type.parseArgLine("-N .*Test").getExcludedClassNamePatterns()), + () -> assertEquals(List.of(".*Test", ".*Tests"), type.parseArgLine("--exclude-classname .*Test --exclude-classname .*Tests").getExcludedClassNamePatterns()), + () -> assertEquals(List.of(".*Test"), type.parseArgLine("--exclude-classname=.*Test").getExcludedClassNamePatterns()) ); // @formatter:on } @Test void usesDefaultClassNamePatternWithoutExplicitArgument() throws Exception { - assertEquals(singletonList(STANDARD_INCLUDE_PATTERN), - ArgsType.args.parseArgLine("").getIncludedClassNamePatterns()); + assertEquals(List.of(STANDARD_INCLUDE_PATTERN), ArgsType.args.parseArgLine("").getIncludedClassNamePatterns()); } @Test @@ -172,11 +168,11 @@ void parseInvalidExcludeClassNamePatterns() { void parseValidIncludedPackages(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(asList("org.junit.included"), + () -> assertEquals(List.of("org.junit.included"), type.parseArgLine("--include-package org.junit.included").getIncludedPackages()), - () -> assertEquals(asList("org.junit.included"), + () -> assertEquals(List.of("org.junit.included"), type.parseArgLine("--include-package=org.junit.included").getIncludedPackages()), - () -> assertEquals(asList("org.junit.included1", "org.junit.included2"), + () -> assertEquals(List.of("org.junit.included1", "org.junit.included2"), type.parseArgLine("--include-package org.junit.included1 --include-package org.junit.included2").getIncludedPackages()) ); // @formatter:on @@ -187,11 +183,11 @@ void parseValidIncludedPackages(ArgsType type) { void parseValidExcludedPackages(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(asList("org.junit.excluded"), + () -> assertEquals(List.of("org.junit.excluded"), type.parseArgLine("--exclude-package org.junit.excluded").getExcludedPackages()), - () -> assertEquals(asList("org.junit.excluded"), + () -> assertEquals(List.of("org.junit.excluded"), type.parseArgLine("--exclude-package=org.junit.excluded").getExcludedPackages()), - () -> assertEquals(asList("org.junit.excluded1", "org.junit.excluded2"), + () -> assertEquals(List.of("org.junit.excluded1", "org.junit.excluded2"), type.parseArgLine("--exclude-package org.junit.excluded1 --exclude-package org.junit.excluded2").getExcludedPackages()) ); // @formatter:on @@ -202,10 +198,10 @@ void parseValidExcludedPackages(ArgsType type) { void parseValidIncludedTags(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(asList("fast"), type.parseArgLine("-t fast").getIncludedTagExpressions()), - () -> assertEquals(asList("fast"), type.parseArgLine("--include-tag fast").getIncludedTagExpressions()), - () -> assertEquals(asList("fast"), type.parseArgLine("--include-tag=fast").getIncludedTagExpressions()), - () -> assertEquals(asList("fast", "slow"), type.parseArgLine("-t fast -t slow").getIncludedTagExpressions()) + () -> assertEquals(List.of("fast"), type.parseArgLine("-t fast").getIncludedTagExpressions()), + () -> assertEquals(List.of("fast"), type.parseArgLine("--include-tag fast").getIncludedTagExpressions()), + () -> assertEquals(List.of("fast"), type.parseArgLine("--include-tag=fast").getIncludedTagExpressions()), + () -> assertEquals(List.of("fast", "slow"), type.parseArgLine("-t fast -t slow").getIncludedTagExpressions()) ); // @formatter:on } @@ -220,10 +216,10 @@ void parseInvalidIncludedTags() { void parseValidExcludedTags(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(asList("fast"), type.parseArgLine("-T fast").getExcludedTagExpressions()), - () -> assertEquals(asList("fast"), type.parseArgLine("--exclude-tag fast").getExcludedTagExpressions()), - () -> assertEquals(asList("fast"), type.parseArgLine("--exclude-tag=fast").getExcludedTagExpressions()), - () -> assertEquals(asList("fast", "slow"), type.parseArgLine("-T fast -T slow").getExcludedTagExpressions()) + () -> assertEquals(List.of("fast"), type.parseArgLine("-T fast").getExcludedTagExpressions()), + () -> assertEquals(List.of("fast"), type.parseArgLine("--exclude-tag fast").getExcludedTagExpressions()), + () -> assertEquals(List.of("fast"), type.parseArgLine("--exclude-tag=fast").getExcludedTagExpressions()), + () -> assertEquals(List.of("fast", "slow"), type.parseArgLine("-T fast -T slow").getExcludedTagExpressions()) ); // @formatter:on } @@ -238,9 +234,9 @@ void parseInvalidExcludedTags() { void parseValidIncludedEngines(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(asList("junit-jupiter"), type.parseArgLine("-e junit-jupiter").getIncludedEngines()), - () -> assertEquals(asList("junit-vintage"), type.parseArgLine("--include-engine junit-vintage").getIncludedEngines()), - () -> assertEquals(emptyList(), type.parseArgLine("").getIncludedEngines()) + () -> assertEquals(List.of("junit-jupiter"), type.parseArgLine("-e junit-jupiter").getIncludedEngines()), + () -> assertEquals(List.of("junit-vintage"), type.parseArgLine("--include-engine junit-vintage").getIncludedEngines()), + () -> assertEquals(List.of(), type.parseArgLine("").getIncludedEngines()) ); // @formatter:on } @@ -255,9 +251,9 @@ void parseInvalidIncludedEngines() { void parseValidExcludedEngines(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(asList("junit-jupiter"), type.parseArgLine("-E junit-jupiter").getExcludedEngines()), - () -> assertEquals(asList("junit-vintage"), type.parseArgLine("--exclude-engine junit-vintage").getExcludedEngines()), - () -> assertEquals(emptyList(), type.parseArgLine("").getExcludedEngines()) + () -> assertEquals(List.of("junit-jupiter"), type.parseArgLine("-E junit-jupiter").getExcludedEngines()), + () -> assertEquals(List.of("junit-vintage"), type.parseArgLine("--exclude-engine junit-vintage").getExcludedEngines()), + () -> assertEquals(List.of(), type.parseArgLine("").getExcludedEngines()) ); // @formatter:on } @@ -273,16 +269,16 @@ void parseValidAdditionalClasspathEntries(ArgsType type) { var dir = Paths.get("."); // @formatter:off assertAll( - () -> assertEquals(singletonList(dir), type.parseArgLine("-cp .").getAdditionalClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("--cp .").getAdditionalClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("-classpath .").getAdditionalClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("-classpath=.").getAdditionalClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("--classpath .").getAdditionalClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("--classpath=.").getAdditionalClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("--class-path .").getAdditionalClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("--class-path=.").getAdditionalClasspathEntries()), - () -> assertEquals(asList(dir, Paths.get("src", "test", "java")), type.parseArgLine("-cp . -cp src/test/java").getAdditionalClasspathEntries()), - () -> assertEquals(asList(dir, Paths.get("src", "test", "java")), type.parseArgLine("-cp ." + File.pathSeparator + "src/test/java").getAdditionalClasspathEntries()) + () -> assertEquals(List.of(dir), type.parseArgLine("-cp .").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("--cp .").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("-classpath .").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("-classpath=.").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("--classpath .").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("--classpath=.").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("--class-path .").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("--class-path=.").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir, Paths.get("src", "test", "java")), type.parseArgLine("-cp . -cp src/test/java").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir, Paths.get("src", "test", "java")), type.parseArgLine("-cp ." + File.pathSeparator + "src/test/java").getAdditionalClasspathEntries()) ); // @formatter:on } @@ -314,13 +310,13 @@ void parseInvalidXmlReportsDirs() { void parseValidUriSelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList(new URI("file:///foo.txt")), type.parseArgLine("-u file:///foo.txt").getSelectedUris()), - () -> assertEquals(singletonList(new URI("file:///foo.txt")), type.parseArgLine("--u file:///foo.txt").getSelectedUris()), - () -> assertEquals(singletonList(new URI("file:///foo.txt")), type.parseArgLine("-select-uri file:///foo.txt").getSelectedUris()), - () -> assertEquals(singletonList(new URI("file:///foo.txt")), type.parseArgLine("-select-uri=file:///foo.txt").getSelectedUris()), - () -> assertEquals(singletonList(new URI("file:///foo.txt")), type.parseArgLine("--select-uri file:///foo.txt").getSelectedUris()), - () -> assertEquals(singletonList(new URI("file:///foo.txt")), type.parseArgLine("--select-uri=file:///foo.txt").getSelectedUris()), - () -> assertEquals(asList(new URI("file:///foo.txt"), new URI("https://example")), type.parseArgLine("-u file:///foo.txt -u https://example").getSelectedUris()) + () -> assertEquals(List.of(new URI("file:///foo.txt")), type.parseArgLine("-u file:///foo.txt").getSelectedUris()), + () -> assertEquals(List.of(new URI("file:///foo.txt")), type.parseArgLine("--u file:///foo.txt").getSelectedUris()), + () -> assertEquals(List.of(new URI("file:///foo.txt")), type.parseArgLine("-select-uri file:///foo.txt").getSelectedUris()), + () -> assertEquals(List.of(new URI("file:///foo.txt")), type.parseArgLine("-select-uri=file:///foo.txt").getSelectedUris()), + () -> assertEquals(List.of(new URI("file:///foo.txt")), type.parseArgLine("--select-uri file:///foo.txt").getSelectedUris()), + () -> assertEquals(List.of(new URI("file:///foo.txt")), type.parseArgLine("--select-uri=file:///foo.txt").getSelectedUris()), + () -> assertEquals(List.of(new URI("file:///foo.txt"), new URI("https://example")), type.parseArgLine("-u file:///foo.txt -u https://example").getSelectedUris()) ); // @formatter:on } @@ -335,13 +331,13 @@ void parseInvalidUriSelectors() { void parseValidFileSelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList("foo.txt"), type.parseArgLine("-f foo.txt").getSelectedFiles()), - () -> assertEquals(singletonList("foo.txt"), type.parseArgLine("--f foo.txt").getSelectedFiles()), - () -> assertEquals(singletonList("foo.txt"), type.parseArgLine("-select-file foo.txt").getSelectedFiles()), - () -> assertEquals(singletonList("foo.txt"), type.parseArgLine("-select-file=foo.txt").getSelectedFiles()), - () -> assertEquals(singletonList("foo.txt"), type.parseArgLine("--select-file foo.txt").getSelectedFiles()), - () -> assertEquals(singletonList("foo.txt"), type.parseArgLine("--select-file=foo.txt").getSelectedFiles()), - () -> assertEquals(asList("foo.txt", "bar.csv"), type.parseArgLine("-f foo.txt -f bar.csv").getSelectedFiles()) + () -> assertEquals(List.of("foo.txt"), type.parseArgLine("-f foo.txt").getSelectedFiles()), + () -> assertEquals(List.of("foo.txt"), type.parseArgLine("--f foo.txt").getSelectedFiles()), + () -> assertEquals(List.of("foo.txt"), type.parseArgLine("-select-file foo.txt").getSelectedFiles()), + () -> assertEquals(List.of("foo.txt"), type.parseArgLine("-select-file=foo.txt").getSelectedFiles()), + () -> assertEquals(List.of("foo.txt"), type.parseArgLine("--select-file foo.txt").getSelectedFiles()), + () -> assertEquals(List.of("foo.txt"), type.parseArgLine("--select-file=foo.txt").getSelectedFiles()), + () -> assertEquals(List.of("foo.txt", "bar.csv"), type.parseArgLine("-f foo.txt -f bar.csv").getSelectedFiles()) ); // @formatter:on } @@ -356,13 +352,13 @@ void parseInvalidFileSelectors() { void parseValidDirectorySelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList("foo/bar"), type.parseArgLine("-d foo/bar").getSelectedDirectories()), - () -> assertEquals(singletonList("foo/bar"), type.parseArgLine("--d foo/bar").getSelectedDirectories()), - () -> assertEquals(singletonList("foo/bar"), type.parseArgLine("-select-directory foo/bar").getSelectedDirectories()), - () -> assertEquals(singletonList("foo/bar"), type.parseArgLine("-select-directory=foo/bar").getSelectedDirectories()), - () -> assertEquals(singletonList("foo/bar"), type.parseArgLine("--select-directory foo/bar").getSelectedDirectories()), - () -> assertEquals(singletonList("foo/bar"), type.parseArgLine("--select-directory=foo/bar").getSelectedDirectories()), - () -> assertEquals(asList("foo/bar", "bar/qux"), type.parseArgLine("-d foo/bar -d bar/qux").getSelectedDirectories()) + () -> assertEquals(List.of("foo/bar"), type.parseArgLine("-d foo/bar").getSelectedDirectories()), + () -> assertEquals(List.of("foo/bar"), type.parseArgLine("--d foo/bar").getSelectedDirectories()), + () -> assertEquals(List.of("foo/bar"), type.parseArgLine("-select-directory foo/bar").getSelectedDirectories()), + () -> assertEquals(List.of("foo/bar"), type.parseArgLine("-select-directory=foo/bar").getSelectedDirectories()), + () -> assertEquals(List.of("foo/bar"), type.parseArgLine("--select-directory foo/bar").getSelectedDirectories()), + () -> assertEquals(List.of("foo/bar"), type.parseArgLine("--select-directory=foo/bar").getSelectedDirectories()), + () -> assertEquals(List.of("foo/bar", "bar/qux"), type.parseArgLine("-d foo/bar -d bar/qux").getSelectedDirectories()) ); // @formatter:on } @@ -377,13 +373,13 @@ void parseInvalidDirectorySelectors() { void parseValidModuleSelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("-o com.acme.foo").getSelectedModules()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("--o com.acme.foo").getSelectedModules()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("-select-module com.acme.foo").getSelectedModules()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("-select-module=com.acme.foo").getSelectedModules()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("--select-module com.acme.foo").getSelectedModules()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("--select-module=com.acme.foo").getSelectedModules()), - () -> assertEquals(asList("com.acme.foo", "com.example.bar"), type.parseArgLine("-o com.acme.foo -o com.example.bar").getSelectedModules()) + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("-o com.acme.foo").getSelectedModules()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("--o com.acme.foo").getSelectedModules()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("-select-module com.acme.foo").getSelectedModules()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("-select-module=com.acme.foo").getSelectedModules()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("--select-module com.acme.foo").getSelectedModules()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("--select-module=com.acme.foo").getSelectedModules()), + () -> assertEquals(List.of("com.acme.foo", "com.example.bar"), type.parseArgLine("-o com.acme.foo -o com.example.bar").getSelectedModules()) ); // @formatter:on } @@ -398,13 +394,13 @@ void parseInvalidModuleSelectors() { void parseValidPackageSelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("-p com.acme.foo").getSelectedPackages()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("--p com.acme.foo").getSelectedPackages()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("-select-package com.acme.foo").getSelectedPackages()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("-select-package=com.acme.foo").getSelectedPackages()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("--select-package com.acme.foo").getSelectedPackages()), - () -> assertEquals(singletonList("com.acme.foo"), type.parseArgLine("--select-package=com.acme.foo").getSelectedPackages()), - () -> assertEquals(asList("com.acme.foo", "com.example.bar"), type.parseArgLine("-p com.acme.foo -p com.example.bar").getSelectedPackages()) + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("-p com.acme.foo").getSelectedPackages()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("--p com.acme.foo").getSelectedPackages()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("-select-package com.acme.foo").getSelectedPackages()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("-select-package=com.acme.foo").getSelectedPackages()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("--select-package com.acme.foo").getSelectedPackages()), + () -> assertEquals(List.of("com.acme.foo"), type.parseArgLine("--select-package=com.acme.foo").getSelectedPackages()), + () -> assertEquals(List.of("com.acme.foo", "com.example.bar"), type.parseArgLine("-p com.acme.foo -p com.example.bar").getSelectedPackages()) ); // @formatter:on } @@ -419,13 +415,13 @@ void parseInvalidPackageSelectors() { void parseValidClassSelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList("com.acme.Foo"), type.parseArgLine("-c com.acme.Foo").getSelectedClasses()), - () -> assertEquals(singletonList("com.acme.Foo"), type.parseArgLine("--c com.acme.Foo").getSelectedClasses()), - () -> assertEquals(singletonList("com.acme.Foo"), type.parseArgLine("-select-class com.acme.Foo").getSelectedClasses()), - () -> assertEquals(singletonList("com.acme.Foo"), type.parseArgLine("-select-class=com.acme.Foo").getSelectedClasses()), - () -> assertEquals(singletonList("com.acme.Foo"), type.parseArgLine("--select-class com.acme.Foo").getSelectedClasses()), - () -> assertEquals(singletonList("com.acme.Foo"), type.parseArgLine("--select-class=com.acme.Foo").getSelectedClasses()), - () -> assertEquals(asList("com.acme.Foo", "com.example.Bar"), type.parseArgLine("-c com.acme.Foo -c com.example.Bar").getSelectedClasses()) + () -> assertEquals(List.of("com.acme.Foo"), type.parseArgLine("-c com.acme.Foo").getSelectedClasses()), + () -> assertEquals(List.of("com.acme.Foo"), type.parseArgLine("--c com.acme.Foo").getSelectedClasses()), + () -> assertEquals(List.of("com.acme.Foo"), type.parseArgLine("-select-class com.acme.Foo").getSelectedClasses()), + () -> assertEquals(List.of("com.acme.Foo"), type.parseArgLine("-select-class=com.acme.Foo").getSelectedClasses()), + () -> assertEquals(List.of("com.acme.Foo"), type.parseArgLine("--select-class com.acme.Foo").getSelectedClasses()), + () -> assertEquals(List.of("com.acme.Foo"), type.parseArgLine("--select-class=com.acme.Foo").getSelectedClasses()), + () -> assertEquals(List.of("com.acme.Foo", "com.example.Bar"), type.parseArgLine("-c com.acme.Foo -c com.example.Bar").getSelectedClasses()) ); // @formatter:on } @@ -440,13 +436,13 @@ void parseInvalidClassSelectors() { void parseValidMethodSelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList("com.acme.Foo#m()"), type.parseArgLine("-m com.acme.Foo#m()").getSelectedMethods()), - () -> assertEquals(singletonList("com.acme.Foo#m()"), type.parseArgLine("--m com.acme.Foo#m()").getSelectedMethods()), - () -> assertEquals(singletonList("com.acme.Foo#m()"), type.parseArgLine("-select-method com.acme.Foo#m()").getSelectedMethods()), - () -> assertEquals(singletonList("com.acme.Foo#m()"), type.parseArgLine("-select-method=com.acme.Foo#m()").getSelectedMethods()), - () -> assertEquals(singletonList("com.acme.Foo#m()"), type.parseArgLine("--select-method com.acme.Foo#m()").getSelectedMethods()), - () -> assertEquals(singletonList("com.acme.Foo#m()"), type.parseArgLine("--select-method=com.acme.Foo#m()").getSelectedMethods()), - () -> assertEquals(asList("com.acme.Foo#m()", "com.example.Bar#method(java.lang.Object)"), + () -> assertEquals(List.of("com.acme.Foo#m()"), type.parseArgLine("-m com.acme.Foo#m()").getSelectedMethods()), + () -> assertEquals(List.of("com.acme.Foo#m()"), type.parseArgLine("--m com.acme.Foo#m()").getSelectedMethods()), + () -> assertEquals(List.of("com.acme.Foo#m()"), type.parseArgLine("-select-method com.acme.Foo#m()").getSelectedMethods()), + () -> assertEquals(List.of("com.acme.Foo#m()"), type.parseArgLine("-select-method=com.acme.Foo#m()").getSelectedMethods()), + () -> assertEquals(List.of("com.acme.Foo#m()"), type.parseArgLine("--select-method com.acme.Foo#m()").getSelectedMethods()), + () -> assertEquals(List.of("com.acme.Foo#m()"), type.parseArgLine("--select-method=com.acme.Foo#m()").getSelectedMethods()), + () -> assertEquals(List.of("com.acme.Foo#m()", "com.example.Bar#method(java.lang.Object)"), type.parseArgLine("-m com.acme.Foo#m() -m com.example.Bar#method(java.lang.Object)").getSelectedMethods()) ); // @formatter:on @@ -462,13 +458,13 @@ void parseInvalidMethodSelectors() { void parseValidClasspathResourceSelectors(ArgsType type) { // @formatter:off assertAll( - () -> assertEquals(singletonList("/foo.csv"), type.parseArgLine("-r /foo.csv").getSelectedClasspathResources()), - () -> assertEquals(singletonList("/foo.csv"), type.parseArgLine("--r /foo.csv").getSelectedClasspathResources()), - () -> assertEquals(singletonList("/foo.csv"), type.parseArgLine("-select-resource /foo.csv").getSelectedClasspathResources()), - () -> assertEquals(singletonList("/foo.csv"), type.parseArgLine("-select-resource=/foo.csv").getSelectedClasspathResources()), - () -> assertEquals(singletonList("/foo.csv"), type.parseArgLine("--select-resource /foo.csv").getSelectedClasspathResources()), - () -> assertEquals(singletonList("/foo.csv"), type.parseArgLine("--select-resource=/foo.csv").getSelectedClasspathResources()), - () -> assertEquals(asList("/foo.csv", "bar.json"), type.parseArgLine("-r /foo.csv -r bar.json").getSelectedClasspathResources()) + () -> assertEquals(List.of("/foo.csv"), type.parseArgLine("-r /foo.csv").getSelectedClasspathResources()), + () -> assertEquals(List.of("/foo.csv"), type.parseArgLine("--r /foo.csv").getSelectedClasspathResources()), + () -> assertEquals(List.of("/foo.csv"), type.parseArgLine("-select-resource /foo.csv").getSelectedClasspathResources()), + () -> assertEquals(List.of("/foo.csv"), type.parseArgLine("-select-resource=/foo.csv").getSelectedClasspathResources()), + () -> assertEquals(List.of("/foo.csv"), type.parseArgLine("--select-resource /foo.csv").getSelectedClasspathResources()), + () -> assertEquals(List.of("/foo.csv"), type.parseArgLine("--select-resource=/foo.csv").getSelectedClasspathResources()), + () -> assertEquals(List.of("/foo.csv", "bar.json"), type.parseArgLine("-r /foo.csv -r bar.json").getSelectedClasspathResources()) ); // @formatter:on } @@ -485,16 +481,16 @@ void parseClasspathScanningEntries(ArgsType type) { // @formatter:off assertAll( () -> assertTrue(type.parseArgLine("--scan-class-path").isScanClasspath()), - () -> assertEquals(emptyList(), type.parseArgLine("--scan-class-path").getSelectedClasspathEntries()), + () -> assertEquals(List.of(), type.parseArgLine("--scan-class-path").getSelectedClasspathEntries()), () -> assertTrue(type.parseArgLine("--scan-classpath").isScanClasspath()), - () -> assertEquals(emptyList(), type.parseArgLine("--scan-classpath").getSelectedClasspathEntries()), + () -> assertEquals(List.of(), type.parseArgLine("--scan-classpath").getSelectedClasspathEntries()), () -> assertTrue(type.parseArgLine("--scan-class-path .").isScanClasspath()), - () -> assertEquals(singletonList(dir), type.parseArgLine("--scan-class-path .").getSelectedClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("--scan-class-path=.").getSelectedClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("-scan-class-path .").getSelectedClasspathEntries()), - () -> assertEquals(singletonList(dir), type.parseArgLine("-scan-class-path=.").getSelectedClasspathEntries()), - () -> assertEquals(asList(dir, Paths.get("src/test/java")), type.parseArgLine("--scan-class-path . --scan-class-path src/test/java").getSelectedClasspathEntries()), - () -> assertEquals(asList(dir, Paths.get("src/test/java")), type.parseArgLine("--scan-class-path ." + File.pathSeparator + "src/test/java").getSelectedClasspathEntries()) + () -> assertEquals(List.of(dir), type.parseArgLine("--scan-class-path .").getSelectedClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("--scan-class-path=.").getSelectedClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("-scan-class-path .").getSelectedClasspathEntries()), + () -> assertEquals(List.of(dir), type.parseArgLine("-scan-class-path=.").getSelectedClasspathEntries()), + () -> assertEquals(List.of(dir, Paths.get("src/test/java")), type.parseArgLine("--scan-class-path . --scan-class-path src/test/java").getSelectedClasspathEntries()), + () -> assertEquals(List.of(dir, Paths.get("src/test/java")), type.parseArgLine("--scan-class-path ." + File.pathSeparator + "src/test/java").getSelectedClasspathEntries()) ); // @formatter:on } @@ -568,12 +564,12 @@ public void close() { } private void assertOptionWithMissingRequiredArgumentThrowsException(String... options) { - assertAll(stream(options).map( + assertAll(Stream.of(options).map( opt -> () -> assertThrows(JUnitException.class, () -> ArgsType.args.parseArgLine(opt)))); } private void assertParses(String name, Predicate property, String... argLines) { - stream(argLines).forEach(argLine -> { + Stream.of(argLines).forEach(argLine -> { CommandLineOptions options = null; try { options = ArgsType.args.parseArgLine(argLine); @@ -595,8 +591,7 @@ CommandLineOptions parseArgLine(String argLine) { CommandLineOptions parseArgLine(String argLine) throws IOException { var atFile = Files.createTempFile("junit-launcher-args", ".txt"); try { - var lines = Arrays.asList(split(argLine)); - Files.write(atFile, lines); + Files.write(atFile, List.of(split(argLine))); return createParser().parse("@" + atFile); } finally { diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java index df1ab72617a5..b78479d7a3aa 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java @@ -10,8 +10,6 @@ package org.junit.platform.console.tasks; -import static java.util.Collections.emptyList; -import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertNotSame; import static org.junit.jupiter.api.Assertions.assertSame; @@ -22,6 +20,7 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.nio.file.Paths; +import java.util.List; import org.junit.jupiter.api.Test; import org.junit.platform.console.ConsoleLauncherExecutionResult; @@ -151,7 +150,7 @@ void hasStatusCode0ForNoTestsAndNotFailIfNoTestsFound() throws Exception { @Test void usesCustomClassLoaderIfAdditionalClassPathEntriesArePresent() throws Exception { - options.setAdditionalClasspathEntries(singletonList(Paths.get("."))); + options.setAdditionalClasspathEntries(List.of(Paths.get("."))); var oldClassLoader = getDefaultClassLoader(); dummyTestEngine.addTest("failingTest", @@ -165,7 +164,7 @@ void usesCustomClassLoaderIfAdditionalClassPathEntriesArePresent() throws Except @Test void usesSameClassLoaderIfNoAdditionalClassPathEntriesArePresent() throws Exception { - options.setAdditionalClasspathEntries(emptyList()); + options.setAdditionalClasspathEntries(List.of()); var oldClassLoader = getDefaultClassLoader(); dummyTestEngine.addTest("failingTest", diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java index cf7dc7a23d12..7543298649e7 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java @@ -10,8 +10,6 @@ package org.junit.platform.console.tasks; -import static java.util.Arrays.asList; -import static java.util.Collections.singletonList; import static java.util.stream.Collectors.toMap; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; @@ -21,6 +19,7 @@ import java.io.File; import java.net.URI; import java.nio.file.Paths; +import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.stream.Stream; @@ -65,7 +64,7 @@ void convertsScanClasspathOptionWithoutExplicitRootDirectories() { @Test void convertsScanClasspathOptionWithExplicitRootDirectories() { options.setScanClasspath(true); - options.setSelectedClasspathEntries(asList(Paths.get("."), Paths.get(".."))); + options.setSelectedClasspathEntries(List.of(Paths.get("."), Paths.get(".."))); var request = convert(); @@ -79,7 +78,7 @@ void convertsScanClasspathOptionWithExplicitRootDirectories() { @Test void convertsScanClasspathOptionWithAdditionalClasspathEntries() { options.setScanClasspath(true); - options.setAdditionalClasspathEntries(asList(Paths.get("."), Paths.get(".."))); + options.setAdditionalClasspathEntries(List.of(Paths.get("."), Paths.get(".."))); var request = convert(); @@ -93,7 +92,7 @@ void convertsScanClasspathOptionWithAdditionalClasspathEntries() { @Test void doesNotSupportScanClasspathAndExplicitSelectors() { options.setScanClasspath(true); - options.setSelectedClasses(singletonList("SomeTest")); + options.setSelectedClasses(List.of("SomeTest")); Throwable cause = assertThrows(PreconditionViolationException.class, this::convert); @@ -114,7 +113,7 @@ void convertsDefaultIncludeClassNamePatternOption() { @Test void convertsExplicitIncludeClassNamePatternOption() { options.setScanClasspath(true); - options.setIncludedClassNamePatterns(asList("Foo.*Bar", "Bar.*Foo")); + options.setIncludedClassNamePatterns(List.of("Foo.*Bar", "Bar.*Foo")); var request = convert(); @@ -126,9 +125,9 @@ void convertsExplicitIncludeClassNamePatternOption() { @Test void includeSelectedClassesAndMethodsRegardlessOfClassNamePatterns() { - options.setSelectedClasses(singletonList("SomeTest")); - options.setSelectedMethods(asList("com.acme.Foo#m()")); - options.setIncludedClassNamePatterns(asList("Foo.*Bar")); + options.setSelectedClasses(List.of("SomeTest")); + options.setSelectedMethods(List.of("com.acme.Foo#m()")); + options.setIncludedClassNamePatterns(List.of("Foo.*Bar")); var request = convert(); @@ -142,7 +141,7 @@ void includeSelectedClassesAndMethodsRegardlessOfClassNamePatterns() { @Test void convertsExcludeClassNamePatternOption() { options.setScanClasspath(true); - options.setExcludedClassNamePatterns(asList("Foo.*Bar", "Bar.*Foo")); + options.setExcludedClassNamePatterns(List.of("Foo.*Bar", "Bar.*Foo")); var request = convert(); @@ -155,8 +154,8 @@ void convertsExcludeClassNamePatternOption() { @Test void convertsPackageOptions() { options.setScanClasspath(true); - options.setIncludedPackages(asList("org.junit.included1", "org.junit.included2", "org.junit.included3")); - options.setExcludedPackages(asList("org.junit.excluded1")); + options.setIncludedPackages(List.of("org.junit.included1", "org.junit.included2", "org.junit.included3")); + options.setExcludedPackages(List.of("org.junit.excluded1")); var request = convert(); var packageNameFilters = request.getFiltersByType(PackageNameFilter.class); @@ -171,8 +170,8 @@ void convertsPackageOptions() { @Test void convertsTagOptions() { options.setScanClasspath(true); - options.setIncludedTagExpressions(asList("fast", "medium", "slow")); - options.setExcludedTagExpressions(asList("slow")); + options.setIncludedTagExpressions(List.of("fast", "medium", "slow")); + options.setExcludedTagExpressions(List.of("slow")); var request = convert(); var postDiscoveryFilters = request.getPostDiscoveryFilters(); @@ -185,8 +184,8 @@ void convertsTagOptions() { @Test void convertsEngineOptions() { options.setScanClasspath(true); - options.setIncludedEngines(asList("engine1", "engine2", "engine3")); - options.setExcludedEngines(singletonList("engine2")); + options.setIncludedEngines(List.of("engine1", "engine2", "engine3")); + options.setExcludedEngines(List.of("engine2")); var request = convert(); var engineFilters = request.getEngineFilters(); @@ -198,7 +197,7 @@ void convertsEngineOptions() { @Test void convertsUriSelectors() { - options.setSelectedUris(asList(URI.create("a"), URI.create("b"))); + options.setSelectedUris(List.of(URI.create("a"), URI.create("b"))); var request = convert(); var uriSelectors = request.getSelectorsByType(UriSelector.class); @@ -208,7 +207,7 @@ void convertsUriSelectors() { @Test void convertsFileSelectors() { - options.setSelectedFiles(asList("foo.txt", "bar.csv")); + options.setSelectedFiles(List.of("foo.txt", "bar.csv")); var request = convert(); var fileSelectors = request.getSelectorsByType(FileSelector.class); @@ -218,7 +217,7 @@ void convertsFileSelectors() { @Test void convertsDirectorySelectors() { - options.setSelectedDirectories(asList("foo/bar", "bar/qux")); + options.setSelectedDirectories(List.of("foo/bar", "bar/qux")); var request = convert(); var directorySelectors = request.getSelectorsByType(DirectorySelector.class); @@ -228,7 +227,7 @@ void convertsDirectorySelectors() { @Test void convertsPackageSelectors() { - options.setSelectedPackages(asList("com.acme.foo", "com.example.bar")); + options.setSelectedPackages(List.of("com.acme.foo", "com.example.bar")); var request = convert(); var packageSelectors = request.getSelectorsByType(PackageSelector.class); @@ -239,7 +238,7 @@ void convertsPackageSelectors() { @Test void convertsClassSelectors() { - options.setSelectedClasses(asList("com.acme.Foo", "com.example.Bar")); + options.setSelectedClasses(List.of("com.acme.Foo", "com.example.Bar")); var request = convert(); var classSelectors = request.getSelectorsByType(ClassSelector.class); @@ -250,7 +249,7 @@ void convertsClassSelectors() { @Test void convertsMethodSelectors() { - options.setSelectedMethods(asList("com.acme.Foo#m()", "com.example.Bar#method(java.lang.Object)")); + options.setSelectedMethods(List.of("com.acme.Foo#m()", "com.example.Bar#method(java.lang.Object)")); var request = convert(); var methodSelectors = request.getSelectorsByType(MethodSelector.class); @@ -266,7 +265,7 @@ void convertsMethodSelectors() { @Test void convertsClasspathResourceSelectors() { - options.setSelectedClasspathResources(asList("foo.csv", "com/example/bar.json")); + options.setSelectedClasspathResources(List.of("foo.csv", "com/example/bar.json")); var request = convert(); var classpathResourceSelectors = request.getSelectorsByType(ClasspathResourceSelector.class); diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java index d4fa5dea23a5..e7487fb9a994 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java @@ -22,8 +22,6 @@ import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Test; @@ -43,7 +41,7 @@ class TreePrinterTests { private List actual() { try { out.flush(); - return Arrays.asList(stream.toString(charset.name()).split("\\R")); + return List.of(stream.toString(charset.name()).split("\\R")); } catch (UnsupportedEncodingException e) { throw new AssertionError(charset.name() + " is an unsupported encoding?!", e); @@ -53,7 +51,7 @@ private List actual() { @Test void emptyTree() { new TreePrinter(out, Theme.UNICODE, true).print(new TreeNode("")); - assertIterableEquals(Collections.singletonList("╷"), actual()); + assertIterableEquals(List.of("╷"), actual()); } @Test @@ -65,7 +63,7 @@ void emptyEngines() { root.addChild(new TreeNode(identifier("e-3", "engine three")).setResult(aborted(null))); new TreePrinter(out, Theme.UNICODE, true).print(root); assertIterableEquals( // - Arrays.asList( // + List.of( // "╷", // "├─ engine zero ↷ none", // "├─ engine one ✔", // @@ -80,7 +78,7 @@ void printNodeHandlesNullMessageThrowableGracefully() { var result = TestExecutionResult.failed(new NullPointerException()); var node = new TreeNode(identifier("NPE", "test()")).setResult(result); new TreePrinter(out, Theme.ASCII, true).print(node); - assertLinesMatch(Arrays.asList(".", "+-- test() [X] java.lang.NullPointerException"), actual()); + assertLinesMatch(List.of(".", "+-- test() [X] java.lang.NullPointerException"), actual()); } @Test diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java index cd3d1705410a..c66a17059cf0 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java @@ -11,8 +11,6 @@ package org.junit.platform.engine.discovery; import static java.lang.String.join; -import static java.util.Collections.emptyList; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -35,9 +33,8 @@ import java.net.URI; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Arrays; -import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -222,7 +219,7 @@ void selectModuleByNamePreconditions() { @Test void selectModulesByNames() { - var selectors = selectModules(new HashSet<>(Arrays.asList("a", "b"))); + var selectors = selectModules(Set.of("a", "b")); var names = selectors.stream().map(ModuleSelector::getModuleName).collect(Collectors.toList()); assertThat(names).containsExactlyInAnyOrder("b", "a"); } @@ -230,7 +227,7 @@ void selectModulesByNames() { @Test void selectModulesByNamesPreconditions() { assertViolatesPrecondition(() -> selectModules(null)); - assertViolatesPrecondition(() -> selectModules(new HashSet<>(Arrays.asList("a", " ")))); + assertViolatesPrecondition(() -> selectModules(Set.of("a", " "))); } @Test @@ -616,21 +613,21 @@ void selectMethodByClassAndNameForSpockSpec() { @Test void selectClasspathRootsWithNonExistingDirectory() { - var selectors = selectClasspathRoots(singleton(Paths.get("some", "local", "path"))); + var selectors = selectClasspathRoots(Set.of(Paths.get("some", "local", "path"))); assertThat(selectors).isEmpty(); } @Test void selectClasspathRootsWithNonExistingJarFile() { - var selectors = selectClasspathRoots(singleton(Paths.get("some.jar"))); + var selectors = selectClasspathRoots(Set.of(Paths.get("some.jar"))); assertThat(selectors).isEmpty(); } @Test void selectClasspathRootsWithExistingDirectory(@TempDir Path tempDir) { - var selectors = selectClasspathRoots(singleton(tempDir)); + var selectors = selectClasspathRoots(Set.of(tempDir)); assertThat(selectors).extracting(ClasspathRootSelector::getClasspathRoot).containsExactly(tempDir.toUri()); } @@ -640,7 +637,7 @@ void selectClasspathRootsWithExistingJarFile() throws Exception { var jarUri = getClass().getResource("/jartest.jar").toURI(); var jarFile = Paths.get(jarUri); - var selectors = selectClasspathRoots(singleton(jarFile)); + var selectors = selectClasspathRoots(Set.of(jarFile)); assertThat(selectors).extracting(ClasspathRootSelector::getClasspathRoot).containsExactly(jarUri); } @@ -680,7 +677,7 @@ void selectDoubleNestedClassByClassNames() { @Test void selectNestedClassPreconditions() { assertViolatesPrecondition(() -> selectNestedClass(null, "ClassName")); - assertViolatesPrecondition(() -> selectNestedClass(emptyList(), "ClassName")); + assertViolatesPrecondition(() -> selectNestedClass(List.of(), "ClassName")); assertViolatesPrecondition(() -> selectNestedClass(List.of("ClassName"), null)); assertViolatesPrecondition(() -> selectNestedClass(List.of("ClassName"), "")); assertViolatesPrecondition(() -> selectNestedClass(List.of("ClassName"), " ")); @@ -750,8 +747,8 @@ void selectDoubleNestedMethodByEnclosingClassNamesAndMethodName() throws Excepti void selectNestedMethodPreconditions() { assertViolatesPrecondition(() -> selectNestedMethod(null, "ClassName", "methodName")); assertViolatesPrecondition(() -> selectNestedMethod(null, "ClassName", "methodName", "int")); - assertViolatesPrecondition(() -> selectNestedMethod(emptyList(), "ClassName", "methodName")); - assertViolatesPrecondition(() -> selectNestedMethod(emptyList(), "ClassName", "methodName", "int")); + assertViolatesPrecondition(() -> selectNestedMethod(List.of(), "ClassName", "methodName")); + assertViolatesPrecondition(() -> selectNestedMethod(List.of(), "ClassName", "methodName", "int")); assertViolatesPrecondition(() -> selectNestedMethod(List.of("ClassName"), null, "methodName")); assertViolatesPrecondition(() -> selectNestedMethod(List.of("ClassName"), null, "methodName", "int")); assertViolatesPrecondition(() -> selectNestedMethod(List.of("ClassName"), " ", "methodName")); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java index 526386711d3b..059fc277bfec 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java @@ -15,14 +15,11 @@ import java.io.File; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.platform.commons.PreconditionViolationException; -import org.junit.platform.engine.TestSource; /** * Unit tests for {@link CompositeTestSource}. @@ -35,7 +32,7 @@ class CompositeTestSourceTests extends AbstractTestSourceTests { Stream createSerializableInstances() { var fileSource = FileSource.from(new File("sample.instance")); var classSource = ClassSource.from(getClass()); - List sources = new ArrayList<>(Arrays.asList(fileSource, classSource)); + var sources = List.of(fileSource, classSource); return Stream.of(CompositeTestSource.from(sources)); } @@ -46,14 +43,14 @@ void createCompositeTestSourceFromNullList() { @Test void createCompositeTestSourceFromEmptyList() { - assertThrows(PreconditionViolationException.class, () -> CompositeTestSource.from(Collections.emptyList())); + assertThrows(PreconditionViolationException.class, () -> CompositeTestSource.from(List.of())); } @Test void createCompositeTestSourceFromClassAndFileSources() { var fileSource = FileSource.from(new File("example.test")); var classSource = ClassSource.from(getClass()); - List sources = new ArrayList<>(Arrays.asList(fileSource, classSource)); + var sources = new ArrayList<>(List.of(fileSource, classSource)); var compositeTestSource = CompositeTestSource.from(sources); assertThat(compositeTestSource.getSources().size()).isEqualTo(2); @@ -69,8 +66,8 @@ void createCompositeTestSourceFromClassAndFileSources() { @Test void equalsAndHashCode() { - List sources1 = Collections.singletonList(ClassSource.from(Number.class)); - List sources2 = Collections.singletonList(ClassSource.from(String.class)); + var sources1 = List.of(ClassSource.from(Number.class)); + var sources2 = List.of(ClassSource.from(String.class)); assertEqualsAndHashCode(CompositeTestSource.from(sources1), CompositeTestSource.from(sources1), CompositeTestSource.from(sources2)); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java index ba253affcf6a..0ae2ec0aedcb 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java @@ -10,13 +10,13 @@ package org.junit.platform.engine.support.hierarchical; -import static java.util.Arrays.asList; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; +import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.locks.Lock; @@ -34,7 +34,7 @@ void acquiresAllLocksInOrder() throws Exception { var lock1 = mock(Lock.class); var lock2 = mock(Lock.class); - new CompositeLock(asList(lock1, lock2)).acquire(); + new CompositeLock(List.of(lock1, lock2)).acquire(); var inOrder = inOrder(lock1, lock2); inOrder.verify(lock1).lockInterruptibly(); @@ -47,7 +47,7 @@ void releasesAllLocksInReverseOrder() throws Exception { var lock1 = mock(Lock.class); var lock2 = mock(Lock.class); - new CompositeLock(asList(lock1, lock2)).acquire().close(); + new CompositeLock(List.of(lock1, lock2)).acquire().close(); var inOrder = inOrder(lock1, lock2); inOrder.verify(lock2).unlock(); @@ -64,7 +64,7 @@ void releasesLocksInReverseOrderWhenInterruptedDuringAcquire() throws Exception var thread = new Thread(() -> { try { - new CompositeLock(asList(firstLock, secondLock, unavailableLock)).acquire(); + new CompositeLock(List.of(firstLock, secondLock, unavailableLock)).acquire(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java index aeac3287abad..20167699afeb 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java @@ -10,7 +10,6 @@ package org.junit.platform.engine.support.hierarchical; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -30,6 +29,7 @@ import static org.mockito.Mockito.when; import java.util.Map; +import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; @@ -660,7 +660,7 @@ void dynamicTestDescriptorsMustNotDeclareExclusiveResources() { var child = spy(new MyLeaf(leafUniqueId)); var dynamicTestDescriptor = spy(new MyLeaf(leafUniqueId.append("dynamic", "child"))); when(dynamicTestDescriptor.getExclusiveResources()).thenReturn( - singleton(new ExclusiveResource("foo", LockMode.READ))); + Set.of(new ExclusiveResource("foo", LockMode.READ))); when(child.execute(any(), any())).thenAnswer(execute(dynamicTestDescriptor)); root.addChild(child); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java index 25e359e2ed0d..dac88f8367ff 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java @@ -10,9 +10,6 @@ package org.junit.platform.engine.support.hierarchical; -import static java.util.Arrays.asList; -import static java.util.Collections.emptySet; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY; import static org.junit.platform.engine.support.hierarchical.ExclusiveResource.LockMode.READ; @@ -20,6 +17,7 @@ import java.util.Collection; import java.util.List; +import java.util.Set; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock; import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock; @@ -38,7 +36,7 @@ class LockManagerTests { @Test void returnsNopLockWithoutExclusiveResources() { - Collection resources = emptySet(); + Collection resources = Set.of(); var locks = getLocks(resources, NopLock.class); @@ -47,7 +45,7 @@ void returnsNopLockWithoutExclusiveResources() { @Test void returnsSingleLockForSingleExclusiveResource() { - Collection resources = singleton(new ExclusiveResource("foo", READ)); + Collection resources = Set.of(new ExclusiveResource("foo", READ)); var locks = getLocks(resources, SingleLock.class); @@ -57,7 +55,7 @@ void returnsSingleLockForSingleExclusiveResource() { @Test void returnsCompositeLockForMultipleDifferentExclusiveResources() { - Collection resources = asList( // + Collection resources = List.of( // new ExclusiveResource("a", READ), // new ExclusiveResource("b", READ_WRITE)); @@ -70,7 +68,7 @@ void returnsCompositeLockForMultipleDifferentExclusiveResources() { @Test void reusesSameLockForExclusiveResourceWithSameKey() { - Collection resources = singleton(new ExclusiveResource("foo", READ)); + Collection resources = Set.of(new ExclusiveResource("foo", READ)); var locks1 = getLocks(resources, SingleLock.class); var locks2 = getLocks(resources, SingleLock.class); @@ -82,7 +80,7 @@ void reusesSameLockForExclusiveResourceWithSameKey() { @Test void returnsWriteLockForExclusiveResourceWithBothLockModes() { - Collection resources = asList( // + Collection resources = List.of( // new ExclusiveResource("bar", READ), // new ExclusiveResource("foo", READ), // new ExclusiveResource("foo", READ_WRITE), // @@ -98,7 +96,7 @@ void returnsWriteLockForExclusiveResourceWithBothLockModes() { @ParameterizedTest @EnumSource void globalLockComesFirst(LockMode globalLockMode) { - Collection resources = asList( // + Collection resources = List.of( // new ExclusiveResource("___foo", READ), // new ExclusiveResource("foo", READ_WRITE), // new ExclusiveResource(GLOBAL_KEY, globalLockMode), // @@ -114,7 +112,7 @@ void globalLockComesFirst(LockMode globalLockMode) { } private Lock getSingleLock(String globalResourceLockKey, LockMode read) { - return getLocks(singleton(new ExclusiveResource(globalResourceLockKey, read)), SingleLock.class).get(0); + return getLocks(Set.of(new ExclusiveResource(globalResourceLockKey, read)), SingleLock.class).get(0); } private List getLocks(Collection resources, Class type) { diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java index 63ad8e7a60aa..88c397b59e1c 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java @@ -10,7 +10,6 @@ package org.junit.platform.engine.support.hierarchical; -import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.platform.commons.util.CollectionUtils.getOnlyElement; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; @@ -51,7 +50,7 @@ void pullUpExclusiveChildResourcesToTestClass() { assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); - assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()).isEqualTo(emptyList()); + assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()).isEqualTo(List.of()); assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).contains(SAME_THREAD); } @@ -79,7 +78,7 @@ void leavesResourceLockOnTestMethodWhenClassDoesNotUseResource() { assertThat(advisor.getForcedExecutionMode(nestedTestClassDescriptor)).isEmpty(); var nestedTestMethodDescriptor = getOnlyElement(nestedTestClassDescriptor.getChildren()); - assertThat(advisor.getResourceLock(nestedTestMethodDescriptor)).extracting(allLocks()).isEqualTo(emptyList()); + assertThat(advisor.getResourceLock(nestedTestMethodDescriptor)).extracting(allLocks()).isEqualTo(List.of()); assertThat(advisor.getForcedExecutionMode(nestedTestMethodDescriptor)).contains(SAME_THREAD); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java index 8eacd6eecf57..9d4ca7878b0c 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java @@ -10,13 +10,14 @@ package org.junit.platform.launcher; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.platform.commons.util.SerializationUtils.serializeAndDeserialize; +import java.util.Set; + import org.junit.jupiter.api.Test; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestTag; @@ -57,13 +58,13 @@ void inheritsTypeFromDescriptor() { void serialization() throws Exception { var identifier = serializeAndDeserialize(// new TestIdentifier("uniqueId", "displayName", ClassSource.from(TestIdentifierTests.class), - singleton(TestTag.create("aTag")), TestDescriptor.Type.TEST, "parentId", "reportingName")); + Set.of(TestTag.create("aTag")), TestDescriptor.Type.TEST, "parentId", "reportingName")); assertEquals("uniqueId", identifier.getUniqueId()); assertEquals("displayName", identifier.getDisplayName()); assertEquals("reportingName", identifier.getLegacyReportingName()); assertThat(identifier.getSource()).contains(ClassSource.from(TestIdentifierTests.class)); - assertEquals(singleton(TestTag.create("aTag")), identifier.getTags()); + assertEquals(Set.of(TestTag.create("aTag")), identifier.getTags()); assertEquals(TestDescriptor.Type.TEST, identifier.getType()); assertTrue(identifier.isTest()); assertFalse(identifier.isContainer()); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java index 33844ba6ceb0..f7f77f4e017a 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java @@ -10,9 +10,10 @@ package org.junit.platform.launcher; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; +import java.util.Set; + import org.junit.jupiter.api.Test; import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.support.descriptor.AbstractTestDescriptor; @@ -32,7 +33,7 @@ public Type getType() { } }); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); assertThat(testPlan.containsTests()).as("contains tests").isFalse(); } @@ -47,7 +48,7 @@ public Type getType() { } }); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); assertThat(testPlan.containsTests()).as("contains tests").isTrue(); } @@ -67,7 +68,7 @@ public boolean mayRegisterTests() { } }); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); assertThat(testPlan.containsTests()).as("contains tests").isTrue(); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java index 29f144b96b2b..217a3705b006 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java @@ -10,8 +10,6 @@ package org.junit.platform.launcher.core; -import static java.util.Collections.emptyMap; -import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -52,14 +50,14 @@ void reset() { @Test void constructorPreconditions() { assertThrows(PreconditionViolationException.class, () -> fromMap(null)); - assertThrows(PreconditionViolationException.class, () -> fromMapAndFile(emptyMap(), null)); - assertThrows(PreconditionViolationException.class, () -> fromMapAndFile(emptyMap(), "")); - assertThrows(PreconditionViolationException.class, () -> fromMapAndFile(emptyMap(), " ")); + assertThrows(PreconditionViolationException.class, () -> fromMapAndFile(Map.of(), null)); + assertThrows(PreconditionViolationException.class, () -> fromMapAndFile(Map.of(), "")); + assertThrows(PreconditionViolationException.class, () -> fromMapAndFile(Map.of(), " ")); } @Test void getPreconditions() { - ConfigurationParameters configParams = fromMap(emptyMap()); + ConfigurationParameters configParams = fromMap(Map.of()); assertThrows(PreconditionViolationException.class, () -> configParams.get(null)); assertThrows(PreconditionViolationException.class, () -> configParams.get("")); assertThrows(PreconditionViolationException.class, () -> configParams.get(" ")); @@ -67,7 +65,7 @@ void getPreconditions() { @Test void noConfigParams() { - ConfigurationParameters configParams = fromMap(emptyMap()); + ConfigurationParameters configParams = fromMap(Map.of()); assertThat(configParams.size()).isEqualTo(0); assertThat(configParams.get(KEY)).isEmpty(); assertThat(configParams.toString()).doesNotContain(KEY); @@ -75,7 +73,7 @@ void noConfigParams() { @Test void explicitConfigParam() { - ConfigurationParameters configParams = fromMap(singletonMap(KEY, CONFIG_PARAM)); + ConfigurationParameters configParams = fromMap(Map.of(KEY, CONFIG_PARAM)); assertThat(configParams.get(KEY)).contains(CONFIG_PARAM); assertThat(configParams.toString()).contains(CONFIG_PARAM); } @@ -83,14 +81,14 @@ void explicitConfigParam() { @Test void systemProperty() { System.setProperty(KEY, SYSTEM_PROPERTY); - ConfigurationParameters configParams = fromMap(emptyMap()); + ConfigurationParameters configParams = fromMap(Map.of()); assertThat(configParams.get(KEY)).contains(SYSTEM_PROPERTY); assertThat(configParams.toString()).doesNotContain(KEY); } @Test void configFile() { - ConfigurationParameters configParams = fromMapAndFile(emptyMap(), CONFIG_FILE_NAME); + ConfigurationParameters configParams = fromMapAndFile(Map.of(), CONFIG_FILE_NAME); assertThat(configParams.get(KEY)).contains(CONFIG_FILE); assertThat(configParams.toString()).contains(CONFIG_FILE); } @@ -98,14 +96,14 @@ void configFile() { @Test void explicitConfigParamOverridesSystemProperty() { System.setProperty(KEY, SYSTEM_PROPERTY); - ConfigurationParameters configParams = fromMap(singletonMap(KEY, CONFIG_PARAM)); + ConfigurationParameters configParams = fromMap(Map.of(KEY, CONFIG_PARAM)); assertThat(configParams.get(KEY)).contains(CONFIG_PARAM); assertThat(configParams.toString()).contains(CONFIG_PARAM); } @Test void explicitConfigParamOverridesConfigFile() { - ConfigurationParameters configParams = fromMapAndFile(singletonMap(KEY, CONFIG_PARAM), CONFIG_FILE_NAME); + ConfigurationParameters configParams = fromMapAndFile(Map.of(KEY, CONFIG_PARAM), CONFIG_FILE_NAME); assertThat(configParams.get(KEY)).contains(CONFIG_PARAM); assertThat(configParams.toString()).contains(CONFIG_PARAM); } @@ -113,7 +111,7 @@ void explicitConfigParamOverridesConfigFile() { @Test void systemPropertyOverridesConfigFile() { System.setProperty(KEY, SYSTEM_PROPERTY); - ConfigurationParameters configParams = fromMapAndFile(emptyMap(), CONFIG_FILE_NAME); + ConfigurationParameters configParams = fromMapAndFile(Map.of(), CONFIG_FILE_NAME); assertThat(configParams.get(KEY)).contains(SYSTEM_PROPERTY); assertThat(configParams.toString()).contains(CONFIG_FILE); } @@ -130,13 +128,13 @@ void getValueInExtensionContext() { @Test void getWithSuccessfulTransformer() { - ConfigurationParameters configParams = fromMap(singletonMap(KEY, "42")); + ConfigurationParameters configParams = fromMap(Map.of(KEY, "42")); assertThat(configParams.get(KEY, Integer::valueOf)).contains(42); } @Test void getWithErroneousTransformer() { - ConfigurationParameters configParams = fromMap(singletonMap(KEY, "42")); + ConfigurationParameters configParams = fromMap(Map.of(KEY, "42")); var exception = assertThrows(JUnitException.class, () -> configParams.get(KEY, input -> { throw new RuntimeException("foo"); })); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java index 0b7634f48d39..a3d6833987c4 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java @@ -10,7 +10,6 @@ package org.junit.platform.launcher.core; -import static java.util.Collections.singletonMap; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -290,7 +289,7 @@ void multipleConfigurationParametersAddedDirectly_areStoredInDiscoveryRequest() void configurationParameterAddedByMap_isStoredInDiscoveryRequest() { // @formatter:off var discoveryRequest = request() - .configurationParameters(singletonMap("key", "value")) + .configurationParameters(Map.of("key", "value")) .build(); // @formatter:on diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java index 43fa30e1d431..35d999c0ba4f 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java @@ -14,7 +14,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.mock; -import java.util.Collections; +import java.util.Set; import java.util.logging.Level; import java.util.logging.LogRecord; @@ -96,7 +96,7 @@ void shouldNotThrowExceptionButLogIfTesPlanExecutionStartedListenerMethodFails( LogRecordListener logRecordListener) { var testDescriptor = getDemoMethodTestDescriptor(); - compositeTestExecutionListener.testPlanExecutionStarted(TestPlan.from(Collections.singleton(testDescriptor))); + compositeTestExecutionListener.testPlanExecutionStarted(TestPlan.from(Set.of(testDescriptor))); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "testPlanExecutionStarted"); @@ -107,7 +107,7 @@ void shouldNotThrowExceptionButLogIfTesPlanExecutionFinishedListenerMethodFails( LogRecordListener logRecordListener) { var testDescriptor = getDemoMethodTestDescriptor(); - compositeTestExecutionListener.testPlanExecutionFinished(TestPlan.from(Collections.singleton(testDescriptor))); + compositeTestExecutionListener.testPlanExecutionFinished(TestPlan.from(Set.of(testDescriptor))); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "testPlanExecutionFinished"); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java index e3e088e352fc..56fda7ca14d8 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java @@ -18,7 +18,7 @@ import java.io.PrintWriter; import java.io.StringWriter; -import java.util.Collections; +import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; @@ -36,7 +36,7 @@ class SummaryGenerationTests { private final SummaryGeneratingListener listener = new SummaryGeneratingListener(); - private final TestPlan testPlan = TestPlan.from(Collections.emptyList()); + private final TestPlan testPlan = TestPlan.from(List.of()); @Test void emptyReport() { diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java index 76317c319023..64c68a997519 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java @@ -10,7 +10,6 @@ package org.junit.platform.launcher.tagexpression; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.platform.engine.TestTag.create; @@ -21,7 +20,6 @@ import static org.junit.platform.launcher.tagexpression.TagExpressions.or; import static org.junit.platform.launcher.tagexpression.TagExpressions.tag; -import java.util.Collections; import java.util.Set; import org.junit.jupiter.api.Test; @@ -49,8 +47,8 @@ void rejectInvalidTestTags() { void tagEvaluation() { var tagExpression = tag("foo"); - assertThat(tagExpression.evaluate(singleton(create("foo")))).isTrue(); - assertThat(tagExpression.evaluate(singleton(create("not_foo")))).isFalse(); + assertThat(tagExpression.evaluate(Set.of(create("foo")))).isTrue(); + assertThat(tagExpression.evaluate(Set.of(create("not_foo")))).isFalse(); } @Test @@ -62,8 +60,8 @@ void justConcatenateNot() { @Test void notEvaluation() { - assertThat(not(True).evaluate(emptyTestTags())).isFalse(); - assertThat(not(False).evaluate(emptyTestTags())).isTrue(); + assertThat(not(True).evaluate(Set.of())).isFalse(); + assertThat(not(False).evaluate(Set.of())).isTrue(); } @Test @@ -73,9 +71,9 @@ void encloseAndWithParenthesis() { @Test void andEvaluation() { - assertThat(and(True, True).evaluate(emptyTestTags())).isTrue(); - assertThat(and(True, False).evaluate(emptyTestTags())).isFalse(); - assertThat(and(False, onEvaluateThrow()).evaluate(emptyTestTags())).isFalse(); + assertThat(and(True, True).evaluate(Set.of())).isTrue(); + assertThat(and(True, False).evaluate(Set.of())).isFalse(); + assertThat(and(False, onEvaluateThrow()).evaluate(Set.of())).isFalse(); } @Test @@ -85,20 +83,20 @@ void encloseOrWithParenthesis() { @Test void orEvaluation() { - assertThat(or(False, False).evaluate(emptyTestTags())).isFalse(); - assertThat(or(True, onEvaluateThrow()).evaluate(emptyTestTags())).isTrue(); - assertThat(or(False, True).evaluate(emptyTestTags())).isTrue(); + assertThat(or(False, False).evaluate(Set.of())).isFalse(); + assertThat(or(True, onEvaluateThrow()).evaluate(Set.of())).isTrue(); + assertThat(or(False, True).evaluate(Set.of())).isTrue(); } @Test void anyEvaluation() { - assertThat(any().evaluate(emptyTestTags())).isFalse(); + assertThat(any().evaluate(Set.of())).isFalse(); assertThat(any().evaluate(Set.of(TestTag.create("foo")))).isTrue(); } @Test void noneEvaluation() { - assertThat(none().evaluate(emptyTestTags())).isTrue(); + assertThat(none().evaluate(Set.of())).isTrue(); assertThat(none().evaluate(Set.of(TestTag.create("foo")))).isFalse(); } @@ -108,7 +106,4 @@ private TagExpression onEvaluateThrow() { }; } - private static Set emptyTestTags() { - return Collections.emptySet(); - } } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java index 18dfc914de42..1f9343c58a96 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java @@ -10,9 +10,10 @@ package org.junit.platform.reporting.legacy; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; +import java.util.Set; + import org.junit.jupiter.api.Test; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestSource; @@ -69,13 +70,13 @@ void legacyReportingClassNameForDescendantOfTestIdentifierWithClassSourceIsClass } private String getClassName(UniqueId uniqueId) { - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); return LegacyReportingUtils.getClassName(testPlan, testPlan.getTestIdentifier(uniqueId.toString())); } @SuppressWarnings("deprecation") private String getClassNameFromOldLocation(UniqueId uniqueId) { - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); return org.junit.platform.launcher.listeners.LegacyReportingUtils.getClassName(testPlan, testPlan.getTestIdentifier(uniqueId.toString())); } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java index 6b2927a09584..bf834c0ed939 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java @@ -10,8 +10,6 @@ package org.junit.platform.reporting.legacy.xml; -import static java.util.Collections.emptySet; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -37,6 +35,7 @@ import java.time.ZonedDateTime; import java.util.LinkedHashMap; import java.util.Map; +import java.util.Set; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestReporter; @@ -335,12 +334,12 @@ void writesHostNameAndTimestamp(@TempDir Path tempDirectory) throws Exception { @Test void printsExceptionWhenReportsDirCannotBeCreated(@TempDir Path tempDirectory) throws Exception { var reportsDir = tempDirectory.resolve("dummy.txt"); - Files.write(reportsDir, singleton("content")); + Files.write(reportsDir, Set.of("content")); var out = new StringWriter(); var listener = new LegacyXmlReportGeneratingListener(reportsDir, new PrintWriter(out)); - listener.testPlanExecutionStarted(TestPlan.from(emptySet())); + listener.testPlanExecutionStarted(TestPlan.from(Set.of())); assertThat(out.toString()).containsSubsequence("Could not create reports directory", "FileAlreadyExistsException", "at "); @@ -356,7 +355,7 @@ void printsExceptionWhenReportCouldNotBeWritten(@TempDir Path tempDirectory) thr var out = new StringWriter(); var listener = new LegacyXmlReportGeneratingListener(tempDirectory, new PrintWriter(out)); - listener.testPlanExecutionStarted(TestPlan.from(singleton(engineDescriptor))); + listener.testPlanExecutionStarted(TestPlan.from(Set.of(engineDescriptor))); listener.executionFinished(TestIdentifier.from(engineDescriptor), successful()); assertThat(out.toString()).containsSubsequence("Could not write XML report", "Exception", "at "); @@ -367,7 +366,7 @@ void writesReportEntriesToSystemOutElement(@TempDir Path tempDirectory, TestRepo throws Exception { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var out = new StringWriter(); var listener = new LegacyXmlReportGeneratingListener(tempDirectory, new PrintWriter(out)); diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java index b23157d56dc6..ca13a6782cb9 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java @@ -10,12 +10,12 @@ package org.junit.platform.reporting.legacy.xml; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.platform.engine.TestExecutionResult.failed; import static org.junit.platform.engine.TestExecutionResult.successful; import java.time.Clock; +import java.util.Set; import org.junit.jupiter.api.Test; import org.junit.platform.engine.UniqueId; @@ -32,7 +32,7 @@ class XmlReportDataTests { void resultOfTestIdentifierWithoutAnyReportedEventsIsEmpty() { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); var result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); @@ -44,7 +44,7 @@ void resultOfTestIdentifierWithoutAnyReportedEventsIsEmpty() { void resultOfTestIdentifierWithoutReportedEventsIsFailureOfAncestor() { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); var failureOfAncestor = failed(new RuntimeException("failed!")); @@ -59,7 +59,7 @@ void resultOfTestIdentifierWithoutReportedEventsIsFailureOfAncestor() { void resultOfTestIdentifierWithoutReportedEventsIsEmptyWhenAncestorWasSuccessful() { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier("[engine:engine]"), successful()); diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java index bf0b797a958b..c47dae5d1239 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java @@ -10,7 +10,6 @@ package org.junit.platform.reporting.legacy.xml; -import static java.util.Collections.singleton; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; @@ -25,6 +24,7 @@ import java.io.Writer; import java.time.Clock; import java.util.Map; +import java.util.Set; import java.util.stream.Stream; import org.junit.jupiter.api.Test; @@ -48,7 +48,7 @@ class XmlReportWriterTests { @Test void writesTestsuiteElementsWithoutTestcaseElementsWithoutAnyTests() throws Exception { - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); @@ -69,7 +69,7 @@ void writesReportEntry() throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); var testDescriptor = new TestDescriptorStub(uniqueId, "successfulTest"); engineDescriptor.addChild(testDescriptor); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.addReportEntry(TestIdentifier.from(testDescriptor), ReportEntry.from("myKey", "myValue")); @@ -93,7 +93,7 @@ void writesCapturedOutput() throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); var testDescriptor = new TestDescriptorStub(uniqueId, "successfulTest"); engineDescriptor.addChild(testDescriptor); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); var reportEntry = ReportEntry.from(Map.of( // @@ -134,7 +134,7 @@ void writesCapturedOutput() throws Exception { void writesEmptySkippedElementForSkippedTestWithoutReason() throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "skippedTest")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markSkipped(testPlan.getTestIdentifier(uniqueId.toString()), null); @@ -166,7 +166,7 @@ public String getLegacyReportingName() { return "failedTest"; } }); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(null)); @@ -187,7 +187,7 @@ public String getLegacyReportingName() { void omitsMessageAttributeForFailedTestWithThrowableWithoutMessage() throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "failedTest")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(new NullPointerException())); @@ -208,7 +208,7 @@ void omitsMessageAttributeForFailedTestWithThrowableWithoutMessage() throws Exce void writesValidXmlEvenIfExceptionMessageContainsCData() throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); var assertionError = new AssertionError(""); @@ -231,7 +231,7 @@ void writesValidXmlEvenIfExceptionMessageContainsCData() throws Exception { void escapesInvalidCharactersInSystemPropertiesAndExceptionMessages(TestInfo testInfo) throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); var assertionError = new AssertionError("expected: but was: "); @@ -257,7 +257,7 @@ void escapesInvalidCharactersInSystemPropertiesAndExceptionMessages(TestInfo tes void doesNotReopenCDataWithinCDataContent() throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); - var testPlan = TestPlan.from(singleton(engineDescriptor)); + var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); var assertionError = new AssertionError(""); diff --git a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java index bbde830b43c5..2f9b6075a8ea 100644 --- a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java @@ -10,9 +10,6 @@ package org.junit.platform.runner; -import static java.util.Arrays.asList; -import static java.util.Collections.emptySet; -import static java.util.Collections.singleton; import static java.util.stream.Collectors.toSet; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; @@ -40,6 +37,7 @@ import java.util.Arrays; import java.util.List; +import java.util.Set; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; @@ -434,7 +432,7 @@ void convertsTestIdentifiersIntoDescriptions() { TestDescriptor container2 = new TestDescriptorStub(UniqueId.root("root", "container2"), "container2"); container2.addChild(new TestDescriptorStub(UniqueId.root("root", "test2a"), "test2a")); container2.addChild(new TestDescriptorStub(UniqueId.root("root", "test2b"), "test2b")); - var testPlan = TestPlan.from(asList(container1, container2)); + var testPlan = TestPlan.from(List.of(container1, container2)); var launcher = mock(Launcher.class); when(launcher.discover(any())).thenReturn(testPlan); @@ -471,11 +469,11 @@ void appliesFilter() throws Exception { TestDescriptor originalParent2 = new TestDescriptorStub(UniqueId.root("root", "parent2"), "parent2"); originalParent2.addChild(new TestDescriptorStub(UniqueId.root("root", "leaf2a"), "leaf2a")); originalParent2.addChild(new TestDescriptorStub(UniqueId.root("root", "leaf2b"), "leaf2b")); - var fullTestPlan = TestPlan.from(asList(originalParent1, originalParent2)); + var fullTestPlan = TestPlan.from(List.of(originalParent1, originalParent2)); TestDescriptor filteredParent = new TestDescriptorStub(UniqueId.root("root", "parent2"), "parent2"); filteredParent.addChild(new TestDescriptorStub(UniqueId.root("root", "leaf2b"), "leaf2b")); - var filteredTestPlan = TestPlan.from(singleton(filteredParent)); + var filteredTestPlan = TestPlan.from(Set.of(filteredParent)); var launcher = mock(Launcher.class); var captor = ArgumentCaptor.forClass(LauncherDiscoveryRequest.class); @@ -497,7 +495,7 @@ void appliesFilter() throws Exception { @Test void throwsNoTestsRemainExceptionWhenNoTestIdentifierMatchesFilter() { - var testPlan = TestPlan.from(singleton(new TestDescriptorStub(UniqueId.root("root", "test"), "test"))); + var testPlan = TestPlan.from(Set.of(new TestDescriptorStub(UniqueId.root("root", "test"), "test"))); var launcher = mock(Launcher.class); when(launcher.discover(any())).thenReturn(testPlan); @@ -735,7 +733,7 @@ private TestDescriptor testDescriptorWithTags(String... tag) { private LauncherDiscoveryRequest instantiateRunnerAndCaptureGeneratedRequest(Class testClass) { var launcher = mock(Launcher.class); var captor = ArgumentCaptor.forClass(LauncherDiscoveryRequest.class); - when(launcher.discover(captor.capture())).thenReturn(TestPlan.from(emptySet())); + when(launcher.discover(captor.capture())).thenReturn(TestPlan.from(Set.of())); new JUnitPlatform(testClass, launcher); From 8622b6d75d65c60cdd97a9b99bea2be3d79e5828 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Oct 2020 18:08:55 +0200 Subject: [PATCH 0050/1433] Upgrade to JUnit 4.13.1 --- gradle.properties | 2 +- .../java/org/junit/vintage/engine/JUnit4VersionCheckTests.java | 1 + .../platform/tooling/support/tests/ModularUserGuideTests.java | 2 +- .../tooling/support/tests/VintageGradleIntegrationTests.java | 2 +- .../tooling/support/tests/VintageMavenIntegrationTests.java | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8942b741e170..014e0f3ad274 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ org.gradle.parallel=true # Dependencies apiguardian.version=1.1.0 assertj.version=3.16.1 -junit4.version=4.13 +junit4.version=4.13.1 junit4Min.version=4.12 opentest4j.version=1.2.0 picocli.version=4.5.0 diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java index 128873f1d85f..71cbb385bd53 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java @@ -31,6 +31,7 @@ class JUnit4VersionCheckTests { void handlesParsingSupportedVersionIdWithStandardVersionFormat() { assertDoesNotThrow(() -> JUnit4VersionCheck.checkSupported(() -> "4.12")); assertDoesNotThrow(() -> JUnit4VersionCheck.checkSupported(() -> "4.13")); + assertDoesNotThrow(() -> JUnit4VersionCheck.checkSupported(() -> "4.13.1")); } /** diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java index 248b72755035..ed63c9c080d4 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java @@ -69,7 +69,7 @@ private static List compile(Path temp, Writer out, Writer err) throws Ex args.add(temp.resolve("destination").toString()); var lib = Files.createDirectories(temp.resolve("lib")); - Helper.load(lib, "junit", "junit", Helper.version("junit4", "4.13")); + Helper.load(lib, "junit", "junit", Helper.version("junit4", "4.13.1")); Helper.load(lib, "org.assertj", "assertj-core", Helper.version("assertJ", "3.14.0")); Helper.load(lib, "org.apiguardian", "apiguardian-api", Helper.version("apiGuardian", "1.1.0")); Helper.load(lib, "org.hamcrest", "hamcrest", Helper.version("hamcrest", "2.2")); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java index 56c6bcf195f6..8a8b0c538480 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java @@ -41,7 +41,7 @@ void unsupportedVersion() { } @ParameterizedTest(name = "{0}") - @ValueSource(strings = { "4.12", "4.13" }) + @ValueSource(strings = { "4.12", "4.13.1" }) void supportedVersions(String version) { Result result = run(version); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index d396beaaf5b8..6f50e1b217ce 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -38,7 +38,7 @@ void unsupportedVersion() { } @ParameterizedTest(name = "{0}") - @ValueSource(strings = { "4.12", "4.13" }) + @ValueSource(strings = { "4.12", "4.13.1" }) void supportedVersions(String version) { Result result = run(version); From f41ea210992253ce22e26e8177ed7099c1e13b07 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Oct 2020 08:50:11 +0200 Subject: [PATCH 0051/1433] Upgradle to 6.7-rc-5 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index af6df179e1ab..90a0f2638a62 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=01b4f3804b6c3f15ff3eb39e56efae55e265b6007c9fa3bd58b83b2dc4697dc4 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-4-bin.zip +distributionSha256Sum=c7c33aa33d32e4bd68df71deb5c6d00f2c4675d88b8a14748661196a717dfe2c +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 23ab692cb129e0980a40efe4fe76a808d6230fa1 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Oct 2020 21:55:14 +0200 Subject: [PATCH 0052/1433] Use Docker images from GitHub Container Registry --- .github/workflows/cross-version.yml | 2 +- .github/workflows/main.yml | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index f25ce85cba03..bd50c289812d 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -21,7 +21,7 @@ jobs: jdk: [16] name: "OpenJDK ${{ matrix.jdk }}" runs-on: ubuntu-latest - container: "junitteam/build:${{ matrix.jdk }}" + container: "ghcr.io/junit-team/build:${{ matrix.jdk }}" steps: - uses: actions/checkout@v2 - name: Cache Gradle wrapper and dependencies diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6cb9abaf282b..b1a983b3bfe2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: linux: name: 'Linux' runs-on: ubuntu-latest - container: junitteam/build:15 + container: ghcr.io/junit-team/build steps: - uses: actions/checkout@v2 - name: Cache Gradle wrapper and dependencies @@ -127,7 +127,7 @@ jobs: name: 'Coverage' needs: linux runs-on: ubuntu-latest - container: junitteam/build:latest + container: ghcr.io/junit-team/build steps: - uses: actions/checkout@v2 - name: Cache Gradle wrapper and dependencies @@ -146,10 +146,6 @@ jobs: key: coverage-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | coverage-${{ runner.os }}-maven- - - name: 'Set up JDK 15' - uses: actions/setup-java@v1 - with: - java-version: 15 - name: Prepare Gradle Enterprise credentials run: | mkdir -p /root/.gradle/enterprise/ From 0f1bf5ecb86c50d420eaa85c1be01a8e812e3df4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Oct 2020 22:09:33 +0200 Subject: [PATCH 0053/1433] Disable test on 16-ea for now /cc @sormuras --- .../platform/tooling/support/tests/JarDescribeModuleTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java index d58fe161e9a2..b555166f6464 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java @@ -25,6 +25,8 @@ import de.sormuras.bartholdy.jdk.Jar; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -38,6 +40,7 @@ class JarDescribeModuleTests { @ParameterizedTest @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") + @DisabledOnJre(JRE.JAVA_16) void describeModule(String module) throws Exception { var modulePath = createJarPath(module); var result = Request.builder() // From 0a60a6ae93685f3e2888a407fbbbe9c3b3d3967f Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Wed, 14 Oct 2020 05:17:43 +0200 Subject: [PATCH 0054/1433] Enable "jar --decscribe-module ..." test on 16-ea Relax the expected text pattern to also match the fixed URI syntax printed by jar tool since version 16-ea+19. https://github.com/openjdk/jdk/pull/393 --- .../jar-describe-module/junit-jupiter-api.expected.txt | 2 +- .../jar-describe-module/junit-jupiter-engine.expected.txt | 2 +- .../junit-jupiter-migrationsupport.expected.txt | 2 +- .../jar-describe-module/junit-jupiter-params.expected.txt | 2 +- .../projects/jar-describe-module/junit-jupiter.expected.txt | 2 +- .../jar-describe-module/junit-platform-commons.expected.txt | 2 +- .../jar-describe-module/junit-platform-console.expected.txt | 2 +- .../jar-describe-module/junit-platform-engine.expected.txt | 2 +- .../jar-describe-module/junit-platform-jfr.expected.txt | 2 +- .../jar-describe-module/junit-platform-launcher.expected.txt | 2 +- .../jar-describe-module/junit-platform-reporting.expected.txt | 2 +- .../jar-describe-module/junit-platform-runner.expected.txt | 2 +- .../jar-describe-module/junit-platform-suite-api.expected.txt | 2 +- .../jar-describe-module/junit-platform-testkit.expected.txt | 2 +- .../jar-describe-module/junit-vintage-engine.expected.txt | 2 +- .../platform/tooling/support/tests/JarDescribeModuleTests.java | 3 --- 16 files changed, 15 insertions(+), 18 deletions(-) diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt index 1d69c6dfb326..3e136ea8a241 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.api@${jupiterVersion} jar:file:.+junit-jupiter-api/build/libs/junit-jupiter-api-${jupiterVersion}.jar/!module-info.class +org.junit.jupiter.api@${jupiterVersion} jar:file:.+junit-jupiter-api/build/libs/junit-jupiter-api-${jupiterVersion}.jar..module-info.class exports org.junit.jupiter.api exports org.junit.jupiter.api.condition exports org.junit.jupiter.api.extension diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt index bfd4d84428c7..40eef7f332f5 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.engine@${jupiterVersion} jar:file:.+junit-jupiter-engine/build/libs/junit-jupiter-engine-${jupiterVersion}.jar/!module-info.class +org.junit.jupiter.engine@${jupiterVersion} jar:file:.+junit-jupiter-engine/build/libs/junit-jupiter-engine-${jupiterVersion}.jar..module-info.class requires java.base mandated requires org.apiguardian.api requires org.junit.jupiter.api diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt index 5f94a311ca68..60f2be783d11 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.migrationsupport@${jupiterVersion} jar:file:.+junit-jupiter-migrationsupport/build/libs/junit-jupiter-migrationsupport-${jupiterVersion}.jar/!module-info.class +org.junit.jupiter.migrationsupport@${jupiterVersion} jar:file:.+junit-jupiter-migrationsupport/build/libs/junit-jupiter-migrationsupport-${jupiterVersion}.jar..module-info.class exports org.junit.jupiter.migrationsupport exports org.junit.jupiter.migrationsupport.conditions exports org.junit.jupiter.migrationsupport.rules diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt index cb4dcfe4c10a..079a57db8655 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.params@${jupiterVersion} jar:file:.+junit-jupiter-params/build/libs/junit-jupiter-params-${jupiterVersion}-all.jar/!module-info.class +org.junit.jupiter.params@${jupiterVersion} jar:file:.+junit-jupiter-params/build/libs/junit-jupiter-params-${jupiterVersion}-all.jar..module-info.class exports org.junit.jupiter.params exports org.junit.jupiter.params.aggregator exports org.junit.jupiter.params.converter diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt index 2ed77d69f52a..007d3af432ba 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter@${jupiterVersion} jar:file:.+junit-jupiter/build/libs/junit-jupiter-${jupiterVersion}.jar/!module-info.class +org.junit.jupiter@${jupiterVersion} jar:file:.+junit-jupiter/build/libs/junit-jupiter-${jupiterVersion}.jar..module-info.class requires java.base mandated requires org.junit.jupiter.api transitive requires org.junit.jupiter.engine transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt index e157f1dc7ebf..6633c600100d 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.commons@${platformVersion} jar:file:.+junit-platform-commons/build/libs/junit-platform-commons-${platformVersion}.jar/!module-info.class +org.junit.platform.commons@${platformVersion} jar:file:.+junit-platform-commons/build/libs/junit-platform-commons-${platformVersion}.jar..module-info.class exports org.junit.platform.commons exports org.junit.platform.commons.annotation exports org.junit.platform.commons.function diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt index 026c47a79320..51cff827ef0e 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.console@${platformVersion} jar:file:.+junit-platform-console/build/libs/junit-platform-console-${platformVersion}-all.jar/!module-info.class +org.junit.platform.console@${platformVersion} jar:file:.+junit-platform-console/build/libs/junit-platform-console-${platformVersion}-all.jar..module-info.class requires java.base mandated requires org.apiguardian.api requires org.junit.platform.commons diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt index d2bf9ff6e70e..dc319ccacac0 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.engine@${platformVersion} jar:file:.+junit-platform-engine/build/libs/junit-platform-engine-${platformVersion}.jar/!module-info.class +org.junit.platform.engine@${platformVersion} jar:file:.+junit-platform-engine/build/libs/junit-platform-engine-${platformVersion}.jar..module-info.class exports org.junit.platform.engine exports org.junit.platform.engine.discovery exports org.junit.platform.engine.reporting diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt index 71f374b320c8..7c18391a5ad1 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.jfr@${platformVersion} jar:file:.+junit-platform-jfr/build/libs/junit-platform-jfr-${platformVersion}.jar/!module-info.class +org.junit.platform.jfr@${platformVersion} jar:file:.+junit-platform-jfr/build/libs/junit-platform-jfr-${platformVersion}.jar..module-info.class requires java.base mandated requires jdk.jfr requires org.apiguardian.api diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt index 186aa08ec7e3..a142504cdcf0 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.launcher@${platformVersion} jar:file:.+junit-platform-launcher/build/libs/junit-platform-launcher-${platformVersion}.jar/!module-info.class +org.junit.platform.launcher@${platformVersion} jar:file:.+junit-platform-launcher/build/libs/junit-platform-launcher-${platformVersion}.jar..module-info.class exports org.junit.platform.launcher exports org.junit.platform.launcher.core exports org.junit.platform.launcher.listeners diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt index 2ce919449b3d..27b0aa74b7bf 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.reporting@${platformVersion} jar:file:.+junit-platform-reporting/build/libs/junit-platform-reporting-${platformVersion}.jar/!module-info.class +org.junit.platform.reporting@${platformVersion} jar:file:.+junit-platform-reporting/build/libs/junit-platform-reporting-${platformVersion}.jar..module-info.class exports org.junit.platform.reporting.legacy exports org.junit.platform.reporting.legacy.xml requires java.base mandated diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt index 300adea5a44d..8ebeee20a3dd 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.runner@${platformVersion} jar:file:.+junit-platform-runner/build/libs/junit-platform-runner-${platformVersion}.jar/!module-info.class +org.junit.platform.runner@${platformVersion} jar:file:.+junit-platform-runner/build/libs/junit-platform-runner-${platformVersion}.jar..module-info.class exports org.junit.platform.runner requires java.base mandated requires junit transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt index 5f8d01e71cb0..cf4f7fdcad33 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.suite.api@${platformVersion} jar:file:.+junit-platform-suite-api/build/libs/junit-platform-suite-api-${platformVersion}.jar/!module-info.class +org.junit.platform.suite.api@${platformVersion} jar:file:.+junit-platform-suite-api/build/libs/junit-platform-suite-api-${platformVersion}.jar..module-info.class exports org.junit.platform.suite.api requires java.base mandated requires org.apiguardian.api transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt index e98e7d5c913f..247d82ecccfe 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.testkit@${platformVersion} jar:file:.+junit-platform-testkit/build/libs/junit-platform-testkit-${platformVersion}.jar/!module-info.class +org.junit.platform.testkit@${platformVersion} jar:file:.+junit-platform-testkit/build/libs/junit-platform-testkit-${platformVersion}.jar..module-info.class exports org.junit.platform.testkit.engine requires java.base mandated requires org.apiguardian.api transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt index 2f60914ad23a..84259d0cb197 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt @@ -1,4 +1,4 @@ -org.junit.vintage.engine@${vintageVersion} jar:file:.+junit-vintage-engine/build/libs/junit-vintage-engine-${jupiterVersion}.jar/!module-info.class +org.junit.vintage.engine@${vintageVersion} jar:file:.+junit-vintage-engine/build/libs/junit-vintage-engine-${jupiterVersion}.jar..module-info.class requires java.base mandated requires junit requires org.apiguardian.api diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java index b555166f6464..d58fe161e9a2 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java @@ -25,8 +25,6 @@ import de.sormuras.bartholdy.jdk.Jar; -import org.junit.jupiter.api.condition.DisabledOnJre; -import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -40,7 +38,6 @@ class JarDescribeModuleTests { @ParameterizedTest @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") - @DisabledOnJre(JRE.JAVA_16) void describeModule(String module) throws Exception { var modulePath = createJarPath(module); var result = Request.builder() // From 92b96e2a542015c83950c6efb9d1fea020f191b0 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 14 Oct 2020 20:02:14 +0200 Subject: [PATCH 0055/1433] Upgradle to 6.7 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 90a0f2638a62..58739421a910 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=c7c33aa33d32e4bd68df71deb5c6d00f2c4675d88b8a14748661196a717dfe2c -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-rc-5-bin.zip +distributionSha256Sum=8ad57759019a9233dc7dc4d1a530cefe109dc122000d57f7e623f8cf4ba9dfc4 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From dc9942fd7f6678b98d513c62edcbb950f2a81ec4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 14 Oct 2020 20:26:30 +0200 Subject: [PATCH 0056/1433] Remove fixed version of JUnit 4 Closes #2447. --- platform-tooling-support-tests/projects/vintage/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/platform-tooling-support-tests/projects/vintage/pom.xml b/platform-tooling-support-tests/projects/vintage/pom.xml index 5cea432f7701..32c537838847 100644 --- a/platform-tooling-support-tests/projects/vintage/pom.xml +++ b/platform-tooling-support-tests/projects/vintage/pom.xml @@ -12,7 +12,6 @@ 1.8 ${maven.compiler.source} ${env.JUNIT_VINTAGE_VERSION} - 4.12 From 45e3c8964a79a496a237338382d7f6112dbf6636 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 14 Oct 2020 20:37:28 +0200 Subject: [PATCH 0057/1433] Clean up test code in platform-tooling-support-tests --- .../main/java/platform/tooling/support/Helper.java | 10 +++++----- .../main/java/platform/tooling/support/Request.java | 3 +-- .../support/tests/GradleMissingEngineTests.java | 6 +++--- .../tooling/support/tests/JavacModulesTests.java | 2 +- .../tooling/support/tests/ManifestTests.java | 13 +++++-------- .../support/tests/ModularUserGuideTests.java | 3 +-- .../tests/VintageGradleIntegrationTests.java | 9 ++++----- .../support/tests/VintageMavenIntegrationTests.java | 9 ++++----- 8 files changed, 24 insertions(+), 31 deletions(-) diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java index 2e26c94b6491..0cf68a0d3381 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java @@ -75,8 +75,8 @@ public static String replaceVersionPlaceholders(String line) { } public static List loadModuleDirectoryNames() { - Pattern moduleLinePattern = Pattern.compile("include\\(\"(.+)\"\\)"); - try (Stream stream = Files.lines(SETTINGS_GRADLE) // + var moduleLinePattern = Pattern.compile("include\\(\"(.+)\"\\)"); + try (var stream = Files.lines(SETTINGS_GRADLE) // .map(moduleLinePattern::matcher) // .filter(Matcher::matches) // .map(matcher -> matcher.group(1)) // @@ -92,8 +92,8 @@ public static List loadModuleDirectoryNames() { public static Path createJarPath(String module) { var parent = Paths.get("..", module, "build", "libs"); - Path jar = parent.resolve(module + '-' + version(module) + ".jar"); - Path shadowJar = parent.resolve(module + '-' + version(module) + "-all.jar"); + var jar = parent.resolve(module + '-' + version(module) + ".jar"); + var shadowJar = parent.resolve(module + '-' + version(module) + "-all.jar"); return Files.exists(jar) ? jar : shadowJar; } @@ -113,7 +113,7 @@ public static List loadJarFiles() { public static Optional getJavaHome(String version) { // First, try various system sources... - Stream sources = Stream.of( // + var sources = Stream.of( // System.getProperty("java.home." + version), // System.getProperty("java." + version), // System.getProperty("jdk.home." + version), // diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java index ffba69b819bd..f19c07e3e010 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java @@ -149,8 +149,7 @@ public Builder setTool(Tool tool) { } public Builder setJavaHome(Path javaHome) { - putEnvironment("JAVA_HOME", javaHome.normalize().toAbsolutePath().toString()); - return this; + return putEnvironment("JAVA_HOME", javaHome.normalize().toAbsolutePath().toString()); } public Builder setProject(String project) { diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java index 34f62958645c..99f3f1362f82 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java @@ -33,14 +33,14 @@ class GradleMissingEngineTests { @Test void gradle_wrapper() { - test(new GradleWrapper(Paths.get("..")), "wrapper"); + test(new GradleWrapper(Paths.get(".."))); } - private void test(Tool gradle, String version) { + private void test(Tool gradle) { var project = "gradle-missing-engine"; var result = Request.builder() // .setProject(project) // - .setWorkspace(project + '-' + version) // + .setWorkspace(project + "-wrapper") // .setTool(gradle) // .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // .addArguments("build", "--no-daemon", "--debug", "--stacktrace") // diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java index 011f8bdeb7bf..8caf2081a3f6 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java @@ -67,7 +67,7 @@ private static class Project { private Stream getMainOutputDirs() { try { return Files.list(javaClassesDir) // - .filter(file -> Files.isDirectory(file)) // + .filter(Files::isDirectory) // .filter(dir -> dir.getFileName().toString().startsWith("main")); } catch (IOException e) { diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java index 630b8db83841..c66fee5b3258 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java @@ -58,21 +58,18 @@ void manifestEntriesAdhereToConventions(String module) throws Exception { assertValue(attributes, "Bundle-Version", MavenVersion.parseMavenString(version).getOSGiVersion().toString()); switch (module) { - case "junit-platform-commons": - assertValue(attributes, "Multi-Release", "true"); - break; - case "junit-platform-console": - assertValue(attributes, "Main-Class", "org.junit.platform.console.ConsoleLauncher"); - break; + case "junit-platform-commons" -> assertValue(attributes, "Multi-Release", "true"); + case "junit-platform-console" -> assertValue(attributes, "Main-Class", + "org.junit.platform.console.ConsoleLauncher"); } var domain = Domain.domain(manifest); domain.getExportPackage().forEach((pkg, attrs) -> { - final String stringVersion = attrs.get(VERSION_ATTRIBUTE); + final var stringVersion = attrs.get(VERSION_ATTRIBUTE); assertNotNull(stringVersion); assertDoesNotThrow(() -> new Version(stringVersion)); }); domain.getImportPackage().forEach((pkg, attrs) -> { - final String stringVersionRange = attrs.get(VERSION_ATTRIBUTE); + final var stringVersionRange = attrs.get(VERSION_ATTRIBUTE); if (stringVersionRange == null) { return; } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java index ed63c9c080d4..c0291d095776 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java @@ -103,7 +103,7 @@ private static List compile(Path temp, Writer out, Writer err) throws Ex return args; } - private static List junit(Path temp, Writer out, Writer err) throws Exception { + private static void junit(Path temp, Writer out, Writer err) throws Exception { var command = new ArrayList(); var projectDir = Path.of("../documentation"); command.add(Path.of(System.getProperty("java.home"), "bin", "java").toString()); @@ -154,7 +154,6 @@ private static List junit(Path temp, Writer out, Writer err) throws Exce System.err.println(err); fail("Unexpected exit code: " + code); } - return command; } @Test diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java index 8a8b0c538480..140c515ec276 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java @@ -13,7 +13,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; -import java.nio.file.Path; import java.nio.file.Paths; import java.time.Duration; @@ -32,7 +31,7 @@ class VintageGradleIntegrationTests { @Test void unsupportedVersion() { - Result result = run("4.11"); + var result = run("4.11"); assertThat(result.getExitCode()).isGreaterThan(0); assertThat(result.getOutput("out")) // @@ -43,19 +42,19 @@ void unsupportedVersion() { @ParameterizedTest(name = "{0}") @ValueSource(strings = { "4.12", "4.13.1" }) void supportedVersions(String version) { - Result result = run(version); + var result = run(version); assertThat(result.getExitCode()).isGreaterThan(0); assertThat(result.getOutput("out")) // .contains("VintageTest > success PASSED") // .contains("VintageTest > failure FAILED"); - Path testResultsDir = Request.WORKSPACE.resolve("vintage-gradle-" + version).resolve("build/test-results/test"); + var testResultsDir = Request.WORKSPACE.resolve("vintage-gradle-" + version).resolve("build/test-results/test"); assertThat(testResultsDir.resolve("TEST-com.example.vintage.VintageTest.xml")).isRegularFile(); } private Result run(String version) { - Result result = Request.builder() // + var result = Request.builder() // .setTool(new GradleWrapper(Paths.get(".."))) // .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // .setProject("vintage") // diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index 6f50e1b217ce..4916f5761490 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -13,7 +13,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assumptions.assumeFalse; -import java.nio.file.Path; import java.time.Duration; import de.sormuras.bartholdy.Result; @@ -30,7 +29,7 @@ class VintageMavenIntegrationTests { @Test void unsupportedVersion() { - Result result = run("4.11"); + var result = run("4.11"); assertThat(result.getExitCode()).isEqualTo(0); assertThat(result.getOutput("out")) // @@ -40,7 +39,7 @@ void unsupportedVersion() { @ParameterizedTest(name = "{0}") @ValueSource(strings = { "4.12", "4.13.1" }) void supportedVersions(String version) { - Result result = run(version); + var result = run(version); assertThat(result.getExitCode()).isGreaterThan(0); assertThat(result.getOutput("out")) // @@ -48,14 +47,14 @@ void supportedVersions(String version) { .contains("VintageTest.failure:") // .contains("Tests run: 2, Failures: 1, Errors: 0, Skipped: 0"); - Path surefireReportsDir = Request.WORKSPACE.resolve("vintage-maven-" + version).resolve( + var surefireReportsDir = Request.WORKSPACE.resolve("vintage-maven-" + version).resolve( "target/surefire-reports"); assertThat(surefireReportsDir.resolve("com.example.vintage.VintageTest.txt")).isRegularFile(); assertThat(surefireReportsDir.resolve("TEST-com.example.vintage.VintageTest.xml")).isRegularFile(); } private Result run(String version) { - Result result = Request.builder() // + var result = Request.builder() // .setTool(Request.maven()) // .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // .setProject("vintage") // From a56cd81c499b5da7bdbaf6a68069b2d444ed78e3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 14 Oct 2020 20:49:55 +0200 Subject: [PATCH 0058/1433] Clean up test code in junit-vintage-engine --- .../engine/JUnit4ParameterizedTests.java | 6 +- .../engine/JUnit4VersionCheckTests.java | 9 +- .../VintageLauncherIntegrationTests.java | 73 +++-- .../VintageTestEngineDiscoveryTests.java | 280 +++++++++--------- .../VintageTestEngineExecutionTests.java | 15 +- .../engine/VintageUniqueIdBuilder.java | 6 +- .../engine/descriptor/OrFilterTests.java | 26 +- .../descriptor/TestSourceProviderTests.java | 7 +- .../VintageTestDescriptorTests.java | 14 +- .../IsPotentialJUnit4TestClassTests.java | 9 +- ...unnerTestDescriptorPostProcessorTests.java | 6 +- .../discovery/VintageDiscovererTests.java | 13 +- .../engine/execution/TestRunTests.java | 29 +- .../engine/support/UniqueIdReaderTests.java | 14 +- .../support/UniqueIdStringifierTests.java | 16 +- .../JUnit3ParallelSuiteWithSubsuites.java | 4 +- ...ingleTestCaseWithSingleTestWhichFails.java | 2 +- .../junit3/JUnit3SuiteWithSubsuites.java | 6 +- .../samples/junit4/ConfigurableRunner.java | 4 +- .../junit4/IgnoredParameterizedTestCase.java | 4 +- ...seWithDistinguishableOverloadedMethod.java | 1 + ...ithDuplicateChangingChildDescriptions.java | 4 +- .../junit4/MalformedJUnit4TestCase.java | 2 +- .../samples/junit4/ParameterizedTestCase.java | 5 +- .../junit4/RunnerThatOnlyReportsFailures.java | 3 +- ...nerWithCustomUniqueIdsAndDisplayNames.java | 8 +- 26 files changed, 266 insertions(+), 300 deletions(-) diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java index 4b549bafe41c..cde4f8cc4c17 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java @@ -10,7 +10,6 @@ package org.junit.vintage.engine; -import static java.util.Collections.singletonMap; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.platform.engine.TestExecutionResult.Status.FAILED; import static org.junit.platform.engine.TestExecutionResult.Status.SUCCESSFUL; @@ -25,7 +24,6 @@ import org.junit.jupiter.api.Test; import org.junit.platform.engine.DiscoverySelector; import org.junit.platform.engine.TestExecutionResult; -import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.core.LauncherFactory; @@ -53,11 +51,11 @@ void selectingWholeParameterizedClassRunsTestsWithAllValues() { void selectingOneTestFromParameterizedClassRunsWithAllValues() { executeTests(selectMethod(JUnit4ParameterizedTestCase.class, "test1")); - assertEquals(singletonMap(FAILED, 3), callCounts); + assertEquals(Map.of(FAILED, 3), callCounts); } private void executeTests(DiscoverySelector selector) { - Launcher launcher = LauncherFactory.create(); + var launcher = LauncherFactory.create(); launcher.registerTestExecutionListeners(new StatusTrackingListener()); // @formatter:off diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java index 71cbb385bd53..ce1198e63833 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java @@ -47,8 +47,7 @@ void handlesParsingSupportedVersionIdWithCustomizedVersionFormat() { @Test void throwsExceptionForUnsupportedVersion() { - JUnitException exception = assertThrows(JUnitException.class, - () -> JUnit4VersionCheck.checkSupported(() -> "4.11")); + var exception = assertThrows(JUnitException.class, () -> JUnit4VersionCheck.checkSupported(() -> "4.11")); assertEquals("Unsupported version of junit:junit: 4.11. Please upgrade to version 4.12 or later.", exception.getMessage()); @@ -58,7 +57,7 @@ void throwsExceptionForUnsupportedVersion() { void handlesErrorsReadingVersion() { Error error = new NoClassDefFoundError(); - JUnitException exception = assertThrows(JUnitException.class, () -> JUnit4VersionCheck.checkSupported(() -> { + var exception = assertThrows(JUnitException.class, () -> JUnit4VersionCheck.checkSupported(() -> { throw error; })); @@ -68,7 +67,7 @@ void handlesErrorsReadingVersion() { @Test void handlesErrorsParsingVersion() { - JUnitException exception = assertThrows(JUnitException.class, + var exception = assertThrows(JUnitException.class, () -> JUnit4VersionCheck.checkSupported(() -> "not a version")); assertEquals("Failed to parse version of junit:junit: not a version", exception.getMessage()); @@ -77,7 +76,7 @@ void handlesErrorsParsingVersion() { @Test @Tag("missing-junit4") void handlesMissingJUnit() { - JUnitException exception = assertThrows(JUnitException.class, JUnit4VersionCheck::checkSupported); + var exception = assertThrows(JUnitException.class, JUnit4VersionCheck::checkSupported); assertEquals("Invalid class/module path: junit-vintage-engine is present but junit:junit is not. " + "Please either remove junit-vintage-engine or add junit:junit, or alternatively use " diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java index 7a6412d8cba2..c33f757ffd0d 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java @@ -30,7 +30,6 @@ import org.junit.jupiter.api.fixtures.TrackLogRecords; import org.junit.platform.commons.logging.LogRecordListener; import org.junit.platform.engine.TestExecutionResult; -import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; @@ -58,14 +57,14 @@ class VintageLauncherIntegrationTests { @Test void executesOnlyTaggedMethodOfRegularTestClass() { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters(includeTags(Categories.Failing.class.getName())); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).hasSize(2); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactlyInAnyOrder("JUnit Vintage", testClass.getSimpleName(), "failingTest"); } @@ -74,14 +73,14 @@ void executesOnlyTaggedMethodOfRegularTestClass() { void executesIncludedTaggedMethodOfNestedTestClass() { Class testClass = EnclosedJUnit4TestCase.class; Class nestedTestClass = EnclosedJUnit4TestCase.NestedClass.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters(includeTags(Categories.Failing.class.getName())); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).hasSize(3); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactlyInAnyOrder("JUnit Vintage", testClass.getSimpleName(), nestedTestClass.getName(), "failingTest"); @@ -91,14 +90,14 @@ void executesIncludedTaggedMethodOfNestedTestClass() { void executesOnlyNotExcludedTaggedMethodOfNestedTestClass() { Class testClass = EnclosedJUnit4TestCase.class; Class nestedTestClass = EnclosedJUnit4TestCase.NestedClass.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters(excludeTags(Categories.Failing.class.getName())); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).hasSize(3); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactlyInAnyOrder("JUnit Vintage", testClass.getSimpleName(), nestedTestClass.getName(), "successfulTest"); @@ -107,14 +106,14 @@ void executesOnlyNotExcludedTaggedMethodOfNestedTestClass() { @Test void removesWholeSubtree() { Class testClass = EnclosedJUnit4TestCase.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters(excludeTags(Categories.Plain.class.getName())); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).isEmpty(); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactlyInAnyOrder("JUnit Vintage"); } @@ -122,14 +121,14 @@ void removesWholeSubtree() { @Test void removesCompleteClassIfNoMethodHasMatchingTags() { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters(includeTags("wrong-tag")); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).isEmpty(); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactly("JUnit Vintage"); } @@ -137,14 +136,14 @@ void removesCompleteClassIfNoMethodHasMatchingTags() { @Test void removesCompleteClassIfItHasExcludedTag() { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters(excludeTags(Categories.Plain.class.getName())); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).isEmpty(); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactly("JUnit Vintage"); } @@ -153,15 +152,15 @@ void removesCompleteClassIfItHasExcludedTag() { @Test void executesAllTestsForNotFilterableRunner(LogRecordListener logRecordListener) { Class testClass = JUnit4TestCaseWithNotFilterableRunner.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters((PostDiscoveryFilter) descriptor -> includedIf(descriptor.getDisplayName().contains("#1"))); - TestPlan testPlan = discover(request); + var testPlan = discover(request); logRecordListener.clear(); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).hasSize(3); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactlyInAnyOrder("JUnit Vintage", testClass.getSimpleName(), "Test #0", "Test #1"); assertThat(logRecordListener.stream(RunnerTestDescriptor.class, Level.WARNING).map(LogRecord::getMessage)) // @@ -175,15 +174,15 @@ void executesAllTestsForNotFilterableRunner(LogRecordListener logRecordListener) void executesAllTestsForNotFilterableChildRunnerOfSuite(LogRecordListener logRecordListener) { Class suiteClass = JUnit4SuiteOfSuiteWithFilterableChildRunner.class; Class testClass = JUnit4TestCaseWithNotFilterableRunner.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(suiteClass)) // .filters((PostDiscoveryFilter) descriptor -> includedIf(descriptor.getDisplayName().contains("#1"))); - TestPlan testPlan = discover(request); + var testPlan = discover(request); logRecordListener.clear(); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).hasSize(4); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactlyInAnyOrder("JUnit Vintage", suiteClass.getSimpleName(), testClass.getName(), "Test #0", "Test #1"); @@ -196,14 +195,14 @@ void executesAllTestsForNotFilterableChildRunnerOfSuite(LogRecordListener logRec void executesOnlyTaggedMethodsForSuite() { Class suiteClass = JUnit4SuiteWithTwoTestCases.class; Class testClass = PlainJUnit4TestCaseWithTwoTestMethods.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(suiteClass)) // .filters(includeTags(Categories.Successful.class.getName())); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).hasSize(3); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactlyInAnyOrder("JUnit Vintage", suiteClass.getSimpleName(), testClass.getName(), "successfulTest"); @@ -212,14 +211,14 @@ void executesOnlyTaggedMethodsForSuite() { @Test void removesCompleteClassWithNotFilterableRunnerIfItHasExcludedTag() { Class testClass = JUnit4TestCaseWithNotFilterableRunner.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters(excludeTags(Categories.Successful.class.getName())); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).isEmpty(); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactly("JUnit Vintage"); } @@ -227,27 +226,27 @@ void removesCompleteClassWithNotFilterableRunnerIfItHasExcludedTag() { @Test void filtersOutAllDescendantsOfParameterizedTestCase() { Class testClass = ParameterizedTestCase.class; - LauncherDiscoveryRequestBuilder request = request() // + var request = request() // .selectors(selectClass(testClass)) // .filters((PostDiscoveryFilter) descriptor -> excluded("excluded")); - TestPlan testPlan = discover(request); + var testPlan = discover(request); assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).isEmpty(); - Map results = execute(request); + var results = execute(request); assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // .containsExactly("JUnit Vintage"); } private TestPlan discover(LauncherDiscoveryRequestBuilder requestBuilder) { - Launcher launcher = LauncherFactory.create(); + var launcher = LauncherFactory.create(); return launcher.discover(toRequest(requestBuilder)); } private Map execute(LauncherDiscoveryRequestBuilder requestBuilder) { Map results = new LinkedHashMap<>(); - LauncherDiscoveryRequest request = toRequest(requestBuilder); - Launcher launcher = LauncherFactory.create(); + var request = toRequest(requestBuilder); + var launcher = LauncherFactory.create(); launcher.execute(request, new TestExecutionListener() { @Override public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java index 5c52f4a48931..e15ed6ace3f6 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java @@ -11,7 +11,6 @@ package org.junit.vintage.engine; import static java.text.MessageFormat.format; -import static java.util.Collections.singleton; import static java.util.function.Predicate.isEqual; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -83,14 +82,14 @@ class VintageTestEngineDiscoveryTests { @Test void resolvesSimpleJUnit4TestClass() throws Exception { Class testClass = PlainJUnit4TestCaseWithSingleTestWhichFails.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertTestMethodDescriptor(childDescriptor, testClass, "failingTest", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -98,11 +97,11 @@ void resolvesSimpleJUnit4TestClass() throws Exception { @Test void resolvesIgnoredJUnit4TestClass() throws Exception { Class testClass = IgnoredJUnit4TestCase.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); assertThat(runnerDescriptor.getChildren()).hasSize(2); @@ -116,11 +115,11 @@ void resolvesIgnoredJUnit4TestClass() throws Exception { @Test void resolvesEmptyIgnoredTestClass() { Class testClass = EmptyIgnoredTestCase.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertFalse(runnerDescriptor.isContainer()); assertTrue(runnerDescriptor.isTest()); assertEquals(testClass.getSimpleName(), runnerDescriptor.getDisplayName()); @@ -131,14 +130,14 @@ void resolvesEmptyIgnoredTestClass() { @Test void resolvesJUnit4TestClassWithCustomRunner() throws Exception { Class testClass = SingleFailingTheoryTestCase.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertTestMethodDescriptor(childDescriptor, testClass, "theory", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -146,14 +145,14 @@ void resolvesJUnit4TestClassWithCustomRunner() throws Exception { @Test void resolvesJUnit3TestCase() throws Exception { Class testClass = PlainJUnit3TestCaseWithSingleTestWhichFails.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertTestMethodDescriptor(childDescriptor, testClass, "test", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -162,17 +161,17 @@ void resolvesJUnit3TestCase() throws Exception { void resolvesJUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails() throws Exception { Class suiteClass = JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.class; Class testClass = PlainJUnit3TestCaseWithSingleTestWhichFails.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(suiteClass); + var discoveryRequest = discoveryRequestForClass(suiteClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(suiteDescriptor, suiteClass); - TestDescriptor testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); assertContainerTestDescriptor(testClassDescriptor, suiteClass, testClass); - TestDescriptor testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); assertTestMethodDescriptor(testMethodDescriptor, testClass, "test", VintageUniqueIdBuilder.uniqueIdForClasses(suiteClass, testClass)); } @@ -181,17 +180,17 @@ void resolvesJUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails() throws Exce void resolvesJUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored() throws Exception { Class suiteClass = JUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored.class; Class testClass = PlainJUnit4TestCaseWithSingleTestWhichIsIgnored.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(suiteClass); + var discoveryRequest = discoveryRequestForClass(suiteClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(suiteDescriptor, suiteClass); - TestDescriptor testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); assertContainerTestDescriptor(testClassDescriptor, suiteClass, testClass); - TestDescriptor testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); assertTestMethodDescriptor(testMethodDescriptor, testClass, "ignoredTest", VintageUniqueIdBuilder.uniqueIdForClasses(suiteClass, testClass)); } @@ -199,17 +198,17 @@ void resolvesJUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored() th @Test void resolvesJUnit4TestCaseWithIndistinguishableOverloadedMethod() { Class testClass = JUnit4TestCaseWithIndistinguishableOverloadedMethod.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); List testMethodDescriptors = new ArrayList<>(runnerDescriptor.getChildren()); assertThat(testMethodDescriptors).hasSize(2); - TestDescriptor testMethodDescriptor = testMethodDescriptors.get(0); + var testMethodDescriptor = testMethodDescriptors.get(0); assertEquals("theory", testMethodDescriptor.getDisplayName()); assertEquals(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "theory", "0"), testMethodDescriptor.getUniqueId()); @@ -225,16 +224,16 @@ void resolvesJUnit4TestCaseWithIndistinguishableOverloadedMethod() { @Test void resolvesJUnit4TestCaseWithDistinguishableOverloadedMethod() throws Exception { Class testClass = JUnit4TestCaseWithDistinguishableOverloadedMethod.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); List testMethodDescriptors = new ArrayList<>(runnerDescriptor.getChildren()); - TestDescriptor testMethodDescriptor = getOnlyElement(testMethodDescriptors); + var testMethodDescriptor = getOnlyElement(testMethodDescriptors); assertEquals("test", testMethodDescriptor.getDisplayName()); assertEquals(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "test"), testMethodDescriptor.getUniqueId()); assertMethodSource(testClass.getMethod("test"), testMethodDescriptor); @@ -252,9 +251,9 @@ void doesNotResolveClassRunWithJUnitPlatform() { @Test void resolvesClasspathSelector() throws Exception { - Path root = getClasspathRoot(PlainJUnit4TestCaseWithSingleTestWhichFails.class); - LauncherDiscoveryRequest discoveryRequest = request().selectors(selectClasspathRoots(singleton(root))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var root = getClasspathRoot(PlainJUnit4TestCaseWithSingleTestWhichFails.class); + var discoveryRequest = request().selectors(selectClasspathRoots(Set.of(root))).build(); + var engineDescriptor = discoverTests(discoveryRequest); // @formatter:off assertThat(engineDescriptor.getChildren()) @@ -267,16 +266,15 @@ void resolvesClasspathSelector() throws Exception { @Test void resolvesClasspathSelectorForJarFile() throws Exception { - URL jarUrl = getClass().getResource("/vintage-testjar.jar"); - Path jarFile = Paths.get(jarUrl.toURI()); + var jarUrl = getClass().getResource("/vintage-testjar.jar"); + var jarFile = Paths.get(jarUrl.toURI()); - ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader(); - try (URLClassLoader classLoader = new URLClassLoader(new URL[] { jarUrl })) { + var originalClassLoader = Thread.currentThread().getContextClassLoader(); + try (var classLoader = new URLClassLoader(new URL[] { jarUrl })) { Thread.currentThread().setContextClassLoader(classLoader); - LauncherDiscoveryRequest discoveryRequest = request().selectors( - selectClasspathRoots(singleton(jarFile))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var discoveryRequest = request().selectors(selectClasspathRoots(Set.of(jarFile))).build(); + var engineDescriptor = discoverTests(discoveryRequest); // @formatter:off assertThat(engineDescriptor.getChildren()) @@ -291,12 +289,12 @@ void resolvesClasspathSelectorForJarFile() throws Exception { @Test void resolvesApplyingClassNameFilters() throws Exception { - Path root = getClasspathRoot(PlainJUnit4TestCaseWithSingleTestWhichFails.class); + var root = getClasspathRoot(PlainJUnit4TestCaseWithSingleTestWhichFails.class); - LauncherDiscoveryRequest discoveryRequest = request().selectors(selectClasspathRoots(singleton(root))).filters( + var discoveryRequest = request().selectors(selectClasspathRoots(Set.of(root))).filters( includeClassNamePatterns(".*JUnit4.*"), includeClassNamePatterns(".*Plain.*")).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); // @formatter:off assertThat(engineDescriptor.getChildren()) @@ -309,12 +307,12 @@ void resolvesApplyingClassNameFilters() throws Exception { @Test void resolvesApplyingPackageNameFilters() throws Exception { - Path root = getClasspathRoot(PlainJUnit4TestCaseWithSingleTestWhichFails.class); + var root = getClasspathRoot(PlainJUnit4TestCaseWithSingleTestWhichFails.class); - LauncherDiscoveryRequest discoveryRequest = request().selectors(selectClasspathRoots(singleton(root))).filters( + var discoveryRequest = request().selectors(selectClasspathRoots(Set.of(root))).filters( includePackageNames("org"), includePackageNames("org.junit")).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); // @formatter:off assertThat(engineDescriptor.getChildren()) @@ -327,10 +325,9 @@ void resolvesApplyingPackageNameFilters() throws Exception { void resolvesPackageSelectorForJUnit4SamplesPackage() { Class testClass = PlainJUnit4TestCaseWithSingleTestWhichFails.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( - selectPackage(testClass.getPackage().getName())).build(); + var discoveryRequest = request().selectors(selectPackage(testClass.getPackage().getName())).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); // @formatter:off assertThat(engineDescriptor.getChildren()) @@ -344,10 +341,9 @@ void resolvesPackageSelectorForJUnit4SamplesPackage() { void resolvesPackageSelectorForJUnit3SamplesPackage() { Class testClass = PlainJUnit3TestCaseWithSingleTestWhichFails.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( - selectPackage(testClass.getPackage().getName())).build(); + var discoveryRequest = request().selectors(selectPackage(testClass.getPackage().getName())).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); // @formatter:off assertThat(engineDescriptor.getChildren()) @@ -361,15 +357,15 @@ void resolvesPackageSelectorForJUnit3SamplesPackage() { void resolvesClassesWithInheritedMethods() throws Exception { Class superclass = PlainJUnit4TestCaseWithSingleTestWhichFails.class; Class testClass = PlainJUnit4TestCaseWithSingleInheritedTestWhichFails.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertEquals(testClass.getSimpleName(), runnerDescriptor.getDisplayName()); assertClassSource(testClass, runnerDescriptor); - TestDescriptor testDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var testDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertEquals("failingTest", testDescriptor.getDisplayName()); assertMethodSource(testClass, superclass.getMethod("failingTest"), testDescriptor); } @@ -377,24 +373,24 @@ void resolvesClassesWithInheritedMethods() throws Exception { @Test void resolvesCategoriesIntoTags() { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = discoveryRequestForClass(testClass); + var discoveryRequest = discoveryRequestForClass(testClass); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(runnerDescriptor.getTags()).containsOnly(TestTag.create(Plain.class.getName())); - TestDescriptor failingTest = findChildByDisplayName(runnerDescriptor, "failingTest"); + var failingTest = findChildByDisplayName(runnerDescriptor, "failingTest"); assertThat(failingTest.getTags()).containsOnly(// TestTag.create(Plain.class.getName()), // TestTag.create(Failing.class.getName())); - TestDescriptor ignoredWithoutReason = findChildByDisplayName(runnerDescriptor, "ignoredTest1_withoutReason"); + var ignoredWithoutReason = findChildByDisplayName(runnerDescriptor, "ignoredTest1_withoutReason"); assertThat(ignoredWithoutReason.getTags()).containsOnly(// TestTag.create(Plain.class.getName()), // TestTag.create(Skipped.class.getName())); - TestDescriptor ignoredWithReason = findChildByDisplayName(runnerDescriptor, "ignoredTest2_withReason"); + var ignoredWithReason = findChildByDisplayName(runnerDescriptor, "ignoredTest2_withReason"); assertThat(ignoredWithReason.getTags()).containsOnly(// TestTag.create(Plain.class.getName()), // TestTag.create(Skipped.class.getName()), // @@ -404,15 +400,14 @@ void resolvesCategoriesIntoTags() { @Test void resolvesMethodSelectorForSingleMethod() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( - selectMethod(testClass, testClass.getMethod("failingTest"))).build(); + var discoveryRequest = request().selectors(selectMethod(testClass, testClass.getMethod("failingTest"))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertTestMethodDescriptor(childDescriptor, testClass, "failingTest", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -420,15 +415,14 @@ void resolvesMethodSelectorForSingleMethod() throws Exception { @Test void resolvesMethodOfIgnoredJUnit4TestClass() throws Exception { Class testClass = IgnoredJUnit4TestCase.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( - selectMethod(testClass, testClass.getMethod("failingTest"))).build(); + var discoveryRequest = request().selectors(selectMethod(testClass, testClass.getMethod("failingTest"))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertTestMethodDescriptor(childDescriptor, testClass, "failingTest", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -436,23 +430,22 @@ void resolvesMethodOfIgnoredJUnit4TestClass() throws Exception { @Test void resolvesMethodSelectorForTwoMethodsOfSameClass() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( - selectMethod(testClass, testClass.getMethod("failingTest")), + var discoveryRequest = request().selectors(selectMethod(testClass, testClass.getMethod("failingTest")), selectMethod(testClass, testClass.getMethod("successfulTest"))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); List testMethodDescriptors = new ArrayList<>(runnerDescriptor.getChildren()); assertThat(testMethodDescriptors).hasSize(2); - TestDescriptor failingTest = testMethodDescriptors.get(0); + var failingTest = testMethodDescriptors.get(0); assertTestMethodDescriptor(failingTest, testClass, "failingTest", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); - TestDescriptor successfulTest = testMethodDescriptors.get(1); + var successfulTest = testMethodDescriptors.get(1); assertTestMethodDescriptor(successfulTest, testClass, "successfulTest", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -460,15 +453,15 @@ void resolvesMethodSelectorForTwoMethodsOfSameClass() throws Exception { @Test void resolvesUniqueIdSelectorForSingleMethod() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( + var discoveryRequest = request().selectors( selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "failingTest"))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var childDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertTestMethodDescriptor(childDescriptor, testClass, "failingTest", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -476,12 +469,12 @@ void resolvesUniqueIdSelectorForSingleMethod() throws Exception { @Test void resolvesUniqueIdSelectorForSingleClass() { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( + var discoveryRequest = request().selectors( selectUniqueId(VintageUniqueIdBuilder.uniqueIdForClass(testClass))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); assertThat(runnerDescriptor.getChildren()).hasSize(5); @@ -491,18 +484,18 @@ void resolvesUniqueIdSelectorForSingleClass() { void resolvesUniqueIdSelectorOfSingleClassWithinSuite() throws Exception { Class suiteClass = JUnit4SuiteWithTwoTestCases.class; Class testClass = PlainJUnit4TestCaseWithSingleTestWhichFails.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( + var discoveryRequest = request().selectors( selectUniqueId(VintageUniqueIdBuilder.uniqueIdForClasses(suiteClass, testClass))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(suiteDescriptor, suiteClass); - TestDescriptor testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); assertContainerTestDescriptor(testClassDescriptor, suiteClass, testClass); - TestDescriptor testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); assertTestMethodDescriptor(testMethodDescriptor, testClass, "failingTest", VintageUniqueIdBuilder.uniqueIdForClasses(suiteClass, testClass)); } @@ -511,19 +504,18 @@ void resolvesUniqueIdSelectorOfSingleClassWithinSuite() throws Exception { void resolvesUniqueIdSelectorOfSingleMethodWithinSuite() throws Exception { Class suiteClass = JUnit4SuiteWithTwoTestCases.class; Class testClass = PlainJUnit4TestCaseWithTwoTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors(selectUniqueId( - VintageUniqueIdBuilder.uniqueIdForMethod(VintageUniqueIdBuilder.uniqueIdForClasses(suiteClass, testClass), - testClass, "successfulTest"))).build(); + var discoveryRequest = request().selectors(selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod( + VintageUniqueIdBuilder.uniqueIdForClasses(suiteClass, testClass), testClass, "successfulTest"))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(suiteDescriptor, suiteClass); - TestDescriptor testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); assertContainerTestDescriptor(testClassDescriptor, suiteClass, testClass); - TestDescriptor testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); assertTestMethodDescriptor(testMethodDescriptor, testClass, "successfulTest", VintageUniqueIdBuilder.uniqueIdForClasses(suiteClass, testClass)); } @@ -531,13 +523,13 @@ void resolvesUniqueIdSelectorOfSingleMethodWithinSuite() throws Exception { @Test void resolvesMultipleUniqueIdSelectorsForMethodsOfSameClass() throws Exception { Class testClass = PlainJUnit4TestCaseWithTwoTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( + var discoveryRequest = request().selectors( selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "successfulTest")), selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "failingTest"))).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); List testMethodDescriptors = new ArrayList<>(runnerDescriptor.getChildren()); @@ -551,29 +543,29 @@ void resolvesMultipleUniqueIdSelectorsForMethodsOfSameClass() throws Exception { @Test void doesNotResolveMissingUniqueIdSelectorForSingleClass() { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( + var discoveryRequest = request().selectors( selectUniqueId(VintageUniqueIdBuilder.uniqueIdForClass(testClass) + "/[test:doesNotExist]")).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor testDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var testDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertInitializationError(testDescriptor, Filter.class, testClass); } @Test void ignoresMoreFineGrainedSelectorsWhenClassIsSelectedAsWell() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( // + var discoveryRequest = request().selectors( // selectMethod(testClass, testClass.getMethod("failingTest")), // selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "abortedTest")), selectClass(testClass) // ).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); assertThat(runnerDescriptor.getChildren()).hasSize(5); @@ -582,14 +574,14 @@ void ignoresMoreFineGrainedSelectorsWhenClassIsSelectedAsWell() throws Exception @Test void resolvesCombinationOfMethodAndUniqueIdSelector() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( // + var discoveryRequest = request().selectors( // selectMethod(testClass, testClass.getMethod("failingTest")), // selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "abortedTest") // )).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); List testMethodDescriptors = new ArrayList<>(runnerDescriptor.getChildren()); @@ -603,17 +595,17 @@ void resolvesCombinationOfMethodAndUniqueIdSelector() throws Exception { @Test void ignoresRedundantSelector() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; - LauncherDiscoveryRequest discoveryRequest = request().selectors( // + var discoveryRequest = request().selectors( // selectMethod(testClass, testClass.getMethod("failingTest")), // selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "failingTest") // )).build(); - TestDescriptor engineDescriptor = discoverTests(discoveryRequest); + var engineDescriptor = discoverTests(discoveryRequest); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor testMethodDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertTestMethodDescriptor(testMethodDescriptor, testClass, "failingTest", VintageUniqueIdBuilder.uniqueIdForClass(testClass)); } @@ -622,7 +614,7 @@ void ignoresRedundantSelector() throws Exception { void doesNotResolveMethodOfClassNotAcceptedByClassNameFilter() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; // @formatter:off - LauncherDiscoveryRequest request = request() + var request = request() .selectors(selectMethod(testClass, testClass.getMethod("failingTest"))) .filters(includeClassNamePatterns("Foo")) .build(); @@ -635,7 +627,7 @@ void doesNotResolveMethodOfClassNotAcceptedByClassNameFilter() throws Exception void doesNotResolveMethodOfClassNotAcceptedByPackageNameFilter() throws Exception { Class testClass = PlainJUnit4TestCaseWithFiveTestMethods.class; // @formatter:off - LauncherDiscoveryRequest request = request() + var request = request() .selectors(selectMethod(testClass, testClass.getMethod("failingTest"))) .filters(includePackageNames("com.acme")) .build(); @@ -648,14 +640,14 @@ void doesNotResolveMethodOfClassNotAcceptedByPackageNameFilter() throws Exceptio void resolvesClassForMethodSelectorForClassWithNonFilterableRunner() { Class testClass = JUnit4TestCaseWithNotFilterableRunner.class; // @formatter:off - LauncherDiscoveryRequest request = request() + var request = request() .selectors(selectUniqueId(VintageUniqueIdBuilder.uniqueIdForMethod(testClass, "Test #0"))) .build(); // @formatter:on - TestDescriptor engineDescriptor = discoverTests(request); + var engineDescriptor = discoverTests(request); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertEquals(testClass.getSimpleName(), runnerDescriptor.getDisplayName()); assertEquals(VintageUniqueIdBuilder.uniqueIdForClass(testClass), runnerDescriptor.getUniqueId()); assertThat(runnerDescriptor.getChildren()).isNotEmpty(); @@ -664,23 +656,23 @@ void resolvesClassForMethodSelectorForClassWithNonFilterableRunner() { @Test void usesCustomUniqueIdsAndDisplayNamesWhenPresent() { Class suiteClass = JUnit4SuiteWithJUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.class; - LauncherDiscoveryRequest request = request().selectors(selectClass(suiteClass)).build(); + var request = request().selectors(selectClass(suiteClass)).build(); - TestDescriptor engineDescriptor = discoverTests(request); + var engineDescriptor = discoverTests(request); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, suiteClass); - TestDescriptor testClassDescriptor = getOnlyElement(runnerDescriptor.getChildren()); + var testClassDescriptor = getOnlyElement(runnerDescriptor.getChildren()); assertEquals("(TestClass)", testClassDescriptor.getDisplayName()); - TestDescriptor childDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + var childDescriptor = getOnlyElement(testClassDescriptor.getChildren()); - UniqueId prefix = VintageUniqueIdBuilder.uniqueIdForClass(suiteClass); + var prefix = VintageUniqueIdBuilder.uniqueIdForClass(suiteClass); assertThat(childDescriptor.getUniqueId().toString()).startsWith(prefix.toString()); assertEquals("(TestMethod)", childDescriptor.getDisplayName()); - String customUniqueIdValue = childDescriptor.getUniqueId().getSegments().get(2).getType(); + var customUniqueIdValue = childDescriptor.getUniqueId().getSegments().get(2).getType(); assertNotNull(Base64.getDecoder().decode(customUniqueIdValue.getBytes(StandardCharsets.UTF_8)), "is a valid Base64 encoding scheme"); } @@ -688,19 +680,19 @@ void usesCustomUniqueIdsAndDisplayNamesWhenPresent() { @Test void resolvesTestSourceForParameterizedTests() throws Exception { Class testClass = ParameterizedTestCase.class; - LauncherDiscoveryRequest request = request().selectors(selectClass(testClass)).build(); + var request = request().selectors(selectClass(testClass)).build(); - TestDescriptor engineDescriptor = discoverTests(request); + var engineDescriptor = discoverTests(request); - TestDescriptor runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); + var runnerDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(runnerDescriptor, testClass); - TestDescriptor fooParentDescriptor = findChildByDisplayName(runnerDescriptor, "[foo]"); + var fooParentDescriptor = findChildByDisplayName(runnerDescriptor, "[foo]"); assertTrue(fooParentDescriptor.isContainer()); assertFalse(fooParentDescriptor.isTest()); assertThat(fooParentDescriptor.getSource()).isEmpty(); - TestDescriptor testMethodDescriptor = getOnlyElement(fooParentDescriptor.getChildren()); + var testMethodDescriptor = getOnlyElement(fooParentDescriptor.getChildren()); assertEquals("test[foo]", testMethodDescriptor.getDisplayName()); assertTrue(testMethodDescriptor.isTest()); assertFalse(testMethodDescriptor.isContainer()); @@ -709,7 +701,7 @@ void resolvesTestSourceForParameterizedTests() throws Exception { private TestDescriptor findChildByDisplayName(TestDescriptor runnerDescriptor, String displayName) { // @formatter:off - Set children = runnerDescriptor.getChildren(); + var children = runnerDescriptor.getChildren(); return children .stream() .filter(where(TestDescriptor::getDisplayName, isEqual(displayName))) @@ -724,18 +716,18 @@ private TestDescriptor discoverTests(LauncherDiscoveryRequest discoveryRequest) } private Path getClasspathRoot(Class testClass) throws Exception { - URL location = testClass.getProtectionDomain().getCodeSource().getLocation(); + var location = testClass.getProtectionDomain().getCodeSource().getLocation(); return Paths.get(location.toURI()); } private void assertYieldsNoDescriptors(Class testClass) { - LauncherDiscoveryRequest request = discoveryRequestForClass(testClass); + var request = discoveryRequestForClass(testClass); assertYieldsNoDescriptors(request); } private void assertYieldsNoDescriptors(LauncherDiscoveryRequest request) { - TestDescriptor engineDescriptor = discoverTests(request); + var engineDescriptor = discoverTests(request); assertThat(engineDescriptor.getChildren()).isEmpty(); } @@ -782,7 +774,7 @@ private static void assertInitializationError(TestDescriptor testDescriptor, Cla private static void assertClassSource(Class expectedClass, TestDescriptor testDescriptor) { assertThat(testDescriptor.getSource()).containsInstanceOf(ClassSource.class); - ClassSource classSource = (ClassSource) testDescriptor.getSource().get(); + var classSource = (ClassSource) testDescriptor.getSource().get(); assertThat(classSource.getJavaClass()).isEqualTo(expectedClass); } @@ -793,7 +785,7 @@ private static void assertMethodSource(Method expectedMethod, TestDescriptor tes private static void assertMethodSource(Class expectedClass, Method expectedMethod, TestDescriptor testDescriptor) { assertThat(testDescriptor.getSource()).containsInstanceOf(MethodSource.class); - MethodSource methodSource = (MethodSource) testDescriptor.getSource().get(); + var methodSource = (MethodSource) testDescriptor.getSource().get(); assertThat(methodSource.getClassName()).isEqualTo(expectedClass.getName()); assertThat(methodSource.getMethodName()).isEqualTo(expectedMethod.getName()); assertThat(methodSource.getMethodParameterTypes()).isEqualTo( diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java index 80aad2c08476..d7c5f851d17a 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java @@ -333,7 +333,7 @@ void reportsExecutionEventsAroundLifecycleMethods() { Class testClass = PlainJUnit4TestCaseWithLifecycleMethods.class; PlainJUnit4TestCaseWithLifecycleMethods.EVENTS.clear(); - EngineExecutionListener listener = new EngineExecutionListener() { + var listener = new EngineExecutionListener() { @Override public void executionStarted(TestDescriptor testDescriptor) { @@ -492,7 +492,7 @@ public Description getDescription() { @Override public void run(RunNotifier notifier) { - Description dynamicDescription = createTestDescription(testClass, "dynamicTest"); + var dynamicDescription = createTestDescription(testClass, "dynamicTest"); notifier.fireTestStarted(dynamicDescription); notifier.fireTestFinished(dynamicDescription); } @@ -527,17 +527,17 @@ public DynamicAndStaticChildrenRunner(Class testClass) { @Override public Description getDescription() { - Description suiteDescription = createSuiteDescription(testClass); + var suiteDescription = createSuiteDescription(testClass); suiteDescription.addChild(createTestDescription(testClass, "staticTest")); return suiteDescription; } @Override public void run(RunNotifier notifier) { - Description staticDescription = getDescription().getChildren().get(0); + var staticDescription = getDescription().getChildren().get(0); notifier.fireTestStarted(staticDescription); notifier.fireTestFinished(staticDescription); - Description dynamicDescription = createTestDescription(testClass, "dynamicTest"); + var dynamicDescription = createTestDescription(testClass, "dynamicTest"); notifier.fireTestStarted(dynamicDescription); notifier.fireTestFinished(dynamicDescription); } @@ -792,9 +792,8 @@ private static EngineExecutionResults execute(LauncherDiscoveryRequest request) private static void execute(Class testClass, EngineExecutionListener listener) { TestEngine testEngine = new VintageTestEngine(); - LauncherDiscoveryRequest discoveryRequest = request(testClass); - TestDescriptor engineTestDescriptor = testEngine.discover(discoveryRequest, - UniqueId.forEngine(testEngine.getId())); + var discoveryRequest = request(testClass); + var engineTestDescriptor = testEngine.discover(discoveryRequest, UniqueId.forEngine(testEngine.getId())); testEngine.execute( new ExecutionRequest(engineTestDescriptor, listener, discoveryRequest.getConfigurationParameters())); } diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java index 7648d9a3dd61..3d61ccce9b01 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java @@ -32,15 +32,15 @@ public static UniqueId uniqueIdForClass(Class clazz) { } public static UniqueId uniqueIdForClasses(Class clazz, Class... clazzes) { - UniqueId uniqueId = uniqueIdForClass(clazz.getName()); - for (Class each : clazzes) { + var uniqueId = uniqueIdForClass(clazz.getName()); + for (var each : clazzes) { uniqueId = uniqueId.append(VintageTestDescriptor.SEGMENT_TYPE_TEST, each.getName()); } return uniqueId; } public static UniqueId uniqueIdForClass(String fullyQualifiedClassName) { - UniqueId containerId = engineId(); + var containerId = engineId(); return containerId.append(VintageTestDescriptor.SEGMENT_TYPE_RUNNER, fullyQualifiedClassName); } diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java index 9db5dac2e986..1baaad2091c9 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java @@ -10,9 +10,6 @@ package org.junit.vintage.engine.descriptor; -import static java.util.Arrays.asList; -import static java.util.Collections.emptyList; -import static java.util.Collections.singleton; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -22,6 +19,9 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import java.util.List; +import java.util.Set; + import org.junit.jupiter.api.Test; import org.junit.platform.commons.PreconditionViolationException; import org.junit.runner.Description; @@ -34,21 +34,19 @@ class OrFilterTests { @Test void exceptionWithoutAnyFilters() { - PreconditionViolationException actual = assertThrows(PreconditionViolationException.class, () -> { - new OrFilter(emptyList()); - }); + var actual = assertThrows(PreconditionViolationException.class, () -> new OrFilter(Set.of())); assertEquals("filters must not be empty", actual.getMessage()); } @Test void evaluatesSingleFilter() { - Filter filter = mockFilter("foo", true); + var filter = mockFilter("foo", true); - OrFilter orFilter = new OrFilter(singleton(filter)); + var orFilter = new OrFilter(Set.of(filter)); assertEquals("foo", orFilter.describe()); - Description description = Description.createTestDescription(getClass(), "evaluatesSingleFilter"); + var description = Description.createTestDescription(getClass(), "evaluatesSingleFilter"); assertTrue(orFilter.shouldRun(description)); verify(filter).shouldRun(same(description)); @@ -56,14 +54,14 @@ void evaluatesSingleFilter() { @Test void evaluatesMultipleFilters() { - Filter filter1 = mockFilter("foo", false); - Filter filter2 = mockFilter("bar", true); + var filter1 = mockFilter("foo", false); + var filter2 = mockFilter("bar", true); - OrFilter orFilter = new OrFilter(asList(filter1, filter2)); + var orFilter = new OrFilter(List.of(filter1, filter2)); assertEquals("foo OR bar", orFilter.describe()); - Description description = Description.createTestDescription(getClass(), "evaluatesMultipleFilters"); + var description = Description.createTestDescription(getClass(), "evaluatesMultipleFilters"); assertTrue(orFilter.shouldRun(description)); verify(filter1).shouldRun(same(description)); @@ -71,7 +69,7 @@ void evaluatesMultipleFilters() { } private Filter mockFilter(String description, boolean result) { - Filter filter = mock(Filter.class); + var filter = mock(Filter.class); when(filter.describe()).thenReturn(description); when(filter.shouldRun(any())).thenReturn(result); return filter; diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java index f3a3dac469dd..857f68e37bd5 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java @@ -14,7 +14,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; -import org.junit.platform.engine.TestSource; import org.junit.platform.engine.support.descriptor.MethodSource; import org.junit.runner.Description; import org.junit.vintage.engine.samples.junit4.ConcreteJUnit4TestCase; @@ -26,12 +25,12 @@ class TestSourceProviderTests { @Test void findsInheritedMethod() { - Description description = Description.createTestDescription(ConcreteJUnit4TestCase.class, "theTest"); + var description = Description.createTestDescription(ConcreteJUnit4TestCase.class, "theTest"); - TestSource source = new TestSourceProvider().findTestSource(description); + var source = new TestSourceProvider().findTestSource(description); assertThat(source).isInstanceOf(MethodSource.class); - MethodSource methodSource = (MethodSource) source; + var methodSource = (MethodSource) source; assertEquals(ConcreteJUnit4TestCase.class.getName(), methodSource.getClassName()); assertEquals("theTest", methodSource.getMethodName()); } diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java index 00310fbc6a75..f8fe68433350 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java @@ -23,8 +23,8 @@ class VintageTestDescriptorTests { @Test void legacyReportingNameUsesClassName() { - Description description = Description.createSuiteDescription(ConcreteJUnit4TestCase.class); - VintageTestDescriptor testDescriptor = new VintageTestDescriptor(uniqueId, description, null); + var description = Description.createSuiteDescription(ConcreteJUnit4TestCase.class); + var testDescriptor = new VintageTestDescriptor(uniqueId, description, null); assertEquals("org.junit.vintage.engine.samples.junit4.ConcreteJUnit4TestCase", testDescriptor.getLegacyReportingName()); @@ -32,17 +32,17 @@ void legacyReportingNameUsesClassName() { @Test void legacyReportingNameUsesMethodName() { - Description description = Description.createTestDescription(ConcreteJUnit4TestCase.class, "legacyTest"); - VintageTestDescriptor testDescriptor = new VintageTestDescriptor(uniqueId, description, null); + var description = Description.createTestDescription(ConcreteJUnit4TestCase.class, "legacyTest"); + var testDescriptor = new VintageTestDescriptor(uniqueId, description, null); assertEquals("legacyTest", testDescriptor.getLegacyReportingName()); } @Test void legacyReportingNameFallbackToDisplayName() { - String suiteName = "Legacy Suite"; - Description description = Description.createSuiteDescription(suiteName); - VintageTestDescriptor testDescriptor = new VintageTestDescriptor(uniqueId, description, null); + var suiteName = "Legacy Suite"; + var description = Description.createSuiteDescription(suiteName); + var testDescriptor = new VintageTestDescriptor(uniqueId, description, null); assertEquals(testDescriptor.getDisplayName(), testDescriptor.getLegacyReportingName()); assertEquals(suiteName, testDescriptor.getLegacyReportingName()); diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java index 2a18ec83bee7..db7e02b4eb34 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java @@ -17,7 +17,7 @@ class IsPotentialJUnit4TestClassTests { - private IsPotentialJUnit4TestClass isPotentialJUnit4TestClass = new IsPotentialJUnit4TestClass(); + private final IsPotentialJUnit4TestClass isPotentialJUnit4TestClass = new IsPotentialJUnit4TestClass(); @Test void staticMemberClass() { @@ -25,7 +25,6 @@ void staticMemberClass() { } public static class Foo { - } @Test @@ -34,7 +33,6 @@ void nonPublicClass() { } static class Bar { - } @Test @@ -43,20 +41,17 @@ void abstractClass() { } public static abstract class Baz { - } @Test void anonymousClass() { - Foo foo = new Foo() { - + var foo = new Foo() { }; assertFalse(isPotentialJUnit4TestClass.test(foo.getClass())); } public class FooBaz { - } @Test diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java index 0e9dab85b26b..1abeff30b9cc 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java @@ -25,7 +25,6 @@ import org.junit.platform.engine.DiscoverySelector; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.launcher.LauncherDiscoveryListener; -import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.vintage.engine.VintageUniqueIdBuilder; import org.junit.vintage.engine.descriptor.RunnerTestDescriptor; @@ -72,11 +71,10 @@ void logsWarningOnNonFilterableRunner(LogRecordListener listener) { } private void resolve(DiscoverySelector selector) { - LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request().selectors(selector).listeners( + var request = LauncherDiscoveryRequestBuilder.request().selectors(selector).listeners( mock(LauncherDiscoveryListener.class)).build(); TestDescriptor engineDescriptor = new VintageDiscoverer().discover(request, VintageUniqueIdBuilder.engineId()); - RunnerTestDescriptor runnerTestDescriptor = (RunnerTestDescriptor) getOnlyElement( - engineDescriptor.getChildren()); + var runnerTestDescriptor = (RunnerTestDescriptor) getOnlyElement(engineDescriptor.getChildren()); new RunnerTestDescriptorPostProcessor(new TestSourceProvider()).applyFiltersAndCreateDescendants( runnerTestDescriptor); } diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java index 2d12f8d3a5af..b50aa69cb4b1 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java @@ -34,7 +34,6 @@ import org.junit.platform.engine.discovery.ClassNameFilter; import org.junit.platform.engine.discovery.PackageNameFilter; import org.junit.platform.launcher.LauncherDiscoveryListener; -import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.vintage.engine.VintageUniqueIdBuilder; import org.junit.vintage.engine.samples.junit3.AbstractJUnit3TestCase; import org.junit.vintage.engine.samples.junit4.AbstractJunit4TestCaseWithConstructorParameter; @@ -56,7 +55,7 @@ void classNameFilterExcludesClass() { .build(); // @formatter:on - TestDescriptor testDescriptor = discover(request); + var testDescriptor = discover(request); assertThat(testDescriptor.getChildren()).hasSize(1); assertThat(getOnlyElement(testDescriptor.getChildren()).getUniqueId().toString()).contains(Foo.class.getName()); @@ -71,7 +70,7 @@ void packageNameFilterExcludesClasses() { .build(); // @formatter:on - TestDescriptor testDescriptor = discover(request); + var testDescriptor = discover(request); assertThat(testDescriptor.getChildren()).isEmpty(); } @@ -88,7 +87,7 @@ void doesNotResolveAbstractJUnit4Classes() { @Test void failsToResolveUnloadableTestClass() { - UniqueId uniqueId = VintageUniqueIdBuilder.uniqueIdForClass("foo.bar.UnknownClass"); + var uniqueId = VintageUniqueIdBuilder.uniqueIdForClass("foo.bar.UnknownClass"); doesNotResolve(selectUniqueId(uniqueId), result -> { assertThat(result.getStatus()).isEqualTo(FAILED); @@ -107,16 +106,16 @@ private void doesNotResolve(DiscoverySelector selector) { private void doesNotResolve(DiscoverySelector selector, Consumer resultCheck) { var discoveryListener = mock(LauncherDiscoveryListener.class); - LauncherDiscoveryRequest request = request() // + var request = request() // .selectors(selector) // .listeners(discoveryListener) // .configurationParameter(DEFAULT_DISCOVERY_LISTENER_CONFIGURATION_PROPERTY_NAME, "logging") // .build(); - TestDescriptor testDescriptor = discover(request); + var testDescriptor = discover(request); assertThat(testDescriptor.getChildren()).isEmpty(); - ArgumentCaptor resultCaptor = ArgumentCaptor.forClass(SelectorResolutionResult.class); + var resultCaptor = ArgumentCaptor.forClass(SelectorResolutionResult.class); verify(discoveryListener).selectorProcessed(eq(UniqueId.forEngine("junit-vintage")), eq(selector), resultCaptor.capture()); resultCheck.accept(resultCaptor.getValue()); diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java index 40b24a40bf31..802f69d5abe3 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java @@ -17,11 +17,7 @@ import static org.junit.vintage.engine.descriptor.VintageTestDescriptor.SEGMENT_TYPE_DYNAMIC; import static org.junit.vintage.engine.descriptor.VintageTestDescriptor.SEGMENT_TYPE_RUNNER; -import java.util.Optional; - import org.junit.jupiter.api.Test; -import org.junit.platform.engine.UniqueId; -import org.junit.runner.Description; import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.vintage.engine.descriptor.RunnerTestDescriptor; import org.junit.vintage.engine.descriptor.VintageTestDescriptor; @@ -35,13 +31,12 @@ class TestRunTests { @Test void returnsEmptyOptionalForUnknownDescriptions() throws Exception { Class testClass = PlainJUnit4TestCaseWithSingleTestWhichFails.class; - UniqueId runnerId = engineId().append(SEGMENT_TYPE_RUNNER, testClass.getName()); - RunnerTestDescriptor runnerTestDescriptor = new RunnerTestDescriptor(runnerId, testClass, - new BlockJUnit4ClassRunner(testClass)); - Description unknownDescription = createTestDescription(testClass, "dynamicTest"); + var runnerId = engineId().append(SEGMENT_TYPE_RUNNER, testClass.getName()); + var runnerTestDescriptor = new RunnerTestDescriptor(runnerId, testClass, new BlockJUnit4ClassRunner(testClass)); + var unknownDescription = createTestDescription(testClass, "dynamicTest"); - TestRun testRun = new TestRun(runnerTestDescriptor); - Optional testDescriptor = testRun.lookupNextTestDescriptor(unknownDescription); + var testRun = new TestRun(runnerTestDescriptor); + var testDescriptor = testRun.lookupNextTestDescriptor(unknownDescription); assertThat(testDescriptor).isEmpty(); } @@ -49,15 +44,13 @@ void returnsEmptyOptionalForUnknownDescriptions() throws Exception { @Test void registersDynamicTestDescriptors() throws Exception { Class testClass = PlainJUnit4TestCaseWithSingleTestWhichFails.class; - UniqueId runnerId = engineId().append(SEGMENT_TYPE_RUNNER, testClass.getName()); - RunnerTestDescriptor runnerTestDescriptor = new RunnerTestDescriptor(runnerId, testClass, - new BlockJUnit4ClassRunner(testClass)); - UniqueId dynamicTestId = runnerId.append(SEGMENT_TYPE_DYNAMIC, "dynamicTest"); - Description dynamicDescription = createTestDescription(testClass, "dynamicTest"); - VintageTestDescriptor dynamicTestDescriptor = new VintageTestDescriptor(dynamicTestId, dynamicDescription, - null); + var runnerId = engineId().append(SEGMENT_TYPE_RUNNER, testClass.getName()); + var runnerTestDescriptor = new RunnerTestDescriptor(runnerId, testClass, new BlockJUnit4ClassRunner(testClass)); + var dynamicTestId = runnerId.append(SEGMENT_TYPE_DYNAMIC, "dynamicTest"); + var dynamicDescription = createTestDescription(testClass, "dynamicTest"); + var dynamicTestDescriptor = new VintageTestDescriptor(dynamicTestId, dynamicDescription, null); - TestRun testRun = new TestRun(runnerTestDescriptor); + var testRun = new TestRun(runnerTestDescriptor); testRun.registerDynamicTest(dynamicTestDescriptor); assertThat(testRun.lookupNextTestDescriptor(dynamicDescription)).contains(dynamicTestDescriptor); diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java index 42fa28f19155..a062bfe2678d 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java @@ -14,15 +14,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.runner.Description.createTestDescription; -import java.io.Serializable; -import java.util.Optional; import java.util.logging.Level; -import java.util.logging.LogRecord; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.fixtures.TrackLogRecords; import org.junit.platform.commons.logging.LogRecordListener; -import org.junit.runner.Description; /** * Tests for {@link UniqueIdReader}. @@ -34,9 +30,9 @@ class UniqueIdReaderTests { @Test void readsUniqueId(LogRecordListener listener) { - Description description = createTestDescription("ClassName", "methodName", "uniqueId"); + var description = createTestDescription("ClassName", "methodName", "uniqueId"); - Serializable uniqueId = new UniqueIdReader().apply(description); + var uniqueId = new UniqueIdReader().apply(description); assertEquals("uniqueId", uniqueId); assertThat(listener.stream(UniqueIdReader.class)).isEmpty(); @@ -44,14 +40,14 @@ void readsUniqueId(LogRecordListener listener) { @Test void returnsDisplayNameWhenUniqueIdCannotBeRead(LogRecordListener listener) { - Description description = createTestDescription("ClassName", "methodName", "uniqueId"); + var description = createTestDescription("ClassName", "methodName", "uniqueId"); assertEquals("methodName(ClassName)", description.getDisplayName()); - Serializable uniqueId = new UniqueIdReader("wrongFieldName").apply(description); + var uniqueId = new UniqueIdReader("wrongFieldName").apply(description); assertEquals(description.getDisplayName(), uniqueId); - Optional logRecord = listener.stream(UniqueIdReader.class, Level.WARNING).findFirst(); + var logRecord = listener.stream(UniqueIdReader.class, Level.WARNING).findFirst(); assertThat(logRecord).isPresent(); assertThat(logRecord.get().getMessage()).isEqualTo( "Could not read unique ID for Description; using display name instead: " + description.getDisplayName()); diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java index a89e425efd9a..8e6bfa4822e9 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java @@ -29,7 +29,7 @@ class UniqueIdStringifierTests { @Test void returnsReadableStringForKnownTypes() { - UniqueIdStringifier stringifier = new UniqueIdStringifier(); + var stringifier = new UniqueIdStringifier(); assertEquals("foo", stringifier.apply("foo")); assertEquals("42", stringifier.apply(42)); @@ -39,21 +39,21 @@ void returnsReadableStringForKnownTypes() { @Test void serializesUnknownTypes() throws Exception { - UniqueIdStringifier stringifier = new UniqueIdStringifier(); + var stringifier = new UniqueIdStringifier(); - String serialized = stringifier.apply(new MyCustomId(42)); + var serialized = stringifier.apply(new MyCustomId(42)); - Object deserializedObject = deserialize(decodeBase64(serialized)); + var deserializedObject = deserialize(decodeBase64(serialized)); assertThat(deserializedObject).isInstanceOf(MyCustomId.class); assertEquals(42, ((MyCustomId) deserializedObject).getValue()); } @Test void usesToStringWhenSerializationFails() { - UniqueIdStringifier stringifier = new UniqueIdStringifier(); - String serialized = stringifier.apply(new ClassWithErroneousSerialization()); + var stringifier = new UniqueIdStringifier(); + var serialized = stringifier.apply(new ClassWithErroneousSerialization()); - String deserializedString = new String(decodeBase64(serialized), UniqueIdStringifier.CHARSET); + var deserializedString = new String(decodeBase64(serialized), UniqueIdStringifier.CHARSET); assertEquals("value from toString()", deserializedString); } @@ -63,7 +63,7 @@ private byte[] decodeBase64(String value) { } private Object deserialize(byte[] bytes) throws Exception { - try (ObjectInputStream inputStream = new ObjectInputStream(new ByteArrayInputStream(bytes))) { + try (var inputStream = new ObjectInputStream(new ByteArrayInputStream(bytes))) { return inputStream.readObject(); } } diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java index fbc957dee0b5..4242bafd94c6 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java @@ -28,10 +28,10 @@ public void hello() { public static TestSuite suite() { TestSuite root = new ActiveTestSuite("allTests"); - TestSuite case1 = new TestSuite("Case1"); + var case1 = new TestSuite("Case1"); case1.addTest(new JUnit3ParallelSuiteWithSubsuites("hello", "world")); root.addTest(case1); - TestSuite case2 = new TestSuite("Case2"); + var case2 = new TestSuite("Case2"); case2.addTest(new JUnit3ParallelSuiteWithSubsuites("hello", "WORLD")); root.addTest(case2); return root; diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java index 91651e71b433..3bced3afad82 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java @@ -19,7 +19,7 @@ public class JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails extends TestCase { public static junit.framework.Test suite() { - TestSuite suite = new TestSuite(); + var suite = new TestSuite(); suite.addTestSuite(PlainJUnit3TestCaseWithSingleTestWhichFails.class); return suite; } diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java index 45d2c30884eb..6656b467c913 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java @@ -26,11 +26,11 @@ public void hello() { } public static TestSuite suite() { - TestSuite root = new TestSuite("allTests"); - TestSuite case1 = new TestSuite("Case1"); + var root = new TestSuite("allTests"); + var case1 = new TestSuite("Case1"); case1.addTest(new JUnit3SuiteWithSubsuites("hello", "world")); root.addTest(case1); - TestSuite case2 = new TestSuite("Case2"); + var case2 = new TestSuite("Case2"); case2.addTest(new JUnit3SuiteWithSubsuites("hello", "WORLD")); root.addTest(case2); return root; diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java index c93df0850e47..00ee9c6cda24 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java @@ -42,7 +42,7 @@ abstract class ConfigurableRunner extends Runner { ConfigurableRunner(Class testClass) { this.testClass = testClass; - ChildCount childCountAnnotation = testClass.getAnnotation(ChildCount.class); + var childCountAnnotation = testClass.getAnnotation(ChildCount.class); int childCount = Optional.ofNullable(childCountAnnotation).map(ChildCount::value).orElse(0); // @formatter:off range(0, childCount) @@ -53,7 +53,7 @@ abstract class ConfigurableRunner extends Runner { @Override public Description getDescription() { - Description suiteDescription = Description.createSuiteDescription(testClass); + var suiteDescription = Description.createSuiteDescription(testClass); filteredChildren.forEach(suiteDescription::addChild); return suiteDescription; } diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java index 565a53a15b09..ee35d42b54a5 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java @@ -10,7 +10,7 @@ package org.junit.vintage.engine.samples.junit4; -import static java.util.Arrays.asList; +import java.util.List; import org.junit.Ignore; import org.junit.Test; @@ -27,7 +27,7 @@ public class IgnoredParameterizedTestCase { @Parameters(name = "{0}") public static Iterable parameters() { - return asList("foo", "bar"); + return List.of("foo", "bar"); } @Parameter diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java index bc930c4ae4ee..b1f777662a8c 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java @@ -27,6 +27,7 @@ public void test() { test("foo"); } + @SuppressWarnings("SameParameterValue") private void test(String message) { fail(message); } diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java index 440328f20ad4..3951efd1a568 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java @@ -18,7 +18,7 @@ public class JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions { public static class Runner extends org.junit.runner.Runner { - private Class testClass; + private final Class testClass; public Runner(Class testClass) { this.testClass = testClass; @@ -45,7 +45,7 @@ private Description getLeafDescription() { @Override public void run(RunNotifier notifier) { - for (int i = 0; i < 2; i++) { + for (var i = 0; i < 2; i++) { notifier.fireTestIgnored(getLeafDescription()); notifier.fireTestStarted(getLeafDescription()); notifier.fireTestFinished(getLeafDescription()); diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java index f20f0145fc75..b397cba754a4 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java @@ -20,7 +20,7 @@ public class MalformedJUnit4TestCase { @Test - /* intentionally not public */ + @SuppressWarnings("TestMethodWithIncorrectSignature") // intentionally not public void nonPublicTest() { fail("this should never be called"); } diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java index 000c793c489f..54c05a3f7235 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java @@ -10,9 +10,10 @@ package org.junit.vintage.engine.samples.junit4; -import static java.util.Arrays.asList; import static org.junit.Assert.assertEquals; +import java.util.List; + import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -27,7 +28,7 @@ public class ParameterizedTestCase { @Parameters(name = "{0}") public static Iterable primes() { - return asList("foo", "bar"); + return List.of("foo", "bar"); } @Parameter diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java index b3f0f238d796..5fe2f0e3efe7 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java @@ -15,7 +15,6 @@ import org.junit.runners.BlockJUnit4ClassRunner; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.InitializationError; -import org.junit.runners.model.Statement; public class RunnerThatOnlyReportsFailures extends BlockJUnit4ClassRunner { public RunnerThatOnlyReportsFailures(Class klass) throws InitializationError { @@ -24,7 +23,7 @@ public RunnerThatOnlyReportsFailures(Class klass) throws InitializationError @Override protected void runChild(FrameworkMethod method, RunNotifier notifier) { - Statement statement = methodBlock(method); + var statement = methodBlock(method); try { statement.evaluate(); } diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java index 46a17b3e93b0..0763719d7b0b 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java @@ -32,18 +32,18 @@ public RunnerWithCustomUniqueIdsAndDisplayNames(Class klass) throws Initializ @Override protected String getName() { - DisplayName displayName = getTestClass().getAnnotation(DisplayName.class); + var displayName = getTestClass().getAnnotation(DisplayName.class); return displayName == null ? super.getName() : displayName.value(); } @Override protected Description describeChild(FrameworkMethod method) { - String testName = getTestName(method); + var testName = getTestName(method); return createTestDescription(getTestClass().getJavaClass().getName(), testName, new CustomUniqueId(testName)); } private String getTestName(FrameworkMethod method) { - DisplayName displayName = method.getAnnotation(DisplayName.class); + var displayName = method.getAnnotation(DisplayName.class); return displayName == null ? testName(method) : displayName.value(); } @@ -60,7 +60,7 @@ public CustomUniqueId(String testName) { @Override public boolean equals(Object obj) { if (obj instanceof CustomUniqueId) { - CustomUniqueId that = (CustomUniqueId) obj; + var that = (CustomUniqueId) obj; return Objects.equals(this.testName, that.testName); } return false; From 76e7f012f1ec878ded4f9bed9af942da5076a2fc Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 14 Oct 2020 20:49:55 +0200 Subject: [PATCH 0059/1433] Clean up test code in junit-platform-engine --- .../DemoHierarchicalContainerDescriptor.java | 14 +------------ .../DemoHierarchicalEngineDescriptor.java | 2 +- .../DemoHierarchicalTestEngine.java | 21 ++++--------------- .../junit/platform/fakes/TestEngineSpy.java | 11 +++------- 4 files changed, 9 insertions(+), 39 deletions(-) diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java index ecd5f1612f80..9b51c75c7b57 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java @@ -11,7 +11,6 @@ package org.junit.platform.engine.support.hierarchical; import static org.junit.platform.engine.support.hierarchical.Node.SkipResult.doNotSkip; -import static org.junit.platform.engine.support.hierarchical.Node.SkipResult.skip; import org.junit.platform.engine.TestSource; import org.junit.platform.engine.UniqueId; @@ -24,12 +23,6 @@ public class DemoHierarchicalContainerDescriptor extends AbstractTestDescriptor implements Node { private final Runnable beforeBlock; - private String skippedReason; - private boolean skipped; - - DemoHierarchicalContainerDescriptor(UniqueId uniqueId, String displayName, Runnable executeBlock) { - this(uniqueId, displayName, null, executeBlock); - } public DemoHierarchicalContainerDescriptor(UniqueId uniqueId, String displayName, TestSource source, Runnable beforeBlock) { @@ -47,14 +40,9 @@ public boolean mayRegisterTests() { return true; } - public void markSkipped(String reason) { - this.skipped = true; - this.skippedReason = reason; - } - @Override public SkipResult shouldBeSkipped(DemoEngineExecutionContext context) { - return this.skipped ? skip(this.skippedReason) : doNotSkip(); + return doNotSkip(); } @Override diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java index 640086baffbf..e10efb55eaad 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java @@ -27,7 +27,7 @@ public class DemoHierarchicalEngineDescriptor extends EngineDescriptor implement }; public DemoHierarchicalEngineDescriptor(UniqueId uniqueId) { - super(uniqueId, uniqueId.getEngineId().get()); + super(uniqueId, uniqueId.getEngineId().orElseThrow()); } public void markSkipped(String reason) { diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java index a2db3afaeeab..9780098afd09 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java @@ -10,14 +10,11 @@ package org.junit.platform.engine.support.hierarchical; -import java.lang.reflect.Method; - import org.junit.platform.engine.EngineDiscoveryRequest; import org.junit.platform.engine.ExecutionRequest; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestSource; import org.junit.platform.engine.UniqueId; -import org.junit.platform.engine.support.descriptor.MethodSource; /** * @since 1.0 @@ -49,18 +46,9 @@ public DemoHierarchicalTestDescriptor addTest(String uniqueName, Runnable execut return addTest(uniqueName, uniqueName, executeBlock); } - public DemoHierarchicalTestDescriptor addTest(Method testMethod, Runnable executeBlock) { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", testMethod.getName()); - MethodSource source = MethodSource.from(testMethod); - DemoHierarchicalTestDescriptor child = new DemoHierarchicalTestDescriptor(uniqueId, testMethod.getName(), - source, executeBlock); - engineDescriptor.addChild(child); - return child; - } - public DemoHierarchicalTestDescriptor addTest(String uniqueName, String displayName, Runnable executeBlock) { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", uniqueName); - DemoHierarchicalTestDescriptor child = new DemoHierarchicalTestDescriptor(uniqueId, displayName, executeBlock); + var uniqueId = engineDescriptor.getUniqueId().append("test", uniqueName); + var child = new DemoHierarchicalTestDescriptor(uniqueId, displayName, executeBlock); engineDescriptor.addChild(child); return child; } @@ -76,9 +64,8 @@ public DemoHierarchicalContainerDescriptor addContainer(String uniqueName, Runna public DemoHierarchicalContainerDescriptor addContainer(String uniqueName, String displayName, TestSource source, Runnable beforeBlock) { - UniqueId uniqueId = engineDescriptor.getUniqueId().append("container", uniqueName); - DemoHierarchicalContainerDescriptor container = new DemoHierarchicalContainerDescriptor(uniqueId, displayName, - source, beforeBlock); + var uniqueId = engineDescriptor.getUniqueId().append("container", uniqueName); + var container = new DemoHierarchicalContainerDescriptor(uniqueId, displayName, source, beforeBlock); engineDescriptor.addChild(container); return container; } diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java index 093f678e7d0c..8856d50e11de 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java @@ -23,8 +23,6 @@ public class TestEngineSpy implements TestEngine { public static final String ID = TestEngineSpy.class.getSimpleName(); - public EngineDiscoveryRequest discoveryRequestForDiscovery; - public UniqueId uniqueIdForDiscovery; public ExecutionRequest requestForExecution; @Override @@ -34,12 +32,9 @@ public String getId() { @Override public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) { - this.discoveryRequestForDiscovery = discoveryRequest; - this.uniqueIdForDiscovery = uniqueId; - - UniqueId engineUniqueId = UniqueId.forEngine(ID); - TestDescriptorStub engineDescriptor = new TestDescriptorStub(engineUniqueId, ID); - TestDescriptorStub testDescriptor = new TestDescriptorStub(engineUniqueId.append("test", "test"), "test"); + var engineUniqueId = UniqueId.forEngine(ID); + var engineDescriptor = new TestDescriptorStub(engineUniqueId, ID); + var testDescriptor = new TestDescriptorStub(engineUniqueId.append("test", "test"), "test"); engineDescriptor.addChild(testDescriptor); return engineDescriptor; } From a37f726bc3f5241cdffd7491e16b0266002e0eb9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 14 Oct 2020 21:13:16 +0200 Subject: [PATCH 0060/1433] Clean up test code in junit-jupiter-params --- .../ParameterizedTestExtensionTests.java | 44 +++--- .../ParameterizedTestIntegrationTests.java | 10 +- .../ParameterizedTestMethodContextTests.java | 5 +- .../ParameterizedTestNameFormatterTests.java | 71 +++++---- .../AggregatorIntegrationTests.java | 20 +-- .../DefaultArgumentsAccessorTests.java | 9 +- .../DefaultArgumentConverterTests.java | 9 +- .../FallbackStringToObjectConverterTests.java | 14 +- .../JavaTimeArgumentConverterTests.java | 7 +- .../converter/TypedArgumentConverterTest.java | 2 +- .../params/provider/ArgumentsTests.java | 8 +- .../provider/CsvArgumentsProviderTests.java | 84 +++++------ .../CsvFileArgumentsProviderTests.java | 136 +++++++++--------- .../provider/EnumArgumentsProviderTests.java | 12 +- .../params/provider/EnumSourceTests.java | 59 ++++---- .../MethodArgumentsProviderTests.java | 4 +- .../provider/MockCsvAnnotationBuilder.java | 4 +- .../provider/ValueArgumentsProviderTests.java | 36 ++--- 18 files changed, 262 insertions(+), 272 deletions(-) diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java index cd1106b77f59..6ad6e471fd10 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java @@ -31,7 +31,6 @@ import org.junit.jupiter.api.TestInstance.Lifecycle; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.TestInstances; -import org.junit.jupiter.api.extension.TestTemplateInvocationContext; import org.junit.jupiter.engine.execution.ExtensionValuesStore; import org.junit.jupiter.engine.execution.NamespaceAwareStore; import org.junit.jupiter.params.provider.Arguments; @@ -52,35 +51,33 @@ class ParameterizedTestExtensionTests { @Test void supportsReturnsFalseForMissingTestMethod() { - ExtensionContext extensionContextWithoutTestMethod = getExtensionContextReturningSingleMethod( - new TestCaseWithoutMethod()); + var extensionContextWithoutTestMethod = getExtensionContextReturningSingleMethod(new TestCaseWithoutMethod()); assertFalse(this.parameterizedTestExtension.supportsTestTemplate(extensionContextWithoutTestMethod)); } @Test void supportsReturnsFalseForTestMethodWithoutParameterizedTestAnnotation() { - ExtensionContext extensionContextWithUnAnnotatedTestMethod = getExtensionContextReturningSingleMethod( + var extensionContextWithUnAnnotatedTestMethod = getExtensionContextReturningSingleMethod( new TestCaseWithMethod()); assertFalse(this.parameterizedTestExtension.supportsTestTemplate(extensionContextWithUnAnnotatedTestMethod)); } @Test void supportsReturnsTrueForTestMethodWithParameterizedTestAnnotation() { - ExtensionContext extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( + var extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( new TestCaseWithAnnotatedMethod()); assertTrue(this.parameterizedTestExtension.supportsTestTemplate(extensionContextWithAnnotatedTestMethod)); } @Test void streamsReturnedByProvidersAreClosedWhenCallingProvide() { - ExtensionContext extensionContext = getExtensionContextReturningSingleMethod( + var extensionContext = getExtensionContextReturningSingleMethod( new ArgumentsProviderWithCloseHandlerTestCase()); // we need to call supportsTestTemplate() first, because it creates and // puts the ParameterizedTestMethodContext into the Store this.parameterizedTestExtension.supportsTestTemplate(extensionContext); - Stream stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( - extensionContext); + var stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts(extensionContext); assertFalse(streamWasClosed); // cause the stream to be evaluated @@ -94,21 +91,20 @@ void argumentsRethrowsOriginalExceptionFromProviderAsUncheckedException() { throw new FileNotFoundException("a message"); }; - FileNotFoundException exception = assertThrows(FileNotFoundException.class, - () -> arguments(failingProvider, null)); + var exception = assertThrows(FileNotFoundException.class, () -> arguments(failingProvider, null)); assertEquals("a message", exception.getMessage()); } @Test void throwsExceptionWhenParameterizedTestIsNotInvokedAtLeastOnce() { - ExtensionContext extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( + var extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( new TestCaseWithAnnotatedMethod()); - Stream stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( + var stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( extensionContextWithAnnotatedTestMethod); // cause the stream to be evaluated stream.toArray(); - JUnitException exception = assertThrows(JUnitException.class, stream::close); + var exception = assertThrows(JUnitException.class, stream::close); assertThat(exception).hasMessage( "Configuration error: You must configure at least one set of arguments for this @ParameterizedTest"); @@ -116,26 +112,26 @@ void throwsExceptionWhenParameterizedTestIsNotInvokedAtLeastOnce() { @Test void throwsExceptionWhenArgumentsProviderIsNotStatic() { - ExtensionContext extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( + var extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( new NonStaticArgumentsProviderTestCase()); - Stream stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( + var stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( extensionContextWithAnnotatedTestMethod); - JUnitException exception = assertThrows(JUnitException.class, stream::toArray); + var exception = assertThrows(JUnitException.class, stream::toArray); assertArgumentsProviderInstantiationException(exception, NonStaticArgumentsProvider.class); } @Test void throwsExceptionWhenArgumentsProviderDoesNotContainNoArgumentConstructor() { - ExtensionContext extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( + var extensionContextWithAnnotatedTestMethod = getExtensionContextReturningSingleMethod( new MissingNoArgumentsConstructorArgumentsProviderTestCase()); - Stream stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( + var stream = this.parameterizedTestExtension.provideTestTemplateInvocationContexts( extensionContextWithAnnotatedTestMethod); - JUnitException exception = assertThrows(JUnitException.class, stream::toArray); + var exception = assertThrows(JUnitException.class, stream::toArray); assertArgumentsProviderInstantiationException(exception, MissingNoArgumentsConstructorArgumentsProvider.class); } @@ -151,7 +147,7 @@ private void assertArgumentsProviderInstantiationException(JUnitException ex private ExtensionContext getExtensionContextReturningSingleMethod(Object testCase) { // @formatter:off - Optional optional = Arrays.stream(testCase.getClass().getDeclaredMethods()) + var optional = Arrays.stream(testCase.getClass().getDeclaredMethods()) .filter(method -> method.getName().equals("method")) .findFirst(); // @formatter:on @@ -167,7 +163,7 @@ public Optional getTestMethod() { @Override public Optional getParent() { - return null; + return Optional.empty(); } @Override @@ -192,12 +188,12 @@ public Set getTags() { @Override public Optional getElement() { - return null; + return Optional.empty(); } @Override public Optional> getTestClass() { - return null; + return Optional.empty(); } @Override @@ -269,7 +265,7 @@ static class ArgumentsProviderWithCloseHandler implements ArgumentsProvider { @Override public Stream provideArguments(ExtensionContext context) { - Stream argumentsStream = Stream.of("foo", "bar").map(Arguments::of); + var argumentsStream = Stream.of("foo", "bar").map(Arguments::of); return argumentsStream.onClose(() -> streamWasClosed = true); } } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java index 39bcdfe61e65..fb106aa2faf3 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java @@ -137,7 +137,7 @@ void legacyReportingNames() { var results = execute("testWithCustomName", String.class, int.class); // @formatter:off - Stream legacyReportingNames = results.testEvents().dynamicallyRegistered() + var legacyReportingNames = results.testEvents().dynamicallyRegistered() .map(Event::getTestDescriptor) .map(TestDescriptor::getLegacyReportingName); // @formatter:on @@ -272,7 +272,7 @@ void executesWithNullSourceForNumber() { @Test void failsWithNullSourceWithZeroFormalParameters() { - String methodName = "testWithNullSourceWithZeroFormalParameters"; + var methodName = "testWithNullSourceWithZeroFormalParameters"; execute(methodName).containerEvents().failed().assertEventsMatchExactly(// event(container(methodName), // finishedWithFailure(// @@ -358,7 +358,7 @@ void executesWithEmptySourceForTwoDimensionalStringArray() { @Test void failsWithEmptySourceWithZeroFormalParameters() { - String methodName = "testWithEmptySourceWithZeroFormalParameters"; + var methodName = "testWithEmptySourceWithZeroFormalParameters"; execute(methodName).containerEvents().failed().assertEventsMatchExactly(// event(container(methodName), // finishedWithFailure(// @@ -381,7 +381,7 @@ void failsWithEmptySourceForUnsupportedType(String methodName, Class paramete finishedWithFailure(// instanceOf(PreconditionViolationException.class), // message(msg -> msg.matches("@EmptySource cannot provide an empty argument to method .+: \\[" - + parameterType.getName() + "\\] is not a supported type."))// + + parameterType.getName() + "] is not a supported type."))// ))); } @@ -1093,7 +1093,7 @@ void test2(String argument, TestInfo testInfo) { } private void performTest(String argument, TestInfo testInfo) { - String testMethod = testInfo.getTestMethod().get().getName(); + var testMethod = testInfo.getTestMethod().orElseThrow().getName(); testMethods.add(testMethod); lifecycleEvents.add(testMethod + ":" + testInfo.getDisplayName()); fail(argument); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java index 347f9e95b52d..82614506ff29 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java @@ -43,7 +43,10 @@ void invalidSignatures(String name) { } private Method method(String name) { - return Arrays.stream(getClass().getDeclaredMethods()).filter(m -> m.getName().equals(name)).findFirst().get(); + return Arrays.stream(getClass().getDeclaredMethods()) // + .filter(m -> m.getName().equals(name)) // + .findFirst() // + .orElseThrow(); } // --- VALID --------------------------------------------------------------- diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java index 78d0fe09c647..dd97bfc4ec51 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java @@ -54,7 +54,7 @@ void restoreLocale() { @Test void formatsDisplayName() { - ParameterizedTestNameFormatter formatter = formatter(DISPLAY_NAME_PLACEHOLDER, "enigma"); + var formatter = formatter(DISPLAY_NAME_PLACEHOLDER, "enigma"); assertEquals("enigma", formatter.format(1)); assertEquals("enigma", formatter.format(2)); @@ -62,7 +62,7 @@ void formatsDisplayName() { @Test void formatsInvocationIndex() { - ParameterizedTestNameFormatter formatter = formatter(INDEX_PLACEHOLDER, "enigma"); + var formatter = formatter(INDEX_PLACEHOLDER, "enigma"); assertEquals("1", formatter.format(1)); assertEquals("2", formatter.format(2)); @@ -70,19 +70,19 @@ void formatsInvocationIndex() { @Test void formatsIndividualArguments() { - ParameterizedTestNameFormatter formatter = formatter("{0} -> {1}", "enigma"); + var formatter = formatter("{0} -> {1}", "enigma"); assertEquals("foo -> 42", formatter.format(1, "foo", 42)); } @Test void formatsCompleteArgumentsList() { - ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); + var formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); // @formatter:off assertEquals("42, 99, enigma, null, [1, 2, 3], [foo, bar], [[2, 4], [3, 9]]", formatter.format(1, - Integer.valueOf(42), + 42, 99, "enigma", null, @@ -95,27 +95,25 @@ void formatsCompleteArgumentsList() { @Test void formatsCompleteArgumentsListWithNames() { - Method testMethod = ParameterizedTestCases.getMethod("parameterizedTest", int.class, String.class, - Object[].class); - ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_WITH_NAMES_PLACEHOLDER, "enigma", testMethod); + var testMethod = ParameterizedTestCases.getMethod("parameterizedTest", int.class, String.class, Object[].class); + var formatter = formatter(ARGUMENTS_WITH_NAMES_PLACEHOLDER, "enigma", testMethod); - String formattedName = formatter.format(1, 42, "enigma", new Object[] { "foo", 1 }); + var formattedName = formatter.format(1, 42, "enigma", new Object[] { "foo", 1 }); assertEquals("someNumber=42, someString=enigma, someArray=[foo, 1]", formattedName); } @Test void formatsCompleteArgumentsListWithoutNamesForAggregators() { - Method testMethod = ParameterizedTestCases.getMethod("parameterizedTestWithAggregator", int.class, - String.class); - ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_WITH_NAMES_PLACEHOLDER, "enigma", testMethod); + var testMethod = ParameterizedTestCases.getMethod("parameterizedTestWithAggregator", int.class, String.class); + var formatter = formatter(ARGUMENTS_WITH_NAMES_PLACEHOLDER, "enigma", testMethod); - String formattedName = formatter.format(1, 42, "foo", "bar"); + var formattedName = formatter.format(1, 42, "foo", "bar"); assertEquals("someNumber=42, foo, bar", formattedName); } @Test void formatsCompleteArgumentsListWithArrays() { - ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); + var formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); // Explicit test for https://github.com/junit-team/junit5/issues/814 assertEquals("[foo, bar]", formatter.format(1, (Object) new String[] { "foo", "bar" })); @@ -125,9 +123,8 @@ void formatsCompleteArgumentsListWithArrays() { @Test void formatsEverythingUsingCustomPattern() { - String pattern = DISPLAY_NAME_PLACEHOLDER + " " + INDEX_PLACEHOLDER + " :: " + ARGUMENTS_PLACEHOLDER - + " :: {1}"; - ParameterizedTestNameFormatter formatter = formatter(pattern, "enigma"); + var pattern = DISPLAY_NAME_PLACEHOLDER + " " + INDEX_PLACEHOLDER + " :: " + ARGUMENTS_PLACEHOLDER + " :: {1}"; + var formatter = formatter(pattern, "enigma"); assertEquals("enigma 1 :: foo, bar :: bar", formatter.format(1, "foo", "bar")); assertEquals("enigma 2 :: foo, 42 :: 42", formatter.format(2, "foo", 42)); @@ -135,16 +132,16 @@ void formatsEverythingUsingCustomPattern() { @Test void formatDoesNotAlterArgumentsArray() { - ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); + var formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); Object[] actual = { 1, "two", Byte.valueOf("-128"), new Integer[][] { { 2, 4 }, { 3, 9 } } }; - Object[] expected = Arrays.copyOf(actual, actual.length); + var expected = Arrays.copyOf(actual, actual.length); assertEquals("1, two, -128, [[2, 4], [3, 9]]", formatter.format(1, actual)); assertArrayEquals(expected, actual); } @Test void formatDoesNotRaiseAnArrayStoreException() { - ParameterizedTestNameFormatter formatter = formatter("{0} -> {1}", "enigma"); + var formatter = formatter("{0} -> {1}", "enigma"); Object[] arguments = new Number[] { 1, 2 }; assertEquals("1 -> 2", formatter.format(1, arguments)); @@ -152,27 +149,27 @@ void formatDoesNotRaiseAnArrayStoreException() { @Test void throwsReadableExceptionForInvalidPattern() { - ParameterizedTestNameFormatter formatter = formatter("{index", "enigma"); + var formatter = formatter("{index", "enigma"); - JUnitException exception = assertThrows(JUnitException.class, () -> formatter.format(1)); + var exception = assertThrows(JUnitException.class, () -> formatter.format(1)); assertNotNull(exception.getCause()); assertEquals(IllegalArgumentException.class, exception.getCause().getClass()); } @Test void formattingDoesNotFailIfArgumentToStringImplementationReturnsNull() { - ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); + var formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); - String formattedName = formatter.format(1, new ToStringReturnsNull(), "foo"); + var formattedName = formatter.format(1, new ToStringReturnsNull(), "foo"); assertThat(formattedName).isEqualTo("null, foo"); } @Test void formattingDoesNotFailIfArgumentToStringImplementationThrowsAnException() { - ParameterizedTestNameFormatter formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); + var formatter = formatter(ARGUMENTS_PLACEHOLDER, "enigma"); - String formattedName = formatter.format(1, new ToStringThrowsException(), "foo"); + var formattedName = formatter.format(1, new ToStringThrowsException(), "foo"); assertThat(formattedName).startsWith(ToStringThrowsException.class.getName() + "@"); assertThat(formattedName).endsWith("foo"); @@ -183,13 +180,13 @@ void formattingDoesNotFailIfArgumentToStringImplementationThrowsAnException() { "DE | 42,23 is positive on 13.01.2019 at 12:34:56" }) void customFormattingExpressionsAreSupported(Locale locale, String expectedValue) { var pattern = "[{index}] {1,number,#.##} is {1,choice,0... parameterTypes) { - return ReflectionUtils.findMethod(ParameterizedTestCases.class, methodName, parameterTypes).get(); + return ReflectionUtils.findMethod(ParameterizedTestCases.class, methodName, parameterTypes).orElseThrow(); } @SuppressWarnings("unused") diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java index 3f6797b40835..34e8738758df 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java @@ -83,7 +83,7 @@ void personAggregatorRegisteredViaCustomAnnotation(@CsvToPerson Person person) { "99 Peachtree Road, Atlanta, 30318"// }) void addressAggregator(@CsvToAddress Address address) { - testAddressAggegator(address); + testAddressAggregator(address); } @ParameterizedTest @@ -95,7 +95,7 @@ void personAggregatorAndAddressAggregator(@CsvToPerson Person person, @CsvToAddress @StartIndex(4) Address address) { testPersonAggregator(person); - testAddressAggegator(address); + testAddressAggregator(address); } @ParameterizedTest(name = "Mixed Mode #1: {arguments}") @@ -108,7 +108,7 @@ void mixedMode(String issueNumber, @CsvToPerson @StartIndex(1) Person person, assertThat(issueNumber).startsWith("gh-"); testPersonAggregator(person); - testAddressAggegator(address); + testAddressAggregator(address); assertThat(testInfo.getDisplayName()).startsWith("Mixed Mode #1"); } @@ -121,7 +121,7 @@ void mapAggregator(@AggregateWith(MapAggregator.class) Map map) @ParameterizedTest @CsvSource({ "1, 2, 3, 4, 5, 6, 7, 8, 9, 10" }) void argumentsAccessor(ArgumentsAccessor arguments) { - assertEquals(55, IntStream.range(0, arguments.size()).map(i -> arguments.getInteger(i)).sum()); + assertEquals(55, IntStream.range(0, arguments.size()).map(arguments::getInteger).sum()); } @ParameterizedTest(name = "2 ArgumentsAccessors: {arguments}") @@ -133,7 +133,7 @@ void argumentsAccessors(ArgumentsAccessor arguments1, ArgumentsAccessor argument @ParameterizedTest(name = "ArgumentsAccessor and TestInfo: {arguments}") @CsvSource({ "1, 2, 3, 4, 5, 6, 7, 8, 9, 10" }) void argumentsAccessorAndTestInfo(ArgumentsAccessor arguments, TestInfo testInfo) { - assertEquals(55, IntStream.range(0, arguments.size()).map(i -> arguments.getInteger(i)).sum()); + assertEquals(55, IntStream.range(0, arguments.size()).map(arguments::getInteger).sum()); assertThat(testInfo.getDisplayName()).startsWith("ArgumentsAccessor and TestInfo"); } @@ -142,7 +142,7 @@ void argumentsAccessorAndTestInfo(ArgumentsAccessor arguments, TestInfo testInfo void indexedArgumentsAndArgumentsAccessor(int num1, int num2, ArgumentsAccessor arguments) { assertEquals(1, num1); assertEquals(2, num2); - assertEquals(55, IntStream.range(0, arguments.size()).map(i -> arguments.getInteger(i)).sum()); + assertEquals(55, IntStream.range(0, arguments.size()).map(arguments::getInteger).sum()); } @ParameterizedTest(name = "Indexed Arguments, ArgumentsAccessor, and TestInfo: {arguments}") @@ -152,7 +152,7 @@ void indexedArgumentsArgumentsAccessorAndTestInfo(int num1, int num2, ArgumentsA assertEquals(1, num1); assertEquals(2, num2); - assertEquals(55, IntStream.range(0, arguments.size()).map(i -> arguments.getInteger(i)).sum()); + assertEquals(55, IntStream.range(0, arguments.size()).map(arguments::getInteger).sum()); assertThat(testInfo.getDisplayName()).startsWith("Indexed Arguments, ArgumentsAccessor, and TestInfo"); } @@ -164,7 +164,7 @@ void indexedArgumentsArgumentsAccessorsAndTestInfo(int num1, int num2, Arguments assertEquals(1, num1); assertEquals(2, num2); assertArrayEquals(arguments1.toArray(), arguments2.toArray()); - assertEquals(55, IntStream.range(0, arguments1.size()).map(i -> arguments1.getInteger(i)).sum()); + assertEquals(55, IntStream.range(0, arguments1.size()).map(arguments1::getInteger).sum()); assertThat(testInfo.getDisplayName()).startsWith("Indexed Arguments, 2 ArgumentsAccessors, and TestInfo"); } @@ -198,7 +198,7 @@ private void testPersonAggregator(Person person) { } } - private void testAddressAggegator(Address address) { + private void testAddressAggregator(Address address) { assertThat(address.street).contains("Peachtree"); assertEquals("Atlanta", address.city); assertEquals(30318, address.zipCode); @@ -306,7 +306,7 @@ static class MapAggregator implements ArgumentsAggregator { public Map aggregateArguments(ArgumentsAccessor arguments, ParameterContext context) { // @formatter:off return IntStream.range(0, arguments.size()) - .mapToObj(i -> arguments.getString(i)) + .mapToObj(arguments::getString) .collect(toMap(s -> s, String::length)); // @formatter:on } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java index 08e88f2f6d26..eaf4d22f2ddd 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java @@ -18,7 +18,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.Arrays; -import java.util.List; import org.junit.jupiter.api.Test; import org.junit.platform.commons.PreconditionViolationException; @@ -138,8 +137,8 @@ void getString() { @Test void toArray() { - DefaultArgumentsAccessor arguments = new DefaultArgumentsAccessor("foo", "bar"); - Object[] copy = arguments.toArray(); + var arguments = new DefaultArgumentsAccessor("foo", "bar"); + var copy = arguments.toArray(); assertArrayEquals(new String[] { "foo", "bar" }, copy); // Modify local copy: @@ -149,8 +148,8 @@ void toArray() { @Test void toList() { - DefaultArgumentsAccessor arguments = new DefaultArgumentsAccessor("foo", "bar"); - List copy = arguments.toList(); + var arguments = new DefaultArgumentsAccessor("foo", "bar"); + var copy = arguments.toList(); assertIterableEquals(Arrays.asList("foo", "bar"), copy); // Modify local copy: diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java index 813dcdbf9764..2dc8ab22a812 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java @@ -19,6 +19,7 @@ import java.net.URI; import java.net.URL; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.nio.file.Paths; import java.time.Duration; @@ -124,8 +125,8 @@ void convertsStringsToEnumConstants() { @Test void convertsStringToCharset() { - assertConverts("ISO-8859-1", Charset.class, Charset.forName("ISO-8859-1")); - assertConverts("UTF-8", Charset.class, Charset.forName("UTF-8")); + assertConverts("ISO-8859-1", Charset.class, StandardCharsets.ISO_8859_1); + assertConverts("UTF-8", Charset.class, StandardCharsets.UTF_8); } @Test @@ -218,14 +219,14 @@ void convertsStringToLocale() { @Test void convertsStringToUUID() { - String uuid = "d043e930-7b3b-48e3-bdbe-5a3ccfb833db"; + var uuid = "d043e930-7b3b-48e3-bdbe-5a3ccfb833db"; assertConverts(uuid, UUID.class, UUID.fromString(uuid)); } // ------------------------------------------------------------------------- private void assertConverts(Object input, Class targetClass, Object expectedOutput) { - Object result = DefaultArgumentConverter.INSTANCE.convert(input, targetClass); + var result = DefaultArgumentConverter.INSTANCE.convert(input, targetClass); assertThat(result) // .describedAs(input + " --(" + targetClass.getName() + ")--> " + expectedOutput) // diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java index d0173b115d1e..687482cc4504 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java @@ -108,21 +108,21 @@ private static Method bookMethod(String methodName) { } private static Method bookMethod(String methodName, Class parameterType) { - return findMethod(Book.class, methodName, parameterType).get(); + return findMethod(Book.class, methodName, parameterType).orElseThrow(); } private static Method newspaperMethod(String methodName) { - return findMethod(Newspaper.class, methodName, String.class).get(); + return findMethod(Newspaper.class, methodName, String.class).orElseThrow(); } private static Method magazineMethod(String methodName) { - return findMethod(Magazine.class, methodName, String.class).get(); + return findMethod(Magazine.class, methodName, String.class).orElseThrow(); } private static void assertConverts(String input, Class targetType, Object expectedOutput) throws Exception { assertThat(converter.canConvert(targetType)).isTrue(); - Object result = converter.convert(input, targetType); + var result = converter.convert(input, targetType); assertThat(result) // .describedAs(input + " --(" + targetType.getName() + ")--> " + expectedOutput) // @@ -164,7 +164,7 @@ public boolean equals(Object obj) { if (!(obj instanceof Book)) { return false; } - Book that = (Book) obj; + var that = (Book) obj; return Objects.equals(this.title, that.title); } @@ -186,7 +186,7 @@ public boolean equals(Object obj) { if (!(obj instanceof Journal)) { return false; } - Journal that = (Journal) obj; + var that = (Journal) obj; return Objects.equals(this.title, that.title); } @@ -216,7 +216,7 @@ public boolean equals(Object obj) { if (!(obj instanceof Newspaper)) { return false; } - Newspaper that = (Newspaper) obj; + var that = (Newspaper) obj; return Objects.equals(this.title, that.title); } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java index 40bda73dfc60..06efb164c17d 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java @@ -105,15 +105,14 @@ void convertsStringToZonedDateTime() { @Test void throwsExceptionOnInvalidTargetType() { - ArgumentConversionException exception = assertThrows(ArgumentConversionException.class, - () -> convert("2017", "yyyy", Integer.class)); + var exception = assertThrows(ArgumentConversionException.class, () -> convert("2017", "yyyy", Integer.class)); assertThat(exception).hasMessage("Cannot convert to java.lang.Integer: 2017"); } private Object convert(Object input, String pattern, Class targetClass) { - JavaTimeArgumentConverter converter = new JavaTimeArgumentConverter(); - JavaTimeConversionPattern annotation = mock(JavaTimeConversionPattern.class); + var converter = new JavaTimeArgumentConverter(); + var annotation = mock(JavaTimeConversionPattern.class); when(annotation.value()).thenReturn(pattern); converter.accept(annotation); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java index 57f98ccaf462..57b78f8e3312 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java @@ -28,7 +28,7 @@ void convertsSourceToTarget() { } private void assertConverts(String input, Integer expectedOutput) { - Integer result = new StringLengthArgumentConverter().convert(input); + var result = new StringLengthArgumentConverter().convert(input); assertThat(result).isEqualTo(expectedOutput); } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java index 206a6216cfbf..d8f0b7e564bf 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java @@ -26,14 +26,14 @@ class ArgumentsTests { @Test void ofSupportsVarargs() { - Arguments arguments = of(1, "2", 3.0); + var arguments = of(1, "2", 3.0); assertArrayEquals(new Object[] { 1, "2", 3.0 }, arguments.get()); } @Test void argumentsSupportsVarargs() { - Arguments arguments = arguments(1, "2", 3.0); + var arguments = arguments(1, "2", 3.0); assertArrayEquals(new Object[] { 1, "2", 3.0 }, arguments.get()); } @@ -42,7 +42,7 @@ void argumentsSupportsVarargs() { void ofReturnsSameArrayUsedForCreating() { Object[] input = { 1, "2", 3.0 }; - Arguments arguments = of(input); + var arguments = of(input); assertThat(arguments.get()).isSameAs(input); } @@ -51,7 +51,7 @@ void ofReturnsSameArrayUsedForCreating() { void argumentsReturnsSameArrayUsedForCreating() { Object[] input = { 1, "2", 3.0 }; - Arguments arguments = arguments(input); + var arguments = arguments(input); assertThat(arguments.get()).isSameAs(input); } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java index 88e45e338a88..8279869a0f9d 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java @@ -27,7 +27,7 @@ class CsvArgumentsProviderTests { @Test void throwsExceptionOnInvalidCsv() { - CsvSource annotation = csvSource("foo", "bar", ""); + var annotation = csvSource("foo", "bar", ""); assertThatExceptionOfType(JUnitException.class)// .isThrownBy(() -> provideArguments(annotation).toArray())// @@ -36,97 +36,97 @@ void throwsExceptionOnInvalidCsv() { @Test void providesSingleArgument() { - CsvSource annotation = csvSource("foo"); + var annotation = csvSource("foo"); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("foo")); } @Test void providesMultipleArguments() { - CsvSource annotation = csvSource("foo", "bar"); + var annotation = csvSource("foo", "bar"); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("foo"), array("bar")); } @Test void splitsAndTrimsArguments() { - CsvSource annotation = csvSource(" foo , bar "); + var annotation = csvSource(" foo , bar "); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("foo", "bar")); } @Test void trimsLeadingSpaces() { - CsvSource annotation = csvSource("'', 1", " '', 2", "'' , 3", " '' , 4"); + var annotation = csvSource("'', 1", " '', 2", "'' , 3", " '' , 4"); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(new Object[][] { { "", "1" }, { "", "2" }, { "", "3" }, { "", "4" } }); } @Test void trimsTrailingSpaces() { - CsvSource annotation = csvSource("1,''", "2, ''", "3,'' ", "4, '' "); + var annotation = csvSource("1,''", "2, ''", "3,'' ", "4, '' "); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(new Object[][] { { "1", "" }, { "2", "" }, { "3", "" }, { "4", "" } }); } @Test void understandsQuotes() { - CsvSource annotation = csvSource("'foo, bar'"); + var annotation = csvSource("'foo, bar'"); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("foo, bar")); } @Test void understandsEscapeCharacters() { - CsvSource annotation = csvSource("'foo or ''bar''', baz"); + var annotation = csvSource("'foo or ''bar''', baz"); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("foo or 'bar'", "baz")); } @Test void doesNotTrimSpacesInsideQuotes() { - CsvSource annotation = csvSource("''", "' '", "'blank '", "' not blank '"); + var annotation = csvSource("''", "' '", "'blank '", "' not blank '"); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array(""), array(" "), array("blank "), array(" not blank ")); } @Test void providesArgumentsWithCharacterDelimiter() { - CsvSource annotation = csvSource().delimiter('|').lines("foo|bar", "bar|foo").build(); + var annotation = csvSource().delimiter('|').lines("foo|bar", "bar|foo").build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("foo", "bar"), array("bar", "foo")); } @Test void providesArgumentsWithStringDelimiter() { - CsvSource annotation = csvSource().delimiterString("~~~").lines("foo~~~ bar", "bar~~~ foo").build(); + var annotation = csvSource().delimiterString("~~~").lines("foo~~~ bar", "bar~~~ foo").build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("foo", "bar"), array("bar", "foo")); } @Test void throwsExceptionIfBothDelimitersAreSimultaneouslySet() { - CsvSource annotation = csvSource().delimiter('|').delimiterString("~~~").build(); + var annotation = csvSource().delimiter('|').delimiterString("~~~").build(); assertThatExceptionOfType(PreconditionViolationException.class)// .isThrownBy(() -> provideArguments(annotation))// @@ -136,85 +136,85 @@ void throwsExceptionIfBothDelimitersAreSimultaneouslySet() { @Test void defaultEmptyValueAndDefaultNullValue() { - CsvSource annotation = csvSource("'', null, , apple"); + var annotation = csvSource("'', null, , apple"); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("", "null", null, "apple")); } @Test void customEmptyValueAndDefaultNullValue() { - CsvSource annotation = csvSource().emptyValue("EMPTY").lines("'', null, , apple").build(); + var annotation = csvSource().emptyValue("EMPTY").lines("'', null, , apple").build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("EMPTY", "null", null, "apple")); } @Test void customNullValues() { - CsvSource annotation = csvSource().nullValues("N/A", "NIL").lines("apple, , NIL, '', N/A, banana").build(); + var annotation = csvSource().nullValues("N/A", "NIL").lines("apple, , NIL, '', N/A, banana").build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(array("apple", null, null, "", null, "banana")); } @Test void convertsEmptyValuesToNullInLinesAfterFirstLine() { - CsvSource annotation = csvSource("'', ''", " , "); + var annotation = csvSource("'', ''", " , "); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments).containsExactly(new Object[][] { { "", "" }, { null, null } }); } @Test void throwsExceptionIfSourceExceedsMaxCharsPerColumnConfig() { - CsvSource annotation = csvSource().lines("413").maxCharsPerColumn(2).build(); + var annotation = csvSource().lines("413").maxCharsPerColumn(2).build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThatExceptionOfType(CsvParsingException.class)// - .isThrownBy(() -> arguments.toArray())// + .isThrownBy(arguments::toArray)// .withMessageStartingWith("Failed to parse CSV input configured via Mock for CsvSource")// .withRootCauseInstanceOf(ArrayIndexOutOfBoundsException.class); } @Test void providesArgumentWithDefaultMaxCharsPerColumnConfig() { - CsvSource annotation = csvSource().lines("0".repeat(4096)).delimiter(';').build(); + var annotation = csvSource().lines("0".repeat(4096)).delimiter(';').build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments.toArray()).hasSize(1); } @Test void throwsExceptionWhenSourceExceedsDefaultMaxCharsPerColumnConfig() { - CsvSource annotation = csvSource().lines("0".repeat(4097)).delimiter(';').build(); + var annotation = csvSource().lines("0".repeat(4097)).delimiter(';').build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThatExceptionOfType(CsvParsingException.class)// - .isThrownBy(() -> arguments.toArray())// + .isThrownBy(arguments::toArray)// .withMessageStartingWith("Failed to parse CSV input configured via Mock for CsvSource")// .withRootCauseInstanceOf(ArrayIndexOutOfBoundsException.class); } @Test void providesArgumentsForExceedsSourceWithCustomMaxCharsPerColumnConfig() { - CsvSource annotation = csvSource().lines("0".repeat(4097)).delimiter(';').maxCharsPerColumn(4097).build(); + var annotation = csvSource().lines("0".repeat(4097)).delimiter(';').maxCharsPerColumn(4097).build(); - Stream arguments = provideArguments(annotation); + var arguments = provideArguments(annotation); assertThat(arguments.toArray()).hasSize(1); } @Test void throwsExceptionWhenMaxCharsPerColumnIsNotPositiveNumber() { - CsvSource annotation = csvSource().lines("41").delimiter(';').maxCharsPerColumn(-1).build(); + var annotation = csvSource().lines("41").delimiter(';').maxCharsPerColumn(-1).build(); assertThatExceptionOfType(PreconditionViolationException.class)// .isThrownBy(() -> provideArguments(annotation))// @@ -222,7 +222,7 @@ void throwsExceptionWhenMaxCharsPerColumnIsNotPositiveNumber() { } private Stream provideArguments(CsvSource annotation) { - CsvArgumentsProvider provider = new CsvArgumentsProvider(); + var provider = new CsvArgumentsProvider(); provider.accept(annotation); return provider.provideArguments(null).map(Arguments::get); } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java index 92eab62aa0a4..8db64501a74d 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java @@ -41,52 +41,51 @@ class CsvFileArgumentsProviderTests { @Test void providesArgumentsForNewlineAndComma() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("test.csv")// .lineSeparator("\n")// .delimiter(',')// .build(); - Stream arguments = provideArguments(annotation, "foo, bar \n baz, qux \n"); + var arguments = provideArguments(annotation, "foo, bar \n baz, qux \n"); assertThat(arguments).containsExactly(array("foo", "bar"), array("baz", "qux")); } @Test void providesArgumentsForCarriageReturnAndSemicolon() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("test.csv")// .lineSeparator("\r")// .delimiter(';')// .build(); - Stream arguments = provideArguments(annotation, "foo; bar \r baz; qux"); + var arguments = provideArguments(annotation, "foo; bar \r baz; qux"); assertThat(arguments).containsExactly(array("foo", "bar"), array("baz", "qux")); } @Test void providesArgumentsWithStringDelimiter() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("test.csv")// .delimiterString(",")// .build(); - Stream arguments = provideArguments(annotation, "foo, bar \n baz, qux \n"); + var arguments = provideArguments(annotation, "foo, bar \n baz, qux \n"); assertThat(arguments).containsExactly(array("foo", "bar"), array("baz", "qux")); } @Test void throwsExceptionIfBothDelimitersAreSimultaneouslySet() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("test.csv")// .delimiter(',')// .delimiterString(";")// .build(); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, - () -> provideArguments(annotation, "foo")); + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(annotation, "foo")); assertThat(exception)// .hasMessageStartingWith("The delimiter and delimiterString attributes cannot be set simultaneously in")// @@ -95,19 +94,19 @@ void throwsExceptionIfBothDelimitersAreSimultaneouslySet() { @Test void ignoresCommentedOutEntries() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("test.csv")// .delimiter(',')// .build(); - Stream arguments = provideArguments(annotation, "foo, bar \n#baz, qux"); + var arguments = provideArguments(annotation, "foo, bar \n#baz, qux"); assertThat(arguments).containsExactly(array("foo", "bar")); } @Test void closesInputStreamForClasspathResource() { - AtomicBoolean closed = new AtomicBoolean(false); + var closed = new AtomicBoolean(false); InputStream inputStream = new ByteArrayInputStream("foo".getBytes()) { @Override @@ -115,9 +114,9 @@ public void close() { closed.set(true); } }; - CsvFileSource annotation = csvFileSource().resources("test.csv").build(); + var annotation = csvFileSource().resources("test.csv").build(); - Stream arguments = provideArguments(inputStream, annotation); + var arguments = provideArguments(inputStream, annotation); assertThat(arguments.count()).isEqualTo(1); assertThat(closed.get()).describedAs("closed").isTrue(); @@ -125,7 +124,7 @@ public void close() { @Test void closesInputStreamForFile(@TempDir Path tempDir) { - AtomicBoolean closed = new AtomicBoolean(false); + var closed = new AtomicBoolean(false); InputStream inputStream = new ByteArrayInputStream("foo".getBytes()) { @Override @@ -133,10 +132,9 @@ public void close() { closed.set(true); } }; - CsvFileSource annotation = csvFileSource().files( - tempDir.resolve("test.csv").toAbsolutePath().toString()).build(); + var annotation = csvFileSource().files(tempDir.resolve("test.csv").toAbsolutePath().toString()).build(); - Stream arguments = provideArguments(inputStream, annotation); + var arguments = provideArguments(inputStream, annotation); assertThat(arguments.count()).isEqualTo(1); assertThat(closed.get()).describedAs("closed").isTrue(); @@ -144,53 +142,53 @@ public void close() { @Test void readsFromSingleClasspathResource() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/single-column.csv")// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).containsExactly(array("foo"), array("bar"), array("baz"), array("qux"), array("")); } @Test void readsFromSingleFileWithAbsolutePath(@TempDir Path tempDir) throws Exception { - Path csvFile = writeClasspathResourceToFile("/single-column.csv", tempDir.resolve("single-column.csv")); - CsvFileSource annotation = csvFileSource()// + var csvFile = writeClasspathResourceToFile("/single-column.csv", tempDir.resolve("single-column.csv")); + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .files(csvFile.toAbsolutePath().toString())// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).containsExactly(array("foo"), array("bar"), array("baz"), array("qux"), array("")); } @Test void readsFromClasspathResourcesAndFiles(@TempDir Path tempDir) throws Exception { - Path csvFile = writeClasspathResourceToFile("/single-column.csv", tempDir.resolve("single-column.csv")); - CsvFileSource annotation = csvFileSource()// + var csvFile = writeClasspathResourceToFile("/single-column.csv", tempDir.resolve("single-column.csv")); + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/single-column.csv")// .files(csvFile.toAbsolutePath().toString())// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).hasSize(2 * 5); } @Test void readsFromSingleFileWithRelativePath() throws Exception { - Path csvFile = writeClasspathResourceToFile("/single-column.csv", Path.of("single-column.csv")); + var csvFile = writeClasspathResourceToFile("/single-column.csv", Path.of("single-column.csv")); try { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .files(csvFile.getFileName().toString())// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).containsExactly(array("foo"), array("bar"), array("baz"), array("qux"), array("")); } @@ -201,64 +199,64 @@ void readsFromSingleFileWithRelativePath() throws Exception { @Test void readsFromSingleClasspathResourceWithCustomEmptyValue() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/single-column.csv")// .emptyValue("EMPTY")// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).containsExactly(array("foo"), array("bar"), array("baz"), array("qux"), array("EMPTY")); } @Test void readsFromMultipleClasspathResources() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/single-column.csv", "/single-column.csv")// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).hasSize(10); } @Test void readsFromSingleClasspathResourceWithHeaders() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/single-column.csv")// .numLinesToSkip(1)// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).containsExactly(array("bar"), array("baz"), array("qux"), array("")); } @Test void readsFromSingleClasspathResourceWithMoreHeadersThanLines() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/single-column.csv")// .numLinesToSkip(10)// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).isEmpty(); } @Test void readsFromMultipleClasspathResourcesWithHeaders() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/single-column.csv", "/single-column.csv")// .numLinesToSkip(1)// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).containsExactly(array("bar"), array("baz"), array("qux"), array(""), array("bar"), array("baz"), array("qux"), array("")); @@ -266,11 +264,11 @@ void readsFromMultipleClasspathResourcesWithHeaders() { @Test void throwsExceptionForMissingClasspathResource() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("/does-not-exist.csv")// .build(); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception).hasMessageContaining("Classpath resource [/does-not-exist.csv] does not exist"); @@ -278,11 +276,11 @@ void throwsExceptionForMissingClasspathResource() { @Test void throwsExceptionForBlankClasspathResource() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources(" ")// .build(); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception).hasMessageContaining("Classpath resource [ ] must not be null or blank"); @@ -290,11 +288,11 @@ void throwsExceptionForBlankClasspathResource() { @Test void throwsExceptionForMissingFile() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .files("does-not-exist.csv")// .build(); - JUnitException exception = assertThrows(JUnitException.class, + var exception = assertThrows(JUnitException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception).hasMessageContaining("File [does-not-exist.csv] could not be read"); @@ -302,11 +300,11 @@ void throwsExceptionForMissingFile() { @Test void throwsExceptionForBlankFile() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .files(" ")// .build(); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception).hasMessageContaining("File [ ] must not be null or blank"); @@ -314,12 +312,12 @@ void throwsExceptionForBlankFile() { @Test void throwsExceptionIfResourcesAndFilesAreEmpty() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources()// .files()// .build(); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception).hasMessageContaining("Resources or files must not be empty"); @@ -327,12 +325,12 @@ void throwsExceptionIfResourcesAndFilesAreEmpty() { @Test void throwsExceptionForInvalidCharset() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("Bogus-Charset")// .resources("/bogus-charset.csv")// .build(); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception)// @@ -342,11 +340,11 @@ void throwsExceptionForInvalidCharset() { @Test void throwsExceptionForInvalidCsvFormat() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("/broken.csv")// .build(); - CsvParsingException exception = assertThrows(CsvParsingException.class, + var exception = assertThrows(CsvParsingException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception)// @@ -356,59 +354,59 @@ void throwsExceptionForInvalidCsvFormat() { @Test void emptyValueIsAnEmptyWithCustomNullValueString() { - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .resources("test.csv")// .lineSeparator("\n")// .delimiter(',')// .nullValues("NIL")// .build(); - Stream arguments = provideArguments(annotation, "apple, , NIL, ''\nNIL, NIL, foo, bar"); + var arguments = provideArguments(annotation, "apple, , NIL, ''\nNIL, NIL, foo, bar"); assertThat(arguments).containsExactly(array("apple", null, null, "''"), array(null, null, "foo", "bar")); } @Test void readsLineFromDefaultMaxCharsFileWithDefaultConfig(@TempDir Path tempDir) throws Exception { - Path csvFile = writeClasspathResourceToFile("/default-max-chars.csv", tempDir.resolve("default-max-chars.csv")); - CsvFileSource annotation = csvFileSource()// + var csvFile = writeClasspathResourceToFile("/default-max-chars.csv", tempDir.resolve("default-max-chars.csv")); + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/default-max-chars.csv")// .files(csvFile.toAbsolutePath().toString())// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).hasSize(2); } @Test void readsLineFromExceedsMaxCharsFileWithCustomConfig(@TempDir Path tempDir) throws java.io.IOException { - Path csvFile = writeClasspathResourceToFile("/exceeds-default-max-chars.csv", + var csvFile = writeClasspathResourceToFile("/exceeds-default-max-chars.csv", tempDir.resolve("exceeds-default-max-chars.csv")); - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/exceeds-default-max-chars.csv")// .maxCharsPerColumn(4097)// .files(csvFile.toAbsolutePath().toString())// .build(); - Stream arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); + var arguments = provideArguments(new CsvFileArgumentsProvider(), annotation); assertThat(arguments).hasSize(2); } @Test void throwsExceptionWhenMaxCharsPerColumnIsNotPositiveNumber(@TempDir Path tempDir) throws java.io.IOException { - Path csvFile = writeClasspathResourceToFile("/exceeds-default-max-chars.csv", + var csvFile = writeClasspathResourceToFile("/exceeds-default-max-chars.csv", tempDir.resolve("exceeds-default-max-chars.csv")); - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/exceeds-default-max-chars.csv")// .maxCharsPerColumn(-1).files(csvFile.toAbsolutePath().toString())// .build(); - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, // + var exception = assertThrows(PreconditionViolationException.class, // () -> provideArguments(new CsvFileArgumentsProvider(), annotation)); assertThat(exception)// @@ -417,15 +415,15 @@ void throwsExceptionWhenMaxCharsPerColumnIsNotPositiveNumber(@TempDir Path tempD @Test void throwsExceptionForExceedsMaxCharsFileWithDefaultConfig(@TempDir Path tempDir) throws java.io.IOException { - Path csvFile = writeClasspathResourceToFile("/exceeds-default-max-chars.csv", + var csvFile = writeClasspathResourceToFile("/exceeds-default-max-chars.csv", tempDir.resolve("exceeds-default-max-chars.csv")); - CsvFileSource annotation = csvFileSource()// + var annotation = csvFileSource()// .encoding("ISO-8859-1")// .resources("/exceeds-default-max-chars.csv")// .files(csvFile.toAbsolutePath().toString())// .build(); - CsvParsingException exception = assertThrows(CsvParsingException.class, + var exception = assertThrows(CsvParsingException.class, () -> provideArguments(new CsvFileArgumentsProvider(), annotation).toArray()); assertThat(exception)// @@ -438,7 +436,7 @@ private Stream provideArguments(CsvFileSource annotation, String conte } private Stream provideArguments(InputStream inputStream, CsvFileSource annotation) { - CsvFileArgumentsProvider provider = new CsvFileArgumentsProvider(new InputStreamProvider() { + var provider = new CsvFileArgumentsProvider(new InputStreamProvider() { @Override public InputStream openClasspathResource(Class baseClass, String path) { assertThat(path).isEqualTo(annotation.resources()[0]); @@ -456,7 +454,7 @@ public InputStream openFile(String path) { private Stream provideArguments(CsvFileArgumentsProvider provider, CsvFileSource annotation) { provider.accept(annotation); - ExtensionContext context = mock(ExtensionContext.class); + var context = mock(ExtensionContext.class); when(context.getTestClass()).thenReturn(Optional.of(CsvFileArgumentsProviderTests.class)); doCallRealMethod().when(context).getRequiredTestClass(); return provider.provideArguments(context).map(Arguments::get); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java index 25518e08f5b5..67759795e218 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java @@ -35,21 +35,21 @@ class EnumArgumentsProviderTests { @Test void providesAllEnumConstants() { - Stream arguments = provideArguments(EnumWithTwoConstants.class); + var arguments = provideArguments(EnumWithTwoConstants.class); assertThat(arguments).containsExactly(new Object[] { FOO }, new Object[] { BAR }); } @Test void provideSingleEnumConstant() { - Stream arguments = provideArguments(EnumWithTwoConstants.class, "FOO"); + var arguments = provideArguments(EnumWithTwoConstants.class, "FOO"); assertThat(arguments).containsExactly(new Object[] { FOO }); } @Test void provideAllEnumConstantsWithNamingAll() { - Stream arguments = provideArguments(EnumWithTwoConstants.class, "FOO", "BAR"); + var arguments = provideArguments(EnumWithTwoConstants.class, "FOO", "BAR"); assertThat(arguments).containsExactly(new Object[] { FOO }, new Object[] { BAR }); } @@ -80,7 +80,7 @@ void providesEnumConstantsBasedOnTestMethod() throws Exception { when(extensionContext.getRequiredTestMethod()).thenReturn( TestCase.class.getDeclaredMethod("methodWithCorrectParameter", EnumWithTwoConstants.class)); - Stream arguments = provideArguments(NullEnum.class); + var arguments = provideArguments(NullEnum.class); assertThat(arguments).containsExactly(new Object[] { FOO }, new Object[] { BAR }); } @@ -125,14 +125,14 @@ private > Stream provideArguments(Class enumClass } private > Stream provideArguments(Class enumClass, Mode mode, String... names) { - EnumSource annotation = mock(EnumSource.class); + var annotation = mock(EnumSource.class); when(annotation.value()).thenAnswer(invocation -> enumClass); when(annotation.mode()).thenAnswer(invocation -> mode); when(annotation.names()).thenAnswer(invocation -> names); when(annotation.toString()).thenReturn(String.format("@EnumSource(value=%s.class, mode=%s, names=%s)", enumClass.getSimpleName(), mode, Arrays.toString(names))); - EnumArgumentsProvider provider = new EnumArgumentsProvider(); + var provider = new EnumArgumentsProvider(); provider.accept(annotation); return provider.provideArguments(extensionContext).map(Arguments::get); } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java index 91d74e036df4..48e4c559f8e4 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java @@ -22,10 +22,7 @@ import static org.junit.jupiter.params.provider.EnumSourceTests.EnumWithThreeConstants.BAZ; import static org.junit.jupiter.params.provider.EnumSourceTests.EnumWithThreeConstants.FOO; -import java.util.Arrays; -import java.util.Collections; import java.util.EnumSet; -import java.util.HashSet; import java.util.Set; import java.util.function.Function; @@ -41,66 +38,66 @@ void includeNamesWithAll() { assertAll("include names with all", // () -> assertTrue(INCLUDE.select(FOO, allOf(EnumWithThreeConstants::name))), () -> assertTrue(INCLUDE.select(BAR, allOf(EnumWithThreeConstants::name))), - () -> assertTrue(INCLUDE.select(BAZ, allOf(EnumWithThreeConstants::name)))); + () -> assertTrue(INCLUDE.select(BAZ, allOf(EnumWithThreeConstants::name))) // + ); } @Test void includeNamesWithSingleton() { assertAll("include names with singleton", // - () -> assertTrue(INCLUDE.select(FOO, FOO.singleton())), - () -> assertTrue(INCLUDE.select(BAR, BAR.singleton())), - () -> assertTrue(INCLUDE.select(BAZ, BAZ.singleton()))); + () -> assertTrue(INCLUDE.select(FOO, Set.of(FOO.name()))), + () -> assertTrue(INCLUDE.select(BAR, Set.of(BAR.name()))), + () -> assertTrue(INCLUDE.select(BAZ, Set.of(BAZ.name()))) // + ); assertAll("include names with singleton complement", // - () -> assertFalse(INCLUDE.select(BAR, FOO.singleton())), - () -> assertFalse(INCLUDE.select(BAZ, FOO.singleton()))); + () -> assertFalse(INCLUDE.select(BAR, Set.of(FOO.name()))), + () -> assertFalse(INCLUDE.select(BAZ, Set.of(FOO.name()))) // + ); } @Test void excludeNames() { assertAll("exclude name with none excluded", // - () -> assertTrue(EXCLUDE.select(FOO, Collections.emptySet())), - () -> assertTrue(EXCLUDE.select(BAR, Collections.emptySet())), - () -> assertTrue(EXCLUDE.select(BAZ, Collections.emptySet()))); + () -> assertTrue(EXCLUDE.select(FOO, Set.of())), // + () -> assertTrue(EXCLUDE.select(BAR, Set.of())), // + () -> assertTrue(EXCLUDE.select(BAZ, Set.of())) // + ); assertAll("exclude name with FOO excluded", // - () -> assertFalse(EXCLUDE.select(FOO, FOO.singleton())), - () -> assertTrue(EXCLUDE.select(BAR, FOO.singleton())), - () -> assertTrue(EXCLUDE.select(BAZ, FOO.singleton()))); + () -> assertFalse(EXCLUDE.select(FOO, Set.of(FOO.name()))), + () -> assertTrue(EXCLUDE.select(BAR, Set.of(FOO.name()))), + () -> assertTrue(EXCLUDE.select(BAZ, Set.of(FOO.name()))) // + ); } @Test void matchesAll() { assertAll("matches all", // - () -> assertTrue(MATCH_ALL.select(FOO, Collections.singleton("F.."))), - () -> assertTrue(MATCH_ALL.select(BAR, Collections.singleton("B.."))), - () -> assertTrue(MATCH_ALL.select(BAZ, Collections.singleton("B..")))); + () -> assertTrue(MATCH_ALL.select(FOO, Set.of("F.."))), + () -> assertTrue(MATCH_ALL.select(BAR, Set.of("B.."))), + () -> assertTrue(MATCH_ALL.select(BAZ, Set.of("B.."))) // + ); assertAll("matches all fails if not all match", // - () -> assertFalse(MATCH_ALL.select(FOO, set("F..", "."))), - () -> assertFalse(MATCH_ALL.select(BAR, set("B..", "."))), - () -> assertFalse(MATCH_ALL.select(BAZ, set("B..", ".")))); + () -> assertFalse(MATCH_ALL.select(FOO, Set.of("F..", "."))), + () -> assertFalse(MATCH_ALL.select(BAR, Set.of("B..", "."))), + () -> assertFalse(MATCH_ALL.select(BAZ, Set.of("B..", "."))) // + ); } @Test void matchesAny() { assertAll("matches any", // - () -> assertTrue(MATCH_ANY.select(FOO, set("B..", "^F.*"))), - () -> assertTrue(MATCH_ANY.select(BAR, set("B", "B.", "B.."))), - () -> assertTrue(MATCH_ANY.select(BAZ, set("^.+[zZ]$")))); + () -> assertTrue(MATCH_ANY.select(FOO, Set.of("B..", "^F.*"))), + () -> assertTrue(MATCH_ANY.select(BAR, Set.of("B", "B.", "B.."))), + () -> assertTrue(MATCH_ANY.select(BAZ, Set.of("^.+[zZ]$")))); } enum EnumWithThreeConstants { FOO, BAR, BAZ; - Set singleton() { - return Collections.singleton(name()); - } } static Set allOf(Function mapper) { return EnumSet.allOf(EnumWithThreeConstants.class).stream().map(mapper).collect(toSet()); } - static Set set(String... strings) { - return new HashSet<>(Arrays.asList(strings)); - } - } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java index 39e1b68c457a..c254fbb8f440 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java @@ -84,8 +84,8 @@ void providesArgumentsUsingStreamOfIntArrays() { var arguments = provideArguments("intArrayStreamProvider"); assertThat(arguments).containsExactly( // - array(new int[] { 1, 2 }), // - array(new int[] { 3, 4 }) // + new Object[] { new int[] { 1, 2 } }, // + new Object[] { new int[] { 3, 4 } } // ); } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java index f9bb7412c3a7..c17dd52462ea 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java @@ -90,7 +90,7 @@ MockCsvSourceBuilder lines(String... lines) { @Override CsvSource build() { - CsvSource annotation = mock(CsvSource.class); + var annotation = mock(CsvSource.class); // Common when(annotation.delimiter()).thenReturn(super.delimiter); @@ -147,7 +147,7 @@ MockCsvFileSourceBuilder numLinesToSkip(int numLinesToSkip) { @Override CsvFileSource build() { - CsvFileSource annotation = mock(CsvFileSource.class); + var annotation = mock(CsvFileSource.class); // Common when(annotation.delimiter()).thenReturn(super.delimiter); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java index 3c22826e6e13..cf9c789f2a94 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java @@ -27,7 +27,7 @@ class ValueArgumentsProviderTests { @Test void multipleInputsAreNotAllowed() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(new short[1], new byte[0], new int[1], new long[0], new float[0], new double[0], new char[0], new boolean[0], new String[0], new Class[0])); @@ -37,7 +37,7 @@ void multipleInputsAreNotAllowed() { @Test void onlyEmptyInputsAreNotAllowed() { - PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + var exception = assertThrows(PreconditionViolationException.class, () -> provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], new double[0], new char[0], new boolean[0], new String[0], new Class[0])); @@ -50,8 +50,8 @@ void onlyEmptyInputsAreNotAllowed() { */ @Test void providesShorts() { - Stream arguments = provideArguments(new short[] { 23, 42 }, new byte[0], new int[0], new long[0], - new float[0], new double[0], new char[0], new boolean[0], new String[0], new Class[0]); + var arguments = provideArguments(new short[] { 23, 42 }, new byte[0], new int[0], new long[0], new float[0], + new double[0], new char[0], new boolean[0], new String[0], new Class[0]); assertThat(arguments).containsExactly(array((short) 23), array((short) 42)); } @@ -61,24 +61,24 @@ void providesShorts() { */ @Test void providesBytes() { - Stream arguments = provideArguments(new short[0], new byte[] { 23, 42 }, new int[0], new long[0], - new float[0], new double[0], new char[0], new boolean[0], new String[0], new Class[0]); + var arguments = provideArguments(new short[0], new byte[] { 23, 42 }, new int[0], new long[0], new float[0], + new double[0], new char[0], new boolean[0], new String[0], new Class[0]); assertThat(arguments).containsExactly(array((byte) 23), array((byte) 42)); } @Test void providesInts() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[] { 23, 42 }, new long[0], - new float[0], new double[0], new char[0], new boolean[0], new String[0], new Class[0]); + var arguments = provideArguments(new short[0], new byte[0], new int[] { 23, 42 }, new long[0], new float[0], + new double[0], new char[0], new boolean[0], new String[0], new Class[0]); assertThat(arguments).containsExactly(array(23), array(42)); } @Test void providesLongs() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[0], new long[] { 23, 42 }, - new float[0], new double[0], new char[0], new boolean[0], new String[0], new Class[0]); + var arguments = provideArguments(new short[0], new byte[0], new int[0], new long[] { 23, 42 }, new float[0], + new double[0], new char[0], new boolean[0], new String[0], new Class[0]); assertThat(arguments).containsExactly(array(23L), array(42L)); } @@ -88,7 +88,7 @@ void providesLongs() { */ @Test void providesFloats() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], + var arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[] { 23.32F, 42.24F }, new double[0], new char[0], new boolean[0], new String[0], new Class[0]); assertThat(arguments).containsExactly(array(23.32F), array(42.24F)); @@ -96,7 +96,7 @@ void providesFloats() { @Test void providesDoubles() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], + var arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], new double[] { 23.32, 42.24 }, new char[0], new boolean[0], new String[0], new Class[0]); assertThat(arguments).containsExactly(array(23.32), array(42.24)); @@ -107,7 +107,7 @@ void providesDoubles() { */ @Test void providesChars() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], + var arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], new double[0], new char[] { 'a', 'b', 'c' }, new boolean[0], new String[0], new Class[0]); assertThat(arguments).containsExactly(array('a'), array('b'), array('c')); @@ -118,7 +118,7 @@ void providesChars() { */ @Test void providesBooleans() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], + var arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], new double[0], new char[0], new boolean[] { true, false }, new String[0], new Class[0]); assertThat(arguments).containsExactly(array(true), array(false)); @@ -126,7 +126,7 @@ void providesBooleans() { @Test void providesStrings() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], + var arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], new double[0], new char[0], new boolean[0], new String[] { "foo", "bar" }, new Class[0]); assertThat(arguments).containsExactly(array("foo"), array("bar")); @@ -137,7 +137,7 @@ void providesStrings() { */ @Test void providesClasses() { - Stream arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], + var arguments = provideArguments(new short[0], new byte[0], new int[0], new long[0], new float[0], new double[0], new char[0], new boolean[0], new String[0], new Class[] { Integer.class, getClass() }); assertThat(arguments).containsExactly(array(Integer.class), array(getClass())); @@ -146,7 +146,7 @@ void providesClasses() { private static Stream provideArguments(short[] shorts, byte[] bytes, int[] ints, long[] longs, float[] floats, double[] doubles, char[] chars, boolean[] booleans, String[] strings, Class[] classes) { - ValueSource annotation = mock(ValueSource.class); + var annotation = mock(ValueSource.class); when(annotation.shorts()).thenReturn(shorts); when(annotation.bytes()).thenReturn(bytes); when(annotation.ints()).thenReturn(ints); @@ -158,7 +158,7 @@ private static Stream provideArguments(short[] shorts, byte[] bytes, i when(annotation.strings()).thenReturn(strings); when(annotation.classes()).thenReturn(classes); - ValueArgumentsProvider provider = new ValueArgumentsProvider(); + var provider = new ValueArgumentsProvider(); provider.accept(annotation); return provider.provideArguments(null).map(Arguments::get); } From 1c8da0d21ee5a70c1766c5b9c00985d5e64b8ad5 Mon Sep 17 00:00:00 2001 From: Julian Sedding Date: Sun, 25 Oct 2020 06:07:22 +0100 Subject: [PATCH 0061/1433] Ensure MANIFEST.MF is the first JAR entry Prior to this commit, due to repacking JAR files in order to support reproducible builds, the `MANIFEST.MF` file entry sorted alphabetically causing issues with tools using `JarInputStream` to read the contents of the repackaged JAR files. This commit always sort `META-INF/` and `META-INF/MANIFEST.MF` entries first. Resolves #2438 --- .../kotlin/java-repackage-jars.gradle.kts | 15 +++++-- .../tests/JarContainsManifestFirstTests.java | 43 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java diff --git a/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts b/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts index e36bea40b0fa..507255835218 100644 --- a/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts +++ b/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts @@ -1,5 +1,3 @@ -import java.util.Calendar -import java.util.GregorianCalendar import java.util.jar.JarEntry import java.util.jar.JarFile import java.util.jar.JarOutputStream @@ -19,10 +17,21 @@ afterEvaluate { val newJarStream = JarOutputStream(os) val oldJar = JarFile(originalOutput) + fun sortAlwaysFirst(name: String): Comparator = + Comparator { a, b -> + when { + a.name == name -> -1 + b.name == name -> 1 + else -> 0 + } + } + oldJar.entries() .toList() .distinctBy { it.name } - .sortedBy { it.name } + .sortedWith(sortAlwaysFirst("META-INF/") + .then(sortAlwaysFirst("META-INF/MANIFEST.MF")) + .thenBy { it.name }) .forEach { entry -> val jarEntry = JarEntry(entry.name) diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java new file mode 100644 index 000000000000..dc481de1630a --- /dev/null +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java @@ -0,0 +1,43 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package platform.tooling.support.tests; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; +import static platform.tooling.support.Helper.createJarPath; + +import java.io.FileInputStream; +import java.nio.file.Files; +import java.util.jar.JarInputStream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +/** + * @since 1.8 + */ +class JarContainsManifestFirstTests { + + @ParameterizedTest + @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") + void manifestFirst(String module) throws Exception { + var modulePath = createJarPath(module); + + if (Files.notExists(modulePath)) { + fail("No such file: " + modulePath); + } + + // JarInputStream expects the META-INF/MANIFEST.MF to be at the start of the JAR archive + try (final JarInputStream jarInputStream = new JarInputStream(new FileInputStream(modulePath.toFile()))) { + assertNotNull(jarInputStream.getManifest(), "MANIFEST.MF should be available via JarInputStream"); + } + } +} From 575f36dae7f04ffc524c20c1cedbb2ea844b92e2 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Sun, 25 Oct 2020 08:47:53 +0100 Subject: [PATCH 0062/1433] Upgrade JitPack configuration to JDK 15 --- .jitpack.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jitpack.yml b/.jitpack.yml index 72eb09e6aa7f..39c04bae497c 100644 --- a/.jitpack.yml +++ b/.jitpack.yml @@ -1,5 +1,5 @@ install: - - wget https://github.com/sormuras/bach/raw/HEAD/install-jdk.sh - - source ./install-jdk.sh --feature 11 + - wget https://github.com/sormuras/bach/raw/master/install-jdk.sh + - source ./install-jdk.sh --feature 15 - ./gradlew --version - ./gradlew publishToMavenLocal -x test From f4cba4cd8dc722c9d643b752a742df53e8da2b20 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 25 Oct 2020 13:47:07 +0100 Subject: [PATCH 0063/1433] Add 5.7.1 release notes --- .../docs/asciidoc/release-notes/index.adoc | 2 + .../release-notes/release-notes-5.7.1.adoc | 58 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc diff --git a/documentation/src/docs/asciidoc/release-notes/index.adoc b/documentation/src/docs/asciidoc/release-notes/index.adoc index 85932bdfc78f..1cd60e14ee5a 100644 --- a/documentation/src/docs/asciidoc/release-notes/index.adoc +++ b/documentation/src/docs/asciidoc/release-notes/index.adoc @@ -18,4 +18,6 @@ include::{includedir}/link-attributes.adoc[] include::{basedir}/release-notes-5.8.0-M1.adoc[] +include::{basedir}/release-notes-5.7.1.adoc[] + include::{basedir}/release-notes-5.7.0.adoc[] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc new file mode 100644 index 000000000000..d95bd1ba792f --- /dev/null +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -0,0 +1,58 @@ +[[release-notes-5.7.1]] +== 5.7.1 + +*Date of Release:* ❓ + +*Scope:* Bug fixes since 5.7.0 + +For a complete list of all _closed_ issues and pull requests for this release, consult the +link:{junit5-repo}+/milestone/52?closed=1+[5.7.1] milestone page in the JUnit repository on +GitHub. + + +[[release-notes-5.7.1-junit-platform]] +=== JUnit Platform + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ + + +[[release-notes-5.7.1-junit-jupiter]] +=== JUnit Jupiter + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ + + +[[release-notes-5.7.1-junit-vintage]] +=== JUnit Vintage + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ From 9c9085033bf45caf704c7653bfe5d1903f072455 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 25 Oct 2020 13:44:48 +0100 Subject: [PATCH 0064/1433] Only call creators that throw exceptions once Prior to this commit, creator functions passed to ExtensionContext.Store were called repeatedly if the first invocation threw an exception. Now, they are only called once and the exception will be rethrown whenever the value stored for that key is read. However, the exception will not be rethrown when closing the store because only successfully created `CloseableResources` can be closed. Resolves #2455. --- .../release-notes/release-notes-5.7.1.adoc | 3 +- .../execution/ExtensionValuesStore.java | 48 +++++++++++++++---- .../execution/ExtensionContextStoreTests.java | 19 ++++++++ 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index d95bd1ba792f..23325f5342a4 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -31,7 +31,8 @@ GitHub. ==== Bug Fixes -* ❓ +* Creator functions passed to `ExtensionContext.Store.getOrComputeIfAbsent()` are now only + called once even if they throw an exception. ==== Deprecations and Breaking Changes diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java index b7df116a62f4..cc1c1d899b77 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java @@ -62,7 +62,7 @@ public ExtensionValuesStore(ExtensionValuesStore parentStore) { public void closeAllStoredCloseableValues() { ThrowableCollector throwableCollector = createThrowableCollector(); storedValues.values().stream() // - .filter(storedValue -> storedValue.evaluate() instanceof CloseableResource) // + .filter(storedValue -> storedValue.evaluateSafely() instanceof CloseableResource) // .sorted(REVERSE_INSERT_ORDER) // .map(storedValue -> (CloseableResource) storedValue.evaluate()) // .forEach(resource -> throwableCollector.execute(resource::close)); @@ -178,6 +178,15 @@ public StoredValue(int order, Supplier supplier) { this.supplier = supplier; } + private Object evaluateSafely() { + try { + return evaluate(); + } + catch (RuntimeException e) { + return null; + } + } + private Object evaluate() { return supplier.get(); } @@ -199,19 +208,38 @@ private MemoizingSupplier(Supplier delegate) { @Override public Object get() { if (value == NO_VALUE_SET) { - lock.lock(); - try { - if (value == NO_VALUE_SET) { - value = delegate.get(); - } - } - finally { - lock.unlock(); - } + computeValue(); + } + if (value instanceof Failure) { + throw ((Failure) value).exception; } return value; } + private void computeValue() { + lock.lock(); + try { + if (value == NO_VALUE_SET) { + value = delegate.get(); + } + } + catch (RuntimeException e) { + value = new Failure(e); + } + finally { + lock.unlock(); + } + } + + private static class Failure { + + private final RuntimeException exception; + + public Failure(RuntimeException exception) { + this.exception = exception; + } + } + } } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java index a848b4039650..b0bb8299e402 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java @@ -11,8 +11,12 @@ package org.junit.jupiter.engine.execution; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.concurrent.atomic.AtomicInteger; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtensionContext.Namespace; import org.junit.jupiter.api.extension.ExtensionContext.Store; @@ -68,4 +72,19 @@ void getOrDefaultWithValueInParentStore() { assertThat(store.getOrDefault(KEY, String.class, VALUE)).isEqualTo(VALUE); } + @Test + void getOrComputeIfAbsentWithFailingCreator() { + var invocations = new AtomicInteger(); + + var e1 = assertThrows(RuntimeException.class, () -> store.getOrComputeIfAbsent(KEY, __ -> { + invocations.incrementAndGet(); + throw new RuntimeException(); + })); + var e2 = assertThrows(RuntimeException.class, () -> store.get(KEY)); + assertSame(e1, e2); + + assertDoesNotThrow(localStore::closeAllStoredCloseableValues); + assertThat(invocations).hasValue(1); + } + } From 2666f74aa5e2ec1305235ed0c8b17d2bd4aa7347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mathieu?= Date: Sun, 25 Oct 2020 17:22:43 +0100 Subject: [PATCH 0065/1433] Expose DynamicTest executable to InvocationInterceptors (#2445) Allow dynamic test invocation interceptors to access the dynamic test executable. Resolves #2399. --- .../release-notes/release-notes-5.8.0-M1.adoc | 4 +- .../DynamicTestInvocationContext.java | 41 +++++++++++++++++++ .../api/extension/InvocationInterceptor.java | 21 ++++++++++ .../descriptor/DynamicTestTestDescriptor.java | 6 ++- .../ExtensionComposabilityTests.java | 1 + .../extension/InvocationInterceptorTests.java | 6 ++- 6 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index baeae7979485..39f7d951b9c8 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -21,7 +21,9 @@ on GitHub. ==== Deprecations and Breaking Changes -* ❓ +* `InvocationInterceptor.interceptDynamicTest(Invocation , ExtensionContext)` has been deprecated in favor of + `InvocationInterceptor.interceptDynamicTest(Invocation , DynamicTestInvocationContext, ExtensionContext)` that + allows to access the dynamic test executable via `DynamicTestInvocationContext.getExecutable()`. ==== New Features and Improvements diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java new file mode 100644 index 000000000000..99f6bb1b4568 --- /dev/null +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java @@ -0,0 +1,41 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api.extension; + +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import org.apiguardian.api.API; +import org.junit.jupiter.api.function.Executable; + +/** + * {@code DynamicTestInvocationContext} represents the context of a + * single invocation of a {@linkplain org.junit.jupiter.api.DynamicTest test}. + * + * @since 5.8 + * @see org.junit.jupiter.api.DynamicTest + */ +@API(status = EXPERIMENTAL, since = "5.8") +public class DynamicTestInvocationContext { + private Executable executable; + + public DynamicTestInvocationContext(Executable executable) { + this.executable = executable; + } + + /** + * Get the {@linkplain Executable} of this dynamic test invocation. + * + * @return the executable of the dynamic test invocation, never null. + */ + public Executable getExecutable() { + return executable; + } +} diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java index d98131bed6d4..64f771368701 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java @@ -10,6 +10,7 @@ package org.junit.jupiter.api.extension; +import static org.apiguardian.api.API.Status.DEPRECATED; import static org.apiguardian.api.API.Status.EXPERIMENTAL; import java.lang.reflect.Constructor; @@ -156,11 +157,31 @@ default void interceptTestTemplateMethod(Invocation invocation, * {@code null} * @param extensionContext the current extension context; never {@code null} * @throws Throwable in case of failures + * @deprecated use {@link #interceptDynamicTest(Invocation, DynamicTestInvocationContext, ExtensionContext)} instead */ + @Deprecated + @API(status = DEPRECATED, since = "5.8") default void interceptDynamicTest(Invocation invocation, ExtensionContext extensionContext) throws Throwable { invocation.proceed(); } + /** + * Intercept the invocation of a {@link DynamicTest}. + * + * @param invocation the invocation that is being intercepted; never + * {@code null} + * @param invocationContext the context of the invocation that is being + * intercepted; never {@code null} + * @param extensionContext the current extension context; never {@code null} + * @throws Throwable in case of failures + */ + @API(status = EXPERIMENTAL, since = "5.8") + default void interceptDynamicTest(Invocation invocation, DynamicTestInvocationContext invocationContext, + ExtensionContext extensionContext) throws Throwable { + // by default call the old interceptDynamicTest(Invocation, ExtensionContext) method so that existing extensions still work + interceptDynamicTest(invocation, extensionContext); + } + /** * Intercept the invocation of an {@link AfterEach @AfterEach} method. * diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java index b31219c92abe..a0d785d90d93 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java @@ -11,6 +11,7 @@ package org.junit.jupiter.engine.descriptor; import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.extension.DynamicTestInvocationContext; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.InvocationInterceptor; import org.junit.jupiter.api.function.Executable; @@ -52,10 +53,13 @@ public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext conte dynamicTest.getExecutable().execute(); return null; }; + DynamicTestInvocationContext dynamicTestInvocationContext = new DynamicTestInvocationContext( + dynamicTest.getExecutable()); ExtensionContext extensionContext = context.getExtensionContext(); ExtensionRegistry extensionRegistry = context.getExtensionRegistry(); interceptorChain.invoke(invocation, extensionRegistry, InterceptorCall.ofVoid( - (interceptor, wrappedInvocation) -> interceptor.interceptDynamicTest(wrappedInvocation, extensionContext))); + (interceptor, wrappedInvocation) -> interceptor.interceptDynamicTest(wrappedInvocation, + dynamicTestInvocationContext, extensionContext))); return context; } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java index d9751a29b903..2ef8886f4816 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java @@ -60,6 +60,7 @@ void ensureJupiterExtensionApisAreComposable() { List expectedMethodNames = expectedMethods.stream() .map(Method::getName) + .distinct() .sorted() .collect(toList()); // @formatter:on diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java index 974ece32ad63..880681c4bcae 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java @@ -35,6 +35,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestFactory; import org.junit.jupiter.api.TestReporter; +import org.junit.jupiter.api.extension.DynamicTestInvocationContext; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.Extension; import org.junit.jupiter.api.extension.ExtensionContext; @@ -287,8 +288,9 @@ public T interceptTestFactoryMethod(Invocation invocation, } @Override - public void interceptDynamicTest(Invocation invocation, ExtensionContext extensionContext) - throws Throwable { + public void interceptDynamicTest(Invocation invocation, DynamicTestInvocationContext invocationContext, + ExtensionContext extensionContext) throws Throwable { + assertThat(invocationContext.getExecutable()).isNotNull(); assertThat(extensionContext.getUniqueId()).isNotBlank(); assertThat(extensionContext.getElement()).isEmpty(); assertThat(extensionContext.getParent().flatMap(ExtensionContext::getTestMethod)).contains( From 6525e176bc53ddc9d6f8471376b5faf1569e3192 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 26 Oct 2020 07:52:57 +0100 Subject: [PATCH 0066/1433] Improve Javadoc of interceptTestFactoryMethod Mention RepeatedTest and ParameterizedTest as examples of TestTemplate methods. Related issue: #2338 --- .../junit/jupiter/api/extension/InvocationInterceptor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java index 64f771368701..31ac35535705 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java @@ -119,7 +119,9 @@ default void interceptTestMethod(Invocation invocation, ReflectiveInvocati } /** - * Intercept the invocation of a {@link TestFactory @TestFactory} method. + * Intercept the invocation of a {@link TestFactory @TestFactory} method, + * such as a {@link org.junit.jupiter.api.RepeatedTest @RepeatedTest} or + * {@code @ParameterizedTest} method. * * @param invocation the invocation that is being intercepted; never * {@code null} From a5e0c2bc7d46da10e31b58fb888d0aa026bdd7e9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 25 Oct 2020 10:26:15 +0100 Subject: [PATCH 0067/1433] Upgrade to bnd 5.2.0 --- buildSrc/build.gradle.kts | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 679ce910df40..264c69ea5c3d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -10,7 +10,7 @@ repositories { dependencies { implementation(kotlin("gradle-plugin")) implementation("de.marcphilipp.gradle:nexus-publish-plugin:0.4.0") - implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2") + implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.2.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.gradle:test-retry-gradle-plugin:1.1.8") } diff --git a/gradle.properties b/gradle.properties index 014e0f3ad274..87b2b6f5241a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -43,7 +43,7 @@ jacoco.version=0.8.6 jmh.version=1.25 ktlint.version=0.35.0 surefire.version=2.22.2 -bnd.version=5.1.2 +bnd.version=5.2.0 # Plugins gradle.enterprise.plugin.version=3.4.1 From 66d08f373e54e83f64337e35ef251c318a4dd4bd Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Mon, 26 Oct 2020 09:52:02 -0400 Subject: [PATCH 0068/1433] osgi: Explicitly set the Bundle-SymbolicName for artifacts Bnd 5.2.0 changed to use the task's archiveClassifier property, if set, in the default value for Bundle-SymbolicName. The current build can use an "all" classifier which results in an incorrect Bundle-SymbolicName. So we must set the desired Bundle-SymbolicName rather than rely on the default. Signed-off-by: BJ Hargrave --- buildSrc/src/main/kotlin/osgi-conventions.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts b/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts index 8b8f1705dc7f..1d2e815d63fe 100644 --- a/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts @@ -18,6 +18,11 @@ tasks.withType().matching { // We've generalized these so that they are widely applicable limiting // module configurations to special cases. btc.setBnd(""" + # Set the Bundle-SymbolicName to the archiveBaseName. + # We don't use the archiveClassifier which Bnd will use + # in the default Bundle-SymbolicName value. + Bundle-SymbolicName: ${'$'}{task.archiveBaseName} + # These are the general rules for package imports. Import-Package: \ !org.apiguardian.api,\ From cd19957e4791f3e4b4ea33b6070a9b0e9f223474 Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Mon, 26 Oct 2020 09:48:52 -0400 Subject: [PATCH 0069/1433] osgi: Use jar task's archiveVersion for the package exports We change to late-bind the export package version to use the jar task's archiveVersion property instead of early binding to the project's version property. This is more correct and allows the task control over the version. We also elide any SNAPSHOT qualifier from the version. Signed-off-by: BJ Hargrave --- buildSrc/src/main/kotlin/osgi-conventions.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts b/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts index 1d2e815d63fe..da7000dd5989 100644 --- a/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts @@ -52,7 +52,7 @@ tasks.withType().matching { # Instruct the APIGuardianAnnotations how to operate. # See https://bnd.bndtools.org/instructions/export-apiguardian.html - -export-apiguardian: *;version=${project.version} + -export-apiguardian: *;version=${'$'}{versionmask;===;${'$'}{version_cleanup;${'$'}{task.archiveVersion}}} """) // Add the convention to the jar task From a6115d835127c71288dd0989d7d9f896f8f08395 Mon Sep 17 00:00:00 2001 From: BJ Hargrave Date: Mon, 26 Oct 2020 17:47:25 -0400 Subject: [PATCH 0070/1433] osgi: Use Bnd macro processing to avoid gradle afterEvaluate We use late-binding to get the project description via Bnd's macro support instead of having to use afterEvaluate to early-bind to the project description in the gradle script. Signed-off-by: BJ Hargrave --- buildSrc/src/main/kotlin/osgi-conventions.gradle.kts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts b/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts index da7000dd5989..00570e03379b 100644 --- a/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/osgi-conventions.gradle.kts @@ -23,6 +23,9 @@ tasks.withType().matching { # in the default Bundle-SymbolicName value. Bundle-SymbolicName: ${'$'}{task.archiveBaseName} + # Set the Bundle-Name from the project description + Bundle-Name: ${'$'}{project.description} + # These are the general rules for package imports. Import-Package: \ !org.apiguardian.api,\ @@ -106,12 +109,3 @@ val verifyOSGi by tasks.registering(Resolve::class) { tasks.check { dependsOn(verifyOSGi) } - -// The ${project.description}, for some odd reason, is only available -// after evaluation. -afterEvaluate { - tasks.withType().configureEach { - convention.findPlugin(BundleTaskConvention::class.java) - ?.bnd("Bundle-Name: ${project.description}") - } -} From 296dec012c94758c864fdba21f58fa7169b26add Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 29 Oct 2020 09:28:48 +0100 Subject: [PATCH 0071/1433] Upgrade Gradle Enterprise plugin to 3.5 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 87b2b6f5241a..c2503f2e7e58 100644 --- a/gradle.properties +++ b/gradle.properties @@ -46,7 +46,7 @@ surefire.version=2.22.2 bnd.version=5.2.0 # Plugins -gradle.enterprise.plugin.version=3.4.1 +gradle.enterprise.plugin.version=3.5 versioning.plugin.version=2.14.0 versions.plugin.version=0.29.0 spotless.plugin.version=5.6.1 From fa6b8fe8805a13b905ada9598e6ff0157d0ebc06 Mon Sep 17 00:00:00 2001 From: Yuri Orlov Date: Sun, 1 Nov 2020 00:19:59 +0300 Subject: [PATCH 0072/1433] Use built-in comparator (#2466) --- .../org/junit/jupiter/engine/descriptor/ExtensionUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java index 1ea9a59c280e..838a432da5be 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java @@ -119,7 +119,7 @@ static void registerExtensionsFromFields(ExtensionRegistrar registrar, Class * @since 5.4 */ private static final Comparator orderComparator = // - (field1, field2) -> Integer.compare(getOrder(field1), getOrder(field2)); + Comparator.comparingInt(ExtensionUtils::getOrder); /** * @since 5.4 From 25d727a186a3151c6cf22619c989082cad39b543 Mon Sep 17 00:00:00 2001 From: Yuri Orlov Date: Sun, 1 Nov 2020 00:21:04 +0300 Subject: [PATCH 0073/1433] use Math.min instead of manual calculation (#2465) --- .../launcher/listeners/MutableTestExecutionSummary.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java index 6339da8dbe6a..24287fcf129b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java @@ -250,7 +250,7 @@ private void printStackTrace(PrintWriter writer, StackTraceElement[] parentTrace } int duplicates = numberOfCommonFrames(trace, parentTrace); int numDistinctFrames = trace.length - duplicates; - int numDisplayLines = (numDistinctFrames > max) ? max : numDistinctFrames; + int numDisplayLines = Math.min(numDistinctFrames, max); for (int i = 0; i < numDisplayLines; i++) { writer.printf("%s%s%s%n", indentation, TAB, trace[i]); } From 3107c3e1706e99284ea28b7fe8b7c6504f6d6a1e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 15 Nov 2020 15:30:09 +0100 Subject: [PATCH 0074/1433] Move entries to 5.7.1 release notes --- .../docs/asciidoc/release-notes/release-notes-5.7.1.adoc | 8 +++++++- .../asciidoc/release-notes/release-notes-5.8.0-M1.adoc | 9 ++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index 23325f5342a4..afc292a80213 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -15,7 +15,9 @@ GitHub. ==== Bug Fixes -* ❓ +* `StringUtils.nullSafeToString()` now returns `"null"` if the invocation of `toString()` + on the supplied object returns `null`. Although this is an internal utility, the effect + of this change may be witnessed by end users and test engine or extension authors. ==== Deprecations and Breaking Changes @@ -31,6 +33,10 @@ GitHub. ==== Bug Fixes +* If the `toString()` implementation of an argument passed to a `@ParameterizedTest` + method returns `null`, the display name formatter for the parameterized test now treats + the name of the corresponding argument as `"null"` instead of throwing an exception. + This fixes a regression introduced in JUnit Jupiter 5.7.0. * Creator functions passed to `ExtensionContext.Store.getOrComputeIfAbsent()` are now only called once even if they throw an exception. diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 39f7d951b9c8..75f23328837c 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -15,9 +15,7 @@ on GitHub. ==== Bug Fixes -* `StringUtils.nullSafeToString()` now returns `"null"` if the invocation of `toString()` - on the supplied object returns `null`. Although this is an internal utility, the effect - of this change may be witnessed by end users and test engine or extension authors. +* ❓ ==== Deprecations and Breaking Changes @@ -35,10 +33,7 @@ on GitHub. ==== Bug Fixes -* If the `toString()` implementation of an argument passed to a `@ParameterizedTest` - method returns `null`, the display name formatter for the parameterized test now treats - the name of the corresponding argument as `"null"` instead of throwing an exception. - This fixes a regression introduced in JUnit Jupiter 5.7.0. +* ❓ ==== Deprecations and Breaking Changes From 36542987a00371ec29374445e0487e51ac3d19e9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 15 Nov 2020 15:35:06 +0100 Subject: [PATCH 0075/1433] Document #2438 in release notes --- .../docs/asciidoc/release-notes/release-notes-5.7.1.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index afc292a80213..3caad020f745 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -10,6 +10,13 @@ link:{junit5-repo}+/milestone/52?closed=1+[5.7.1] milestone page in the JUnit re GitHub. +[[release-notes-5.7.1-general-bug-fixes]] +=== General bug fixes + +* For compatibility with `JarInputStream`, all JARs now contain `META-INF/` and + `META-INF/MANIFEST.MF` as their first entries again. + + [[release-notes-5.7.1-junit-platform]] === JUnit Platform From 7547bb8a06d0af8d15d396b89ab888f655a7a5d9 Mon Sep 17 00:00:00 2001 From: Matthias Merdes Date: Sun, 15 Nov 2020 15:37:33 +0100 Subject: [PATCH 0076/1433] Improve user guide for nested tests (#2474) * add image of ide execution, avoid 'family' wording * explain nesting and the role of lifecycle methods in more detail * document the change in the release notes Resolves #2451. --- .../release-notes/release-notes-5.7.1.adoc | 2 +- .../images/writing-tests_nested_test_ide.png | Bin 0 -> 230224 bytes .../asciidoc/user-guide/writing-tests.adoc | 29 +++++++++++++----- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 documentation/src/docs/asciidoc/user-guide/images/writing-tests_nested_test_ide.png diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index 3caad020f745..cfde0aa9a0f9 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -53,7 +53,7 @@ GitHub. ==== New Features and Improvements -* ❓ +* The user guide now explains Nested Tests in more detail. [[release-notes-5.7.1-junit-vintage]] diff --git a/documentation/src/docs/asciidoc/user-guide/images/writing-tests_nested_test_ide.png b/documentation/src/docs/asciidoc/user-guide/images/writing-tests_nested_test_ide.png new file mode 100644 index 0000000000000000000000000000000000000000..8a5dd0a1d1587bdeceb95ba49d5daee71f1df8ed GIT binary patch literal 230224 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 z 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 h2EPt_KAIC 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

    *Yu9?kYueZX07fPg7FKePXyy`SA1+k?Nae>Sre zen0>D-j#($vhVMok4iWEq<2mJn!L2~(<@i6#b1l>W`4bXvhLdbYk=_I`LE&GJ!dLUUHx3vIVCg!0CIfKCjbBd literal 0 HcmV?d00001 diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 3c6a686f3038..963dafe0341e 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -642,7 +642,9 @@ configuration file instead of via a JVM system property. === Nested Tests `@Nested` tests give the test writer more capabilities to express the relationship among -several groups of tests. Here's an elaborate example. +several groups of tests. Such nested tests make use of Java's nested classes and +facilitate hierarchical thinking about the test structure. +Here's an elaborate example, both as source code and as an IDE execution screenshot. [source,java,indent=0] .Nested test suite for testing a stack @@ -650,13 +652,26 @@ several groups of tests. Here's an elaborate example. include::{testDir}/example/TestingAStackDemo.java[tags=user_guide] ---- +When executing this example in an IDE, the test execution tree in the GUI will look +similar to the following image. + +image::writing-tests_nested_test_ide.png[caption='',title='Executing a nested test in an IDE'] + +In this example preconditions from outer tests are used in inner tests by defining +hierarchical lifecycle methods for the setup code. E.g., the method `createNewStack()` +annotated as a lifecycle method with `@BeforeEach` is such a setup method which is used +at all level below in the nesting tree. + +The fact that setup code from outer tests is run before inner tests are executed gives +you the ability to run all tests independently. You can even run inner tests alone +without outer tests, because the setup code from the outer tests is always executed. + NOTE: _Only non-static nested classes_ (i.e. _inner classes_) can serve as `@Nested` test -classes. Nesting can be arbitrarily deep, and those inner classes are considered to be -full members of the test class family with one exception: `@BeforeAll` and `@AfterAll` -methods do not work _by default_. The reason is that Java does not allow `static` members -in inner classes. However, this restriction can be circumvented by annotating a `@Nested` -test class with `@TestInstance(Lifecycle.PER_CLASS)` (see -<>). +classes. Nesting can be arbitrarily deep, and those inner classes are subject to full +lifecycle support with one exception:`@BeforeAll` and `@AfterAll` methods do not work +_by default_. The reason is that Java does not allow `static` members in inner classes. +However, this restriction can be circumvented by annotating a `@Nested` test class with +`@TestInstance(Lifecycle.PER_CLASS)` (see <>). [[writing-tests-dependency-injection]] === Dependency Injection for Constructors and Methods From bbfc66b2bfd7f840a132a22d9e26c393eddaa5b3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 16 Nov 2020 20:48:43 +0100 Subject: [PATCH 0077/1433] Upgradle to 6.7.1 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 58739421a910..8174453a1aa1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=8ad57759019a9233dc7dc4d1a530cefe109dc122000d57f7e623f8cf4ba9dfc4 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionSha256Sum=3239b5ed86c3838a37d983ac100573f64c1f3fd8e1eb6c89fa5f9529b5ec091d +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From e31e58d9c3d3ce9b74ede13f6f60c588abecea98 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 20 Nov 2020 13:57:46 +0100 Subject: [PATCH 0078/1433] Polishing --- .../asciidoc/user-guide/writing-tests.adoc | 20 +++++++++---------- .../DynamicTestInvocationContext.java | 13 +++++++----- .../execution/ConstructorInvocation.java | 9 +++++---- .../engine/execution/MethodInvocation.java | 16 +++++++-------- .../testkit/engine/EngineTestKitTests.java | 2 +- 5 files changed, 32 insertions(+), 28 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 963dafe0341e..e6967618c75b 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -643,8 +643,8 @@ configuration file instead of via a JVM system property. `@Nested` tests give the test writer more capabilities to express the relationship among several groups of tests. Such nested tests make use of Java's nested classes and -facilitate hierarchical thinking about the test structure. -Here's an elaborate example, both as source code and as an IDE execution screenshot. +facilitate hierarchical thinking about the test structure. Here's an elaborate example, +both as source code and as a screenshot of the execution within an IDE. [source,java,indent=0] .Nested test suite for testing a stack @@ -657,18 +657,18 @@ similar to the following image. image::writing-tests_nested_test_ide.png[caption='',title='Executing a nested test in an IDE'] -In this example preconditions from outer tests are used in inner tests by defining -hierarchical lifecycle methods for the setup code. E.g., the method `createNewStack()` -annotated as a lifecycle method with `@BeforeEach` is such a setup method which is used -at all level below in the nesting tree. +In this example, preconditions from outer tests are used in inner tests by defining +hierarchical lifecycle methods for the setup code. For example, `createNewStack()` is a +`@BeforeEach` lifecycle method that is used in the test class in which it is defined and +in all levels in the nesting tree below the class in which it is defined. -The fact that setup code from outer tests is run before inner tests are executed gives -you the ability to run all tests independently. You can even run inner tests alone -without outer tests, because the setup code from the outer tests is always executed. +The fact that setup code from outer tests is run before inner tests are executed gives you +the ability to run all tests independently. You can even run inner tests alone without +running the outer tests, because the setup code from the outer tests is always executed. NOTE: _Only non-static nested classes_ (i.e. _inner classes_) can serve as `@Nested` test classes. Nesting can be arbitrarily deep, and those inner classes are subject to full -lifecycle support with one exception:`@BeforeAll` and `@AfterAll` methods do not work +lifecycle support with one exception: `@BeforeAll` and `@AfterAll` methods do not work _by default_. The reason is that Java does not allow `static` members in inner classes. However, this restriction can be circumvented by annotating a `@Nested` test class with `@TestInstance(Lifecycle.PER_CLASS)` (see <>). diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java index 99f6bb1b4568..8476d7f99d37 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java @@ -17,25 +17,28 @@ /** * {@code DynamicTestInvocationContext} represents the context of a - * single invocation of a {@linkplain org.junit.jupiter.api.DynamicTest test}. + * single invocation of a {@linkplain org.junit.jupiter.api.DynamicTest + * dynamic test}. * * @since 5.8 * @see org.junit.jupiter.api.DynamicTest */ @API(status = EXPERIMENTAL, since = "5.8") public class DynamicTestInvocationContext { - private Executable executable; + + private final Executable executable; public DynamicTestInvocationContext(Executable executable) { this.executable = executable; } /** - * Get the {@linkplain Executable} of this dynamic test invocation. + * Get the {@linkplain Executable} of this dynamic test invocation context. * - * @return the executable of the dynamic test invocation, never null. + * @return the executable of the dynamic test invocation, never {@code null} */ public Executable getExecutable() { - return executable; + return this.executable; } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java index bebeb487131b..7f83e24d8a7c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java @@ -33,17 +33,17 @@ class ConstructorInvocation implements Invocation, ReflectiveInvocationCon @Override public Class getTargetClass() { - return constructor.getDeclaringClass(); + return this.constructor.getDeclaringClass(); } @Override public Constructor getExecutable() { - return constructor; + return this.constructor; } @Override public List getArguments() { - return unmodifiableList(Arrays.asList(arguments)); + return unmodifiableList(Arrays.asList(this.arguments)); } @Override @@ -53,6 +53,7 @@ public Optional getTarget() { @Override public T proceed() { - return ReflectionUtils.newInstance(constructor, arguments); + return ReflectionUtils.newInstance(this.constructor, this.arguments); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java index 1f29960a2014..d444c818f65c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java @@ -23,9 +23,9 @@ class MethodInvocation implements Invocation, ReflectiveInvocationContext { - protected final Method method; - protected final Optional target; - protected final Object[] arguments; + private final Method method; + private final Optional target; + private final Object[] arguments; MethodInvocation(Method method, Optional target, Object[] arguments) { this.method = method; @@ -35,29 +35,29 @@ class MethodInvocation implements Invocation, ReflectiveInvocationContext< @Override public Class getTargetClass() { - return target.> map(Object::getClass).orElseGet(method::getDeclaringClass); + return this.target.> map(Object::getClass).orElseGet(this.method::getDeclaringClass); } @Override @SuppressWarnings("unchecked") public Optional getTarget() { - return target; + return this.target; } @Override public Method getExecutable() { - return method; + return this.method; } @Override public List getArguments() { - return unmodifiableList(Arrays.asList(arguments)); + return unmodifiableList(Arrays.asList(this.arguments)); } @Override @SuppressWarnings("unchecked") public T proceed() { - return (T) ReflectionUtils.invokeMethod(method, target.orElse(null), arguments); + return (T) ReflectionUtils.invokeMethod(this.method, this.target.orElse(null), this.arguments); } } diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java index cdf0e97ad705..a3f386fa9b03 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java @@ -25,7 +25,7 @@ import org.junit.jupiter.params.provider.CsvSource; import org.junit.platform.engine.reporting.ReportEntry; -public class EngineTestKitTests { +class EngineTestKitTests { private static final String KEY = EngineTestKitTests.class.getName(); From ab61708bde98bd295ddd9560faf6f6c6142bc406 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 20 Nov 2020 14:07:28 +0100 Subject: [PATCH 0079/1433] Convert DynamicTestInvocationContext to an interface See #2399 --- .../DynamicTestInvocationContext.java | 14 ++------ .../DefaultDynamicTestInvocationContext.java | 34 +++++++++++++++++++ .../descriptor/DynamicTestTestDescriptor.java | 2 +- 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java index 8476d7f99d37..39ad238cf64e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java @@ -24,21 +24,13 @@ * @see org.junit.jupiter.api.DynamicTest */ @API(status = EXPERIMENTAL, since = "5.8") -public class DynamicTestInvocationContext { - - private final Executable executable; - - public DynamicTestInvocationContext(Executable executable) { - this.executable = executable; - } +public interface DynamicTestInvocationContext { /** - * Get the {@linkplain Executable} of this dynamic test invocation context. + * Get the {@code Executable} of this dynamic test invocation context. * * @return the executable of the dynamic test invocation, never {@code null} */ - public Executable getExecutable() { - return this.executable; - } + Executable getExecutable(); } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java new file mode 100644 index 000000000000..4b6cb2b34dd7 --- /dev/null +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java @@ -0,0 +1,34 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.descriptor; + +import org.junit.jupiter.api.extension.DynamicTestInvocationContext; +import org.junit.jupiter.api.function.Executable; + +/** + * Default implementation of the {@link DynamicTestInvocationContext} API. + * + * @since 5.8 + */ +class DefaultDynamicTestInvocationContext implements DynamicTestInvocationContext { + + private final Executable executable; + + DefaultDynamicTestInvocationContext(Executable executable) { + this.executable = executable; + } + + @Override + public Executable getExecutable() { + return this.executable; + } + +} diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java index a0d785d90d93..e35293fa4754 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java @@ -53,7 +53,7 @@ public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext conte dynamicTest.getExecutable().execute(); return null; }; - DynamicTestInvocationContext dynamicTestInvocationContext = new DynamicTestInvocationContext( + DynamicTestInvocationContext dynamicTestInvocationContext = new DefaultDynamicTestInvocationContext( dynamicTest.getExecutable()); ExtensionContext extensionContext = context.getExtensionContext(); ExtensionRegistry extensionRegistry = context.getExtensionRegistry(); From a3cd0f911d8ee9d9b4e50b46523c388200649d03 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 20 Nov 2020 16:35:34 +0100 Subject: [PATCH 0080/1433] Add test(Condition) & nestedContainer(Class,Condition) in Test Kit This commit introduces new `test(Condition)` and `nestedContainer(Class, Condition)` methods in `EventConditions` that allow you to provide conditions for matching against test and nested container events when using the `EngineTestKit`. For example, `test(displayName("my test"))` can be used to match against a test whose display name is `my test`. Closes #2473 --- .../release-notes/release-notes-5.8.0-M1.adoc | 6 ++- .../testkit/engine/EventConditions.java | 47 ++++++++++++++++++- .../NestedContainerEventConditionTests.java | 7 ++- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 75f23328837c..b253ab9af374 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -25,7 +25,11 @@ on GitHub. ==== New Features and Improvements -* ❓ +* New `test(Condition)` and `nestedContainer(Class, Condition)` methods + in `EventConditions` that allow you to provide conditions for matching against test and + nested container events when using the `EngineTestKit`. For example, + `test(displayName("my test"))` can be used to match against a test whose display name is + `my test`. [[release-notes-5.8.0-M1-junit-jupiter]] diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java index 55fafae055ad..c99e8875bae1 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java @@ -88,7 +88,7 @@ public static Condition engine() { * @see #uniqueIdSubstring(String) */ public static Condition test(String uniqueIdSubstring) { - return allOf(test(), uniqueIdSubstring(uniqueIdSubstring)); + return test(uniqueIdSubstring(uniqueIdSubstring)); } /** @@ -100,6 +100,7 @@ public static Condition test(String uniqueIdSubstring) { * display name} equals the supplied {@link String}. * * @see #test() + * @see #test(Condition) * @see #uniqueIdSubstring(String) * @see #displayName(String) */ @@ -107,6 +108,25 @@ public static Condition test(String uniqueIdSubstring, String displayName return allOf(test(), uniqueIdSubstring(uniqueIdSubstring), displayName(displayName)); } + /** + * Create a new {@link Condition} that matches if and only if an + * {@link Event} matches the supplied {@code Condition} and its + * {@linkplain Event#getTestDescriptor() test descriptor} is a + * {@linkplain TestDescriptor#isTest() test}. + * + *

    For example, {@code test(displayName("my display name"))} can be used + * to match against a test with the given display name. + * + * @since 1.8 + * @see #test(String) + * @see #test(String, String) + * @see #displayName(String) + */ + @API(status = MAINTAINED, since = "1.8") + public static Condition test(Condition condition) { + return allOf(test(), condition); + } + /** * Create a new {@link Condition} that matches if and only if an * {@link Event}'s {@linkplain Event#getTestDescriptor() test descriptor} is @@ -158,6 +178,29 @@ public static Condition container() { return new Condition<>(byTestDescriptor(TestDescriptor::isContainer), "is a container"); } + /** + * Create a new {@link Condition} that matches if and only if an + * {@link Event} matches the supplied {@code Condition}, its + * {@linkplain Event#getTestDescriptor() test descriptor} is + * a {@linkplain TestDescriptor#isContainer() container}, and its + * {@linkplain TestDescriptor#getUniqueId() unique id} contains the + * simple names of the supplied {@link Class} and all of its + * {@linkplain Class#getEnclosingClass() enclosing classes}. + * + *

    For example, {@code nestedContainer(MyNestedTests.class, displayName("my display name"))} + * can be used to match against a nested container with the given display name. + * + *

    Please note that this method does not differentiate between static + * nested classes and non-static member classes (e.g., inner classes). + * + * @since 1.8 + * @see #nestedContainer(Class) + */ + @API(status = MAINTAINED, since = "1.8") + public static Condition nestedContainer(Class clazz, Condition condition) { + return allOf(nestedContainer(clazz), condition); + } + /** * Create a new {@link Condition} that matches if and only if an * {@link Event}'s {@linkplain Event#getTestDescriptor() test descriptor} is @@ -168,6 +211,8 @@ public static Condition container() { * *

    Please note that this method does not differentiate between static * nested classes and non-static member classes (e.g., inner classes). + * + * @see #nestedContainer(Class, Condition) */ public static Condition nestedContainer(Class clazz) { Preconditions.notNull(clazz, "Class must not be null"); diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java index bced3458a194..3d0ffad4d147 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java @@ -15,6 +15,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; import static org.junit.platform.testkit.engine.EventConditions.container; +import static org.junit.platform.testkit.engine.EventConditions.displayName; import static org.junit.platform.testkit.engine.EventConditions.engine; import static org.junit.platform.testkit.engine.EventConditions.event; import static org.junit.platform.testkit.engine.EventConditions.finishedSuccessfully; @@ -26,6 +27,7 @@ import java.util.HashMap; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.platform.commons.PreconditionViolationException; @@ -107,14 +109,14 @@ void eventConditionsForMultipleLevelsOfNestedClasses() { event(container(ATestCase.class), started()), event(test("test_a"), started()), event(test("test_a"), finishedSuccessfully()), - event(nestedContainer(ATestCase.BTestCase.class), started()), + event(nestedContainer(ATestCase.BTestCase.class, displayName("Test case B")), started()), event(test("test_b"), started()), event(test("test_b"), finishedSuccessfully()), event(nestedContainer(ATestCase.BTestCase.CTestCase.class), started()), event(test("test_c"), started()), event(test("test_c"), finishedSuccessfully()), event(nestedContainer(ATestCase.BTestCase.CTestCase.class), finishedSuccessfully()), - event(nestedContainer(ATestCase.BTestCase.class), finishedSuccessfully()), + event(nestedContainer(ATestCase.BTestCase.class, displayName("Test case B")), finishedSuccessfully()), event(container(ATestCase.class), finishedSuccessfully()), event(engine(), finishedSuccessfully()) ); @@ -128,6 +130,7 @@ void test_a() { } @Nested + @DisplayName("Test case B") class BTestCase { @Test void test_b() { From 7da75de5e4ea59de6185328140d0e890940c94c5 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 24 Nov 2020 14:16:30 +0100 Subject: [PATCH 0081/1433] Delete unused statements in Kotlin-based tests --- .../jupiter/api/KotlinAssertTimeoutAssertionsTests.kt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt index 505121efa7e5..3366d1e70b5f 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt @@ -100,7 +100,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val exception = assertThrows { assertTimeout(ofMillis(500)) { ExceptionUtils.throwAsUncheckedException(RuntimeException("not this time")) - "Tempus Fugit" } } assertMessageEquals(exception, "not this time") @@ -121,7 +120,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val error = assertThrows { assertTimeout(ofMillis(10)) { nap() - "Tempus Fugit" } } assertMessageStartsWith(error, "execution exceeded timeout of 10 ms by") @@ -132,7 +130,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val error = assertThrows { assertTimeout(ofMillis(10), "Tempus Fugit") { nap() - "Tempus Fugit" } } assertMessageStartsWith(error, "Tempus Fugit ==> execution exceeded timeout of 10 ms by") @@ -143,7 +140,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val error = assertThrows { assertTimeout(ofMillis(10), { "Tempus" + " " + "Fugit" }) { nap() - "Tempus Fugit" } } assertMessageStartsWith(error, "Tempus Fugit ==> execution exceeded timeout of 10 ms by") @@ -225,7 +221,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val exception = assertThrows { assertTimeoutPreemptively(ofMillis(500)) { ExceptionUtils.throwAsUncheckedException(RuntimeException("not this time")) - "Tempus Fugit" } } assertMessageEquals(exception, "not this time") @@ -246,7 +241,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val error = assertThrows { assertTimeoutPreemptively(ofMillis(10)) { waitForInterrupt() - "Tempus Fugit" } } assertMessageEquals(error, "execution timed out after 10 ms") @@ -257,7 +251,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val error = assertThrows { assertTimeoutPreemptively(ofMillis(10), "Tempus Fugit") { waitForInterrupt() - "Tempus Fugit" } } assertMessageEquals(error, "Tempus Fugit ==> execution timed out after 10 ms") @@ -268,7 +261,6 @@ internal class KotlinAssertTimeoutAssertionsTests { val error = assertThrows { assertTimeoutPreemptively(ofMillis(10), { "Tempus" + " " + "Fugit" }) { waitForInterrupt() - "Tempus Fugit" } } assertMessageEquals(error, "Tempus Fugit ==> execution timed out after 10 ms") From fdac06b72901f83da28691019cfc305e1163d7a0 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 26 Nov 2020 11:35:04 +0100 Subject: [PATCH 0082/1433] Upgrade test-retry plugin to 1.2.0 --- buildSrc/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 264c69ea5c3d..e73569dac287 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -12,5 +12,5 @@ dependencies { implementation("de.marcphilipp.gradle:nexus-publish-plugin:0.4.0") implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.2.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") - implementation("org.gradle:test-retry-gradle-plugin:1.1.8") + implementation("org.gradle:test-retry-gradle-plugin:1.2.0") } From 072b480061d955cec889d4c62f7de8e2b87059df Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 27 Nov 2020 15:28:14 +0100 Subject: [PATCH 0083/1433] Upgradle to 6.8-rc-1 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8174453a1aa1..33de58d960ab 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=3239b5ed86c3838a37d983ac100573f64c1f3fd8e1eb6c89fa5f9529b5ec091d -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionSha256Sum=155bafc3a46f81b7af481ad7dba391a3b9c12818f27da8684178ffeaa40e6d7e +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From d54bb96ebd55a84b756ebb1792d702d33a038b20 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 27 Nov 2020 15:56:13 +0100 Subject: [PATCH 0084/1433] Upgrade Groovy for JDK 16 support --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c2503f2e7e58..2c7505dc7b08 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,7 +31,7 @@ bartholdy.version=0.2.3 classgraph.version=4.8.87 commons-io.version=2.7 kotlinx-coroutines-core.version=1.3.9 -groovy.version=3.0.5 +groovy.version=3.0.6 log4j.version=2.13.3 mockito.version=3.5.0 slf4j.version=1.7.30 From 047f739852d4d29b21f329c9ef9b6325df88a626 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 27 Nov 2020 16:22:47 +0100 Subject: [PATCH 0085/1433] Pin Groovy compilation to use JDK 15 for now --- .../src/main/kotlin/java-toolchain-conventions.gradle.kts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index 7fcb690a3f0f..e87c039a0fc5 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile val javaToolchainVersion: String? by project -val defaultLanguageVersion = JavaLanguageVersion.of(15)!! +val defaultLanguageVersion = JavaLanguageVersion.of(15) val javaLanguageVersion = javaToolchainVersion?.let { JavaLanguageVersion.of(it) } ?: defaultLanguageVersion project.pluginManager.withPlugin("java") { @@ -17,6 +17,12 @@ project.pluginManager.withPlugin("java") { tasks.withType().configureEach { javaCompiler.set(compiler) } + tasks.withType().configureEach { + javaLauncher.set(javaToolchainService.launcherFor { + // Groovy does not yet support JDK 16, see https://issues.apache.org/jira/browse/GROOVY-9752 + languageVersion.set(defaultLanguageVersion) + }) + } tasks.withType().configureEach { javaLauncher.set(javaToolchainService.launcherFor(extension.toolchain)) } From f35ec81e2dfaaa7d4ba3373e0966d8070c17693e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 27 Nov 2020 17:30:50 +0100 Subject: [PATCH 0086/1433] Enable build scans and build cache for CodeQL builds --- .github/workflows/codeql-analysis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 89f58eef355c..edff8a72224e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,6 +14,11 @@ on: schedule: - cron: '0 19 * * 3' +env: + ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} + ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} + ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' + jobs: analyze: name: Analyze @@ -68,6 +73,10 @@ jobs: # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project # uses a compiled language + - name: Prepare Gradle Enterprise credentials + run: | + mkdir -p $HOME/.gradle/enterprise/ + echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties - name: Build run: | ./gradlew --version From d1234f1c23eef133c68283faa58ccac048cdfcd5 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 27 Nov 2020 17:47:31 +0100 Subject: [PATCH 0087/1433] Use javaLanguageVersion if its less than 15 --- buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index e87c039a0fc5..d50db99d8856 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -20,7 +20,7 @@ project.pluginManager.withPlugin("java") { tasks.withType().configureEach { javaLauncher.set(javaToolchainService.launcherFor { // Groovy does not yet support JDK 16, see https://issues.apache.org/jira/browse/GROOVY-9752 - languageVersion.set(defaultLanguageVersion) + languageVersion.set(minOf(javaLanguageVersion, defaultLanguageVersion)) }) } tasks.withType().configureEach { From 3bda349ece20004adb1cc49df1000dfa596d6ed5 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 28 Nov 2020 16:51:06 +0100 Subject: [PATCH 0088/1433] Disable build cache for CodeQL build again --- .github/workflows/codeql-analysis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index edff8a72224e..0721acc252b7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -15,8 +15,6 @@ on: - cron: '0 19 * * 3' env: - ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} - ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' jobs: From 177d808f886355fac552aee9495212a4041c0316 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 28 Nov 2020 17:01:00 +0100 Subject: [PATCH 0089/1433] Disable reading from the remote build cache for the CodeQL build --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0721acc252b7..de13166399f7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -78,7 +78,7 @@ jobs: - name: Build run: | ./gradlew --version - ./gradlew allMainClasses -PjavaToolchainVersion=11 + ./gradlew --no-build-cache allMainClasses -PjavaToolchainVersion=11 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 From c797e6fd9d55445292e3212b9ba91151d846de28 Mon Sep 17 00:00:00 2001 From: Yuri Orlov Date: Mon, 7 Dec 2020 21:03:11 +0300 Subject: [PATCH 0090/1433] More straightforward usage of Optional (#2467) --- .../engine/extension/DisabledCondition.java | 18 ++++++++---------- .../conditions/IgnoreCondition.java | 19 ++++++++----------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java index 1b0a2b264ad4..7c08d520209c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java @@ -13,7 +13,6 @@ import static org.junit.platform.commons.util.AnnotationUtils.findAnnotation; import java.lang.reflect.AnnotatedElement; -import java.util.Optional; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.extension.ConditionEvaluationResult; @@ -39,15 +38,14 @@ class DisabledCondition implements ExecutionCondition { */ @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { - Optional element = context.getElement(); - Optional disabled = findAnnotation(element, Disabled.class); - if (disabled.isPresent()) { - String reason = disabled.map(Disabled::value).filter(StringUtils::isNotBlank).orElseGet( - () -> element.get() + " is @Disabled"); - return ConditionEvaluationResult.disabled(reason); - } - - return ENABLED; + AnnotatedElement element = context.getElement().orElse(null); + return findAnnotation(element, Disabled.class).map(annotation -> toResult(element, annotation)).orElse(ENABLED); + } + + private ConditionEvaluationResult toResult(AnnotatedElement element, Disabled annotation) { + String value = annotation.value(); + String reason = StringUtils.isNotBlank(value) ? value : element + " is @Disabled"; + return ConditionEvaluationResult.disabled(reason); } } diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java index 2c9c7ed6750e..c56ae0b5ef0b 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java @@ -14,7 +14,6 @@ import static org.junit.platform.commons.util.AnnotationUtils.findAnnotation; import java.lang.reflect.AnnotatedElement; -import java.util.Optional; import org.apiguardian.api.API; import org.junit.Ignore; @@ -45,16 +44,14 @@ public class IgnoreCondition implements ExecutionCondition { */ @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { - Optional element = context.getElement(); - Optional ignoreAnnotation = findAnnotation(element, Ignore.class); - if (ignoreAnnotation.isPresent()) { - String reason = ignoreAnnotation.map(Ignore::value) // - .filter(StringUtils::isNotBlank) // - .orElseGet(() -> element.get() + " is disabled via @org.junit.Ignore"); - return ConditionEvaluationResult.disabled(reason); - } - - return ENABLED; + AnnotatedElement element = context.getElement().orElse(null); + return findAnnotation(element, Ignore.class).map(annotation -> toResult(element, annotation)).orElse(ENABLED); + } + + private ConditionEvaluationResult toResult(AnnotatedElement element, Ignore annotation) { + String value = annotation.value(); + String reason = StringUtils.isNotBlank(value) ? value : element + " is disabled via @org.junit.Ignore"; + return ConditionEvaluationResult.disabled(reason); } } From f407ee7166ee5622bf2c121d66fd0854b7ddb0ac Mon Sep 17 00:00:00 2001 From: Juliette de Rancourt Date: Mon, 7 Dec 2020 19:10:38 +0100 Subject: [PATCH 0091/1433] Format code introduced in #2467 --- .../org/junit/jupiter/engine/extension/DisabledCondition.java | 4 +++- .../jupiter/migrationsupport/conditions/IgnoreCondition.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java index 7c08d520209c..1dcaa184b829 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java @@ -39,7 +39,9 @@ class DisabledCondition implements ExecutionCondition { @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { AnnotatedElement element = context.getElement().orElse(null); - return findAnnotation(element, Disabled.class).map(annotation -> toResult(element, annotation)).orElse(ENABLED); + return findAnnotation(element, Disabled.class) // + .map(annotation -> toResult(element, annotation)) // + .orElse(ENABLED); } private ConditionEvaluationResult toResult(AnnotatedElement element, Disabled annotation) { diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java index c56ae0b5ef0b..f99562fd0f0a 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java @@ -45,7 +45,9 @@ public class IgnoreCondition implements ExecutionCondition { @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { AnnotatedElement element = context.getElement().orElse(null); - return findAnnotation(element, Ignore.class).map(annotation -> toResult(element, annotation)).orElse(ENABLED); + return findAnnotation(element, Ignore.class) // + .map(annotation -> toResult(element, annotation)) // + .orElse(ENABLED); } private ConditionEvaluationResult toResult(AnnotatedElement element, Ignore annotation) { From f1fb1b1b15f64e927343817214922491432896a0 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Wed, 9 Dec 2020 12:19:41 +0100 Subject: [PATCH 0092/1433] Check only non-static methods in extension composability tests See https://bugs.openjdk.java.net/browse/JDK-8159746 for details --- .../jupiter/api/extension/ExtensionComposabilityTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java index 2ef8886f4816..e76933bc0c0e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java @@ -67,12 +67,13 @@ void ensureJupiterExtensionApisAreComposable() { // 3) Dynamically implement all Extension APIs Object dynamicKitchenSinkExtension = Proxy.newProxyInstance(getClass().getClassLoader(), - extensionApis.toArray(new Class[extensionApis.size()]), (proxy, method, args) -> null); + extensionApis.toArray(Class[]::new), (proxy, method, args) -> null); // 4) Determine what ended up in the kitchen sink... // @formatter:off List actualMethods = Arrays.stream(dynamicKitchenSinkExtension.getClass().getDeclaredMethods()) + .filter(ReflectionUtils::isNotStatic) .collect(toList()); List actualMethodSignatures = actualMethods.stream() From 7f5e22536b26a99b310f565de7df9d8a0518b079 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 11 Dec 2020 13:24:16 +0100 Subject: [PATCH 0093/1433] Ensure consistent top-level test class legacy reporting names Prior to this commit, legacy reporting names of JUnit 3 suites were not the fully-qualified test class name but rather some textual description of the test suite (e.g. "TestSuite with 42 tests [example: ...]"). Now, the legacy reporting name of top-level test classes reported by the Vintage engine is always the fully-qualified test class name. --- .../docs/asciidoc/release-notes/release-notes-5.7.1.adoc | 3 ++- .../vintage/engine/descriptor/RunnerTestDescriptor.java | 7 +++++++ .../vintage/engine/VintageTestEngineDiscoveryTests.java | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index cfde0aa9a0f9..ffd50079431c 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -61,7 +61,8 @@ GitHub. ==== Bug Fixes -* ❓ +* The legacy reporting name of top-level test classes is now always their fully-qualified + class name. Previously, a textual description was returned for JUnit 3 suites. ==== Deprecations and Breaking Changes diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java index b5a03cc5560f..efd386a04df0 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java @@ -21,6 +21,7 @@ import java.util.function.Consumer; import org.apiguardian.api.API; +import org.junit.platform.commons.JUnitException; import org.junit.platform.commons.logging.Logger; import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.engine.UniqueId; @@ -50,6 +51,12 @@ public RunnerTestDescriptor(UniqueId uniqueId, Class testClass, Runner runner this.runner = runner; } + @Override + public String getLegacyReportingName() { + return getSource().map(source -> ((ClassSource) source).getClassName()) // + .orElseThrow(() -> new JUnitException("source should have been present")); + } + public Request toRequest() { return new RunnerRequest(this.runner); } diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java index e15ed6ace3f6..ef40db7b40af 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java @@ -167,6 +167,10 @@ void resolvesJUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails() throws Exce var suiteDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertRunnerTestDescriptor(suiteDescriptor, suiteClass); + assertThat(suiteDescriptor.getDisplayName()).describedAs("display name") // + .startsWith(suiteClass.getSimpleName()); + assertThat(suiteDescriptor.getLegacyReportingName()).describedAs("legacy reporting name") // + .isEqualTo(suiteClass.getName()); var testClassDescriptor = getOnlyElement(suiteDescriptor.getChildren()); assertContainerTestDescriptor(testClassDescriptor, suiteClass, testClass); From 4afd0fcb3cd1a3345361ca05dfe414231c1e8040 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 12 Dec 2020 11:11:00 +0100 Subject: [PATCH 0094/1433] Use fine-grained normalization for jar manifests Instead of ignoring the entire manifest including OSGi metadata and other attributes that may potentiallt influence the tests' outcome, we now only include specific, inconsequential attributes such as timestamps and the commit checksum. --- .../kotlin/java-library-conventions.gradle.kts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index da74eb53f918..cd3b0b40b179 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -129,10 +129,16 @@ if (project in mavenizedProjects) { normalization { runtimeClasspath { - // Ignore the JAR manifest when checking whether runtime classpath have changed - // because it contains timestamps and the commit checksum. This is used when - // checking whether a test task is up-to-date or can be loaded from the build cache. - ignore("/META-INF/MANIFEST.MF") + metaInf { + // Ignore inconsequential JAR manifest attributes such as timestamps and the commit checksum. + // This is used when checking whether runtime classpaths, e.g. of test tasks, have changed and + // improves cacheability of such tasks. + ignoreAttribute("Built-By") + ignoreAttribute("Build-Date") + ignoreAttribute("Build-Time") + ignoreAttribute("Build-Revision") + ignoreAttribute("Created-By") + } } } From 05e9fb569202b00972b07029778a2e8fbe390bdd Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 13 Dec 2020 14:30:01 +0100 Subject: [PATCH 0095/1433] Introduce utility method for processing all destroyed test instances The new utility method helps to ensure all test instances are processed by a `TestInstancePreDestroyCallback` when used in conjunction with `@Nested` tests. Resolves #2430. --- .../release-notes/release-notes-5.7.1.adoc | 2 + .../TestInstancePreDestroyCallback.java | 67 ++++++++++- .../ExtensionComposabilityTests.java | 3 + .../engine/TestInstanceLifecycleTests.java | 1 + ...ePreDestroyCallbackUtilityMethodTests.java | 111 ++++++++++++++++++ 5 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index ffd50079431c..f64441794e82 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -54,6 +54,8 @@ GitHub. ==== New Features and Improvements * The user guide now explains Nested Tests in more detail. +* New utility method in `TestInstancePreDestroyCallback` helps to ensure all test + instances are processed when used in conjunction with `@Nested` tests. [[release-notes-5.7.1-junit-vintage]] diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java index d64b4bee0807..815d89cedc3f 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java @@ -10,9 +10,18 @@ package org.junit.jupiter.api.extension; +import static org.apiguardian.api.API.Status.EXPERIMENTAL; import static org.apiguardian.api.API.Status.STABLE; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.function.Consumer; + import org.apiguardian.api.API; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.TestInstance.Lifecycle; /** * {@code TestInstancePreDestroyCallback} defines the API for {@link Extension @@ -24,9 +33,9 @@ * *

    Extensions that implement {@code TestInstancePreDestroyCallback} must be * registered at the class level if the test class is configured with - * {@link org.junit.jupiter.api.TestInstance.Lifecycle @TestInstance(Lifecycle.PER_CLASS)} + * {@link Lifecycle @TestInstance(Lifecycle.PER_CLASS)} * semantics. If the test class is configured with - * {@link org.junit.jupiter.api.TestInstance.Lifecycle @TestInstance(Lifecycle.PER_METHOD)} + * {@link Lifecycle @TestInstance(Lifecycle.PER_METHOD)} * semantics, {@code TestInstancePreDestroyCallback} extensions may be registered * at the class level or at the method level. In the latter case, the * {@code TestInstancePreDestroyCallback} extension will only be applied to the @@ -48,12 +57,64 @@ public interface TestInstancePreDestroyCallback extends Extension { /** - * Callback for processing a test instance before it is destroyed. + * Callback for processing test instances before they are destroyed. + * + *

    Contrary to {@link TestInstancePostProcessor#postProcessTestInstance} + * this method is only called once for each {@link ExtensionContext} even if + * there are multiple test instances about to be destroyed in case of + * {@link Nested @Nested} tests. Please use the provided + * {@link #preDestroyTestInstances(ExtensionContext, Consumer)} utility + * method to ensure that all test instances are handled. * * @param context the current extension context; never {@code null} * @see ExtensionContext#getTestInstance() * @see ExtensionContext#getRequiredTestInstance() + * @see ExtensionContext#getTestInstances() + * @see ExtensionContext#getRequiredTestInstances() + * @see #preDestroyTestInstances(ExtensionContext, Consumer) */ void preDestroyTestInstance(ExtensionContext context) throws Exception; + /** + * Utility method for processing all test instances of an + * {@link ExtensionContext} that are not present in any of its parent + * contexts. + * + *

    This method should be called in order to implement this interface + * correctly since it ensures that the right test instances are processed + * regardless of the used {@linkplain Lifecycle lifecycle}. The supplied + * callback is called once per test instance that is about to be destroyed + * starting with the innermost one. + * + *

    This method is intended to be called from an implementation of + * {@link #preDestroyTestInstance(ExtensionContext)} like this: + * + *

    {@code
    +	 * class MyExtension implements TestInstancePreDestroyCallback {
    +	 *     @Override
    +	 *     public void preDestroyTestInstance(ExtensionContext context) {
    +	 *         TestInstancePreDestroyCallback.preDestroyTestInstances(context, testInstance -> {
    +	 *             // custom logic that processes testInstance
    +	 *         });
    +	 *     }
    +	 * }
    +	 * }
    + * + * @param context the current extension context; never {@code null} + * @param callback the callback to be invoked for every test instance of the + * current extension context that is about to be destroyed; never + * {@code null} + * @since 5.7.1 + */ + @API(status = EXPERIMENTAL, since = "5.7.1") + static void preDestroyTestInstances(ExtensionContext context, Consumer callback) { + List destroyedInstances = new ArrayList<>(context.getRequiredTestInstances().getAllInstances()); + for (Optional current = context.getParent(); current.isPresent(); current = current.get().getParent()) { + current.get().getTestInstances().map(TestInstances::getAllInstances).ifPresent( + destroyedInstances::removeAll); + } + Collections.reverse(destroyedInstances); + destroyedInstances.forEach(callback); + } + } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java index e76933bc0c0e..254cd4e25095 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java @@ -14,8 +14,10 @@ import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.platform.commons.util.FunctionUtils.where; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.lang.reflect.Proxy; import java.util.Arrays; import java.util.List; @@ -51,6 +53,7 @@ void ensureJupiterExtensionApisAreComposable() { .map(Class::getDeclaredMethods) .flatMap(Arrays::stream) .filter(not(Method::isSynthetic)) + .filter(not(where(Method::getModifiers, Modifier::isStatic))) .collect(toList()); List expectedMethodSignatures = expectedMethods.stream() diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java index b9f53f743602..fd160212ff55 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java @@ -455,6 +455,7 @@ void instancePerClassWithNestedTestClass() { assertSame(nestedInstance, instanceMap.get(nestedPreDestroyCallbackTestInstanceKey).getInnermostInstance()); Object outerInstance = instanceMap.get(nestedExecutionConditionKey1).findInstance(testClass).get(); + assertSame(outerInstance, instance); assertSame(outerInstance, instanceMap.get(postProcessTestInstanceKey).getInnermostInstance()); assertSame(outerInstance, instanceMap.get(preDestroyCallbackTestInstanceKey).getInnermostInstance()); diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java new file mode 100644 index 000000000000..f6f5c3908239 --- /dev/null +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java @@ -0,0 +1,111 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.extension; + +import static org.junit.jupiter.api.DynamicTest.dynamicTest; +import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; +import static org.junit.platform.testkit.engine.EventConditions.event; +import static org.junit.platform.testkit.engine.EventConditions.reportEntry; +import static org.junit.platform.testkit.engine.EventConditions.started; +import static org.junit.platform.testkit.engine.EventConditions.test; + +import java.util.Map; +import java.util.stream.Stream; + +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestFactory; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.TestInstancePostProcessor; +import org.junit.jupiter.api.extension.TestInstancePreDestroyCallback; +import org.junit.jupiter.engine.AbstractJupiterTestEngineTests; + +public class TestInstancePreDestroyCallbackUtilityMethodTests extends AbstractJupiterTestEngineTests { + + @TestFactory + Stream destroysWhatWasPostProcessed() { + var testClasses = Stream.of(PerMethodLifecycleOnAllLevels.class, PerMethodWithinPerClassLifecycle.class, + PerClassWithinPerMethodLifecycle.class, PerClassLifecycleOnAllLevels.class); + return testClasses.map(testClass -> dynamicTest( // + testClass.getSimpleName(), // + () -> executeTestsForClass(testClass).allEvents().debug() // + .assertStatistics(stats -> stats.reportingEntryPublished(4)) // + .assertEventsMatchLooselyInOrder( // + reportEntry(Map.of("post-process", testClass.getSimpleName())), + reportEntry(Map.of("post-process", "Inner")), // + event(test(), started()), // + reportEntry(Map.of("pre-destroy", "Inner")), // + reportEntry(Map.of("pre-destroy", testClass.getSimpleName())) // + ))); + } + + @ExtendWith(TestInstanceLifecycleExtension.class) + static class PerMethodLifecycleOnAllLevels { + @Nested + class Inner { + @Test + void test() { + } + } + } + + @ExtendWith(TestInstanceLifecycleExtension.class) + @TestInstance(PER_CLASS) + static class PerMethodWithinPerClassLifecycle { + @Nested + class Inner { + @Test + void test() { + } + } + } + + @ExtendWith(TestInstanceLifecycleExtension.class) + static class PerClassWithinPerMethodLifecycle { + @Nested + @TestInstance(PER_CLASS) + class Inner { + @Test + void test() { + } + } + } + + @ExtendWith(TestInstanceLifecycleExtension.class) + @TestInstance(PER_CLASS) + static class PerClassLifecycleOnAllLevels { + @Nested + @TestInstance(PER_CLASS) + class Inner { + @Test + void test() { + } + } + } + + private static class TestInstanceLifecycleExtension + implements TestInstancePostProcessor, TestInstancePreDestroyCallback { + + @Override + public void postProcessTestInstance(Object testInstance, ExtensionContext context) { + context.publishReportEntry("post-process", testInstance.getClass().getSimpleName()); + } + + @Override + public void preDestroyTestInstance(ExtensionContext context) { + TestInstancePreDestroyCallback.preDestroyTestInstances(context, + testInstance -> context.publishReportEntry("pre-destroy", testInstance.getClass().getSimpleName())); + } + } +} From 40102f747192cd4a15456c92141dfefce9f87c47 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 13 Dec 2020 15:15:33 +0100 Subject: [PATCH 0096/1433] Improve Javadoc formatting --- .../TestInstancePreDestroyCallback.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java index 815d89cedc3f..f9509fdcee7a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java @@ -89,16 +89,14 @@ public interface TestInstancePreDestroyCallback extends Extension { *

    This method is intended to be called from an implementation of * {@link #preDestroyTestInstance(ExtensionContext)} like this: * - *

    {@code
    -	 * class MyExtension implements TestInstancePreDestroyCallback {
    -	 *     @Override
    -	 *     public void preDestroyTestInstance(ExtensionContext context) {
    -	 *         TestInstancePreDestroyCallback.preDestroyTestInstances(context, testInstance -> {
    -	 *             // custom logic that processes testInstance
    -	 *         });
    -	 *     }
    -	 * }
    -	 * }
    + *
    {@code class MyExtension implements TestInstancePreDestroyCallback {
    +	 *    @Override
    +	 *    public void preDestroyTestInstance(ExtensionContext context) {
    +	 *        TestInstancePreDestroyCallback.preDestroyTestInstances(context, testInstance -> {
    +	 *            // custom logic that processes testInstance
    +	 *        });
    +	 *    }
    +	 *}}
    * * @param context the current extension context; never {@code null} * @param callback the callback to be invoked for every test instance of the From 999c3abc782981a6d1564c4681ef6559a30b6a28 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 15 Dec 2020 20:12:13 +0100 Subject: [PATCH 0097/1433] Add JDK 17 build --- .github/workflows/cross-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index bd50c289812d..f6094e86692e 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -18,7 +18,7 @@ jobs: openjdk: strategy: matrix: - jdk: [16] + jdk: [16, 17] name: "OpenJDK ${{ matrix.jdk }}" runs-on: ubuntu-latest container: "ghcr.io/junit-team/build:${{ matrix.jdk }}" From 69c9f12402b7102f6fba5a77eff7f867da2c3b07 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 15 Dec 2020 20:37:54 +0100 Subject: [PATCH 0098/1433] Add temporary workaround for JavaCompile tasks --- buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index d50db99d8856..7d97f10b2479 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -16,6 +16,8 @@ project.pluginManager.withPlugin("java") { } tasks.withType().configureEach { javaCompiler.set(compiler) + // Temporary workaround for https://github.com/gradle/gradle/issues/15538 + options.forkOptions.jvmArgs!!.addAll(listOf("--add-opens", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED")) } tasks.withType().configureEach { javaLauncher.set(javaToolchainService.launcherFor { From 24612eda66861c71d8a230c74de38f03ebd8f551 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 15 Dec 2020 20:42:27 +0100 Subject: [PATCH 0099/1433] Add JRE.JAVA_17 --- .../release-notes/release-notes-5.7.1.adoc | 1 + .../java/org/junit/jupiter/api/condition/JRE.java | 14 ++++++++++++-- .../DisabledForJreRangeConditionTests.java | 3 ++- .../DisabledForJreRangeIntegrationTests.java | 3 ++- .../condition/DisabledOnJreConditionTests.java | 12 +++++++++++- .../condition/DisabledOnJreIntegrationTests.java | 12 ++++++++++-- .../EnabledForJreRangeConditionTests.java | 3 ++- .../EnabledForJreRangeIntegrationTests.java | 6 ++++-- .../api/condition/EnabledOnJreConditionTests.java | 12 +++++++++++- .../condition/EnabledOnJreIntegrationTests.java | 15 +++++++++++++-- 10 files changed, 68 insertions(+), 13 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index f64441794e82..4b776d75d361 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -56,6 +56,7 @@ GitHub. * The user guide now explains Nested Tests in more detail. * New utility method in `TestInstancePreDestroyCallback` helps to ensure all test instances are processed when used in conjunction with `@Nested` tests. +* `JAVA_17` has been added to the `JRE` enum for use with JRE-based execution conditions. [[release-notes-5.7.1-junit-vintage]] diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java index f72a69a2068f..97dea28c3bc8 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java @@ -106,11 +106,19 @@ public enum JRE { @API(status = STABLE, since = "5.7") JAVA_16, + /** + * Java 17. + * + * @since 5.7.1 + */ + @API(status = STABLE, since = "5.7.1") + JAVA_17, + /** * A JRE version other than {@link #JAVA_8}, {@link #JAVA_9}, * {@link #JAVA_10}, {@link #JAVA_11}, {@link #JAVA_12}, - * {@link #JAVA_13}, {@link #JAVA_14}, {@link #JAVA_15}, or - * {@link #JAVA_16}. + * {@link #JAVA_13}, {@link #JAVA_14}, {@link #JAVA_15}, + * {@link #JAVA_16}, or {@link #JAVA_17}. */ OTHER; @@ -156,6 +164,8 @@ private static JRE determineCurrentVersion() { return JAVA_15; case 16: return JAVA_16; + case 17: + return JAVA_17; default: return OTHER; } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java index 12e8f810689e..d4ac17ad137e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java @@ -18,6 +18,7 @@ import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava14; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava15; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava16; +import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava17; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava8; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava9; @@ -118,7 +119,7 @@ void javaMin10() { void other() { evaluateCondition(); assertDisabledOnCurrentJreIf(!(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() - || onJava14() || onJava15() || onJava16())); + || onJava14() || onJava15() || onJava16() || onJava17())); } private void assertDisabledOnCurrentJreIf(boolean condition) { diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java index a3e7ff1b744e..e6433a92deb1 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava14; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava15; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava16; +import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava17; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava8; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava9; import static org.junit.jupiter.api.condition.JRE.JAVA_10; @@ -85,7 +86,7 @@ void javaMin10() { @DisabledForJreRange(min = OTHER, max = OTHER) void other() { assertTrue(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() || onJava14() - || onJava15() || onJava16()); + || onJava15() || onJava16() || onJava17()); } } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java index e009330c952f..459a95adaf57 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java @@ -19,6 +19,7 @@ import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava14; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava15; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava16; +import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava17; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava8; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava9; @@ -156,6 +157,15 @@ void java16() { assertDisabledOnCurrentJreIf(onJava16()); } + /** + * @see DisabledOnJreIntegrationTests#java17() + */ + @Test + void java17() { + evaluateCondition(); + assertDisabledOnCurrentJreIf(onJava17()); + } + /** * @see DisabledOnJreIntegrationTests#other() */ @@ -163,7 +173,7 @@ void java16() { void other() { evaluateCondition(); assertDisabledOnCurrentJreIf(!(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() - || onJava14() || onJava15() || onJava16())); + || onJava14() || onJava15() || onJava16() || onJava17())); } private void assertDisabledOnCurrentJreIf(boolean condition) { diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java index 8fd050cc6166..16bd2d922e53 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava14; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava15; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava16; +import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava17; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava8; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava9; import static org.junit.jupiter.api.condition.JRE.JAVA_10; @@ -29,6 +30,7 @@ import static org.junit.jupiter.api.condition.JRE.JAVA_14; import static org.junit.jupiter.api.condition.JRE.JAVA_15; import static org.junit.jupiter.api.condition.JRE.JAVA_16; +import static org.junit.jupiter.api.condition.JRE.JAVA_17; import static org.junit.jupiter.api.condition.JRE.JAVA_8; import static org.junit.jupiter.api.condition.JRE.JAVA_9; import static org.junit.jupiter.api.condition.JRE.OTHER; @@ -55,7 +57,7 @@ void missingJreDeclaration() { } @Test - @DisabledOnJre(value = { JAVA_8, JAVA_9, JAVA_10, JAVA_11, JAVA_12, JAVA_13, JAVA_14, JAVA_15, JAVA_16, + @DisabledOnJre(value = { JAVA_8, JAVA_9, JAVA_10, JAVA_11, JAVA_12, JAVA_13, JAVA_14, JAVA_15, JAVA_16, JAVA_17, OTHER }, disabledReason = "Disabled on every JRE") void disabledOnAllJavaVersions() { fail("should be disabled"); @@ -115,11 +117,17 @@ void java16() { assertFalse(onJava16()); } + @Test + @DisabledOnJre(JAVA_17) + void java17() { + assertFalse(onJava17()); + } + @Test @DisabledOnJre(OTHER) void other() { assertTrue(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() || onJava14() - || onJava15() || onJava16()); + || onJava15() || onJava16() || onJava17()); } } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java index 0206555fd256..135e7a47f92e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java @@ -18,6 +18,7 @@ import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava14; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava15; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava16; +import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava17; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava8; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava9; @@ -118,7 +119,7 @@ void javaMin10() { void other() { evaluateCondition(); assertEnabledOnCurrentJreIf(!(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() - || onJava14() || onJava15() || onJava16())); + || onJava14() || onJava15() || onJava16() || onJava17())); } private void assertEnabledOnCurrentJreIf(boolean condition) { diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java index 218b4a236d33..8aacf053e46a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java @@ -20,6 +20,7 @@ import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava14; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava15; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava16; +import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava17; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava8; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava9; import static org.junit.jupiter.api.condition.JRE.JAVA_10; @@ -81,7 +82,8 @@ void javaMax12() { @Test @EnabledForJreRange(min = JAVA_10) void javaMin10() { - assertTrue(onJava10() || onJava11() || onJava12() || onJava13() || onJava14() || onJava15() || onJava16()); + assertTrue(onJava10() || onJava11() || onJava12() || onJava13() || onJava14() || onJava15() || onJava16() + || onJava17()); assertFalse(onJava9()); } @@ -89,7 +91,7 @@ void javaMin10() { @EnabledForJreRange(min = OTHER, max = OTHER) void other() { assertFalse(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() || onJava14() - || onJava15() || onJava16()); + || onJava15() || onJava16() || onJava17()); } } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java index bb3111d6d96a..fbda32fcd4c5 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java @@ -19,6 +19,7 @@ import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava14; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava15; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava16; +import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava17; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava8; import static org.junit.jupiter.api.condition.EnabledOnJreIntegrationTests.onJava9; @@ -155,6 +156,15 @@ void java16() { assertEnabledOnCurrentJreIf(onJava16()); } + /** + * @see EnabledOnJreIntegrationTests#java17() + */ + @Test + void java17() { + evaluateCondition(); + assertEnabledOnCurrentJreIf(onJava17()); + } + /** * @see EnabledOnJreIntegrationTests#other() */ @@ -162,7 +172,7 @@ void java16() { void other() { evaluateCondition(); assertEnabledOnCurrentJreIf(!(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() - || onJava14() || onJava15() || onJava16())); + || onJava14() || onJava15() || onJava16() || onJava17())); assertCustomDisabledReasonIs("Disabled on almost every JRE"); } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java index 9299b994e78d..8fb9d0902ca6 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java @@ -19,6 +19,7 @@ import static org.junit.jupiter.api.condition.JRE.JAVA_14; import static org.junit.jupiter.api.condition.JRE.JAVA_15; import static org.junit.jupiter.api.condition.JRE.JAVA_16; +import static org.junit.jupiter.api.condition.JRE.JAVA_17; import static org.junit.jupiter.api.condition.JRE.JAVA_8; import static org.junit.jupiter.api.condition.JRE.JAVA_9; import static org.junit.jupiter.api.condition.JRE.OTHER; @@ -47,7 +48,7 @@ void missingJreDeclaration() { } @Test - @EnabledOnJre({ JAVA_8, JAVA_9, JAVA_10, JAVA_11, JAVA_12, JAVA_13, JAVA_14, JAVA_15, JAVA_16, OTHER }) + @EnabledOnJre({ JAVA_8, JAVA_9, JAVA_10, JAVA_11, JAVA_12, JAVA_13, JAVA_14, JAVA_15, JAVA_16, JAVA_17, OTHER }) void enabledOnAllJavaVersions() { } @@ -105,11 +106,17 @@ void java16() { assertTrue(onJava16()); } + @Test + @EnabledOnJre(JAVA_17) + void java17() { + assertTrue(onJava17()); + } + @Test @EnabledOnJre(value = OTHER, disabledReason = "Disabled on almost every JRE") void other() { assertFalse(onJava8() || onJava9() || onJava10() || onJava11() || onJava12() || onJava13() || onJava14() - || onJava15() || onJava16()); + || onJava15() || onJava16() || onJava17()); } static boolean onJava8() { @@ -148,4 +155,8 @@ static boolean onJava16() { return JAVA_VERSION.startsWith("16"); } + static boolean onJava17() { + return JAVA_VERSION.startsWith("17"); + } + } From 7726e0e17db94538b788a0e9c91f28ae081b1b82 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 15 Dec 2020 21:49:09 +0100 Subject: [PATCH 0100/1433] Fix Kotlin compiler warnings in buildSrc --- buildSrc/build.gradle.kts | 12 ++++++++++++ .../src/main/kotlin/java-repackage-jars.gradle.kts | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index e73569dac287..4e93d887d722 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { `kotlin-dsl` } @@ -14,3 +16,13 @@ dependencies { implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.gradle:test-retry-gradle-plugin:1.2.0") } + +kotlinDslPluginOptions { + experimentalWarning.set(false) +} + +tasks.withType().configureEach { + kotlinOptions { + allWarningsAsErrors = true + } +} diff --git a/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts b/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts index 507255835218..a000989b0327 100644 --- a/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts +++ b/buildSrc/src/main/kotlin/java-repackage-jars.gradle.kts @@ -2,6 +2,7 @@ import java.util.jar.JarEntry import java.util.jar.JarFile import java.util.jar.JarOutputStream import org.gradle.api.internal.file.archive.ZipCopyAction +import java.nio.file.Files // This registers a `doLast` action to rewrite the timestamps of the project's output JAR afterEvaluate { @@ -9,8 +10,8 @@ afterEvaluate { jarTask.doLast { - val newFile = createTempFile("rewrite-timestamp") - val originalOutput = jarTask.archiveFile.get().getAsFile() + val newFile = Files.createTempFile("rewrite-timestamp", null).toFile() + val originalOutput = jarTask.archiveFile.get().asFile newFile.outputStream().use { os -> From 591ef5487e5e1c12c1997b4d2959778fb23c1bd5 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 15 Dec 2020 21:49:59 +0100 Subject: [PATCH 0101/1433] Add default constructors explicitly --- .../kotlin/java-library-conventions.gradle.kts | 2 +- .../junit/jupiter/api/DisplayNameGenerator.java | 12 ++++++++++++ .../java/org/junit/jupiter/api/MethodOrderer.java | 14 ++++++++++++++ .../engine/config/DefaultJupiterConfiguration.java | 2 +- .../engine/descriptor/DisplayNameUtils.java | 12 ++++++++---- .../platform/engine/reporting/ReportEntry.java | 9 +++++++++ .../hierarchical/HierarchicalTestEngine.java | 3 +++ .../SameThreadHierarchicalTestExecutorService.java | 3 +++ 8 files changed, 51 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index cd3b0b40b179..137355d7b451 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -155,9 +155,9 @@ val compileModule by tasks.registering(JavaCompile::class) { classpath = files() options.release.set(9) options.compilerArgs.addAll(listOf( - // "-verbose", // Suppress warnings for automatic modules: org.apiguardian.api, org.opentest4j "-Xlint:all,-requires-automatic,-requires-transitive-automatic", + "-Werror", // Terminates compilation when warnings occur. "--module-version", "${project.version}", "--module-source-path", files(modularProjects.map { "${it.projectDir}/src/module" }).asPath )) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java index 42bb9821057c..94bba94d3bf1 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java @@ -92,6 +92,9 @@ class Standard implements DisplayNameGenerator { static final DisplayNameGenerator INSTANCE = new Standard(); + public Standard() { + } + @Override public String generateDisplayNameForClass(Class testClass) { String name = testClass.getName(); @@ -122,6 +125,9 @@ class Simple extends Standard { static final DisplayNameGenerator INSTANCE = new Simple(); + public Simple() { + } + @Override public String generateDisplayNameForMethod(Class testClass, Method testMethod) { String displayName = testMethod.getName(); @@ -148,6 +154,9 @@ class ReplaceUnderscores extends Simple { static final DisplayNameGenerator INSTANCE = new ReplaceUnderscores(); + public ReplaceUnderscores() { + } + @Override public String generateDisplayNameForClass(Class testClass) { return replaceUnderscores(super.generateDisplayNameForClass(testClass)); @@ -185,6 +194,9 @@ class IndicativeSentences implements DisplayNameGenerator { static final DisplayNameGenerator INSTANCE = new IndicativeSentences(); + public IndicativeSentences() { + } + @Override public String generateDisplayNameForClass(Class testClass) { return getGeneratorForIndicativeSentence(testClass).generateDisplayNameForClass(testClass); diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java index 9e57b0b28dcd..59d8f1318034 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java @@ -123,6 +123,8 @@ default Optional getDefaultExecutionMode() { @Deprecated class Alphanumeric extends MethodName { + public Alphanumeric() { + } } /** * {@code MethodOrderer} that sorts methods alphanumerically based on their @@ -136,6 +138,9 @@ class Alphanumeric extends MethodName { @API(status = EXPERIMENTAL, since = "5.7") class MethodName implements MethodOrderer { + public MethodName() { + } + /** * Sort the methods encapsulated in the supplied * {@link MethodOrdererContext} alphanumerically based on their names @@ -164,6 +169,9 @@ private static String parameterList(Method method) { @API(status = EXPERIMENTAL, since = "5.7") class DisplayName implements MethodOrderer { + public DisplayName() { + } + /** * Sort the methods encapsulated in the supplied * {@link MethodOrdererContext} alphanumerically based on their display @@ -195,6 +203,9 @@ public void orderMethods(MethodOrdererContext context) { */ class OrderAnnotation implements MethodOrderer { + public OrderAnnotation() { + } + /** * Sort the methods encapsulated in the supplied * {@link MethodOrdererContext} based on the {@link Order @Order} @@ -260,6 +271,9 @@ class Random implements MethodOrderer { */ public static final String RANDOM_SEED_PROPERTY_NAME = "junit.jupiter.execution.order.random.seed"; + public Random() { + } + /** * Order the methods encapsulated in the supplied * {@link MethodOrdererContext} pseudo-randomly. diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java index fe5b65b3acd4..13fdd46218ba 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java @@ -100,7 +100,7 @@ public Predicate getExecutionConditionFilter() { @Override public DisplayNameGenerator getDefaultDisplayNameGenerator() { return displayNameGeneratorConverter.get(configurationParameters, DEFAULT_DISPLAY_NAME_GENERATOR_PROPERTY_NAME) // - .orElseGet(DisplayNameGenerator.Standard::new); + .orElseGet(() -> DisplayNameGenerator.getDisplayNameGenerator(DisplayNameGenerator.Standard.class)); } @Override diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java index eb5cc106ccb8..1d1de39d685f 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java @@ -46,22 +46,26 @@ final class DisplayNameUtils { /** * Pre-defined standard display name generator instance. */ - private static final DisplayNameGenerator standardGenerator = new Standard(); + private static final DisplayNameGenerator standardGenerator = DisplayNameGenerator.getDisplayNameGenerator( + Standard.class); /** * Pre-defined simple display name generator instance. */ - private static final DisplayNameGenerator simpleGenerator = new Simple(); + private static final DisplayNameGenerator simpleGenerator = DisplayNameGenerator.getDisplayNameGenerator( + Simple.class); /** * Pre-defined display name generator instance replacing underscores. */ - private static final DisplayNameGenerator replaceUnderscoresGenerator = new ReplaceUnderscores(); + private static final DisplayNameGenerator replaceUnderscoresGenerator = DisplayNameGenerator.getDisplayNameGenerator( + ReplaceUnderscores.class); /** * Pre-defined display name generator instance producing indicative sentences. */ - private static final DisplayNameGenerator indicativeSentencesGenerator = new IndicativeSentences(); + private static final DisplayNameGenerator indicativeSentencesGenerator = DisplayNameGenerator.getDisplayNameGenerator( + IndicativeSentences.class); static String determineDisplayName(AnnotatedElement element, Supplier displayNameSupplier) { Preconditions.notNull(element, "Annotated element must not be null"); diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java index fa40437d52cb..6eb2ccaed2d9 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java @@ -10,6 +10,7 @@ package org.junit.platform.engine.reporting; +import static org.apiguardian.api.API.Status.DEPRECATED; import static org.apiguardian.api.API.Status.STABLE; import java.time.LocalDateTime; @@ -35,6 +36,14 @@ public final class ReportEntry { private final LocalDateTime timestamp = LocalDateTime.now(); private final Map keyValuePairs = new LinkedHashMap<>(); + /** + * @deprecated Use {@link #from(String, String)} or {@link #from(Map)} + */ + @API(status = DEPRECATED, since = "5.8") + @Deprecated + public ReportEntry() { + } + /** * Factory for creating a new {@code ReportEntry} from a map of key-value pairs. * diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java index 7506965c9f9a..ee8fbe153eb2 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java @@ -29,6 +29,9 @@ @API(status = MAINTAINED, since = "1.0") public abstract class HierarchicalTestEngine implements TestEngine { + public HierarchicalTestEngine() { + } + /** * Create an {@linkplain #createExecutorService(ExecutionRequest) executor * service}; create an initial {@linkplain #createExecutionContext execution diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java index 024aa3691360..5a5c3d3b8d68 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java @@ -27,6 +27,9 @@ @API(status = EXPERIMENTAL, since = "1.3") public class SameThreadHierarchicalTestExecutorService implements HierarchicalTestExecutorService { + public SameThreadHierarchicalTestExecutorService() { + } + @Override public Future submit(TestTask testTask) { testTask.execute(); From 637a78393194737e77d6f9681ad93e9ddac1f399 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 15 Dec 2020 21:50:17 +0100 Subject: [PATCH 0102/1433] Fix Kotlin compiler warning in test code --- buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts | 1 + .../junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts index 3342cd189501..9f0d594d327a 100644 --- a/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts @@ -10,5 +10,6 @@ tasks.withType().configureEach { jvmTarget = Versions.jvmTarget.toString() apiVersion = "1.3" languageVersion = "1.3" + allWarningsAsErrors = true } } diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt index 9d4d7a9d5e62..a7ba382c5d69 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt @@ -17,6 +17,7 @@ class ArbitraryNamingKotlinTestCase { val METHOD_NAME = "\uD83E\uDD86 ~|~test with a really, (really) terrible name & that needs to be changed!~|~" } + @Suppress("DANGEROUS_CHARACTERS") @Test fun `🦆 ~|~test with a really, (really) terrible name & that needs to be changed!~|~`() { } From 29bd012157992f90d4fcd711f22a1bd659fa7a1c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 17 Dec 2020 20:24:31 +0100 Subject: [PATCH 0103/1433] Upgradle to 6.8-rc-3 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 33de58d960ab..4adb35dc8035 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=155bafc3a46f81b7af481ad7dba391a3b9c12818f27da8684178ffeaa40e6d7e -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-1-bin.zip +distributionSha256Sum=6c929633a439d248413d3d1bff477195ee662ccadc6fdc31f6f50f8059a2be36 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 4035759b00662f5e545eacec56b5bd7c48f1132b Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 17 Dec 2020 20:16:13 +0100 Subject: [PATCH 0104/1433] Upgrade ArchUnit to 0.15.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2c7505dc7b08..f7bbdb97980a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ picocli.version=4.5.0 univocity-parsers.version=2.9.0 # Test Dependencies -archunit.version=0.14.1 +archunit.version=0.15.0 bartholdy.version=0.2.3 classgraph.version=4.8.87 commons-io.version=2.7 From 1d41adde0c53489f11ac1c16e1799ea76093edee Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 18 Dec 2020 20:38:18 +0100 Subject: [PATCH 0105/1433] Make it easier to dogfood junit-platform-jfr Then running the build with -PenableJFR we now capture a JFR recording in the test task's output folder. It's not enabled by default since the recording may contain potentially sensitive data, e.g. environement variables or system properties. --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 9 +++++++++ platform-tests/platform-tests.gradle.kts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 57a97e90247d..eb005c6d05df 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -20,6 +20,14 @@ tasks.withType().configureEach { systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") // Required until ASM officially supports the JDK 14 systemProperty("net.bytebuddy.experimental", true) + if (project.hasProperty("enableJFR")) { + jvmArgs( + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+DebugNonSafepoints", + "-XX:StartFlightRecording=filename=${reports.junitXml.destination},dumponexit=true,settings=profile.jfc", + "-XX:FlightRecorderOptions=stackdepth=1024" + ) + } } dependencies { @@ -37,6 +45,7 @@ dependencies { "testImplementation"(testFixtures(project(":junit-jupiter-api"))) "testRuntimeOnly"(project(":junit-platform-launcher")) + "testRuntimeOnly"(project(":junit-platform-jfr")) "testRuntimeOnly"("org.apache.logging.log4j:log4j-core") "testRuntimeOnly"("org.apache.logging.log4j:log4j-jul") diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 89662f6ee73d..2d25b3005045 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -53,7 +53,7 @@ tasks { useJUnitPlatform { excludeTags("exclude") } - jvmArgs = listOf("-Xmx1g") + jvmArgs("-Xmx1g") } test_4_12 { useJUnitPlatform { From bb6adb89498f15f365b1ecbfb2489bf537539e98 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 21 Dec 2020 12:14:13 +0100 Subject: [PATCH 0106/1433] Make line wrapping more consistent --- .../asciidoc/release-notes/release-notes-5.8.0-M1.adoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index b253ab9af374..c4fd5e82c249 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -19,9 +19,11 @@ on GitHub. ==== Deprecations and Breaking Changes -* `InvocationInterceptor.interceptDynamicTest(Invocation , ExtensionContext)` has been deprecated in favor of - `InvocationInterceptor.interceptDynamicTest(Invocation , DynamicTestInvocationContext, ExtensionContext)` that - allows to access the dynamic test executable via `DynamicTestInvocationContext.getExecutable()`. +* `InvocationInterceptor.interceptDynamicTest(Invocation , ExtensionContext)` has + been deprecated in favor of + `InvocationInterceptor.interceptDynamicTest(Invocation , DynamicTestInvocationContext, ExtensionContext)` + that allows to access the dynamic test executable via + `DynamicTestInvocationContext.getExecutable()`. ==== New Features and Improvements From 84f6ad9a9420c32b52d2479e7acf1663edbb6f36 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 21 Dec 2020 12:19:56 +0100 Subject: [PATCH 0107/1433] Remove "experimental" warning on promoted APIs --- .../docs/asciidoc/user-guide/migration-from-junit4.adoc | 6 ------ .../src/docs/asciidoc/user-guide/running-tests.adoc | 4 ---- documentation/src/docs/asciidoc/user-guide/testkit.adoc | 4 ---- .../src/docs/asciidoc/user-guide/writing-tests.adoc | 7 ------- 4 files changed, 21 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/migration-from-junit4.adoc b/documentation/src/docs/asciidoc/user-guide/migration-from-junit4.adoc index b3fb1ded6ed8..9f939692c1cf 100644 --- a/documentation/src/docs/asciidoc/user-guide/migration-from-junit4.adoc +++ b/documentation/src/docs/asciidoc/user-guide/migration-from-junit4.adoc @@ -98,9 +98,6 @@ all rule migration support extensions: `VerifierSupport`, `ExternalResourceSuppo However, if you intend to develop a new extension for JUnit 5 please use the new extension model of JUnit Jupiter instead of the rule-based model of JUnit 4. -WARNING: JUnit 4 `Rule` support in JUnit Jupiter is currently an _experimental_ feature. -Consult the table in <> for detail. - [[migrating-from-junit4-ignore-annotation-support]] === JUnit 4 @Ignore Support @@ -121,6 +118,3 @@ automatically registers the `IgnoreCondition` along with ---- include::{testDir}/example/IgnoredTestsDemo.java[tags=user_guide] ---- - -WARNING: JUnit 4 `@Ignore` support in JUnit Jupiter is currently an _experimental_ -feature. Consult the table in <> for detail. diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index 5adb80db0fc7..6f609123b09f 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -825,10 +825,6 @@ because particularly when <> it would be impossible to attribute it to a specific test or container. -WARNING: Capturing output is currently an _experimental_ feature. You're invited to give -it a try and provide feedback to the JUnit team so they can improve and eventually -<> this feature. - [[running-tests-flight-recorder]] === Flight Recorder Support diff --git a/documentation/src/docs/asciidoc/user-guide/testkit.adoc b/documentation/src/docs/asciidoc/user-guide/testkit.adoc index 32658381eaff..665c4daea788 100644 --- a/documentation/src/docs/asciidoc/user-guide/testkit.adoc +++ b/documentation/src/docs/asciidoc/user-guide/testkit.adoc @@ -5,10 +5,6 @@ The `junit-platform-testkit` artifact provides support for executing a test plan JUnit Platform and then verifying the expected results. As of JUnit Platform 1.4, this support is limited to the execution of a single `TestEngine` (see <>). -WARNING: Although the Test Kit is currently an <> feature, the JUnit Team invites you to try it out and provide feedback to -help improve the Test Kit APIs and eventually <> this feature. - [[testkit-engine]] ==== Engine Test Kit diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index e6967618c75b..4e4500018543 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -1010,9 +1010,6 @@ palindromes(String) ✔ └─ [3] candidate=able was I ere I saw elba ✔ .... -WARNING: Parameterized tests are currently an _experimental_ feature. Consult the table -in <> for details. - [[writing-tests-parameterized-tests-setup]] ==== Required Setup @@ -1739,10 +1736,6 @@ implementations. [[writing-tests-declarative-timeouts]] === Timeouts -.Declarative timeouts are an experimental feature -WARNING: You're invited to give it a try and provide feedback to the JUnit team so they -can improve and eventually <> this feature. - The `@Timeout` annotation allows one to declare that a test, test factory, test template, or lifecycle method should fail if its execution time exceeds a given duration. The time unit for the duration defaults to seconds but is configurable. From a8d08e0164a52266dc38cad2b82a05bfae459127 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 21 Dec 2020 10:41:57 +0100 Subject: [PATCH 0108/1433] Report containers as JFR events Prior to this commit only tests were reported as JFR events. However, it's also useful to see events for containers, e.g. test classes, in particular when they require expensive setup that causes other JFR events such as garbage collection. Moreover, this commit adds an integration test using the new JfrUnit Jupiter extension. --- build.gradle.kts | 6 +- dependencies/dependencies.gradle.kts | 1 + .../release-notes/release-notes-5.8.0-M1.adoc | 2 + gradle.properties | 1 + .../platform/jfr/FlightRecordingListener.java | 20 ++--- platform-tests/platform-tests.gradle.kts | 2 + ...ightRecordingListenerIntegrationTests.java | 83 +++++++++++++++++++ 7 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingListenerIntegrationTests.java diff --git a/build.gradle.kts b/build.gradle.kts index e3bfa95a1c9b..bd68f106495a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -98,13 +98,17 @@ allprojects { } repositories { - // mavenLocal() mavenCentral() maven(url = "https://oss.sonatype.org/content/repositories/snapshots") { mavenContent { snapshotsOnly() } } + maven(url = "https://jitpack.io") { + mavenContent { + includeModule("com.github.gunnarmorling", "jfrunit") + } + } } } diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 090ab495abd5..27c846279ade 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -33,5 +33,6 @@ dependencies { api("org.mockito:mockito-junit-jupiter:${versions["mockito"]}") api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") api("org.spockframework:spock-core:${versions["spock"]}") + api("com.github.gunnarmorling:jfrunit:${versions["jfrunit"]}") } } diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index c4fd5e82c249..e5d86fe33fbe 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -32,6 +32,8 @@ on GitHub. nested container events when using the `EngineTestKit`. For example, `test(displayName("my test"))` can be used to match against a test whose display name is `my test`. +* The `junit-platform-jfr` module now also reports events for containers, e.g. test + classes. [[release-notes-5.8.0-M1-junit-jupiter]] diff --git a/gradle.properties b/gradle.properties index f7bbdb97980a..a0d656aff911 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,6 +36,7 @@ log4j.version=2.13.3 mockito.version=3.5.0 slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 +jfrunit.version=main-SNAPSHOT # Tools checkstyle.version=8.36.2 diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingListener.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingListener.java index 9b36cd561836..0393f12fa1ad 100644 --- a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingListener.java +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingListener.java @@ -17,7 +17,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.util.Map; -import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -52,7 +51,7 @@ public class FlightRecordingListener implements TestExecutionListener { @Override public void testPlanExecutionStarted(TestPlan plan) { - TestPlanExecutionEvent event = new TestPlanExecutionEvent(); + var event = new TestPlanExecutionEvent(); event.containsTests = plan.containsTests(); event.engineNames = plan.getRoots().stream().map(TestIdentifier::getDisplayName).collect( Collectors.joining(", ")); @@ -62,13 +61,13 @@ public void testPlanExecutionStarted(TestPlan plan) { @Override public void testPlanExecutionFinished(TestPlan plan) { - TestPlanExecutionEvent event = testPlanExecutionEvent.get(); + var event = testPlanExecutionEvent.get(); event.commit(); } @Override public void executionSkipped(TestIdentifier test, String reason) { - SkippedTestEvent event = new SkippedTestEvent(); + var event = new SkippedTestEvent(); event.initialize(test); event.reason = reason; event.commit(); @@ -76,7 +75,7 @@ public void executionSkipped(TestIdentifier test, String reason) { @Override public void executionStarted(TestIdentifier test) { - TestExecutionEvent event = new TestExecutionEvent(); + var event = new TestExecutionEvent(); testExecutionEventMap.put(test.getUniqueId(), event); event.initialize(test); event.begin(); @@ -84,11 +83,8 @@ public void executionStarted(TestIdentifier test) { @Override public void executionFinished(TestIdentifier test, TestExecutionResult result) { - if (test.isContainer() && result.getStatus().equals(TestExecutionResult.Status.SUCCESSFUL)) { - return; - } - Optional throwable = result.getThrowable(); - TestExecutionEvent event = testExecutionEventMap.get(test.getUniqueId()); // TODO Remove? + var throwable = result.getThrowable(); + var event = testExecutionEventMap.remove(test.getUniqueId()); event.end(); event.result = result.getStatus().toString(); event.exceptionClass = throwable.map(Throwable::getClass).orElse(null); @@ -98,8 +94,8 @@ public void executionFinished(TestIdentifier test, TestExecutionResult result) { @Override public void reportingEntryPublished(TestIdentifier test, ReportEntry reportEntry) { - for (Map.Entry entry : reportEntry.getKeyValuePairs().entrySet()) { - ReportEntryEvent event = new ReportEntryEvent(); + for (var entry : reportEntry.getKeyValuePairs().entrySet()) { + var event = new ReportEntryEvent(); event.uniqueId = test.getUniqueId(); event.key = entry.getKey(); event.value = entry.getValue(); diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 2d25b3005045..596b3ef2bd46 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -12,6 +12,7 @@ dependencies { testImplementation(project(":junit-platform-commons")) testImplementation(project(":junit-platform-console")) testImplementation(project(":junit-platform-engine")) + testImplementation(project(":junit-platform-jfr")) testImplementation(project(":junit-platform-launcher")) // --- Things we are testing with --------------------------------------------- @@ -21,6 +22,7 @@ dependencies { testImplementation(testFixtures(project(":junit-platform-launcher"))) testImplementation(project(":junit-jupiter-engine")) testImplementation("org.apiguardian:apiguardian-api") + testImplementation("com.github.gunnarmorling:jfrunit") // --- Test run-time dependencies --------------------------------------------- testRuntimeOnly(project(":junit-vintage-engine")) diff --git a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingListenerIntegrationTests.java new file mode 100644 index 000000000000..568a58580a50 --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingListenerIntegrationTests.java @@ -0,0 +1,83 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.jfr; + +import static dev.morling.jfrunit.ExpectedEvent.event; +import static dev.morling.jfrunit.JfrEventsAssert.assertThat; +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; +import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; + +import dev.morling.jfrunit.EnableEvent; +import dev.morling.jfrunit.JfrEventTest; +import dev.morling.jfrunit.JfrEvents; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestReporter; +import org.junit.jupiter.engine.JupiterTestEngine; +import org.junit.platform.launcher.core.LauncherConfig; +import org.junit.platform.launcher.core.LauncherFactory; + +@JfrEventTest +public class FlightRecordingListenerIntegrationTests { + + public JfrEvents jfrEvents = new JfrEvents(); + + @Test + @EnableEvent("org.junit.*") + void reportsEvents() { + var config = LauncherConfig.builder() // + .enableTestExecutionListenerAutoRegistration(false) // + .enableTestEngineAutoRegistration(false) // + .addTestEngines(new JupiterTestEngine()) // + .build(); + var request = request() // + .selectors(selectClass(TestCase.class)) // + .build(); + + LauncherFactory.create(config).execute(request, new FlightRecordingListener()); + jfrEvents.awaitEvents(); + + assertThat(jfrEvents) // + .contains(event("org.junit.TestPlan") // + .with("engineNames", "JUnit Jupiter")) // + .contains(event("org.junit.TestExecution") // + .with("displayName", "JUnit Jupiter") // + .with("type", "CONTAINER")) // + .contains(event("org.junit.TestExecution") // + .with("displayName", FlightRecordingListenerIntegrationTests.class.getSimpleName() + "$" + + TestCase.class.getSimpleName()) // + .with("type", "CONTAINER")) // + .contains(event("org.junit.TestExecution") // + .with("displayName", "test(TestReporter)") // + .with("type", "TEST") // + .with("result", "SUCCESSFUL")) // + .contains(event("org.junit.ReportEntry") // + .with("key", "message") // + .with("value", "Hello JFR!")) // + .contains(event("org.junit.SkippedTest") // + .with("displayName", "skipped()") // + .with("type", "TEST") // + .with("reason", "for demonstration purposes")); + } + + static class TestCase { + @Test + void test(TestReporter reporter) { + reporter.publishEntry("message", "Hello JFR!"); + } + + @Test + @Disabled("for demonstration purposes") + void skipped() { + } + } +} From 044f71c4c1bf8ae5aad01aae6641e99d833bbf2d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 21 Dec 2020 16:23:17 +0100 Subject: [PATCH 0109/1433] Remove ineffectual configuration The Kotlin compiler now displays a big warning for these options anyway but since the `kotlin-dsl` will soon cease using them, we can safely remove this option now. --- buildSrc/build.gradle.kts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 4e93d887d722..d97ba94cbd15 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -17,10 +17,6 @@ dependencies { implementation("org.gradle:test-retry-gradle-plugin:1.2.0") } -kotlinDslPluginOptions { - experimentalWarning.set(false) -} - tasks.withType().configureEach { kotlinOptions { allWarningsAsErrors = true From 86d66459df2827cb5fbc8c7f0d404b1bdeafebf0 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 21 Dec 2020 16:24:07 +0100 Subject: [PATCH 0110/1433] Add possibility to configure number of test retries Useful locally to disable retries of failing integration tests via -Pretries=0. --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index eb005c6d05df..137d0d9e67d6 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -15,7 +15,7 @@ tasks.withType().configureEach { exceptionFormat = FULL } retry { - maxRetries.set(2) + maxRetries.set(providers.gradleProperty("retries").map(String::toInt).orElse(2)) } systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") // Required until ASM officially supports the JDK 14 From 8b71ee63e734d1dc46231c8ca0ab28627c56d5d2 Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Wed, 21 Oct 2020 20:03:12 +0200 Subject: [PATCH 0111/1433] Add possibility to register discovery listeners via SPI `LauncherDiscoveryListeners` can now be registered via Java's `ServiceLoader` mechanism in addition to those passed as part of each `LauncherDiscoveryRequest` and the default one. Whether discovery listeners are picked up via ServiceLoader is configurable via `LauncherConfig` (defaults to true). Closes #2457. Related to #201. Co-authored-by: Marc Philipp --- .../release-notes/release-notes-5.8.0-M1.adoc | 2 + .../asciidoc/user-guide/launcher-api.adoc | 23 +++++-- .../launcher/core/DefaultLauncher.java | 23 +++++-- .../launcher/core/DefaultLauncherConfig.java | 14 +++-- .../core/EngineDiscoveryOrchestrator.java | 20 +++++- .../launcher/core/LauncherConfig.java | 50 ++++++++++++--- .../core/LauncherDiscoveryRequestBuilder.java | 3 +- .../launcher/core/LauncherFactory.java | 29 ++++++++- ...aderLauncherDiscoveryListenerRegistry.java | 38 ++++++++++++ .../module-info.java | 2 + .../testkit/engine/EngineTestKit.java | 2 +- .../TestLauncherDiscoveryListener.java | 30 +++++++++ .../launcher/core/LauncherConfigTests.java | 18 ++++++ .../launcher/core/LauncherFactoryTests.java | 62 ++++++++++++++++--- ...latform.launcher.LauncherDiscoveryListener | 1 + ...it.platform.launcher.TestExecutionListener | 0 .../junit-platform.properties | 0 .../junit-platform-launcher.expected.txt | 1 + .../projects/standalone/expected-err.txt | 2 + 19 files changed, 277 insertions(+), 43 deletions(-) create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java create mode 100644 platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java create mode 100644 platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener rename platform-tests/src/test/resources/{ => testservices}/META-INF/services/org.junit.platform.launcher.TestExecutionListener (100%) rename platform-tests/src/test/resources/{ => testservices}/junit-platform.properties (100%) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index e5d86fe33fbe..45f2961664e3 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -34,6 +34,8 @@ on GitHub. `my test`. * The `junit-platform-jfr` module now also reports events for containers, e.g. test classes. +* Custom `LauncherDiscoveryListener` implementations can now be registered via Java’s + `ServiceLoader` mechanism. [[release-notes-5.8.0-M1-junit-jupiter]] diff --git a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc index a1964e34e59c..c22b70ef12e2 100644 --- a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc +++ b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc @@ -112,24 +112,39 @@ In addition to specifying post-discovery filters as part of a `{LauncherDiscover passed to the `{Launcher}` API, by default custom `{PostDiscoveryFilter}` implementations will be discovered at runtime via Java's `java.util.ServiceLoader` mechanism and automatically applied by the `Launcher` in addition to those that are part of the request. + For example, an `example.CustomTagFilter` class implementing `{PostDiscoveryFilter}` and declared within the `/META-INF/services/org.junit.platform.launcher.PostDiscoveryFilter` file is loaded and applied automatically. +[[launcher-api-launcher-discovery-listeners-custom]] +==== Plugging in your own Discovery Listeners + +In addition to specifying post-discovery filters as part of a `{LauncherDiscoveryRequest}` +passed to the `{Launcher}` API, custom `{LauncherDiscoveryListener}` implementations can +be discovered at runtime via Java's `java.util.ServiceLoader` mechanism and automatically +automatically registered with the `Launcher` created via the `LauncherFactory`. + +For example, an `example.CustomLauncherDiscoveryListener` class implementing +`{LauncherDiscoveryListener}` and declared within the +`/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener` file is loaded +and applied automatically. + [[launcher-api-listeners-custom]] -==== Plugging in your own Test Execution Listener +==== Plugging in your own Execution Listener In addition to the public `{Launcher}` API method for registering test execution listeners programmatically, by default custom `{TestExecutionListener}` implementations will be discovered at runtime via Java's `java.util.ServiceLoader` mechanism and -automatically registered with the `Launcher` created via the `LauncherFactory`. For -example, an `example.TestInfoPrinter` class implementing `{TestExecutionListener}` and +automatically registered with the `Launcher` created via the `LauncherFactory`. + +For example, an `example.TestInfoPrinter` class implementing `{TestExecutionListener}` and declared within the `/META-INF/services/org.junit.platform.launcher.TestExecutionListener` file is loaded and registered automatically. [[launcher-api-listeners-custom-deactivation]] -==== Deactivating Test Execution Listeners +==== Deactivating Execution Listeners Sometimes it can be useful to run a test suite _without_ certain execution listeners being active. For example, you might have custom a `TestExecutionListener` that sends the test diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java index 36b1769d38cf..f42d5d9c3a18 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java @@ -17,6 +17,7 @@ import org.junit.platform.commons.util.Preconditions; import org.junit.platform.engine.TestEngine; import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; @@ -41,17 +42,23 @@ class DefaultLauncher implements Launcher { /** * Construct a new {@code DefaultLauncher} with the supplied test engines. * - * @param testEngines the test engines to delegate to; never {@code null} or empty - * @param filters the additional post discovery filters for discovery requests; never {@code null} + * @param testEngines the test engines to delegate to; never {@code null} or + * empty + * @param postDiscoveryFilters the additional post discovery filters for + * discovery requests; never {@code null} + * @param launcherDiscoveryListeners the additional launcher discovery + * listeners for discovery requests; never {@code null} */ - DefaultLauncher(Iterable testEngines, Collection filters) { + DefaultLauncher(Iterable testEngines, Collection postDiscoveryFilters, + Collection launcherDiscoveryListeners) { Preconditions.condition(testEngines != null && testEngines.iterator().hasNext(), () -> "Cannot create Launcher without at least one TestEngine; " + "consider adding an engine implementation JAR to the classpath"); - Preconditions.notNull(filters, "PostDiscoveryFilter array must not be null"); - Preconditions.containsNoNullElements(filters, "PostDiscoveryFilter array must not contain null elements"); + Preconditions.notNull(postDiscoveryFilters, "PostDiscoveryFilter array must not be null"); + Preconditions.containsNoNullElements(postDiscoveryFilters, + "PostDiscoveryFilter array must not contain null elements"); this.discoveryOrchestrator = new EngineDiscoveryOrchestrator(EngineIdValidator.validate(testEngines), - unmodifiableCollection(filters)); + unmodifiableCollection(postDiscoveryFilters), unmodifiableCollection(launcherDiscoveryListeners)); } @Override @@ -88,6 +95,10 @@ TestExecutionListenerRegistry getTestExecutionListenerRegistry() { return listenerRegistry; } + LauncherDiscoveryListener getLauncherDiscoveryListener(LauncherDiscoveryRequest discoveryRequest) { + return discoveryOrchestrator.getLauncherDiscoveryListener(discoveryRequest); + } + private LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, String phase) { return discoveryOrchestrator.discover(discoveryRequest, phase); } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java index 41bdfeab6e6b..7ca4875e0544 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java @@ -26,23 +26,20 @@ class DefaultLauncherConfig implements LauncherConfig { private final boolean testEngineAutoRegistrationEnabled; - + private final boolean launcherDiscoveryListenerAutoRegistrationEnabled; private final boolean testExecutionListenerAutoRegistrationEnabled; - private final boolean postDiscoveryFilterAutoRegistrationEnabled; - private final Collection additionalTestEngines; - private final Collection additionalTestExecutionListeners; - private final Collection additionalPostDiscoveryFilters; DefaultLauncherConfig(boolean testEngineAutoRegistrationEnabled, + boolean launcherDiscoveryListenerAutoRegistrationEnabled, boolean testExecutionListenerAutoRegistrationEnabled, boolean postDiscoveryFilterAutoRegistrationEnabled, Collection additionalTestEngines, Collection additionalTestExecutionListeners, Collection additionalPostDiscoveryFilters) { - + this.launcherDiscoveryListenerAutoRegistrationEnabled = launcherDiscoveryListenerAutoRegistrationEnabled; this.testExecutionListenerAutoRegistrationEnabled = testExecutionListenerAutoRegistrationEnabled; this.testEngineAutoRegistrationEnabled = testEngineAutoRegistrationEnabled; this.postDiscoveryFilterAutoRegistrationEnabled = postDiscoveryFilterAutoRegistrationEnabled; @@ -56,6 +53,11 @@ public boolean isTestEngineAutoRegistrationEnabled() { return this.testEngineAutoRegistrationEnabled; } + @Override + public boolean isLauncherDiscoveryListenerAutoRegistrationEnabled() { + return launcherDiscoveryListenerAutoRegistrationEnabled; + } + @Override public boolean isTestExecutionListenerAutoRegistrationEnabled() { return this.testExecutionListenerAutoRegistrationEnabled; diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java index 6c5fd203597f..002944d84ce5 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java @@ -11,6 +11,7 @@ package org.junit.platform.launcher.core; import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toList; import static org.apiguardian.api.API.Status.INTERNAL; import static org.junit.platform.engine.Filter.composeFilters; @@ -20,6 +21,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.stream.Stream; import org.apiguardian.api.API; import org.junit.platform.commons.JUnitException; @@ -35,6 +37,7 @@ import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.PostDiscoveryFilter; +import org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners; /** * Orchestrates test discovery using the configured test engines. @@ -49,11 +52,14 @@ public class EngineDiscoveryOrchestrator { private final EngineDiscoveryResultValidator discoveryResultValidator = new EngineDiscoveryResultValidator(); private final Iterable testEngines; private final Collection postDiscoveryFilters; + private final Collection launcherDiscoveryListeners; public EngineDiscoveryOrchestrator(Iterable testEngines, - Collection postDiscoveryFilters) { + Collection postDiscoveryFilters, + Collection launcherDiscoveryListeners) { this.testEngines = testEngines; this.postDiscoveryFilters = postDiscoveryFilters; + this.launcherDiscoveryListeners = launcherDiscoveryListeners; } /** @@ -96,7 +102,7 @@ public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, String } private TestDescriptor discoverEngineRoot(TestEngine testEngine, LauncherDiscoveryRequest discoveryRequest) { - LauncherDiscoveryListener discoveryListener = discoveryRequest.getDiscoveryListener(); + LauncherDiscoveryListener discoveryListener = getLauncherDiscoveryListener(discoveryRequest); UniqueId uniqueEngineId = UniqueId.forEngine(testEngine.getId()); try { discoveryListener.engineDiscoveryStarted(uniqueEngineId); @@ -114,6 +120,16 @@ private TestDescriptor discoverEngineRoot(TestEngine testEngine, LauncherDiscove } } + LauncherDiscoveryListener getLauncherDiscoveryListener(LauncherDiscoveryRequest discoveryRequest) { + LauncherDiscoveryListener discoveryListener = discoveryRequest.getDiscoveryListener(); + if (!launcherDiscoveryListeners.isEmpty()) { + List allDiscoveryListeners = Stream.concat(Stream.of(discoveryListener), + launcherDiscoveryListeners.stream()).collect(toList()); + discoveryListener = LauncherDiscoveryListeners.composite(allDiscoveryListeners); + } + return discoveryListener; + } + private void applyPostDiscoveryFilters(Map testEngineDescriptors, List filters) { Filter postDiscoveryFilter = composeFilters(filters); diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java index afed3e096c8b..f973d8fc4c1f 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java @@ -60,6 +60,18 @@ public interface LauncherConfig { */ boolean isTestEngineAutoRegistrationEnabled(); + /** + * Determine if launcher discovery listeners should be discovered at runtime + * using the {@link java.util.ServiceLoader ServiceLoader} mechanism and + * automatically registered. + * + * @return {@code true} if launcher discovery listeners should be + * automatically registered + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + boolean isLauncherDiscoveryListenerAutoRegistrationEnabled(); + /** * Determine if test execution listeners should be discovered at runtime * using the {@link java.util.ServiceLoader ServiceLoader} mechanism and @@ -77,6 +89,7 @@ public interface LauncherConfig { * * @return {@code true} if post discovery filters should be automatically * registered + * @since 1.7 */ @API(status = EXPERIMENTAL, since = "1.7") boolean isPostDiscoveryFilterAutoRegistrationEnabled(); @@ -105,6 +118,7 @@ public interface LauncherConfig { * * @return the collection of additional post discovery filters; never * {@code null} but potentially empty + * @since 1.7 */ @API(status = EXPERIMENTAL, since = "1.7") Collection getAdditionalPostDiscoveryFilters(); @@ -123,22 +137,35 @@ static Builder builder() { */ class Builder { - private boolean listenerAutoRegistrationEnabled = true; - private boolean engineAutoRegistrationEnabled = true; - + private boolean launcherDiscoveryListenerAutoRegistrationEnabled = true; + private boolean testExecutionListenerAutoRegistrationEnabled = true; private boolean postDiscoveryFilterAutoRegistrationEnabled = true; - private final Collection engines = new LinkedHashSet<>(); - private final Collection listeners = new LinkedHashSet<>(); - private final Collection postDiscoveryFilters = new LinkedHashSet<>(); private Builder() { /* no-op */ } + /** + * Configure the auto-registration flag for launcher discovery + * listeners. + * + *

    Defaults to {@code true}. + * + * @param enabled {@code true} if launcher discovery listeners should be + * automatically registered + * @return this builder for method chaining + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + public Builder enableLauncherDiscoveryListenerAutoRegistration(boolean enabled) { + this.launcherDiscoveryListenerAutoRegistrationEnabled = enabled; + return this; + } + /** * Configure the auto-registration flag for test execution listeners. * @@ -149,7 +176,7 @@ private Builder() { * @return this builder for method chaining */ public Builder enableTestExecutionListenerAutoRegistration(boolean enabled) { - this.listenerAutoRegistrationEnabled = enabled; + this.testExecutionListenerAutoRegistrationEnabled = enabled; return this; } @@ -175,6 +202,7 @@ public Builder enableTestEngineAutoRegistration(boolean enabled) { * @param enabled {@code true} if post discovery filters should be automatically * registered * @return this builder for method chaining + * @since 1.7 */ @API(status = EXPERIMENTAL, since = "1.7") public Builder enablePostDiscoveryFilterAutoRegistration(boolean enabled) { @@ -217,6 +245,7 @@ public Builder addTestExecutionListeners(TestExecutionListener... listeners) { * @param filters additional post discovery filters to register; * never {@code null} or containing {@code null} * @return this builder for method chaining + * @since 1.7 */ @API(status = EXPERIMENTAL, since = "1.7") public Builder addPostDiscoveryFilters(PostDiscoveryFilter... filters) { @@ -231,9 +260,10 @@ public Builder addPostDiscoveryFilters(PostDiscoveryFilter... filters) { * builder. */ public LauncherConfig build() { - return new DefaultLauncherConfig(this.engineAutoRegistrationEnabled, this.listenerAutoRegistrationEnabled, - this.postDiscoveryFilterAutoRegistrationEnabled, this.engines, this.listeners, - this.postDiscoveryFilters); + return new DefaultLauncherConfig(this.engineAutoRegistrationEnabled, + this.launcherDiscoveryListenerAutoRegistrationEnabled, + this.testExecutionListenerAutoRegistrationEnabled, this.postDiscoveryFilterAutoRegistrationEnabled, + this.engines, this.listeners, this.postDiscoveryFilters); } } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java index 6de1ed6980c6..272973ad8802 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java @@ -274,7 +274,8 @@ private LauncherDiscoveryListener getLauncherDiscoveryListener(ConfigurationPara if (discoveryListeners.contains(defaultDiscoveryListener)) { return LauncherDiscoveryListeners.composite(discoveryListeners); } - List allDiscoveryListeners = new ArrayList<>(discoveryListeners); + List allDiscoveryListeners = new ArrayList<>(discoveryListeners.size() + 1); + allDiscoveryListeners.addAll(discoveryListeners); allDiscoveryListeners.add(defaultDiscoveryListener); return LauncherDiscoveryListeners.composite(allDiscoveryListeners); } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java index 739b01baf20f..6b1ee7d93d8c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java @@ -28,6 +28,7 @@ import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.TestEngine; import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; @@ -90,26 +91,48 @@ public static Launcher create() throws PreconditionViolationException { public static Launcher create(LauncherConfig config) throws PreconditionViolationException { Preconditions.notNull(config, "LauncherConfig must not be null"); + Set engines = collectTestEngines(config); + List filters = collectPostDiscoveryFilters(config); + List discoveryListeners = collectLauncherDiscoveryListeners(config); + + Launcher launcher = new DefaultLauncher(engines, filters, discoveryListeners); + + registerTestExecutionListeners(config, launcher); + + return launcher; + } + + private static Set collectTestEngines(LauncherConfig config) { Set engines = new LinkedHashSet<>(); if (config.isTestEngineAutoRegistrationEnabled()) { new ServiceLoaderTestEngineRegistry().loadTestEngines().forEach(engines::add); } engines.addAll(config.getAdditionalTestEngines()); + return engines; + } + private static List collectPostDiscoveryFilters(LauncherConfig config) { List filters = new ArrayList<>(); if (config.isPostDiscoveryFilterAutoRegistrationEnabled()) { new ServiceLoaderPostDiscoveryFilterRegistry().loadPostDiscoveryFilters().forEach(filters::add); } filters.addAll(config.getAdditionalPostDiscoveryFilters()); + return filters; + } - Launcher launcher = new DefaultLauncher(engines, filters); + private static List collectLauncherDiscoveryListeners(LauncherConfig config) { + List discoveryListeners = new ArrayList<>(); + if (config.isLauncherDiscoveryListenerAutoRegistrationEnabled()) { + new ServiceLoaderLauncherDiscoveryListenerRegistry().loadListeners().forEach(discoveryListeners::add); + } + return discoveryListeners; + } + private static void registerTestExecutionListeners(LauncherConfig config, Launcher launcher) { if (config.isTestExecutionListenerAutoRegistrationEnabled()) { loadAndFilterTestExecutionListeners().forEach(launcher::registerTestExecutionListeners); } config.getAdditionalTestExecutionListeners().forEach(launcher::registerTestExecutionListeners); - - return launcher; } private static Stream loadAndFilterTestExecutionListeners() { diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java new file mode 100644 index 000000000000..ca4788adaff5 --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java @@ -0,0 +1,38 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import static java.util.stream.Collectors.toList; +import static java.util.stream.StreamSupport.stream; + +import java.util.ServiceLoader; + +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; +import org.junit.platform.commons.util.ClassLoaderUtils; +import org.junit.platform.launcher.LauncherDiscoveryListener; + +/** + * @since 1.8 + */ +class ServiceLoaderLauncherDiscoveryListenerRegistry { + + private static final Logger logger = LoggerFactory.getLogger(ServiceLoaderLauncherDiscoveryListenerRegistry.class); + + Iterable loadListeners() { + Iterable listeners = ServiceLoader.load(LauncherDiscoveryListener.class, + ClassLoaderUtils.getDefaultClassLoader()); + logger.config(() -> "Loaded LauncherDiscoveryListener instances: " + + stream(listeners.spliterator(), false).map(Object::toString).collect(toList())); + return listeners; + } + +} diff --git a/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java b/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java index f9200fda65f4..9ccde3666d41 100644 --- a/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java +++ b/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java @@ -15,6 +15,7 @@ * * @since 1.0 * @uses org.junit.platform.engine.TestEngine + * @uses org.junit.platform.launcher.LauncherDiscoveryListener * @uses org.junit.platform.launcher.PostDiscoveryFilter * @uses org.junit.platform.launcher.TestExecutionListener */ @@ -30,6 +31,7 @@ exports org.junit.platform.launcher.listeners.discovery; uses org.junit.platform.engine.TestEngine; + uses org.junit.platform.launcher.LauncherDiscoveryListener; uses org.junit.platform.launcher.PostDiscoveryFilter; uses org.junit.platform.launcher.TestExecutionListener; } diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java index 8826f87b829d..f1c87fe44a44 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java @@ -265,7 +265,7 @@ private static void executeDirectly(TestEngine testEngine, EngineDiscoveryReques private static void executeUsingLauncherOrchestration(TestEngine testEngine, LauncherDiscoveryRequest discoveryRequest, EngineExecutionListener listener) { TestDescriptor engineTestDescriptor; - LauncherDiscoveryResult discoveryResult = new EngineDiscoveryOrchestrator(singleton(testEngine), + LauncherDiscoveryResult discoveryResult = new EngineDiscoveryOrchestrator(singleton(testEngine), emptySet(), emptySet()).discover(discoveryRequest, "testing"); engineTestDescriptor = discoveryResult.getEngineTestDescriptor(testEngine); Preconditions.notNull(engineTestDescriptor, "TestEngine did not yield a TestDescriptor"); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java new file mode 100644 index 000000000000..497b649ae2c0 --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher; + +public class TestLauncherDiscoveryListener extends LauncherDiscoveryListener { + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + return getClass() == obj.getClass(); + } + + @Override + public int hashCode() { + return 1; + } +} diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java index cd9e2a0e5b48..cd233214e13e 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java @@ -50,8 +50,12 @@ void defaultConfig() { assertTrue(config.isTestEngineAutoRegistrationEnabled(), "Test engine auto-registration should be enabled by default"); + assertTrue(config.isLauncherDiscoveryListenerAutoRegistrationEnabled(), + "Launcher discovery listener auto-registration should be enabled by default"); assertTrue(config.isTestExecutionListenerAutoRegistrationEnabled(), "Test execution listener auto-registration should be enabled by default"); + assertTrue(config.isPostDiscoveryFilterAutoRegistrationEnabled(), + "Post-discovery filter auto-registration should be enabled by default"); assertThat(config.getAdditionalTestEngines()).isEmpty(); @@ -65,6 +69,13 @@ void disableTestEngineAutoRegistration() { assertFalse(config.isTestEngineAutoRegistrationEnabled()); } + @Test + void disableLauncherDiscoveryListenerAutoRegistration() { + var config = LauncherConfig.builder().enableLauncherDiscoveryListenerAutoRegistration(false).build(); + + assertFalse(config.isLauncherDiscoveryListenerAutoRegistrationEnabled()); + } + @Test void disableTestExecutionListenerAutoRegistration() { var config = LauncherConfig.builder().enableTestExecutionListenerAutoRegistration(false).build(); @@ -72,6 +83,13 @@ void disableTestExecutionListenerAutoRegistration() { assertFalse(config.isTestExecutionListenerAutoRegistrationEnabled()); } + @Test + void disablePostDiscoveryFilterAutoRegistration() { + var config = LauncherConfig.builder().enablePostDiscoveryFilterAutoRegistration(false).build(); + + assertFalse(config.isPostDiscoveryFilterAutoRegistrationEnabled()); + } + @Test void addTestEngines() { TestEngine first = new TestEngineStub(); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java index a0b4f7f75445..d510aa3a9c91 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java @@ -15,6 +15,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; +import static org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners.abortOnFailure; import java.net.URL; import java.net.URLClassLoader; @@ -26,6 +27,7 @@ import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TagFilter; import org.junit.platform.launcher.TestIdentifier; +import org.junit.platform.launcher.TestLauncherDiscoveryListener; import org.junit.platform.launcher.listeners.AnotherUnusedTestExecutionListener; import org.junit.platform.launcher.listeners.NoopTestExecutionListener; import org.junit.platform.launcher.listeners.UnusedTestExecutionListener; @@ -42,20 +44,24 @@ void preconditions() { @Test void noopTestExecutionListenerIsLoadedViaServiceApi() { - var launcher = (DefaultLauncher) LauncherFactory.create(); - var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); - var listener = listeners.stream().filter(NoopTestExecutionListener.class::isInstance).findFirst(); - assertThat(listener).isPresent(); + withTestServices(() -> { + var launcher = (DefaultLauncher) LauncherFactory.create(); + var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); + var listener = listeners.stream().filter(NoopTestExecutionListener.class::isInstance).findFirst(); + assertThat(listener).isPresent(); + }); } @Test void unusedTestExecutionListenerIsNotLoadedViaServiceApi() { - var launcher = (DefaultLauncher) LauncherFactory.create(); - var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); - - assertThat(listeners).filteredOn(AnotherUnusedTestExecutionListener.class::isInstance).isEmpty(); - assertThat(listeners).filteredOn(UnusedTestExecutionListener.class::isInstance).isEmpty(); - assertThat(listeners).filteredOn(NoopTestExecutionListener.class::isInstance).isNotEmpty(); + withTestServices(() -> { + var launcher = (DefaultLauncher) LauncherFactory.create(); + var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); + + assertThat(listeners).filteredOn(AnotherUnusedTestExecutionListener.class::isInstance).isEmpty(); + assertThat(listeners).filteredOn(UnusedTestExecutionListener.class::isInstance).isEmpty(); + assertThat(listeners).filteredOn(NoopTestExecutionListener.class::isInstance).isNotEmpty(); + }); } @Test @@ -162,6 +168,42 @@ void notApplyIfDisabledPostDiscoveryFiltersViaServiceApi() { } } + @Test + void doesNotDiscoverLauncherDiscoverRequestListenerViaServiceApiWhenDisabled() { + withTestServices(() -> { + var launcher = (DefaultLauncher) LauncherFactory.create( + LauncherConfig.builder().enableLauncherDiscoveryListenerAutoRegistration(false).build()); + var launcherDiscoveryListener = launcher.getLauncherDiscoveryListener(request().build()); + + assertThat(launcherDiscoveryListener).isEqualTo(abortOnFailure()); + }); + } + + @Test + void discoversLauncherDiscoverRequestListenerViaServiceApiByDefault() { + withTestServices(() -> { + var launcher = (DefaultLauncher) LauncherFactory.create(); + var launcherDiscoveryListener = launcher.getLauncherDiscoveryListener(request().build()); + + assertThat(launcherDiscoveryListener.getClass().getSimpleName()).startsWith("Composite"); + assertThat(launcherDiscoveryListener).extracting("listeners").asList() // + .containsExactlyInAnyOrder(new TestLauncherDiscoveryListener(), abortOnFailure()); + }); + } + + private static void withTestServices(Runnable runnable) { + var current = Thread.currentThread().getContextClassLoader(); + try { + var url = LauncherFactoryTests.class.getClassLoader().getResource("testservices/"); + var classLoader = new URLClassLoader(new URL[] { url }, current); + Thread.currentThread().setContextClassLoader(classLoader); + runnable.run(); + } + finally { + Thread.currentThread().setContextClassLoader(current); + } + } + private LauncherDiscoveryRequest createLauncherDiscoveryRequestForBothStandardEngineExampleClasses() { // @formatter:off return request() diff --git a/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener b/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener new file mode 100644 index 000000000000..3c8c2d5022c4 --- /dev/null +++ b/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener @@ -0,0 +1 @@ +org.junit.platform.launcher.TestLauncherDiscoveryListener diff --git a/platform-tests/src/test/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener b/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.TestExecutionListener similarity index 100% rename from platform-tests/src/test/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener rename to platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.TestExecutionListener diff --git a/platform-tests/src/test/resources/junit-platform.properties b/platform-tests/src/test/resources/testservices/junit-platform.properties similarity index 100% rename from platform-tests/src/test/resources/junit-platform.properties rename to platform-tests/src/test/resources/testservices/junit-platform.properties diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt index a142504cdcf0..82f90fef731d 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt @@ -9,5 +9,6 @@ requires org.apiguardian.api transitive requires org.junit.platform.commons transitive requires org.junit.platform.engine transitive uses org.junit.platform.engine.TestEngine +uses org.junit.platform.launcher.LauncherDiscoveryListener uses org.junit.platform.launcher.PostDiscoveryFilter uses org.junit.platform.launcher.TestExecutionListener diff --git a/platform-tooling-support-tests/projects/standalone/expected-err.txt b/platform-tooling-support-tests/projects/standalone/expected-err.txt index f140d43c746a..27c15985896b 100644 --- a/platform-tooling-support-tests/projects/standalone/expected-err.txt +++ b/platform-tooling-support-tests/projects/standalone/expected-err.txt @@ -2,5 +2,7 @@ .+ Discovered TestEngines with IDs. .junit-jupiter .+ junit-vintage .+ .+ org.junit.platform.launcher.core.ServiceLoaderPostDiscoveryFilterRegistry loadPostDiscoveryFilters .+ Loaded PostDiscoveryFilter instances: .. +.+ org.junit.platform.launcher.core.ServiceLoaderLauncherDiscoveryListenerRegistry loadListeners +.+ Loaded LauncherDiscoveryListener instances: .. .+ org.junit.platform.launcher.core.ServiceLoaderTestExecutionListenerRegistry loadListeners .+ Loaded TestExecutionListener instances: .. From b7eddfc1d953282c2e2cf428a425e047a96b6ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Ledoyen?= Date: Tue, 22 Dec 2020 09:47:14 +0100 Subject: [PATCH 0112/1433] Support underscores for numeric in CSV sources (#2425) This kind of notation was introduced in Java 1.7 to improve readability of long numbers. See https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html Resolves #2335. --- .../release-notes/release-notes-5.8.0-M1.adoc | 4 ++- .../java/example/ParameterizedTestDemo.java | 3 ++- .../src/test/resources/two-column.csv | 1 + .../converter/DefaultArgumentConverter.java | 26 ++++++++++++++++--- .../DefaultArgumentConverterTests.java | 8 +++++- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 45f2961664e3..d4e216a0edfe 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -51,7 +51,9 @@ on GitHub. ==== New Features and Improvements -* ❓ +* Numeric literals used with `@CsvSource` or `CsvFileSource` can now be expressed using + underscores as in some JVM languages, to improve readability of long numbers like + `700_000_000`. [[release-notes-5.8.0-M1-junit-vintage]] diff --git a/documentation/src/test/java/example/ParameterizedTestDemo.java b/documentation/src/test/java/example/ParameterizedTestDemo.java index b0f2b76fde99..40f440d305ee 100644 --- a/documentation/src/test/java/example/ParameterizedTestDemo.java +++ b/documentation/src/test/java/example/ParameterizedTestDemo.java @@ -210,7 +210,8 @@ static Stream stringIntAndListProvider() { @CsvSource({ "apple, 1", "banana, 2", - "'lemon, lime', 0xF1" + "'lemon, lime', 0xF1", + "strawberry, 700_000" }) void testWithCsvSource(String fruit, int rank) { assertNotNull(fruit); diff --git a/documentation/src/test/resources/two-column.csv b/documentation/src/test/resources/two-column.csv index 2ef0d215adac..917fba3ff5b6 100644 --- a/documentation/src/test/resources/two-column.csv +++ b/documentation/src/test/resources/two-column.csv @@ -2,3 +2,4 @@ Country, reference Sweden, 1 Poland, 2 "United States of America", 3 +France, 700_000 diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java index dc44195d0d53..72e555f42fe5 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java @@ -76,7 +76,8 @@ public class DefaultArgumentConverter extends SimpleArgumentConverter { public static final DefaultArgumentConverter INSTANCE = new DefaultArgumentConverter(); private static final List stringToObjectConverters = unmodifiableList(asList( // - new StringToPrimitiveConverter(), // + new StringToBooleanAndCharPrimitiveConverter(), // + new StringToNumericPrimitiveConverter(), // new StringToEnumConverter(), // new StringToJavaTimeConverter(), // new StringToCommonJavaTypesConverter(), // @@ -140,7 +141,7 @@ interface StringToObjectConverter { } - private static class StringToPrimitiveConverter implements StringToObjectConverter { + private static class StringToBooleanAndCharPrimitiveConverter implements StringToObjectConverter { private static final Map, Function> CONVERTERS; static { @@ -150,6 +151,25 @@ private static class StringToPrimitiveConverter implements StringToObjectConvert Preconditions.condition(source.length() == 1, () -> "String must have length of 1: " + source); return source.charAt(0); }); + CONVERTERS = unmodifiableMap(converters); + } + + @Override + public boolean canConvert(Class targetType) { + return CONVERTERS.containsKey(targetType); + } + + @Override + public Object convert(String source, Class targetType) { + return CONVERTERS.get(targetType).apply(source); + } + } + + private static class StringToNumericPrimitiveConverter implements StringToObjectConverter { + + private static final Map, Function> CONVERTERS; + static { + Map, Function> converters = new HashMap<>(); converters.put(Byte.class, Byte::decode); converters.put(Short.class, Short::decode); converters.put(Integer.class, Integer::decode); @@ -166,7 +186,7 @@ public boolean canConvert(Class targetType) { @Override public Object convert(String source, Class targetType) { - return CONVERTERS.get(targetType).apply(source); + return CONVERTERS.get(targetType).apply(source.replace("_", "")); } } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java index 2dc8ab22a812..f9318cacdd2e 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java @@ -84,13 +84,19 @@ void isAwareOfWideningConversions() { @Test void convertsStringsToPrimitiveTypes() { assertConverts("true", boolean.class, true); - assertConverts("1", byte.class, (byte) 1); assertConverts("o", char.class, 'o'); + assertConverts("1", byte.class, (byte) 1); + assertConverts("1_0", byte.class, (byte) 10); assertConverts("1", short.class, (short) 1); + assertConverts("1_2", short.class, (short) 12); assertConverts("42", int.class, 42); + assertConverts("700_050_000", int.class, 700_050_000); assertConverts("42", long.class, 42L); + assertConverts("4_2", long.class, 42L); assertConverts("42.23", float.class, 42.23f); + assertConverts("42.2_3", float.class, 42.23f); assertConverts("42.23", double.class, 42.23); + assertConverts("42.2_3", double.class, 42.23); } /** From aa9ea48298902391b61a489b845e7f419ee2b999 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 22 Dec 2020 13:00:41 +0100 Subject: [PATCH 0113/1433] Upgradle to 6.8-rc-4 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4adb35dc8035..37b9a50578f1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=6c929633a439d248413d3d1bff477195ee662ccadc6fdc31f6f50f8059a2be36 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-3-bin.zip +distributionSha256Sum=6cb03b71767b169eda987338091172cbc84eb0cd53a93c17e6661688411e267e +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 8a48d5ca851a24539ca1bce138a10161426e8a25 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 22 Dec 2020 13:33:48 +0100 Subject: [PATCH 0114/1433] Fix compilation error --- .../org/junit/platform/launcher/LauncherDiscoveryListener.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index f7bf7f34a559..65fa3219270a 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -46,6 +46,9 @@ public abstract class LauncherDiscoveryListener implements EngineDiscoveryListen public static final LauncherDiscoveryListener NOOP = new LauncherDiscoveryListener() { }; + public LauncherDiscoveryListener() { + } + /** * Called when test discovery is about to be started for an engine. * From f734fd1db06c305ff4b367467911771f09592509 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 22 Dec 2020 16:38:24 +0100 Subject: [PATCH 0115/1433] Upgrade apiguardian to 1.1.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index a0d656aff911..87227a7c26c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ org.gradle.caching=true org.gradle.parallel=true # Dependencies -apiguardian.version=1.1.0 +apiguardian.version=1.1.1 assertj.version=3.16.1 junit4.version=4.13.1 junit4Min.version=4.12 From 7a8385fc3ab586f580058440f34a64e01b188dcd Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 21 Dec 2020 18:06:10 +0100 Subject: [PATCH 0116/1433] Add JFR events for test discovery Since test discovery can take a considerable amount of time, we now also report JFR events on the launcher and engine level. --- .../release-notes/release-notes-5.8.0-M1.adoc | 6 +- .../jfr/FlightRecordingDiscoveryListener.java | 103 ++++++++++++++++++ ... => FlightRecordingExecutionListener.java} | 48 +++----- .../java/org/junit/platform/jfr/UniqueId.java | 28 +++++ ...latform.launcher.LauncherDiscoveryListener | 1 + ...it.platform.launcher.TestExecutionListener | 2 +- .../org.junit.platform.jfr/module-info.java | 4 +- .../launcher/LauncherDiscoveryListener.java | 26 ++++- .../launcher/core/DefaultLauncher.java | 9 +- .../core/EngineDiscoveryOrchestrator.java | 40 +++++-- .../CompositeLauncherDiscoveryListener.java | 11 ++ .../LoggingLauncherDiscoveryListener.java | 11 ++ ...LauncherFactoryForTestingPurposesOnly.java | 2 + .../testkit/engine/EngineTestKit.java | 3 +- ...dingDiscoveryListenerIntegrationTests.java | 52 +++++++++ ...ingExecutionListenerIntegrationTests.java} | 19 ++-- .../launcher/core/DefaultLauncherTests.java | 7 +- .../launcher/core/LauncherFactoryTests.java | 2 +- ...LoggingLauncherDiscoveryListenerTests.java | 4 +- .../junit-platform-jfr.expected.txt | 3 +- 20 files changed, 312 insertions(+), 69 deletions(-) create mode 100644 junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java rename junit-platform-jfr/src/main/java/org/junit/platform/jfr/{FlightRecordingListener.java => FlightRecordingExecutionListener.java} (79%) create mode 100644 junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java create mode 100644 junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener create mode 100644 platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java rename platform-tests/src/test/java/org/junit/platform/jfr/{FlightRecordingListenerIntegrationTests.java => FlightRecordingExecutionListenerIntegrationTests.java} (76%) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index d4e216a0edfe..152f754a5eff 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -32,8 +32,10 @@ on GitHub. nested container events when using the `EngineTestKit`. For example, `test(displayName("my test"))` can be used to match against a test whose display name is `my test`. -* The `junit-platform-jfr` module now also reports events for containers, e.g. test - classes. +* The `junit-platform-jfr` module now also reports execution events for containers, e.g. + test classes. +* The `junit-platform-jfr` module now also reports test discovery events for the launcher + and registered test engines. * Custom `LauncherDiscoveryListener` implementations can now be registered via Java’s `ServiceLoader` mechanism. diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java new file mode 100644 index 000000000000..0f0bde40d0ba --- /dev/null +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java @@ -0,0 +1,103 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.jfr; + +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicReference; + +import jdk.jfr.Category; +import jdk.jfr.Event; +import jdk.jfr.Label; +import jdk.jfr.Name; +import jdk.jfr.StackTrace; + +import org.apiguardian.api.API; +import org.junit.platform.engine.DiscoveryFilter; +import org.junit.platform.engine.DiscoverySelector; +import org.junit.platform.launcher.EngineDiscoveryResult; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherDiscoveryRequest; + +/** + * A {@link LauncherDiscoveryListener} that generates Java Flight Recorder + * events. + * + * @see JEP 328: Flight Recorder + * @since 1.8 + */ +@API(status = EXPERIMENTAL, since = "1.8") +public class FlightRecordingDiscoveryListener extends LauncherDiscoveryListener { + + private final AtomicReference launcherDiscoveryEvent = new AtomicReference<>(); + private final Map engineDiscoveryEvents = new ConcurrentHashMap<>(); + + @Override + public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) { + var event = new LauncherDiscoveryEvent(); + event.selectors = request.getSelectorsByType(DiscoverySelector.class).size(); + event.filters = request.getFiltersByType(DiscoveryFilter.class).size(); + event.begin(); + launcherDiscoveryEvent.set(event); + } + + @Override + public void launcherDiscoveryFinished(LauncherDiscoveryRequest request) { + launcherDiscoveryEvent.getAndSet(null).commit(); + } + + @Override + public void engineDiscoveryStarted(org.junit.platform.engine.UniqueId engineId) { + var event = new EngineDiscoveryEvent(); + event.uniqueId = engineId.toString(); + event.begin(); + engineDiscoveryEvents.put(engineId, event); + } + + @Override + public void engineDiscoveryFinished(org.junit.platform.engine.UniqueId engineId, EngineDiscoveryResult result) { + var event = engineDiscoveryEvents.remove(engineId); + event.result = result.getStatus().toString(); + event.commit(); + } + + @Category({ "JUnit", "Discovery" }) + @StackTrace(false) + abstract static class DiscoveryEvent extends Event { + } + + @Label("Test Discovery") + @Category({ "JUnit", "Discovery" }) + @Name("org.junit.LauncherDiscovery") + static class LauncherDiscoveryEvent extends DiscoveryEvent { + + @Label("Number of selectors") + int selectors; + + @Label("Number of filters") + int filters; + } + + @Label("Engine Discovery") + @Category({ "JUnit", "Discovery" }) + @Name("org.junit.EngineDiscovery") + static class EngineDiscoveryEvent extends DiscoveryEvent { + + @UniqueId + @Label("Unique Id") + String uniqueId; + + @Label("Result") + String result; + } +} diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingListener.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java similarity index 79% rename from junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingListener.java rename to junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java index 0393f12fa1ad..c7013a2aacfd 100644 --- a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingListener.java +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java @@ -12,10 +12,6 @@ import static org.apiguardian.api.API.Status.EXPERIMENTAL; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; @@ -24,9 +20,7 @@ import jdk.jfr.Category; import jdk.jfr.Event; import jdk.jfr.Label; -import jdk.jfr.MetadataDefinition; import jdk.jfr.Name; -import jdk.jfr.Relational; import jdk.jfr.StackTrace; import org.apiguardian.api.API; @@ -41,13 +35,13 @@ * events. * * @see JEP 328: Flight Recorder - * @since 1.7 + * @since 1.8 */ -@API(status = EXPERIMENTAL, since = "1.7") -public class FlightRecordingListener implements TestExecutionListener { +@API(status = EXPERIMENTAL, since = "1.8") +public class FlightRecordingExecutionListener implements TestExecutionListener { private final AtomicReference testPlanExecutionEvent = new AtomicReference<>(); - private final Map testExecutionEventMap = new ConcurrentHashMap<>(); + private final Map testExecutionEvents = new ConcurrentHashMap<>(); @Override public void testPlanExecutionStarted(TestPlan plan) { @@ -61,8 +55,7 @@ public void testPlanExecutionStarted(TestPlan plan) { @Override public void testPlanExecutionFinished(TestPlan plan) { - var event = testPlanExecutionEvent.get(); - event.commit(); + testPlanExecutionEvent.getAndSet(null).commit(); } @Override @@ -76,7 +69,7 @@ public void executionSkipped(TestIdentifier test, String reason) { @Override public void executionStarted(TestIdentifier test) { var event = new TestExecutionEvent(); - testExecutionEventMap.put(test.getUniqueId(), event); + testExecutionEvents.put(test.getUniqueId(), event); event.initialize(test); event.begin(); } @@ -84,7 +77,7 @@ public void executionStarted(TestIdentifier test) { @Override public void executionFinished(TestIdentifier test, TestExecutionResult result) { var throwable = result.getThrowable(); - var event = testExecutionEventMap.remove(test.getUniqueId()); + var event = testExecutionEvents.remove(test.getUniqueId()); event.end(); event.result = result.getStatus().toString(); event.exceptionClass = throwable.map(Throwable::getClass).orElse(null); @@ -103,28 +96,21 @@ public void reportingEntryPublished(TestIdentifier test, ReportEntry reportEntry } } - @Category("JUnit") - @Label("Test Plan") - @Name("org.junit.TestPlan") + @Category({ "JUnit", "Execution" }) @StackTrace(false) - static class TestPlanExecutionEvent extends Event { + abstract static class ExecutionEvent extends Event { + } + + @Label("Test Execution") + @Name("org.junit.TestPlanExecution") + static class TestPlanExecutionEvent extends ExecutionEvent { @Label("Contains Tests") boolean containsTests; @Label("Engine Names") String engineNames; } - @MetadataDefinition - @Relational - @Name("org.junit.UniqueId") - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.FIELD) - public @interface UniqueId { - } - - @Category("JUnit") - @StackTrace(false) - abstract static class TestEvent extends Event { + abstract static class TestEvent extends ExecutionEvent { @UniqueId @Label("Unique Id") String uniqueId; @@ -161,11 +147,9 @@ static class TestExecutionEvent extends TestEvent { String exceptionMessage; } - @Category("JUnit") @Label("Report Entry") @Name("org.junit.ReportEntry") - @StackTrace(false) - static class ReportEntryEvent extends Event { + static class ReportEntryEvent extends ExecutionEvent { @UniqueId @Label("Unique Id") String uniqueId; diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java new file mode 100644 index 000000000000..270d5b5c651b --- /dev/null +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java @@ -0,0 +1,28 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.jfr; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import jdk.jfr.MetadataDefinition; +import jdk.jfr.Name; +import jdk.jfr.Relational; + +@MetadataDefinition +@Relational +@Name("org.junit.UniqueId") +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +@interface UniqueId { +} diff --git a/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener b/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener new file mode 100644 index 000000000000..de4e472c48e7 --- /dev/null +++ b/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener @@ -0,0 +1 @@ +org.junit.platform.jfr.FlightRecordingDiscoveryListener diff --git a/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener b/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener index 34c207842512..35571863ed87 100644 --- a/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener +++ b/junit-platform-jfr/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener @@ -1 +1 @@ -org.junit.platform.jfr.FlightRecordingListener +org.junit.platform.jfr.FlightRecordingExecutionListener diff --git a/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java b/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java index c1b5dee50257..4fc851f0fd78 100644 --- a/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java +++ b/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java @@ -23,6 +23,8 @@ requires org.junit.platform.engine; requires org.junit.platform.launcher; + provides org.junit.platform.launcher.LauncherDiscoveryListener + with org.junit.platform.jfr.FlightRecordingDiscoveryListener; provides org.junit.platform.launcher.TestExecutionListener - with org.junit.platform.jfr.FlightRecordingListener; + with org.junit.platform.jfr.FlightRecordingExecutionListener; } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index 65fa3219270a..553b1a829737 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -21,9 +21,9 @@ * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} * to be notified of events that occur during test discovery. * - *

    All methods in this interface have empty default implementations. - * Concrete implementations may therefore override one or more of these methods - * to be notified of the selected events. + *

    All methods in this class have empty default implementations. + * Subclasses may therefore override one or more of these methods to be notified + * of the selected events. * *

    JUnit provides default implementations that are created via the factory * methods in @@ -49,6 +49,26 @@ public abstract class LauncherDiscoveryListener implements EngineDiscoveryListen public LauncherDiscoveryListener() { } + /** + * Called when test discovery is about to be started. + * + * @param request the request for which discovery is being started + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) { + } + + /** + * Called when test discovery has finished. + * + * @param request the request for which discovery has finished + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + public void launcherDiscoveryFinished(LauncherDiscoveryRequest request) { + } + /** * Called when test discovery is about to be started for an engine. * diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java index f42d5d9c3a18..5e1516fe45c1 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java @@ -11,6 +11,8 @@ package org.junit.platform.launcher.core; import static java.util.Collections.unmodifiableCollection; +import static org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.Phase.DISCOVERY; +import static org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.Phase.EXECUTION; import java.util.Collection; @@ -71,7 +73,7 @@ public void registerTestExecutionListeners(TestExecutionListener... listeners) { @Override public TestPlan discover(LauncherDiscoveryRequest discoveryRequest) { Preconditions.notNull(discoveryRequest, "LauncherDiscoveryRequest must not be null"); - return InternalTestPlan.from(discover(discoveryRequest, "discovery")); + return InternalTestPlan.from(discover(discoveryRequest, DISCOVERY)); } @Override @@ -79,7 +81,7 @@ public void execute(LauncherDiscoveryRequest discoveryRequest, TestExecutionList Preconditions.notNull(discoveryRequest, "LauncherDiscoveryRequest must not be null"); Preconditions.notNull(listeners, "TestExecutionListener array must not be null"); Preconditions.containsNoNullElements(listeners, "individual listeners must not be null"); - execute(InternalTestPlan.from(discover(discoveryRequest, "execution")), listeners); + execute(InternalTestPlan.from(discover(discoveryRequest, EXECUTION)), listeners); } @Override @@ -99,7 +101,8 @@ LauncherDiscoveryListener getLauncherDiscoveryListener(LauncherDiscoveryRequest return discoveryOrchestrator.getLauncherDiscoveryListener(discoveryRequest); } - private LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, String phase) { + private LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, + EngineDiscoveryOrchestrator.Phase phase) { return discoveryOrchestrator.discover(discoveryRequest, phase); } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java index 002944d84ce5..3b9ea03be8d4 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java @@ -19,6 +19,7 @@ import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Optional; import java.util.stream.Stream; @@ -70,7 +71,19 @@ public EngineDiscoveryOrchestrator(Iterable testEngines, * filters} and {@linkplain PostDiscoveryFilter post-discovery filters} and * {@linkplain TestDescriptor#prune() prunes} the resulting test tree. */ - public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, String phase) { + public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, Phase phase) { + LauncherDiscoveryListener listener = getLauncherDiscoveryListener(request); + listener.launcherDiscoveryStarted(request); + try { + return discoverSafely(request, phase, listener); + } + finally { + listener.launcherDiscoveryFinished(request); + } + } + + private LauncherDiscoveryResult discoverSafely(LauncherDiscoveryRequest request, Phase phase, + LauncherDiscoveryListener listener) { Map testEngineDescriptors = new LinkedHashMap<>(); for (TestEngine testEngine : this.testEngines) { @@ -80,7 +93,7 @@ public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, String if (engineIsExcluded) { logger.debug(() -> String.format( - "Test discovery for engine '%s' was skipped due to an EngineFilter in phase '%s'.", + "Test discovery for engine '%s' was skipped due to an EngineFilter in %s phase.", testEngine.getId(), phase)); continue; } @@ -88,7 +101,7 @@ public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, String logger.debug(() -> String.format("Discovering tests during Launcher %s phase in engine '%s'.", phase, testEngine.getId())); - TestDescriptor rootDescriptor = discoverEngineRoot(testEngine, request); + TestDescriptor rootDescriptor = discoverEngineRoot(testEngine, request, listener); testEngineDescriptors.put(testEngine, rootDescriptor); } @@ -101,21 +114,21 @@ public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, String return new LauncherDiscoveryResult(testEngineDescriptors, request.getConfigurationParameters()); } - private TestDescriptor discoverEngineRoot(TestEngine testEngine, LauncherDiscoveryRequest discoveryRequest) { - LauncherDiscoveryListener discoveryListener = getLauncherDiscoveryListener(discoveryRequest); + private TestDescriptor discoverEngineRoot(TestEngine testEngine, LauncherDiscoveryRequest request, + LauncherDiscoveryListener listener) { UniqueId uniqueEngineId = UniqueId.forEngine(testEngine.getId()); try { - discoveryListener.engineDiscoveryStarted(uniqueEngineId); - TestDescriptor engineRoot = testEngine.discover(discoveryRequest, uniqueEngineId); + listener.engineDiscoveryStarted(uniqueEngineId); + TestDescriptor engineRoot = testEngine.discover(request, uniqueEngineId); discoveryResultValidator.validate(testEngine, engineRoot); - discoveryListener.engineDiscoveryFinished(uniqueEngineId, EngineDiscoveryResult.successful()); + listener.engineDiscoveryFinished(uniqueEngineId, EngineDiscoveryResult.successful()); return engineRoot; } catch (Throwable throwable) { UnrecoverableExceptions.rethrowIfUnrecoverable(throwable); String message = String.format("TestEngine with ID '%s' failed to discover tests", testEngine.getId()); JUnitException cause = new JUnitException(message, throwable); - discoveryListener.engineDiscoveryFinished(uniqueEngineId, EngineDiscoveryResult.failed(cause)); + listener.engineDiscoveryFinished(uniqueEngineId, EngineDiscoveryResult.failed(cause)); return new EngineDiscoveryErrorDescriptor(uniqueEngineId, testEngine, cause); } } @@ -183,4 +196,13 @@ private void acceptInAllTestEngines(Map testEngineDe testEngineDescriptors.values().forEach(descriptor -> descriptor.accept(visitor)); } + public enum Phase { + DISCOVERY, EXECUTION; + + @Override + public String toString() { + return name().toLowerCase(Locale.ENGLISH); + } + } + } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java index d50c0920d3e7..efaffcef2c5a 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java @@ -19,6 +19,7 @@ import org.junit.platform.engine.UniqueId; import org.junit.platform.launcher.EngineDiscoveryResult; import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherDiscoveryRequest; /** * @since 1.6 @@ -32,6 +33,16 @@ class CompositeLauncherDiscoveryListener extends LauncherDiscoveryListener { this.listeners = Collections.unmodifiableList(new ArrayList<>(listeners)); } + @Override + public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) { + listeners.forEach(delegate -> delegate.launcherDiscoveryStarted(request)); + } + + @Override + public void launcherDiscoveryFinished(LauncherDiscoveryRequest request) { + listeners.forEach(delegate -> delegate.launcherDiscoveryFinished(request)); + } + @Override public void engineDiscoveryStarted(UniqueId engineId) { listeners.forEach(delegate -> delegate.engineDiscoveryStarted(engineId)); diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java index 3fc606cec774..aa651de7a13c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java @@ -24,6 +24,7 @@ import org.junit.platform.engine.discovery.UniqueIdSelector; import org.junit.platform.launcher.EngineDiscoveryResult; import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherDiscoveryRequest; /** * @since 1.6 @@ -33,6 +34,16 @@ class LoggingLauncherDiscoveryListener extends LauncherDiscoveryListener { private static final Logger logger = LoggerFactory.getLogger(LoggingLauncherDiscoveryListener.class); + @Override + public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) { + logger.trace(() -> "Test discovery started"); + } + + @Override + public void launcherDiscoveryFinished(LauncherDiscoveryRequest request) { + logger.trace(() -> "Test discovery finished"); + } + @Override public void engineDiscoveryStarted(UniqueId engineId) { logger.trace(() -> "Engine " + engineId + " has started discovering tests"); diff --git a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java index c2dbd3a745d2..e71c334b3869 100644 --- a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java +++ b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java @@ -22,7 +22,9 @@ public static Launcher createLauncher(TestEngine... engines) { return LauncherFactory.create(LauncherConfig.builder() // .enableTestEngineAutoRegistration(false) // .addTestEngines(engines) // + .enableLauncherDiscoveryListenerAutoRegistration(false) // .enableTestExecutionListenerAutoRegistration(false) // + .enablePostDiscoveryFilterAutoRegistration(false) // .build()); } diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java index f1c87fe44a44..76b7594ccacd 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java @@ -18,6 +18,7 @@ import static org.apiguardian.api.API.Status.DEPRECATED; import static org.apiguardian.api.API.Status.EXPERIMENTAL; import static org.apiguardian.api.API.Status.MAINTAINED; +import static org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.Phase.EXECUTION; import java.util.ArrayList; import java.util.List; @@ -266,7 +267,7 @@ private static void executeUsingLauncherOrchestration(TestEngine testEngine, LauncherDiscoveryRequest discoveryRequest, EngineExecutionListener listener) { TestDescriptor engineTestDescriptor; LauncherDiscoveryResult discoveryResult = new EngineDiscoveryOrchestrator(singleton(testEngine), emptySet(), - emptySet()).discover(discoveryRequest, "testing"); + emptySet()).discover(discoveryRequest, EXECUTION); engineTestDescriptor = discoveryResult.getEngineTestDescriptor(testEngine); Preconditions.notNull(engineTestDescriptor, "TestEngine did not yield a TestDescriptor"); new EngineExecutionOrchestrator().execute(discoveryResult, listener); diff --git a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java new file mode 100644 index 000000000000..c70de8452e61 --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java @@ -0,0 +1,52 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.jfr; + +import static dev.morling.jfrunit.ExpectedEvent.event; +import static dev.morling.jfrunit.JfrEventsAssert.assertThat; +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; +import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; + +import dev.morling.jfrunit.EnableEvent; +import dev.morling.jfrunit.JfrEventTest; +import dev.morling.jfrunit.JfrEvents; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.engine.JupiterTestEngine; +import org.junit.platform.launcher.core.LauncherFactoryForTestingPurposesOnly; + +@JfrEventTest +public class FlightRecordingDiscoveryListenerIntegrationTests { + + public JfrEvents jfrEvents = new JfrEvents(); + + @Test + @EnableEvent("org.junit.*") + void reportsEvents() { + var launcher = LauncherFactoryForTestingPurposesOnly.createLauncher(new JupiterTestEngine()); + var request = request() // + .selectors(selectClass(FlightRecordingDiscoveryListenerIntegrationTests.class)) // + .listeners(new FlightRecordingDiscoveryListener()) // + .build(); + + launcher.discover(request); + jfrEvents.awaitEvents(); + + assertThat(jfrEvents) // + .contains(event("org.junit.LauncherDiscovery") // + // TODO JfrUnit does not yey support checking int values + // .with("selectors", 1) // + // .with("filters", 0) // + ) // + .contains(event("org.junit.EngineDiscovery") // + .with("uniqueId", "[engine:junit-jupiter]")); + } +} diff --git a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java similarity index 76% rename from platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingListenerIntegrationTests.java rename to platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java index 568a58580a50..36ff8135f444 100644 --- a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingListenerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java @@ -23,38 +23,33 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestReporter; import org.junit.jupiter.engine.JupiterTestEngine; -import org.junit.platform.launcher.core.LauncherConfig; -import org.junit.platform.launcher.core.LauncherFactory; +import org.junit.platform.launcher.core.LauncherFactoryForTestingPurposesOnly; @JfrEventTest -public class FlightRecordingListenerIntegrationTests { +public class FlightRecordingExecutionListenerIntegrationTests { public JfrEvents jfrEvents = new JfrEvents(); @Test @EnableEvent("org.junit.*") void reportsEvents() { - var config = LauncherConfig.builder() // - .enableTestExecutionListenerAutoRegistration(false) // - .enableTestEngineAutoRegistration(false) // - .addTestEngines(new JupiterTestEngine()) // - .build(); + var launcher = LauncherFactoryForTestingPurposesOnly.createLauncher(new JupiterTestEngine()); var request = request() // .selectors(selectClass(TestCase.class)) // .build(); - LauncherFactory.create(config).execute(request, new FlightRecordingListener()); + launcher.execute(request, new FlightRecordingExecutionListener()); jfrEvents.awaitEvents(); assertThat(jfrEvents) // - .contains(event("org.junit.TestPlan") // + .contains(event("org.junit.TestPlanExecution") // .with("engineNames", "JUnit Jupiter")) // .contains(event("org.junit.TestExecution") // .with("displayName", "JUnit Jupiter") // .with("type", "CONTAINER")) // .contains(event("org.junit.TestExecution") // - .with("displayName", FlightRecordingListenerIntegrationTests.class.getSimpleName() + "$" - + TestCase.class.getSimpleName()) // + .with("displayName", FlightRecordingExecutionListenerIntegrationTests.class.getSimpleName() + + "$" + TestCase.class.getSimpleName()) // .with("type", "CONTAINER")) // .contains(event("org.junit.TestExecution") // .with("displayName", "test(TestReporter)") // diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java index 08468c284c9e..8910104380a8 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java @@ -170,14 +170,17 @@ public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId var launcher = createLauncher(engine); var discoveryListener = mock(LauncherDiscoveryListener.class); - var testPlan = launcher.discover(request() // + var request = request() // .listeners(discoveryListener) // .configurationParameter(DEFAULT_DISCOVERY_LISTENER_CONFIGURATION_PROPERTY_NAME, "logging") // - .build()); + .build(); + var testPlan = launcher.discover(request); assertThat(testPlan.getRoots()).hasSize(1); var engineIdentifier = getOnlyElement(testPlan.getRoots()); assertThat(getOnlyElement(testPlan.getRoots()).getDisplayName()).isEqualTo("my-engine-id"); + verify(discoveryListener).launcherDiscoveryStarted(request); + verify(discoveryListener).launcherDiscoveryFinished(request); assertDiscoveryFailed(engine, discoveryListener); var listener = mock(TestExecutionListener.class); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java index d510aa3a9c91..13200078408c 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java @@ -187,7 +187,7 @@ void discoversLauncherDiscoverRequestListenerViaServiceApiByDefault() { assertThat(launcherDiscoveryListener.getClass().getSimpleName()).startsWith("Composite"); assertThat(launcherDiscoveryListener).extracting("listeners").asList() // - .containsExactlyInAnyOrder(new TestLauncherDiscoveryListener(), abortOnFailure()); + .contains(new TestLauncherDiscoveryListener(), abortOnFailure()); }); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java index 285e80b82262..fbac2f47f921 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java @@ -119,8 +119,10 @@ void logsTraceMessageOnStartAndEnd(LogRecordListener log) { assertThat(log.stream(LoggingLauncherDiscoveryListener.class, Level.FINER)) // .extracting(LogRecord::getMessage) // .containsExactly( // + "Test discovery started", // "Engine [engine:some-engine] has started discovering tests", // - "Engine [engine:some-engine] has finished discovering tests"); + "Engine [engine:some-engine] has finished discovering tests", // + "Test discovery finished"); } } diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt index 7c18391a5ad1..ecee3737775f 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt @@ -4,5 +4,6 @@ requires jdk.jfr requires org.apiguardian.api requires org.junit.platform.engine requires org.junit.platform.launcher -provides org.junit.platform.launcher.TestExecutionListener with org.junit.platform.jfr.FlightRecordingListener +provides org.junit.platform.launcher.LauncherDiscoveryListener with org.junit.platform.jfr.FlightRecordingDiscoveryListener +provides org.junit.platform.launcher.TestExecutionListener with org.junit.platform.jfr.FlightRecordingExecutionListener contains org.junit.platform.jfr From 47d1ee494fde4dc154d3ad3d02a4e7c8b9339d3d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 09:09:27 +0100 Subject: [PATCH 0117/1433] Remove Codecov token According to their docs, GH Actions workflows don't require a token. --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b1a983b3bfe2..6eb7164f4b17 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -157,8 +157,6 @@ jobs: ./gradlew --scan --no-parallel --stacktrace --warning-mode=all -PenableJaCoCo build jacocoRootReport - name: Upload to Codecov.io shell: bash - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: | bash <(curl -s https://codecov.io/bash) From 377775325791779ac78920c4c97fa04985621413 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 18:16:15 +0100 Subject: [PATCH 0118/1433] Update codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index de13166399f7..e5c81b22cb8b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,12 +39,7 @@ jobs: # a pull request then we can checkout the head. fetch-depth: 2 - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # Install and setup JDK + # Install and setup JDK - name: Setup JDK 11 uses: actions/setup-java@v1 with: From 075e4b62aff65da1c6163c32ee74168e7cfa7905 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 19:21:32 +0100 Subject: [PATCH 0119/1433] Add auto-imported settings from Intellij IDEA 2020.3 --- .idea/vcs.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index f77f7d2313e4..cac68bbbeb72 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,5 +1,15 @@ + + + + \ No newline at end of file From 4747ae5bf3b2a889a83a3ccf6f5abf76ae840ee8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 19:21:55 +0100 Subject: [PATCH 0120/1433] Use official Codecov GH Action --- .github/workflows/main.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6eb7164f4b17..03479b427db7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -156,9 +156,7 @@ jobs: ./gradlew --version ./gradlew --scan --no-parallel --stacktrace --warning-mode=all -PenableJaCoCo build jacocoRootReport - name: Upload to Codecov.io - shell: bash - run: | - bash <(curl -s https://codecov.io/bash) + uses: codecov/codecov-action@v1 publish_artifacts: name: Publish Snapshot Artifacts From a2eed5ced250d918209dbce517df84a017a1c9d7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 19:27:29 +0100 Subject: [PATCH 0121/1433] Configure fetch-depth in all workflows --- .github/workflows/cross-version.yml | 2 ++ .github/workflows/gradle-wrapper-validation.yml | 2 ++ .github/workflows/main.yml | 13 +++++++++++++ .github/workflows/reproducible-build.yml | 2 ++ 4 files changed, 19 insertions(+) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index f6094e86692e..0ac665a6c27a 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -24,6 +24,8 @@ jobs: container: "ghcr.io/junit-team/build:${{ matrix.jdk }}" steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 405a2b306592..ba7ceef98a0a 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -7,4 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03479b427db7..2e0cb83e79c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,6 +21,8 @@ jobs: container: ghcr.io/junit-team/build steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: @@ -51,6 +53,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: @@ -94,6 +98,8 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: @@ -130,6 +136,9 @@ jobs: container: ghcr.io/junit-team/build steps: - uses: actions/checkout@v2 + with: + # Codecov needs fetch-depth > 1 + fetch-depth: 2 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: @@ -165,6 +174,8 @@ jobs: if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: @@ -192,6 +203,8 @@ jobs: if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index c50b8a0baf47..b53c03ef6d2a 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -18,6 +18,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + fetch-depth: 1 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: From d4857247ab79c31c3a1df5e5e3d8e7e9e532accc Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 19:29:37 +0100 Subject: [PATCH 0122/1433] Remove --warning-mode=all in favor of build scans --- .github/workflows/cross-version.yml | 2 +- .github/workflows/main.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 0ac665a6c27a..afc53e9d4e6a 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -49,4 +49,4 @@ jobs: - name: Test run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" + ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e0cb83e79c6..2bbeab311873 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: - name: 'Test' run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build + ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true build windows: name: 'Windows' @@ -91,7 +91,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build + ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build ./gradlew --stop mac: name: 'Mac OS' @@ -127,7 +127,7 @@ jobs: - name: 'Test' run: | ./gradlew --version - ./gradlew --scan --no-parallel --warning-mode=all -Dplatform.tooling.support.tests.enabled=true build + ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true build coverage: name: 'Coverage' @@ -163,7 +163,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew --scan --no-parallel --stacktrace --warning-mode=all -PenableJaCoCo build jacocoRootReport + ./gradlew --scan --no-parallel --stacktrace -PenableJaCoCo build jacocoRootReport - name: Upload to Codecov.io uses: codecov/codecov-action@v1 From b30ff5d71206fb11983d9ba9603337f7ad82a501 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 19:34:48 +0100 Subject: [PATCH 0123/1433] Merge coverage with Linux job --- .github/workflows/main.yml | 73 ++++++++++---------------------------- 1 file changed, 19 insertions(+), 54 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2bbeab311873..85a3762951da 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ env: jobs: linux: - name: 'Linux' + name: Linux runs-on: ubuntu-latest container: ghcr.io/junit-team/build steps: @@ -43,13 +43,15 @@ jobs: run: | mkdir -p /root/.gradle/enterprise/ echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > /root/.gradle/enterprise/keys.properties - - name: 'Test' + - name: Test and Coverage run: | ./gradlew --version - ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true build + ./gradlew --scan --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo build jacocoRootReport + - name: Upload to Codecov.io + uses: codecov/codecov-action@v1 windows: - name: 'Windows' + name: Windows runs-on: windows-latest steps: - uses: actions/checkout@v2 @@ -71,14 +73,14 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- - - name: 'Set up JDK 8' + - name: Set up JDK 8 uses: actions/setup-java@v1 with: java-version: 8 - - name: 'Prepare JDK8 env var' + - name: Prepare JDK8 env var shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - - name: 'Set up JDK 15' + - name: Set up JDK 15 uses: actions/setup-java@v1 with: java-version: 15 @@ -87,14 +89,15 @@ jobs: run: | mkdir -p $HOME/.gradle/enterprise/ echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties - - name: 'Test' + - name: Test shell: bash run: | ./gradlew --version - ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build + ./gradlew --scan --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build ./gradlew --stop + mac: - name: 'Mac OS' + name: Mac OS runs-on: macos-latest steps: - uses: actions/checkout@v2 @@ -116,7 +119,7 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- - - name: 'Set up JDK 15' + - name: Set up JDK 15 uses: actions/setup-java@v1 with: java-version: 15 @@ -127,45 +130,7 @@ jobs: - name: 'Test' run: | ./gradlew --version - ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true build - - coverage: - name: 'Coverage' - needs: linux - runs-on: ubuntu-latest - container: ghcr.io/junit-team/build - steps: - - uses: actions/checkout@v2 - with: - # Codecov needs fetch-depth > 1 - fetch-depth: 2 - - name: Cache Gradle wrapper and dependencies - uses: actions/cache@v2 - with: - path: | - /root/.gradle/caches/ - /root/.gradle/wrapper/dists - key: coverage-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} - restore-keys: | - coverage-${{ runner.os }}-gradle- - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: /root/.m2/repository - key: coverage-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - coverage-${{ runner.os }}-maven- - - name: Prepare Gradle Enterprise credentials - run: | - mkdir -p /root/.gradle/enterprise/ - echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > /root/.gradle/enterprise/keys.properties - - name: 'Run tests with JaCoCo' - shell: bash - run: | - ./gradlew --version - ./gradlew --scan --no-parallel --stacktrace -PenableJaCoCo build jacocoRootReport - - name: Upload to Codecov.io - uses: codecov/codecov-action@v1 + ./gradlew --scan --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true build publish_artifacts: name: Publish Snapshot Artifacts @@ -185,11 +150,11 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: 'Set up JDK 15' + - name: Set up JDK 15 uses: actions/setup-java@v1 with: java-version: 15 - - name: 'Publish' + - name: Publish env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} @@ -214,11 +179,11 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: 'Set up JDK 15' + - name: Set up JDK 15 uses: actions/setup-java@v1 with: java-version: 15 - - name: 'Upload Documentation' + - name: Upload Documentation env: GRGIT_USER: ${{ secrets.GH_TOKEN }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} From 52c1beb7d1a8279a44769835530405e7aa6617a9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 21:13:55 +0100 Subject: [PATCH 0124/1433] Increase fetch-depth for Codecov --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 85a3762951da..396911c24813 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,8 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth: 1 + # Codecov needs fetch-depth > 1 + fetch-depth: 2 - name: Cache Gradle wrapper and dependencies uses: actions/cache@v2 with: From 49d1308aad3df3972a9dc1137e122d9783820e5c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 28 Dec 2020 21:18:47 +0100 Subject: [PATCH 0125/1433] Add caching step to CodeQL workflow --- .github/workflows/codeql-analysis.yml | 43 +++++---------------------- 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e5c81b22cb8b..e91dd4d6a5bb 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,8 +1,3 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. name: "CodeQL" on: @@ -21,51 +16,30 @@ jobs: analyze: name: Analyze runs-on: ubuntu-latest - strategy: fail-fast: false matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] language: ['java', 'javascript'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - steps: - name: Checkout repository uses: actions/checkout@v2 + - name: Cache Gradle wrapper and dependencies + uses: actions/cache@v2 with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # Install and setup JDK + path: | + /root/.gradle/caches/ + /root/.gradle/wrapper/dists + key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} + restore-keys: | + test-${{ runner.os }}-gradle- - name: Setup JDK 11 uses: actions/setup-java@v1 with: java-version: 11 - - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - #- name: Autobuild - # uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - name: Prepare Gradle Enterprise credentials run: | mkdir -p $HOME/.gradle/enterprise/ @@ -74,6 +48,5 @@ jobs: run: | ./gradlew --version ./gradlew --no-build-cache allMainClasses -PjavaToolchainVersion=11 - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 From 3795d71dbfe869235c3a44f239e6bc2096230e7f Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 2 Jan 2021 20:20:24 +0100 Subject: [PATCH 0126/1433] Document constant value for ExclusiveResource.GLOBAL_KEY (#2511) By documenting the value of `ExclusiveResource.GLOBAL_KEY` test engines that can not reference constants from a class file may use plain text configuration to run tests in isolation. Additionally by documenting the constants used in `Resources` the canonical resource names are exposed and can be consistently used elsewhere. Fixes #2508. --- .../release-notes/release-notes-5.8.0-M1.adoc | 2 ++ .../junit/jupiter/api/parallel/Isolated.java | 2 +- .../junit/jupiter/api/parallel/Resources.java | 22 ++++++++++++++----- .../hierarchical/ExclusiveResource.java | 3 ++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 152f754a5eff..9965b080795c 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -38,6 +38,7 @@ on GitHub. and registered test engines. * Custom `LauncherDiscoveryListener` implementations can now be registered via Java’s `ServiceLoader` mechanism. +* Documented constant value of `ExclusiveResource.GLOBAL_KEY`. [[release-notes-5.8.0-M1-junit-jupiter]] @@ -56,6 +57,7 @@ on GitHub. * Numeric literals used with `@CsvSource` or `CsvFileSource` can now be expressed using underscores as in some JVM languages, to improve readability of long numbers like `700_000_000`. +* Documented constant values in `Resources`. [[release-notes-5.8.0-M1-junit-vintage]] diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java index 8146166eaead..104e6a44ef62 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java @@ -37,7 +37,7 @@ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Inherited -@ResourceLock("org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY") +@ResourceLock(Resources.GLOBAL) public @interface Isolated { /** diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java index 6028eab46f5a..b82569c5b92d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java @@ -24,7 +24,7 @@ public class Resources { /** - * Represents Java's system properties. + * Represents Java's system properties: {@value} * * @see System#getProperties() * @see System#setProperties(java.util.Properties) @@ -32,7 +32,7 @@ public class Resources { public static final String SYSTEM_PROPERTIES = "java.lang.System.properties"; /** - * Represents the standard output stream of the current process. + * Represents the standard output stream of the current process: {@value} * * @see System#out * @see System#setOut(java.io.PrintStream) @@ -40,7 +40,7 @@ public class Resources { public static final String SYSTEM_OUT = "java.lang.System.out"; /** - * Represents the standard error stream of the current process. + * Represents the standard error stream of the current process: {@value} * * @see System#err * @see System#setErr(java.io.PrintStream) @@ -48,7 +48,8 @@ public class Resources { public static final String SYSTEM_ERR = "java.lang.System.err"; /** - * Represents the default locale for the current instance of the JVM. + * Represents the default locale for the current instance of the JVM: + * {@value} * * @since 5.4 * @see java.util.Locale#setDefault(java.util.Locale) @@ -57,7 +58,8 @@ public class Resources { public static final String LOCALE = "java.util.Locale.default"; /** - * Represents the default time zone for the current instance of the JVM. + * Represents the default time zone for the current instance of the JVM: + * {@value} * * @since 5.4 * @see java.util.TimeZone#setDefault(java.util.TimeZone) @@ -65,6 +67,16 @@ public class Resources { @API(status = EXPERIMENTAL, since = "5.4") public static final String TIME_ZONE = "java.util.TimeZone.default"; + /** + * Represents the global resource lock: {@value} + * + * @since 5.8 + * @see Isolated + * @see ExclusiveResource + */ + @API(status = EXPERIMENTAL, since = "5.8") + public static final String GLOBAL = "org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY"; + private Resources() { /* no-op */ } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java index 72f54c396348..564350ae10ac 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java @@ -32,7 +32,8 @@ public class ExclusiveResource { /** * Key of the global resource lock that all direct children of the engine - * descriptor acquire in {@linkplain LockMode#READ read mode} by default. + * descriptor acquire in {@linkplain LockMode#READ read mode} by default: + * {@value} * *

    If any node {@linkplain Node#getExclusiveResources() requires} an * exclusive resource with the same key in From 03a79c13f612099a8fc328aa2bcff23e4f8dcc2c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 3 Jan 2021 11:31:44 +0100 Subject: [PATCH 0127/1433] Deprecate accidentally public constructor --- .../core/LauncherDiscoveryRequestBuilder.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java index 272973ad8802..7a27914cad8a 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java @@ -10,6 +10,7 @@ package org.junit.platform.launcher.core; +import static org.apiguardian.api.API.Status.DEPRECATED; import static org.apiguardian.api.API.Status.STABLE; import java.util.ArrayList; @@ -107,7 +108,19 @@ public final class LauncherDiscoveryRequestBuilder { * @return a new builder */ public static LauncherDiscoveryRequestBuilder request() { - return new LauncherDiscoveryRequestBuilder(); + return new LauncherDiscoveryRequestBuilder(null); + } + + /** + * @deprecated Use {@link #request()} + */ + @API(status = DEPRECATED, since = "5.8") + @Deprecated + public LauncherDiscoveryRequestBuilder() { + this(null); + } + + private LauncherDiscoveryRequestBuilder(@SuppressWarnings("unused") Object ignored) { } /** From f6353883f23ee3d9a1027224c682e0477782b962 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 4 Jan 2021 14:54:47 +0100 Subject: [PATCH 0128/1433] Fix Javadoc --- .../java/org/junit/jupiter/api/parallel/Resources.java | 2 +- .../src/module/org.junit.platform.jfr/module-info.java | 8 +++++--- .../platform/launcher/LauncherDiscoveryListener.java | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java index b82569c5b92d..89a22048319e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java @@ -72,7 +72,7 @@ public class Resources { * * @since 5.8 * @see Isolated - * @see ExclusiveResource + * @see org.junit.platform.engine.support.hierarchical.ExclusiveResource */ @API(status = EXPERIMENTAL, since = "5.8") public static final String GLOBAL = "org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_KEY"; diff --git a/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java b/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java index 4fc851f0fd78..0636e4eff966 100644 --- a/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java +++ b/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java @@ -9,10 +9,12 @@ */ /** - * Provides the JUnit Platform Flight Recording Listener. + * Provides Java Flight Recorder events for the JUnit Platform. * - *

    The Flight Recording Listener is a {@link TestExecutionListener} that - * generates Java Flight Recorder events. + *

    The Flight Recording Listener module implements a + * {@link org.junit.platform.launcher.LauncherDiscoveryListener} and a + * {@link org.junit.platform.launcher.TestExecutionListener} that generate Java + * Flight Recorder (JFR) events. * * @see JEP 328: Flight Recorder * @since 1.7 diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index 553b1a829737..38ae37af3710 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -17,9 +17,9 @@ import org.junit.platform.engine.UniqueId; /** - * Register a concrete implementation of this interface with a - * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} - * to be notified of events that occur during test discovery. + * Register a concrete implementation of this class with a + * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} or + * {@link Launcher} to be notified of events that occur during test discovery. * *

    All methods in this class have empty default implementations. * Subclasses may therefore override one or more of these methods to be notified @@ -35,6 +35,7 @@ * * @see org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners * @see LauncherDiscoveryRequest#getDiscoveryListener() + * @see org.junit.platform.launcher.core.LauncherConfig.Builder#addLauncherDiscoveryListeners * @since 1.6 */ @API(status = EXPERIMENTAL, since = "1.6") From 610614ae917c6d211663798142a2dbbe50a10a04 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 4 Jan 2021 15:00:18 +0100 Subject: [PATCH 0129/1433] Revert premature change --- .../junit/platform/launcher/LauncherDiscoveryListener.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index 38ae37af3710..8830e252a8a5 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -18,8 +18,8 @@ /** * Register a concrete implementation of this class with a - * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} or - * {@link Launcher} to be notified of events that occur during test discovery. + * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} + * to be notified of events that occur during test discovery. * *

    All methods in this class have empty default implementations. * Subclasses may therefore override one or more of these methods to be notified @@ -35,7 +35,6 @@ * * @see org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners * @see LauncherDiscoveryRequest#getDiscoveryListener() - * @see org.junit.platform.launcher.core.LauncherConfig.Builder#addLauncherDiscoveryListeners * @since 1.6 */ @API(status = EXPERIMENTAL, since = "1.6") From a73ac51f72b455a1b9ca93220b944b8d3802a574 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Mon, 4 Jan 2021 19:01:48 +0100 Subject: [PATCH 0130/1433] Introduce test for scanning classes in a modular JAR Addresses #2500 --- .../commons/util/ClasspathScannerTests.java | 22 ++++++++++++++++++ .../src/test/resources/com.greetings@1-ea.jar | Bin 0 -> 1380 bytes 2 files changed, 22 insertions(+) create mode 100644 platform-tests/src/test/resources/com.greetings@1-ea.jar diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java index 38f9c0304da3..a752394aef77 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java @@ -18,6 +18,7 @@ import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.io.IOException; +import java.lang.module.ModuleFinder; import java.net.URI; import java.net.URL; import java.net.URLClassLoader; @@ -27,6 +28,7 @@ import java.util.ArrayList; import java.util.Enumeration; import java.util.List; +import java.util.Set; import java.util.function.BiFunction; import java.util.function.Predicate; import java.util.logging.Level; @@ -176,6 +178,26 @@ void scanForClassesInPackage() { assertTrue(classes.contains(MemberClassToBeFound.class)); } + @Test + // #2500 + void scanForClassesInPackageWithinModuleSharingNames() throws Exception { + var jarfile = getClass().getResource("/com.greetings@1-ea.jar"); + + var module = "com.greetings"; + var before = ModuleFinder.of(); + var finder = ModuleFinder.of(Path.of(jarfile.toURI())); + var boot = ModuleLayer.boot(); + var configuration = boot.configuration().resolveAndBind(before, finder, Set.of(module)); + var parent = ClassLoader.getPlatformClassLoader(); + var layer = ModuleLayer.defineModulesWithOneLoader(configuration, List.of(boot), parent).layer(); + + var classpathScanner = new ClasspathScanner(() -> layer.findLoader(module), ReflectionUtils::tryToLoadClass); + + var classes = classpathScanner.scanForClassesInPackage("com.greetings", allClasses); + var classNames = classes.stream().map(Class::getName).collect(Collectors.toList()); + assertThat(classNames).hasSize(1).contains("com.greetings.Main"); + } + @Test void findAllClassesInPackageWithinJarFile() throws Exception { var jarfile = getClass().getResource("/jartest.jar"); diff --git a/platform-tests/src/test/resources/com.greetings@1-ea.jar b/platform-tests/src/test/resources/com.greetings@1-ea.jar new file mode 100644 index 0000000000000000000000000000000000000000..38c7b065939520c1cc747b02cbb4e2acacdda028 GIT binary patch literal 1380 zcmWIWW@Zs#;Nak35ScF@$bbYm8CV#6T|*poJ^kGD|D9rBU}gyLX6FE@V1gw{R=$JI~Y~A6>8x?o#*50=_>i_%x z3#U4D%G@7anr*&$_7<)dg^C+re;!I|>s1IfS$O#_=M!o7wMtXcoLSTIgZ9U$xoGNc z{_U#0HV))A=Y6ZhqJTEX0Wog32?Awv^HWN5Qgt))((?6^a}tY-eSNL@ngRsogt7?Q za~zBASh!)6$wp(tk1YN%oLzfb)UVAueTcb2<1w?+uA_BnY3XtAj|(3Vk~_Hbg!9Bt zIw$)sF$vzWSFq@ut-zyH$@yr`&sixOKP3wE6darN(Zo1^#!okunXIe-{dg#RgJt&@ zu5V5o`P(mWiMQPI6RSM(S|zn<=gKC|!&NuCUg#u+wFL4`dAB-5qm(`B$FxSpQ@eX7 z&I>LnF?W2CeRV-RE93 zv+nc~$(MJoDc_Kln@81r3nO5X_Z u4ypq=wIf0bl-`j;5tQB$KnfUuAlndn5vf1Go0Scuk_`w8fOgzt2JrxLE2uXB literal 0 HcmV?d00001 From 41e8a235389044a68c19699d2dae1952cc611483 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Mon, 4 Jan 2021 21:00:22 +0100 Subject: [PATCH 0131/1433] Add Revved up by Gradle Enterprise Badge to Readme (#2512) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7751939d85d3..b7055b276a18 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ in `build/reports/jacoco/jacocoRootReport/html/index.html`. ## Gradle Build Scans and Build Caching +[![Revved up by Gradle Enterprise](https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.junit.org/scans) + JUnit 5 utilizes [Gradle Enterprise](https://gradle.com/) for _Build Scans_ and the _Remote Build Cache_. An example build scan for JUnit 5 can be viewed [here](https://ge.junit.org/s/2vwrn4rn67dky). Currently, only core team members can From fe29e1d6caa623361f75e327cf472215533c4391 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 4 Jan 2021 21:54:56 +0100 Subject: [PATCH 0132/1433] Improve test for MethodOrderers --- .../engine/extension/OrderedMethodTests.java | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java index af550d36be60..9733f8f97d85 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java @@ -11,7 +11,6 @@ package org.junit.jupiter.engine.extension; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.DynamicTest.dynamicTest; import static org.junit.jupiter.api.MethodOrderer.Random.RANDOM_SEED_PROPERTY_NAME; import static org.junit.jupiter.api.Order.DEFAULT; @@ -28,7 +27,6 @@ import java.util.logging.Level; import java.util.logging.LogRecord; import java.util.regex.Pattern; -import java.util.stream.Collectors; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -183,27 +181,27 @@ void defaultOrderer() { @Test @TrackLogRecords void randomWithBogusSeedRepeatedly(LogRecordListener listener) { - String seed = "explode"; - String expectedMessagePattern = "Failed to convert configuration parameter \\[" - + Pattern.quote(Random.RANDOM_SEED_PROPERTY_NAME) + "\\] with value \\[" + seed - + "\\] to a long\\. Using default seed \\[\\d+\\] as fallback\\."; + var seed = "explode"; + var expectedMessagePattern = Pattern.compile( + "Failed to convert configuration parameter \\[" + Pattern.quote(Random.RANDOM_SEED_PROPERTY_NAME) + + "] with value \\[" + seed + "] to a long\\. Using default seed \\[\\d+] as fallback\\."); Set uniqueSequences = new HashSet<>(); - for (int i = 0; i < 10; i++) { + for (var i = 0; i < 10; i++) { callSequence.clear(); listener.clear(); - var tests = executeTestsInParallelWithRandomSeed(RandomTestCase.class, seed); + var tests = executeRandomTestCaseInParallelWithRandomSeed(seed); tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); - uniqueSequences.add(callSequence.stream().collect(Collectors.joining(","))); + uniqueSequences.add(String.join(",", callSequence)); // @formatter:off - assertTrue(listener.stream(Random.class, Level.WARNING) - .map(LogRecord::getMessage) - .anyMatch(msg -> msg.matches(expectedMessagePattern))); + assertThat(listener.stream(Random.class, Level.WARNING) + .map(LogRecord::getMessage)) + .anyMatch(expectedMessagePattern.asMatchPredicate()); // @formatter:on } @@ -215,23 +213,23 @@ void randomWithBogusSeedRepeatedly(LogRecordListener listener) { void randomWithDifferentSeedConsecutively(LogRecordListener listener) { Set uniqueSequences = new HashSet<>(); - for (int i = 0; i < 10; i++) { - String seed = String.valueOf(i); - String expectedMessage = "Using custom seed for configuration parameter [" - + Random.RANDOM_SEED_PROPERTY_NAME + "] with value [" + seed + "]."; + for (var i = 0; i < 10; i++) { + var seed = String.valueOf(i); + var expectedMessage = "Using custom seed for configuration parameter [" + Random.RANDOM_SEED_PROPERTY_NAME + + "] with value [" + seed + "]."; callSequence.clear(); listener.clear(); - var tests = executeTestsInParallelWithRandomSeed(RandomTestCase.class, seed); + var tests = executeRandomTestCaseInParallelWithRandomSeed(seed); tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); - uniqueSequences.add(callSequence.stream().collect(Collectors.joining(","))); + uniqueSequences.add(String.join(",", callSequence)); // @formatter:off - assertTrue(listener.stream(Random.class, Level.CONFIG) - .map(LogRecord::getMessage) - .anyMatch(expectedMessage::equals)); + assertThat(listener.stream(Random.class, Level.CONFIG) + .map(LogRecord::getMessage)) + .contains(expectedMessage); // @formatter:on assertThat(threadNames).hasSize(i + 1); @@ -244,15 +242,15 @@ void randomWithDifferentSeedConsecutively(LogRecordListener listener) { @Test @TrackLogRecords void randomWithCustomSeed(LogRecordListener listener) { - String seed = "42"; - String expectedMessage = "Using custom seed for configuration parameter [" + Random.RANDOM_SEED_PROPERTY_NAME + var seed = "42"; + var expectedMessage = "Using custom seed for configuration parameter [" + Random.RANDOM_SEED_PROPERTY_NAME + "] with value [" + seed + "]."; - for (int i = 0; i < 10; i++) { + for (var i = 0; i < 10; i++) { callSequence.clear(); listener.clear(); - var tests = executeTestsInParallelWithRandomSeed(RandomTestCase.class, seed); + var tests = executeRandomTestCaseInParallelWithRandomSeed(seed); tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); @@ -260,9 +258,9 @@ void randomWithCustomSeed(LogRecordListener listener) { assertThat(callSequence).containsExactly("test2()", "test3()", "test4()", "repetition 1 of 1", "test1()"); // @formatter:off - assertTrue(listener.stream(Random.class, Level.CONFIG) - .map(LogRecord::getMessage) - .anyMatch(expectedMessage::equals)); + assertThat(listener.stream(Random.class, Level.CONFIG) + .map(LogRecord::getMessage)) + .contains(expectedMessage); // @formatter:on } @@ -278,7 +276,7 @@ void misbehavingMethodOrdererThatAddsElements(LogRecordListener listener) { assertThat(callSequence).containsExactlyInAnyOrder("test1()", "test2()"); - String expectedMessage = "MethodOrderer [" + MisbehavingByAdding.class.getName() + var expectedMessage = "MethodOrderer [" + MisbehavingByAdding.class.getName() + "] added 2 MethodDescriptor(s) for test class [" + testClass.getName() + "] which will be ignored."; assertExpectedLogMessage(listener, expectedMessage); @@ -293,7 +291,7 @@ void misbehavingMethodOrdererThatRemovesElements(LogRecordListener listener) { assertThat(callSequence).containsExactlyInAnyOrder("test1()", "test2()", "test3()"); - String expectedMessage = "MethodOrderer [" + MisbehavingByRemoving.class.getName() + var expectedMessage = "MethodOrderer [" + MisbehavingByRemoving.class.getName() + "] removed 2 MethodDescriptor(s) for test class [" + testClass.getName() + "] which will be retained with arbitrary ordering."; @@ -302,9 +300,9 @@ void misbehavingMethodOrdererThatRemovesElements(LogRecordListener listener) { private void assertExpectedLogMessage(LogRecordListener listener, String expectedMessage) { // @formatter:off - assertTrue(listener.stream(Level.WARNING) - .map(LogRecord::getMessage) - .anyMatch(expectedMessage::equals)); + assertThat(listener.stream(Level.WARNING) + .map(LogRecord::getMessage)) + .contains(expectedMessage); // @formatter:on } @@ -325,9 +323,10 @@ private Events executeTestsInParallel(Class testClass, Class testClass, String seed) { + private Events executeRandomTestCaseInParallelWithRandomSeed(String seed) { var configurationParameters = Map.of(// PARALLEL_EXECUTION_ENABLED_PROPERTY_NAME, "true", // + DEFAULT_PARALLEL_EXECUTION_MODE, "concurrent", // RANDOM_SEED_PROPERTY_NAME, seed // ); @@ -335,7 +334,7 @@ private Events executeTestsInParallelWithRandomSeed(Class testClass, String s return EngineTestKit .engine("junit-jupiter") .configurationParameters(configurationParameters) - .selectors(selectClass(testClass)) + .selectors(selectClass(RandomTestCase.class)) .execute() .testEvents(); // @formatter:on @@ -355,12 +354,13 @@ void c() { } + @SuppressWarnings("unused") @TestMethodOrder(MethodName.class) static class MethodNameTestCase extends BaseTestCase { @BeforeEach void trackInvocations(TestInfo testInfo) { - var method = testInfo.getTestMethod().get(); + var method = testInfo.getTestMethod().orElseThrow(AssertionError::new); var signature = String.format("%s(%s)", method.getName(), ClassUtils.nullSafeToString(method.getParameterTypes())); @@ -407,13 +407,13 @@ void zzz() { } } - @SuppressWarnings("deprecation") + @SuppressWarnings({ "deprecation", "unused" }) @TestMethodOrder(org.junit.jupiter.api.MethodOrderer.Alphanumeric.class) static class AlphanumericTestCase extends BaseTestCase { @BeforeEach void trackInvocations(TestInfo testInfo) { - var method = testInfo.getTestMethod().get(); + var method = testInfo.getTestMethod().orElseThrow(AssertionError::new); var signature = String.format("%s(%s)", method.getName(), ClassUtils.nullSafeToString(method.getParameterTypes())); @@ -697,13 +697,13 @@ static class MisbehavingByAdding implements MethodOrderer { @Override public void orderMethods(MethodOrdererContext context) { - context.getMethodDescriptors().add(mock(MethodDescriptor.class)); - context.getMethodDescriptors().add(mock(MethodDescriptor.class)); + context.getMethodDescriptors().add(mockMethodDescriptor()); + context.getMethodDescriptors().add(mockMethodDescriptor()); } @SuppressWarnings("unchecked") - static T mock(Class type) { - return (T) Mockito.mock(type); + static T mockMethodDescriptor() { + return (T) Mockito.mock((Class) MethodDescriptor.class); } } From 81e82d9f7768e49497d0f7631b7908022cd3cca8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 4 Jan 2021 22:01:03 +0100 Subject: [PATCH 0133/1433] Upgradle to 6.8-rc-5 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37b9a50578f1..4f84333d2748 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=6cb03b71767b169eda987338091172cbc84eb0cd53a93c17e6661688411e267e -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-4-bin.zip +distributionSha256Sum=569bebddc0c174475cc25d708e54af793f25fd37e5a72e53674f8ef628b6ddfd +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 9c59b692fd2d75a1600791a5680bb3a5b22e8f73 Mon Sep 17 00:00:00 2001 From: Jan Bernitt Date: Tue, 5 Jan 2021 09:52:12 +0100 Subject: [PATCH 0134/1433] Add `assertInstanceOf` to Jupiter's assertions Closes #2492 --- .../release-notes/release-notes-5.8.0-M1.adoc | 3 +- .../junit/jupiter/api/AssertInstanceOf.java | 57 +++++++++ .../org/junit/jupiter/api/Assertions.java | 47 ++++++++ .../api/AssertInstanceOfAssertionsTests.java | 109 ++++++++++++++++++ 4 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java create mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 9965b080795c..2486425e1a4e 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -58,7 +58,8 @@ on GitHub. underscores as in some JVM languages, to improve readability of long numbers like `700_000_000`. * Documented constant values in `Resources`. - +* New `assertInstanceOf` methods as a replacement for `assertTrue(obj instanceof X)` which + provide better error messages comparable to those of `assertThrows`. [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java new file mode 100644 index 000000000000..44e423a99fb2 --- /dev/null +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java @@ -0,0 +1,57 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import static org.junit.jupiter.api.AssertionUtils.buildPrefix; +import static org.junit.jupiter.api.AssertionUtils.format; +import static org.junit.jupiter.api.AssertionUtils.nullSafeGet; + +import java.util.function.Supplier; + +import org.opentest4j.AssertionFailedError; + +/** + * {@code AssertInstanceOf} is a collection of utility methods that support + * asserting that a value is of a expected instance type - + * in other words, if it can be assigned to the expected type. + * + * @since 5.8 + */ +class AssertInstanceOf { + + private AssertInstanceOf() { + /* no-op */ + } + + static T assertInstanceOf(Class expectedType, Object actualValue) { + return assertInstanceOf(expectedType, actualValue, (Object) null); + } + + static T assertInstanceOf(Class expectedType, Object actualValue, String message) { + return assertInstanceOf(expectedType, actualValue, (Object) message); + } + + static T assertInstanceOf(Class expectedType, Object actualValue, Supplier messageSupplier) { + return assertInstanceOf(expectedType, actualValue, (Object) messageSupplier); + } + + private static T assertInstanceOf(Class expectedType, Object actualValue, Object messageOrSupplier) { + if (!expectedType.isInstance(actualValue)) { + String template = "Unexpected type"; + if (actualValue == null) + template = "Unexpected null value"; + String message = buildPrefix(nullSafeGet(messageOrSupplier)) + + format(expectedType, actualValue == null ? null : actualValue.getClass(), template); + throw new AssertionFailedError(message); + } + return expectedType.cast(actualValue); + } +} diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java index 59ebdf61f3b0..5d130ddea6d0 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java @@ -10,6 +10,7 @@ package org.junit.jupiter.api; +import static org.apiguardian.api.API.Status.EXPERIMENTAL; import static org.apiguardian.api.API.Status.STABLE; import java.time.Duration; @@ -3448,4 +3449,50 @@ public static T assertTimeoutPreemptively(Duration timeout, ThrowingSupplier return AssertTimeout.assertTimeoutPreemptively(timeout, supplier, messageSupplier); } + /** + * Assert that the supplied {@code actualValue} is an instance of the + * {@code expectedType}. + * + *

    Like the {@code instanceof} operator a {@code null} value is not + * considered to be of the {@code expectedType} and does not pass the assertion. + * + * @since 5.8 + */ + @API(status = EXPERIMENTAL, since = "5.8") + public static T assertInstanceOf(Class expectedType, Object actualValue) { + return AssertInstanceOf.assertInstanceOf(expectedType, actualValue); + } + + /** + * Assert that the supplied {@code actualValue} is an instance of the + * {@code expectedType}. + * + *

    Like the {@code instanceof} operator a {@code null} value is not + * considered to be of the {@code expectedType} and does not pass the assertion. + * + *

    Fails with the supplied failure {@code message}. + * + * @since 5.8 + */ + @API(status = EXPERIMENTAL, since = "5.8") + public static T assertInstanceOf(Class expectedType, Object actualValue, String message) { + return AssertInstanceOf.assertInstanceOf(expectedType, actualValue, message); + } + + /** + * Assert that the supplied {@code actualValue} is an instance of the + * {@code expectedType}. + * + *

    Like the {@code instanceof} operator a {@code null} value is not + * considered to be of the {@code expectedType} and does not pass the assertion. + * + *

    If necessary, the failure message will be retrieved lazily from the + * supplied {@code messageSupplier}. + * + * @since 5.8 + */ + @API(status = EXPERIMENTAL, since = "5.8") + public static T assertInstanceOf(Class expectedType, Object actualValue, Supplier messageSupplier) { + return AssertInstanceOf.assertInstanceOf(expectedType, actualValue, messageSupplier); + } } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java new file mode 100644 index 000000000000..2acafd1fdff6 --- /dev/null +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java @@ -0,0 +1,109 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.io.IOException; + +import org.junit.jupiter.api.function.Executable; +import org.opentest4j.AssertionFailedError; + +/** + * Unit tests for JUnit Jupiter {@link Assertions#assertInstanceOf(Class, Object)}. + * + * @since 5.8 + */ +class AssertInstanceOfAssertionsTests { + + @Test + void assertInstanceOfFailsNullValue() { + assertInstanceOfFails(String.class, null, "null value"); + } + + @Test + void assertInstanceOfFailsWrongTypeValue() { + assertInstanceOfFails(String.class, 1, "type"); + } + + @Test + void assertInstanceOfFailsWrongExceptionValue() { + assertInstanceOfFails(RuntimeException.class, new IOException(), "type"); + } + + @Test + void assertInstanceOfFailsSuperTypeExceptionValue() { + assertInstanceOfFails(IllegalArgumentException.class, new RuntimeException(), "type"); + } + + private static class BaseClass { + } + + private static class SubClass extends BaseClass { + + } + + @Test + void assertInstanceOfFailsSuperTypeValue() { + assertInstanceOfFails(SubClass.class, new BaseClass(), "type"); + } + + @Test + void assertInstanceOfSucceedsSameTypeValue() { + assertInstanceOfSucceeds(String.class, "indeed a String"); + assertInstanceOfSucceeds(BaseClass.class, new BaseClass()); + assertInstanceOfSucceeds(SubClass.class, new SubClass()); + } + + @Test + void assertInstanceOfSucceedsExpectSuperClassOfValue() { + assertInstanceOfSucceeds(CharSequence.class, "indeed a CharSequence"); + assertInstanceOfSucceeds(BaseClass.class, new SubClass()); + } + + @Test + void assertInstanceOfSucceedsSameTypeExceptionValue() { + assertInstanceOfSucceeds(UnsupportedOperationException.class, new UnsupportedOperationException()); + } + + @Test + void assertInstanceOfSucceedsExpectSuperClassOfExceptionValue() { + assertInstanceOfSucceeds(RuntimeException.class, new IllegalArgumentException("is a RuntimeException")); + } + + private void assertInstanceOfSucceeds(Class expectedType, Object actualValue) { + T res = assertInstanceOf(expectedType, actualValue); + assertSame(res, actualValue); + res = assertInstanceOf(expectedType, actualValue, "extra"); + assertSame(res, actualValue); + res = assertInstanceOf(expectedType, actualValue, () -> "extra"); + assertSame(res, actualValue); + } + + private void assertInstanceOfFails(Class expectedType, Object actualValue, String unexpectedSort) { + String valueType = actualValue == null ? "null" : actualValue.getClass().getCanonicalName(); + String expectedMessage = String.format("Unexpected %s ==> expected: <%s> but was: <%s>", unexpectedSort, + expectedType.getCanonicalName(), valueType); + + assertThrowsWithMessage(expectedMessage, () -> assertInstanceOf(expectedType, actualValue)); + assertThrowsWithMessage("extra ==> " + expectedMessage, + () -> assertInstanceOf(expectedType, actualValue, "extra")); + assertThrowsWithMessage("extra ==> " + expectedMessage, + () -> assertInstanceOf(expectedType, actualValue, () -> "extra")); + } + + private void assertThrowsWithMessage(String expectedMessage, Executable executable) { + assertEquals(expectedMessage, assertThrows(AssertionFailedError.class, executable).getMessage()); + } +} From 74e8de70d9802bb896e21153a7328942e2471dbf Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 8 Jan 2021 18:06:33 +0100 Subject: [PATCH 0135/1433] Upgradle to 6.8 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4f84333d2748..87e87435cbe3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=569bebddc0c174475cc25d708e54af793f25fd37e5a72e53674f8ef628b6ddfd -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-5-bin.zip +distributionSha256Sum=e2774e6fb77c43657decde25542dea710aafd78c4022d19b196e7e78d79d8c6c +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From e098fcd5567dbe786d02772c357f63ba98e374e3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 8 Jan 2021 20:31:28 +0100 Subject: [PATCH 0136/1433] Make LauncherDiscoveryListener an interface (#2519) As discussed in today's team call, we're deliberately breaking backwards compatibility of the experimental abstract `LauncherDiscoveryListener` class by changing it to be an interface. This makes it more flexible and consistent with the rest of the codebase, e.g. `TestExecutionListener`. --- .../release-notes/release-notes-5.8.0-M1.adoc | 13 ++++++----- .../jfr/FlightRecordingDiscoveryListener.java | 2 +- .../launcher/LauncherDiscoveryListener.java | 23 ++++++++----------- ...ortOnFailureLauncherDiscoveryListener.java | 2 +- .../CompositeLauncherDiscoveryListener.java | 2 +- .../LoggingLauncherDiscoveryListener.java | 2 +- .../TestLauncherDiscoveryListener.java | 2 +- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 2486425e1a4e..952a6bbfa8fc 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -19,11 +19,8 @@ on GitHub. ==== Deprecations and Breaking Changes -* `InvocationInterceptor.interceptDynamicTest(Invocation , ExtensionContext)` has - been deprecated in favor of - `InvocationInterceptor.interceptDynamicTest(Invocation , DynamicTestInvocationContext, ExtensionContext)` - that allows to access the dynamic test executable via - `DynamicTestInvocationContext.getExecutable()`. +* For consistency with the rest of the JUnit Platform, the experimental + `LauncherDiscoveryListener` is now an interface instead of an abstract class. ==== New Features and Improvements @@ -50,7 +47,11 @@ on GitHub. ==== Deprecations and Breaking Changes -* ❓ +* `InvocationInterceptor.interceptDynamicTest(Invocation , ExtensionContext)` has + been deprecated in favor of + `InvocationInterceptor.interceptDynamicTest(Invocation , DynamicTestInvocationContext, ExtensionContext)` + that allows to access the dynamic test executable via + `DynamicTestInvocationContext.getExecutable()`. ==== New Features and Improvements diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java index 0f0bde40d0ba..c3c52445311a 100644 --- a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java @@ -37,7 +37,7 @@ * @since 1.8 */ @API(status = EXPERIMENTAL, since = "1.8") -public class FlightRecordingDiscoveryListener extends LauncherDiscoveryListener { +public class FlightRecordingDiscoveryListener implements LauncherDiscoveryListener { private final AtomicReference launcherDiscoveryEvent = new AtomicReference<>(); private final Map engineDiscoveryEvents = new ConcurrentHashMap<>(); diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index 8830e252a8a5..75498f500607 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -17,13 +17,13 @@ import org.junit.platform.engine.UniqueId; /** - * Register a concrete implementation of this class with a + * Register a concrete implementation of this interface with a * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} * to be notified of events that occur during test discovery. * - *

    All methods in this class have empty default implementations. - * Subclasses may therefore override one or more of these methods to be notified - * of the selected events. + *

    All methods in this interface have empty default implementations. + * Concrete implementations may therefore override one or more of these methods + * to be notified of the selected events. * *

    JUnit provides default implementations that are created via the factory * methods in @@ -38,17 +38,14 @@ * @since 1.6 */ @API(status = EXPERIMENTAL, since = "1.6") -public abstract class LauncherDiscoveryListener implements EngineDiscoveryListener { +public interface LauncherDiscoveryListener extends EngineDiscoveryListener { /** * No-op implementation of {@code LauncherDiscoveryListener} */ - public static final LauncherDiscoveryListener NOOP = new LauncherDiscoveryListener() { + LauncherDiscoveryListener NOOP = new LauncherDiscoveryListener() { }; - public LauncherDiscoveryListener() { - } - /** * Called when test discovery is about to be started. * @@ -56,7 +53,7 @@ public LauncherDiscoveryListener() { * @since 1.8 */ @API(status = EXPERIMENTAL, since = "1.8") - public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) { + default void launcherDiscoveryStarted(LauncherDiscoveryRequest request) { } /** @@ -66,7 +63,7 @@ public void launcherDiscoveryStarted(LauncherDiscoveryRequest request) { * @since 1.8 */ @API(status = EXPERIMENTAL, since = "1.8") - public void launcherDiscoveryFinished(LauncherDiscoveryRequest request) { + default void launcherDiscoveryFinished(LauncherDiscoveryRequest request) { } /** @@ -74,7 +71,7 @@ public void launcherDiscoveryFinished(LauncherDiscoveryRequest request) { * * @param engineId the unique ID of the engine descriptor */ - public void engineDiscoveryStarted(UniqueId engineId) { + default void engineDiscoveryStarted(UniqueId engineId) { } /** @@ -87,7 +84,7 @@ public void engineDiscoveryStarted(UniqueId engineId) { * @param result the discovery result of the supplied engine * @see EngineDiscoveryResult */ - public void engineDiscoveryFinished(UniqueId engineId, EngineDiscoveryResult result) { + default void engineDiscoveryFinished(UniqueId engineId, EngineDiscoveryResult result) { } } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java index e064d4d2b305..1f115af2ad9f 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java @@ -26,7 +26,7 @@ * @since 1.6 * @see LauncherDiscoveryListeners#abortOnFailure() */ -class AbortOnFailureLauncherDiscoveryListener extends LauncherDiscoveryListener { +class AbortOnFailureLauncherDiscoveryListener implements LauncherDiscoveryListener { @Override public void engineDiscoveryFinished(UniqueId engineId, EngineDiscoveryResult result) { diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java index efaffcef2c5a..2a504abe0e0c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java @@ -25,7 +25,7 @@ * @since 1.6 * @see LauncherDiscoveryListeners#composite(List) */ -class CompositeLauncherDiscoveryListener extends LauncherDiscoveryListener { +class CompositeLauncherDiscoveryListener implements LauncherDiscoveryListener { private final List listeners; diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java index aa651de7a13c..edff6d732248 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java @@ -30,7 +30,7 @@ * @since 1.6 * @see LauncherDiscoveryListeners#logging() */ -class LoggingLauncherDiscoveryListener extends LauncherDiscoveryListener { +class LoggingLauncherDiscoveryListener implements LauncherDiscoveryListener { private static final Logger logger = LoggerFactory.getLogger(LoggingLauncherDiscoveryListener.class); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java index 497b649ae2c0..c91e9fe3dea0 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java @@ -10,7 +10,7 @@ package org.junit.platform.launcher; -public class TestLauncherDiscoveryListener extends LauncherDiscoveryListener { +public class TestLauncherDiscoveryListener implements LauncherDiscoveryListener { @Override public boolean equals(Object obj) { From df3059a4baf8f621b80a6eaa54c12318c28453be Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 24 Oct 2020 17:49:44 +0200 Subject: [PATCH 0137/1433] Jupiter: Don't retain dynamic TestDescriptors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to allow them to be garbage collected, dynamic test descriptors are no longer added to their parent’s list of children. This is fine because they were never used in that list. --- .../jupiter/engine/descriptor/TestFactoryTestDescriptor.java | 2 +- .../jupiter/engine/descriptor/TestTemplateTestDescriptor.java | 2 +- .../org/junit/jupiter/engine/TestTemplateInvocationTests.java | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java index 27585ae612fb..21358b175844 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java @@ -155,7 +155,7 @@ static Optional createDynamicDescriptor(JupiterTestDescri } if (dynamicDescendantFilter.test(uniqueId)) { JupiterTestDescriptor descriptor = descriptorCreator.get(); - parent.addChild(descriptor); + descriptor.setParent(parent); return Optional.of(descriptor); } return Optional.empty(); diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java index e7beae004a32..52bd229b50e1 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java @@ -135,7 +135,7 @@ private Optional createInvocationTestDescriptor(TestTemplateInvo } private void execute(DynamicTestExecutor dynamicTestExecutor, TestDescriptor testDescriptor) { - addChild(testDescriptor); + testDescriptor.setParent(this); dynamicTestExecutor.execute(testDescriptor); } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java index f5e966322208..6abe26936542 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java @@ -11,7 +11,6 @@ package org.junit.jupiter.engine; import static java.util.Arrays.asList; -import static java.util.Collections.singleton; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -97,7 +96,7 @@ void templateWithSingleRegisteredExtensionIsInvoked() { } @Test - void parentChildRelationshipIsEstablished() { + void parentRelationshipIsEstablished() { LauncherDiscoveryRequest request = request().selectors( selectMethod(MyTestTemplateTestCase.class, "templateWithSingleRegisteredExtension")).build(); @@ -107,7 +106,6 @@ void parentChildRelationshipIsEstablished() { container("templateWithSingleRegisteredExtension")); TestDescriptor invocationDescriptor = findTestDescriptor(executionResults, test("test-template-invocation:#1")); assertThat(invocationDescriptor.getParent()).hasValue(templateMethodDescriptor); - assertThat(templateMethodDescriptor.getChildren()).isEqualTo(singleton(invocationDescriptor)); } @Test From 3270b9d9f9b2927711b4f5546efa6537f0cff402 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 24 Oct 2020 17:52:02 +0200 Subject: [PATCH 0138/1433] Platform: Don't store String representation of unique IDs This reduces the memory overhead of each `TestIdentifier` and each `UniqueId`. --- .../org/junit/platform/engine/UniqueId.java | 14 +- .../platform/launcher/TestIdentifier.java | 137 ++++++++++++++++-- .../org/junit/platform/launcher/TestPlan.java | 25 ++-- .../commons/util/SerializationUtils.java | 11 +- .../launcher/TestIdentifierTests.java | 71 +++++++-- .../test/resources/serialized-test-identifier | Bin 0 -> 1079 bytes 6 files changed, 206 insertions(+), 52 deletions(-) create mode 100644 platform-tests/src/test/resources/serialized-test-identifier diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java index 70fb92861d0e..54a9ab1391e1 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java @@ -15,6 +15,7 @@ import static org.apiguardian.api.API.Status.STABLE; import java.io.Serializable; +import java.lang.ref.SoftReference; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -85,7 +86,7 @@ public static UniqueId root(String segmentType, String value) { // lazily computed private transient int hashCode; // lazily computed - private transient String toString; + private transient SoftReference toString; private UniqueId(UniqueIdFormat uniqueIdFormat, Segment segment) { this.uniqueIdFormat = uniqueIdFormat; @@ -250,9 +251,10 @@ public int hashCode() { */ @Override public String toString() { - String s = this.toString; - if (s == null) { - s = this.uniqueIdFormat.format(this); + SoftReference s = this.toString; + String value = s == null ? null : s.get(); + if (value == null) { + value = this.uniqueIdFormat.format(this); // this is a benign race like String#hash // we potentially read and write values from multiple threads // without a happens-before relationship @@ -260,9 +262,9 @@ public String toString() { // that were valid at one point, either null or the toString value // so we might end up not seeing a value that a different thread // has computed or multiple threads writing the same value - this.toString = s; + this.toString = new SoftReference<>(value); } - return s; + return value; } /** diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java index c336bb651bae..399dc32928ab 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java @@ -14,6 +14,11 @@ import static org.apiguardian.api.API.Status.INTERNAL; import static org.apiguardian.api.API.Status.STABLE; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamClass; +import java.io.ObjectStreamField; import java.io.Serializable; import java.util.LinkedHashSet; import java.util.Objects; @@ -27,6 +32,7 @@ import org.junit.platform.engine.TestDescriptor.Type; import org.junit.platform.engine.TestSource; import org.junit.platform.engine.TestTag; +import org.junit.platform.engine.UniqueId; /** * Immutable data transfer object that represents a test or container which is @@ -39,9 +45,14 @@ public final class TestIdentifier implements Serializable { private static final long serialVersionUID = 1L; + private static final ObjectStreamField[] serialPersistentFields = ObjectStreamClass.lookup( + SerializedForm.class).getFields(); - private final String uniqueId; - private final String parentId; + // Only set during deserialization process + private SerializedForm serializedForm; + + private final UniqueId uniqueId; + private final UniqueId parentId; private final String displayName; private final String legacyReportingName; private final TestSource source; @@ -54,19 +65,24 @@ public final class TestIdentifier implements Serializable { @API(status = INTERNAL, since = "1.0") public static TestIdentifier from(TestDescriptor testDescriptor) { Preconditions.notNull(testDescriptor, "TestDescriptor must not be null"); - String uniqueId = testDescriptor.getUniqueId().toString(); + UniqueId uniqueId = testDescriptor.getUniqueId(); String displayName = testDescriptor.getDisplayName(); TestSource source = testDescriptor.getSource().orElse(null); Set tags = testDescriptor.getTags(); Type type = testDescriptor.getType(); - String parentId = testDescriptor.getParent().map( - parentDescriptor -> parentDescriptor.getUniqueId().toString()).orElse(null); + UniqueId parentId = testDescriptor.getParent().map(TestDescriptor::getUniqueId).orElse(null); String legacyReportingName = testDescriptor.getLegacyReportingName(); return new TestIdentifier(uniqueId, displayName, source, tags, type, parentId, legacyReportingName); } - TestIdentifier(String uniqueId, String displayName, TestSource source, Set tags, Type type, - String parentId, String legacyReportingName) { + private TestIdentifier(SerializedForm serializedForm) { + this(UniqueId.parse(serializedForm.uniqueId), serializedForm.displayName, serializedForm.source, + serializedForm.tags, serializedForm.type, UniqueId.parse(serializedForm.parentId), + serializedForm.legacyReportingName); + } + + private TestIdentifier(UniqueId uniqueId, String displayName, TestSource source, Set tags, Type type, + UniqueId parentId, String legacyReportingName) { Preconditions.notNull(type, "TestDescriptor.Type must not be null"); this.uniqueId = uniqueId; this.parentId = parentId; @@ -78,7 +94,8 @@ public static TestIdentifier from(TestDescriptor testDescriptor) { } /** - * Get the unique ID of the represented test or container. + * Get the unique ID of the represented test or container as a + * {@code String}. * *

    Uniqueness must be guaranteed across an entire * {@linkplain TestPlan test plan}, regardless of how many engines are used @@ -87,11 +104,28 @@ public static TestIdentifier from(TestDescriptor testDescriptor) { * @return the unique ID for this identifier; never {@code null} */ public String getUniqueId() { + return this.uniqueId.toString(); + } + + /** + * Get the unique ID of the represented test or container as a + * {@code UniqueId}. + * + *

    Uniqueness must be guaranteed across an entire + * {@linkplain TestPlan test plan}, regardless of how many engines are used + * behind the scenes. + * + * @return the unique ID for this identifier; never {@code null} + * @since 5.8 + */ + @API(status = STABLE, since = "5.8") + public UniqueId getUniqueIdObject() { return this.uniqueId; } /** - * Get the unique ID of this identifier's parent, if available. + * Get the unique ID of this identifier's parent as a {@code String}, if + * available. * *

    An identifier without a parent is called a root. * @@ -99,6 +133,21 @@ public String getUniqueId() { * never {@code null} though potentially empty */ public Optional getParentId() { + return getParentIdObject().map(UniqueId::toString); + } + + /** + * Get the unique ID of this identifier's parent as a {@code UniqueId}, if + * available. + * + *

    An identifier without a parent is called a root. + * + * @return a container for the unique ID for this identifier's parent; + * never {@code null} though potentially empty + * @since 5.8 + */ + @API(status = STABLE, since = "5.8") + public Optional getParentIdObject() { return Optional.ofNullable(this.parentId); } @@ -184,7 +233,7 @@ public Optional getSource() { * @see TestTag */ public Set getTags() { - return this.tags; + return unmodifiableSet(this.tags); } @Override @@ -216,4 +265,72 @@ public String toString() { // @formatter:on } + private void writeObject(ObjectOutputStream s) throws IOException { + SerializedForm serializedForm = new SerializedForm(this); + serializedForm.serialize(s); + } + + private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { + serializedForm = SerializedForm.deserialize(s); + } + + private Object readResolve() { + return new TestIdentifier(serializedForm); + } + + /** + * Represents the serialized output of {@code TestIdentifier}. The fields on this + * class match the fields that {@code TestIdentifier} had prior to 5.8. + */ + private static class SerializedForm implements Serializable { + + private static final long serialVersionUID = 1L; + + private final String uniqueId; + private final String parentId; + private final String displayName; + private final String legacyReportingName; + private final TestSource source; + private final Set tags; + private final Type type; + + SerializedForm(TestIdentifier testIdentifier) { + this.uniqueId = testIdentifier.uniqueId.toString(); + this.parentId = testIdentifier.parentId.toString(); + this.displayName = testIdentifier.displayName; + this.legacyReportingName = testIdentifier.legacyReportingName; + this.source = testIdentifier.source; + this.tags = testIdentifier.tags; + this.type = testIdentifier.type; + } + + @SuppressWarnings("unchecked") + private SerializedForm(ObjectInputStream.GetField fields) throws IOException { + this.uniqueId = (String) fields.get("uniqueId", null); + this.parentId = (String) fields.get("parentId", null); + this.displayName = (String) fields.get("displayName", null); + this.legacyReportingName = (String) fields.get("legacyReportingName", null); + this.source = (TestSource) fields.get("source", null); + this.tags = (Set) fields.get("tags", null); + this.type = (Type) fields.get("type", null); + } + + void serialize(ObjectOutputStream s) throws IOException { + ObjectOutputStream.PutField fields = s.putFields(); + fields.put("uniqueId", uniqueId); + fields.put("parentId", parentId); + fields.put("displayName", displayName); + fields.put("legacyReportingName", legacyReportingName); + fields.put("source", source); + fields.put("tags", tags); + fields.put("type", type); + s.writeFields(); + } + + static SerializedForm deserialize(ObjectInputStream s) throws ClassNotFoundException, IOException { + ObjectInputStream.GetField fields = s.readFields(); + return new SerializedForm(fields); + } + } + } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java index 81be02db94d4..bc6075d8158e 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java @@ -11,13 +11,13 @@ package org.junit.platform.launcher; import static java.util.Collections.emptySet; +import static java.util.Collections.synchronizedSet; import static java.util.Collections.unmodifiableSet; import static org.apiguardian.api.API.Status.DEPRECATED; import static org.apiguardian.api.API.Status.INTERNAL; import static org.apiguardian.api.API.Status.STABLE; import java.util.Collection; -import java.util.Collections; import java.util.LinkedHashSet; import java.util.Map; import java.util.Optional; @@ -30,6 +30,7 @@ import org.junit.platform.commons.util.Preconditions; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestDescriptor.Visitor; +import org.junit.platform.engine.UniqueId; /** * {@code TestPlan} describes the tree of tests and containers as discovered @@ -57,11 +58,11 @@ @API(status = STABLE, since = "1.0") public class TestPlan { - private final Set roots = Collections.synchronizedSet(new LinkedHashSet<>(4)); + private final Set roots = synchronizedSet(new LinkedHashSet<>(4)); - private final Map> children = new ConcurrentHashMap<>(32); + private final Map> children = new ConcurrentHashMap<>(32); - private final Map allIdentifiers = new ConcurrentHashMap<>(32); + private final Map allIdentifiers = new ConcurrentHashMap<>(32); private final boolean containsTests; @@ -101,11 +102,11 @@ protected TestPlan(boolean containsTests) { @API(status = DEPRECATED, since = "1.4") public void add(TestIdentifier testIdentifier) { Preconditions.notNull(testIdentifier, "testIdentifier must not be null"); - allIdentifiers.put(testIdentifier.getUniqueId(), testIdentifier); - if (testIdentifier.getParentId().isPresent()) { - String parentId = testIdentifier.getParentId().get(); + allIdentifiers.put(testIdentifier.getUniqueIdObject(), testIdentifier); + if (testIdentifier.getParentIdObject().isPresent()) { + UniqueId parentId = testIdentifier.getParentIdObject().get(); Set directChildren = children.computeIfAbsent(parentId, - key -> Collections.synchronizedSet(new LinkedHashSet<>(16))); + key -> synchronizedSet(new LinkedHashSet<>(16))); directChildren.add(testIdentifier); } else { @@ -155,7 +156,8 @@ public Set getChildren(TestIdentifier parent) { */ public Set getChildren(String parentId) { Preconditions.notBlank(parentId, "parent ID must not be null or blank"); - return children.containsKey(parentId) ? unmodifiableSet(children.get(parentId)) : emptySet(); + UniqueId uniqueId = UniqueId.parse(parentId); + return children.containsKey(uniqueId) ? unmodifiableSet(children.get(uniqueId)) : emptySet(); } /** @@ -169,9 +171,10 @@ public Set getChildren(String parentId) { */ public TestIdentifier getTestIdentifier(String uniqueId) throws PreconditionViolationException { Preconditions.notBlank(uniqueId, "unique ID must not be null or blank"); - Preconditions.condition(allIdentifiers.containsKey(uniqueId), + UniqueId uniqueIdObject = UniqueId.parse(uniqueId); + Preconditions.condition(allIdentifiers.containsKey(uniqueIdObject), () -> "No TestIdentifier with unique ID [" + uniqueId + "] has been added to this TestPlan."); - return allIdentifiers.get(uniqueId); + return allIdentifiers.get(uniqueIdObject); } /** diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java b/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java index 04bd5cb509b9..838a8e3d0489 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java @@ -14,23 +14,16 @@ import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.io.Serializable; public class SerializationUtils { - @SuppressWarnings("unchecked") - public static T serializeAndDeserialize(T object) throws Exception { - var bytes = serialize(object); - return (T) deserialize(bytes); - } - - private static Object deserialize(byte[] bytes) throws Exception { + public static Object deserialize(byte[] bytes) throws Exception { try (var in = new ObjectInputStream(new ByteArrayInputStream(bytes))) { return in.readObject(); } } - private static byte[] serialize(Object object) throws Exception { + public static byte[] serialize(Object object) throws Exception { try (var byteArrayOutputStream = new ByteArrayOutputStream(); var objectOutputStream = new ObjectOutputStream(byteArrayOutputStream)) { objectOutputStream.writeObject(object); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java index 9d4ca7878b0c..b82c02615a99 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java @@ -10,11 +10,11 @@ package org.junit.platform.launcher; -import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.platform.commons.util.SerializationUtils.serializeAndDeserialize; +import static org.junit.platform.commons.util.SerializationUtils.deserialize; +import static org.junit.platform.commons.util.SerializationUtils.serialize; import java.util.Set; @@ -22,7 +22,9 @@ import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestTag; import org.junit.platform.engine.UniqueId; +import org.junit.platform.engine.support.descriptor.AbstractTestDescriptor; import org.junit.platform.engine.support.descriptor.ClassSource; +import org.junit.platform.engine.support.descriptor.EngineDescriptor; import org.junit.platform.fakes.TestDescriptorStub; /** @@ -55,20 +57,57 @@ void inheritsTypeFromDescriptor() { } @Test - void serialization() throws Exception { - var identifier = serializeAndDeserialize(// - new TestIdentifier("uniqueId", "displayName", ClassSource.from(TestIdentifierTests.class), - Set.of(TestTag.create("aTag")), TestDescriptor.Type.TEST, "parentId", "reportingName")); - - assertEquals("uniqueId", identifier.getUniqueId()); - assertEquals("displayName", identifier.getDisplayName()); - assertEquals("reportingName", identifier.getLegacyReportingName()); - assertThat(identifier.getSource()).contains(ClassSource.from(TestIdentifierTests.class)); - assertEquals(Set.of(TestTag.create("aTag")), identifier.getTags()); - assertEquals(TestDescriptor.Type.TEST, identifier.getType()); - assertTrue(identifier.isTest()); - assertFalse(identifier.isContainer()); - assertThat(identifier.getParentId()).contains("parentId"); + void currentVersionCanBeSerializedAndDeserialized() throws Exception { + var originalIdentifier = createOriginalTestIdentifier(); + var deserializedIdentifier = (TestIdentifier) deserialize(serialize(originalIdentifier)); + assertDeepEquals(originalIdentifier, deserializedIdentifier); + } + + @Test + void initialVersionCanBeDeserialized() throws Exception { + try (var inputStream = getClass().getResourceAsStream("/serialized-test-identifier")) { + var bytes = inputStream.readAllBytes(); + var deserializedIdentifier = (TestIdentifier) deserialize(bytes); + assertDeepEquals(createOriginalTestIdentifier(), deserializedIdentifier); + } + } + + private static void assertDeepEquals(TestIdentifier first, TestIdentifier second) { + assertEquals(first, second); + assertEquals(first.getUniqueId(), second.getUniqueId()); + assertEquals(first.getUniqueIdObject(), second.getUniqueIdObject()); + assertEquals(first.getDisplayName(), second.getDisplayName()); + assertEquals(first.getLegacyReportingName(), second.getLegacyReportingName()); + assertEquals(first.getSource(), second.getSource()); + assertEquals(first.getTags(), second.getTags()); + assertEquals(first.getType(), second.getType()); + assertEquals(first.getParentId(), second.getParentId()); + assertEquals(first.getParentIdObject(), second.getParentIdObject()); + } + + private static TestIdentifier createOriginalTestIdentifier() { + var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); + var uniqueId = engineDescriptor.getUniqueId().append("child", "child"); + var testSource = ClassSource.from(TestIdentifierTests.class); + var testDescriptor = new AbstractTestDescriptor(uniqueId, "displayName", testSource) { + + @Override + public Type getType() { + return Type.TEST; + } + + @Override + public String getLegacyReportingName() { + return "reportingName"; + } + + @Override + public Set getTags() { + return Set.of(TestTag.create("aTag")); + } + }; + engineDescriptor.addChild(testDescriptor); + return TestIdentifier.from(testDescriptor); } } diff --git a/platform-tests/src/test/resources/serialized-test-identifier b/platform-tests/src/test/resources/serialized-test-identifier new file mode 100644 index 0000000000000000000000000000000000000000..614b53bb6557e251e93c145414c5f3efa2dd0f53 GIT binary patch literal 1079 zcmb7Dv2N5r5S_amkca?DkccRPgcK+u*lj3Kt^kn)5y?V`a~h%`E%u&o!`|B2U5C3S zx`rAlQfT-EdJw-rMFkC?kUA~1YX@7WBM~lad1vO$dv9hxAHxNsVI|cG+0B)(B$Lc` zQ{5+$fPARuLr?iot`ea*b!<9555ZfO zCC0+FqH%78q#bU3V3;8gJqKu=n@Eeyrg}NV0xX(AY!)lz zK&ZDoe#T4>`~Q+ZUmg8kK@it}zRD`&-`3wBef;|6!IV?=ZWhJOJ$mdkLIY86Pw=(e z4(DUY5}%66o@7g%-WNBN7Q^`9K*RmBQO5SVM1%#;_^M~@ZYkMNdA}ZXEy9gXXklq= OujzKw6Ea@)@0~x1PiaX2 literal 0 HcmV?d00001 From dc8bdb413ad23c4b804523bcd08e162360219d14 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 31 Dec 2020 13:30:04 +0100 Subject: [PATCH 0139/1433] Platform: Link to undeprecated LegacyReportingUtils --- .../main/java/org/junit/platform/launcher/TestIdentifier.java | 3 ++- .../platform/launcher/listeners/LegacyReportingUtils.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java index 399dc32928ab..a773cceeb3b3 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java @@ -179,8 +179,9 @@ public String getDisplayName() { * * @return the legacy reporting name; never {@code null} or blank * @see org.junit.platform.engine.TestDescriptor#getLegacyReportingName() - * @see org.junit.platform.launcher.listeners.LegacyReportingUtils + * @see org.junit.platform.reporting.legacy.LegacyReportingUtils */ + @SuppressWarnings("JavadocReference") public String getLegacyReportingName() { return this.legacyReportingName; } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java index 07f806bbc167..a39514fa57cb 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java @@ -27,6 +27,7 @@ * instead. */ @Deprecated +@SuppressWarnings("JavadocReference") @API(status = DEPRECATED, since = "1.6") public class LegacyReportingUtils { From 1e5e4b6c426e3edd824bafbb9ef113af64000928 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 24 Oct 2020 17:56:50 +0200 Subject: [PATCH 0140/1433] Platform: Avoid large number of empty LinkedHashSets Instead of using a `LinkedHashSet` for empty or single-element sets of tags, we now use the immutable empty set for the most common case of no tags and `Collections.singleton` which is more memory efficient for Single tag sets. --- .../junit/platform/launcher/TestIdentifier.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java index a773cceeb3b3..da698a8307bb 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java @@ -10,9 +10,12 @@ package org.junit.platform.launcher; +import static java.util.Collections.emptySet; +import static java.util.Collections.singleton; import static java.util.Collections.unmodifiableSet; import static org.apiguardian.api.API.Status.INTERNAL; import static org.apiguardian.api.API.Status.STABLE; +import static org.junit.platform.commons.util.CollectionUtils.getOnlyElement; import java.io.IOException; import java.io.ObjectInputStream; @@ -88,11 +91,22 @@ private TestIdentifier(UniqueId uniqueId, String displayName, TestSource source, this.parentId = parentId; this.displayName = displayName; this.source = source; - this.tags = unmodifiableSet(new LinkedHashSet<>(tags)); + this.tags = copyOf(tags); this.type = type; this.legacyReportingName = legacyReportingName; } + private Set copyOf(Set tags) { + switch (tags.size()) { + case 0: + return emptySet(); + case 1: + return singleton(getOnlyElement(tags)); + default: + return new LinkedHashSet<>(tags); + } + } + /** * Get the unique ID of the represented test or container as a * {@code String}. From d89c532139c859cf55ba13b299125b03e9b8c5de Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 24 Oct 2020 17:54:09 +0200 Subject: [PATCH 0141/1433] Platform: Avoid wasting memory from unnecessarily large ArrayLists The list of segments of a `UniqueId` is immutable. Prior to this commit, we were using an unsized `ArrayList` to store them which was wasteful since the backing array was often too large. --- .../java/org/junit/platform/engine/UniqueId.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java index 54a9ab1391e1..b88926eab24c 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java @@ -89,8 +89,7 @@ public static UniqueId root(String segmentType, String value) { private transient SoftReference toString; private UniqueId(UniqueIdFormat uniqueIdFormat, Segment segment) { - this.uniqueIdFormat = uniqueIdFormat; - this.segments = singletonList(segment); + this(uniqueIdFormat, singletonList(segment)); } /** @@ -102,7 +101,7 @@ private UniqueId(UniqueIdFormat uniqueIdFormat, Segment segment) { */ UniqueId(UniqueIdFormat uniqueIdFormat, List segments) { this.uniqueIdFormat = uniqueIdFormat; - this.segments = unmodifiableList(segments); + this.segments = segments; } final Optional getRoot() { @@ -123,7 +122,7 @@ public final Optional getEngineId() { * {@code UniqueId}. */ public final List getSegments() { - return this.segments; + return unmodifiableList(this.segments); } /** @@ -157,7 +156,8 @@ public final UniqueId append(String segmentType, String value) { @API(status = STABLE, since = "1.1") public final UniqueId append(Segment segment) { Preconditions.notNull(segment, "segment must not be null"); - List baseSegments = new ArrayList<>(this.segments); + List baseSegments = new ArrayList<>(this.segments.size() + 1); + baseSegments.addAll(this.segments); baseSegments.add(segment); return new UniqueId(this.uniqueIdFormat, baseSegments); } @@ -192,7 +192,7 @@ public boolean hasPrefix(UniqueId potentialPrefix) { @API(status = STABLE, since = "1.5") public UniqueId removeLastSegment() { Preconditions.condition(this.segments.size() > 1, "Cannot remove last remaining segment"); - return new UniqueId(uniqueIdFormat, new ArrayList<>(segments.subList(0, segments.size() - 1))); + return new UniqueId(uniqueIdFormat, new ArrayList<>(this.segments.subList(0, this.segments.size() - 1))); } /** From 1134e2856fbcb864b8aee4b20429f4368b8d29c3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 24 Oct 2020 17:55:33 +0200 Subject: [PATCH 0142/1433] Platform: Avoid storing all returned futures Instead of storing all `Future` instances we now only store those that Are not yet finished. --- .../support/hierarchical/NodeTestTask.java | 43 ++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java index 5d98dfaaf0b2..a722a3f51328 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java @@ -16,8 +16,10 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.CancellationException; +import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; @@ -29,6 +31,7 @@ import org.junit.platform.commons.util.UnrecoverableExceptions; import org.junit.platform.engine.EngineExecutionListener; import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService.TestTask; import org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor; import org.junit.platform.engine.support.hierarchical.Node.ExecutionMode; @@ -40,10 +43,13 @@ class NodeTestTask implements TestTask { private static final Logger logger = LoggerFactory.getLogger(NodeTestTask.class); + private static final Runnable NOOP = () -> { + }; private final NodeTestTaskContext taskContext; private final TestDescriptor testDescriptor; private final Node node; + private final Runnable finalizer; private C parentContext; private C context; @@ -53,9 +59,14 @@ class NodeTestTask implements TestTask { private ThrowableCollector throwableCollector; NodeTestTask(NodeTestTaskContext taskContext, TestDescriptor testDescriptor) { + this(taskContext, testDescriptor, NOOP); + } + + NodeTestTask(NodeTestTaskContext taskContext, TestDescriptor testDescriptor, Runnable finalizer) { this.taskContext = taskContext; this.testDescriptor = testDescriptor; this.node = NodeUtils.asNode(testDescriptor); + this.finalizer = finalizer; } @Override @@ -100,6 +111,7 @@ public void execute() { + "why the flag was not cleared by user code.", this.testDescriptor.getDisplayName(), this.testDescriptor.getUniqueId())); } + finalizer.run(); } // Clear reference to context to allow it to be garbage collected. @@ -185,7 +197,7 @@ private void reportCompletion() { } private class DefaultDynamicTestExecutor implements DynamicTestExecutor { - private final List> futures = new ArrayList<>(); + private final Map unfinishedTasks = new ConcurrentHashMap<>(); @Override public void execute(TestDescriptor testDescriptor) { @@ -206,20 +218,22 @@ public Future execute(TestDescriptor testDescriptor, EngineExecutionListener return completedFuture(null); } else { + UniqueId uniqueId = testDescriptor.getUniqueId(); NodeTestTask nodeTestTask = new NodeTestTask<>(taskContext.withListener(executionListener), - testDescriptor); + testDescriptor, () -> unfinishedTasks.remove(uniqueId)); nodeTestTask.setParentContext(context); - Future future = taskContext.getExecutorService().submit(nodeTestTask); - futures.add(future); + unfinishedTasks.put(uniqueId, DynamicTaskState.unscheduled()); + Future future = taskContext.getExecutorService().submit(nodeTestTask); + unfinishedTasks.computeIfPresent(uniqueId, (__, state) -> DynamicTaskState.scheduled(future)); return future; } } @Override public void awaitFinished() throws InterruptedException { - for (Future future : futures) { + for (DynamicTaskState state : unfinishedTasks.values()) { try { - future.get(); + state.awaitFinished(); } catch (CancellationException ignore) { // Futures returned by execute() may have been cancelled @@ -231,4 +245,21 @@ public void awaitFinished() throws InterruptedException { } } + @FunctionalInterface + private interface DynamicTaskState { + + DynamicTaskState UNSCHEDULED = () -> { + }; + + static DynamicTaskState unscheduled() { + return UNSCHEDULED; + } + + static DynamicTaskState scheduled(Future future) { + return future::get; + } + + void awaitFinished() throws CancellationException, ExecutionException, InterruptedException; + } + } From 1f7729caa6daab34357188a579ebfc1f24f14803 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 6 Dec 2020 15:31:59 +0100 Subject: [PATCH 0143/1433] Vintage: Avoid evaluating regex if possible `Description.getMethod()` evaluates a regex every time it is called which is expensive for large test suites. `DescriptionUtils` now tries computing it without evaluating a regex first and only falls back on `Description.getMethod()` if the display name does not look as expected. --- .../engine/descriptor/DescriptionUtils.java | 37 +++++++++++ .../engine/descriptor/TestSourceProvider.java | 2 +- .../descriptor/VintageTestDescriptor.java | 4 +- .../discovery/IsPotentialJUnit4TestClass.java | 6 +- .../discovery/MethodSelectorResolver.java | 5 +- .../descriptor/DescriptionUtilsTests.java | 61 +++++++++++++++++++ 6 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java create mode 100644 junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java new file mode 100644 index 000000000000..a4d632b83da3 --- /dev/null +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.vintage.engine.descriptor; + +import org.apiguardian.api.API; +import org.junit.runner.Description; + +@API(status = API.Status.INTERNAL, since = "5.8") +public class DescriptionUtils { + + private DescriptionUtils() { + } + + public static String getMethodName(Description description) { + String displayName = description.getDisplayName(); + int i = displayName.indexOf('('); + if (i >= 0) { + int j = displayName.lastIndexOf('('); + if (i == j) { + char lastChar = displayName.charAt(displayName.length() - 1); + if (lastChar == ')') { + return displayName.substring(0, i); + } + } + } + return description.getMethodName(); + } + +} diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java index 36e0efa58008..85c664de59a6 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java @@ -40,7 +40,7 @@ public class TestSourceProvider { public TestSource findTestSource(Description description) { Class testClass = description.getTestClass(); if (testClass != null) { - String methodName = description.getMethodName(); + String methodName = DescriptionUtils.getMethodName(description); if (methodName != null) { Method method = findMethod(testClass, sanitizeMethodName(methodName)); if (method != null) { diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java index 62077d06a304..7953a29b956d 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java @@ -55,7 +55,7 @@ public VintageTestDescriptor(UniqueId uniqueId, Description description, TestSou } private static String generateDisplayName(Description description) { - String methodName = description.getMethodName(); + String methodName = DescriptionUtils.getMethodName(description); return isNotBlank(methodName) ? methodName : description.getDisplayName(); } @@ -65,7 +65,7 @@ public Description getDescription() { @Override public String getLegacyReportingName() { - String methodName = description.getMethodName(); + String methodName = DescriptionUtils.getMethodName(description); if (methodName == null) { String className = description.getClassName(); if (isNotBlank(className)) { diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java index 6af3ef53c621..686c80655145 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java @@ -10,16 +10,20 @@ package org.junit.vintage.engine.discovery; +import static org.apiguardian.api.API.Status.INTERNAL; import static org.junit.platform.commons.util.ReflectionUtils.isAbstract; import static org.junit.platform.commons.util.ReflectionUtils.isInnerClass; import static org.junit.platform.commons.util.ReflectionUtils.isPublic; import java.util.function.Predicate; +import org.apiguardian.api.API; + /** * @since 4.12 */ -class IsPotentialJUnit4TestClass implements Predicate> { +@API(status = INTERNAL, since = "5.8", consumers = "org.junit.vintage.**") +public class IsPotentialJUnit4TestClass implements Predicate> { @Override public boolean test(Class candidate) { diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java index 74521cf0c979..c725e4bdc097 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java @@ -26,6 +26,7 @@ import org.junit.platform.engine.support.discovery.SelectorResolver; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; +import org.junit.vintage.engine.descriptor.DescriptionUtils; import org.junit.vintage.engine.descriptor.RunnerTestDescriptor; /** @@ -87,6 +88,7 @@ private Filter toUniqueIdFilter(RunnerTestDescriptor runnerTestDescriptor, Uniqu * {@link org.junit.runners.Parameterized} runner. */ private static Filter matchMethodDescription(final Description desiredDescription) { + String desiredMethodName = DescriptionUtils.getMethodName(desiredDescription); return new Filter() { @Override @@ -105,7 +107,8 @@ public boolean shouldRun(Description description) { } private boolean isParameterizedMethod(Description description) { - return description.getMethodName().startsWith(desiredDescription.getMethodName() + "["); + String methodName = DescriptionUtils.getMethodName(description); + return methodName.startsWith(desiredMethodName + "["); } @Override diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java new file mode 100644 index 000000000000..49b9f1c5dd7d --- /dev/null +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java @@ -0,0 +1,61 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.vintage.engine.descriptor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.DynamicContainer.dynamicContainer; +import static org.junit.jupiter.api.DynamicTest.dynamicTest; + +import java.util.stream.Stream; + +import org.junit.internal.builders.AllDefaultPossibilitiesBuilder; +import org.junit.jupiter.api.DynamicNode; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.TestFactory; +import org.junit.platform.commons.util.ClassFilter; +import org.junit.platform.commons.util.ReflectionUtils; +import org.junit.runner.Description; +import org.junit.vintage.engine.discovery.IsPotentialJUnit4TestClass; + +class DescriptionUtilsTests { + + AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); + + @TestFactory + Stream computedMethodNameCorrectly() { + var classFilter = ClassFilter.of(new IsPotentialJUnit4TestClass()); + var testClasses = ReflectionUtils.findAllClassesInPackage("org.junit.vintage.engine.samples", classFilter); + return testClasses.stream().flatMap(this::toDynamicTests); + } + + private Stream toDynamicTests(Class testClass) { + try { + var runner = builder.runnerForClass(testClass); + return toDynamicTests(Stream.of(runner.getDescription())); + } + catch (Throwable throwable) { + throw new RuntimeException(throwable); + } + } + + Stream toDynamicTests(Stream children) { + return children.map(description -> description.isTest() // + ? toDynamicTest(description, "child: " + description.toString()) // + : dynamicContainer("class: " + description.toString(), Stream.concat( // + Stream.of(toDynamicTest(description, "self")), // + toDynamicTests(description.getChildren().stream())))); + } + + private DynamicTest toDynamicTest(Description description, String displayName) { + return dynamicTest(displayName, + () -> assertEquals(description.getMethodName(), DescriptionUtils.getMethodName(description))); + } +} From 5557b81d9e24d47575dab9ab29a2338ea954b9ad Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 6 Dec 2020 15:35:34 +0100 Subject: [PATCH 0144/1433] Vintage: Cache test sources by description Test sources are now cached by description which avoids the overhead of creating multiple instances for the same method, e.g. for parameterized tests or generative test suites that include the same class multiple times with different configurations. --- .../engine/descriptor/TestSourceProvider.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java index 85c664de59a6..10976e6b9336 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java @@ -10,6 +10,7 @@ package org.junit.vintage.engine.descriptor; +import static java.util.Collections.synchronizedMap; import static java.util.function.Predicate.isEqual; import static java.util.stream.Collectors.toList; import static org.apiguardian.api.API.Status.INTERNAL; @@ -17,9 +18,9 @@ import static org.junit.platform.commons.util.ReflectionUtils.findMethods; import java.lang.reflect.Method; -import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apiguardian.api.API; import org.junit.platform.commons.support.ModifierSupport; @@ -35,9 +36,18 @@ @API(status = INTERNAL, since = "5.6") public class TestSourceProvider { - private final Map, List> methodsCache = Collections.synchronizedMap(new LruCache<>(31)); + private static final TestSource NULL_SOURCE = new TestSource() { + }; + + private final Map testSourceCache = new ConcurrentHashMap<>(); + private final Map, List> methodsCache = synchronizedMap(new LruCache<>(31)); public TestSource findTestSource(Description description) { + TestSource testSource = testSourceCache.computeIfAbsent(description, this::computeTestSource); + return testSource == NULL_SOURCE ? null : testSource; + } + + private TestSource computeTestSource(Description description) { Class testClass = description.getTestClass(); if (testClass != null) { String methodName = DescriptionUtils.getMethodName(description); @@ -49,7 +59,7 @@ public TestSource findTestSource(Description description) { } return ClassSource.from(testClass); } - return null; + return NULL_SOURCE; } private String sanitizeMethodName(String methodName) { From 6dc8671339d43883126b87c5cba934205f1659af Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 6 Dec 2020 16:10:26 +0100 Subject: [PATCH 0145/1433] Vintage: Avoid allocation for descriptions without children This eliminates allocation overhead for the most common case where a `Description` represents a test, i.e. does not have children. --- .../engine/discovery/RunnerTestDescriptorPostProcessor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java index 86f768bf2dca..f1410fd13b2d 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java @@ -47,6 +47,9 @@ void applyFiltersAndCreateDescendants(RunnerTestDescriptor runnerTestDescriptor) } private void addChildrenRecursively(VintageTestDescriptor parent) { + if (parent.getDescription().isTest()) { + return; + } List children = parent.getDescription().getChildren(); // Use LinkedHashMap to preserve order, ArrayList for fast access by index Map> childrenByUniqueId = children.stream().collect( From 94e5fb91d84cd5221f4a02dfba025bc7de124abb Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 11 Dec 2020 13:03:23 +0100 Subject: [PATCH 0146/1433] Vintage: Allow garbage collecting executed runners RunnerTestDescriptors can now be garbage collected after they have been executed because they are now removed from the list of children of the engine descriptor. --- .../vintage/engine/VintageTestEngine.java | 19 +++++++++---------- .../descriptor/VintageEngineDescriptor.java | 12 ++++++------ .../RunnerTestDescriptorPostProcessor.java | 6 +----- .../engine/discovery/VintageDiscoverer.java | 16 ++++++---------- .../engine/execution/RunnerExecutor.java | 5 ++--- ...unnerTestDescriptorPostProcessorTests.java | 4 +--- 6 files changed, 25 insertions(+), 37 deletions(-) diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java index a4d8206ecaec..0b90e0d58ef8 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java @@ -14,6 +14,7 @@ import static org.junit.platform.engine.TestExecutionResult.successful; import static org.junit.vintage.engine.descriptor.VintageTestDescriptor.ENGINE_ID; +import java.util.Iterator; import java.util.Optional; import org.apiguardian.api.API; @@ -68,19 +69,17 @@ public void execute(ExecutionRequest request) { EngineExecutionListener engineExecutionListener = request.getEngineExecutionListener(); VintageEngineDescriptor engineDescriptor = (VintageEngineDescriptor) request.getRootTestDescriptor(); engineExecutionListener.executionStarted(engineDescriptor); - RunnerExecutor runnerExecutor = new RunnerExecutor(engineExecutionListener, - engineDescriptor.getTestSourceProvider()); - executeAllChildren(runnerExecutor, engineDescriptor); + executeAllChildren(engineDescriptor, engineExecutionListener); engineExecutionListener.executionFinished(engineDescriptor, successful()); } - private void executeAllChildren(RunnerExecutor runnerExecutor, TestDescriptor engineDescriptor) { - // @formatter:off - engineDescriptor.getChildren() - .stream() - .map(RunnerTestDescriptor.class::cast) - .forEach(runnerExecutor::execute); - // @formatter:on + private void executeAllChildren(VintageEngineDescriptor engineDescriptor, + EngineExecutionListener engineExecutionListener) { + RunnerExecutor runnerExecutor = new RunnerExecutor(engineExecutionListener); + for (Iterator iterator = engineDescriptor.getModifiableChildren().iterator(); iterator.hasNext();) { + runnerExecutor.execute((RunnerTestDescriptor) iterator.next()); + iterator.remove(); + } } } diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java index 81b92ab251a5..23f09d7b0b14 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java @@ -12,7 +12,10 @@ import static org.apiguardian.api.API.Status.INTERNAL; +import java.util.Set; + import org.apiguardian.api.API; +import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.support.descriptor.EngineDescriptor; @@ -22,15 +25,12 @@ @API(status = INTERNAL, since = "5.6") public class VintageEngineDescriptor extends EngineDescriptor { - private final TestSourceProvider testSourceProvider; - - public VintageEngineDescriptor(UniqueId uniqueId, TestSourceProvider testSourceProvider) { + public VintageEngineDescriptor(UniqueId uniqueId) { super(uniqueId, "JUnit Vintage"); - this.testSourceProvider = testSourceProvider; } - public TestSourceProvider getTestSourceProvider() { - return testSourceProvider; + public Set getModifiableChildren() { + return children; } } diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java index f1410fd13b2d..daa518e7f75a 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java @@ -35,11 +35,7 @@ class RunnerTestDescriptorPostProcessor { private final UniqueIdReader uniqueIdReader = new UniqueIdReader(); private final UniqueIdStringifier uniqueIdStringifier = new UniqueIdStringifier(); - private final TestSourceProvider testSourceProvider; - - public RunnerTestDescriptorPostProcessor(TestSourceProvider testSourceProvider) { - this.testSourceProvider = testSourceProvider; - } + private final TestSourceProvider testSourceProvider = new TestSourceProvider(); void applyFiltersAndCreateDescendants(RunnerTestDescriptor runnerTestDescriptor) { addChildrenRecursively(runnerTestDescriptor); diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java index 5aa1136a8475..26422dec3484 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java @@ -19,7 +19,6 @@ import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver; import org.junit.vintage.engine.descriptor.RunnerTestDescriptor; -import org.junit.vintage.engine.descriptor.TestSourceProvider; import org.junit.vintage.engine.descriptor.VintageEngineDescriptor; /** @@ -39,16 +38,13 @@ public class VintageDiscoverer { // @formatter:on public VintageEngineDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) { - TestSourceProvider testSourceProvider = new TestSourceProvider(); - VintageEngineDescriptor engineDescriptor = new VintageEngineDescriptor(uniqueId, testSourceProvider); + VintageEngineDescriptor engineDescriptor = new VintageEngineDescriptor(uniqueId); resolver.resolve(discoveryRequest, engineDescriptor); - RunnerTestDescriptorPostProcessor postProcessor = new RunnerTestDescriptorPostProcessor(testSourceProvider); - // @formatter:off - engineDescriptor.getChildren().stream() - .filter(RunnerTestDescriptor.class::isInstance) - .map(RunnerTestDescriptor.class::cast) - .forEach(postProcessor::applyFiltersAndCreateDescendants); - // @formatter:on + RunnerTestDescriptorPostProcessor postProcessor = new RunnerTestDescriptorPostProcessor(); + for (TestDescriptor testDescriptor : engineDescriptor.getChildren()) { + RunnerTestDescriptor runnerTestDescriptor = (RunnerTestDescriptor) testDescriptor; + postProcessor.applyFiltersAndCreateDescendants(runnerTestDescriptor); + } return engineDescriptor; } diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java index daa638795f54..871a7f28383a 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java @@ -28,11 +28,10 @@ public class RunnerExecutor { private final EngineExecutionListener engineExecutionListener; - private final TestSourceProvider testSourceProvider; + private final TestSourceProvider testSourceProvider = new TestSourceProvider(); - public RunnerExecutor(EngineExecutionListener engineExecutionListener, TestSourceProvider testSourceProvider) { + public RunnerExecutor(EngineExecutionListener engineExecutionListener) { this.engineExecutionListener = engineExecutionListener; - this.testSourceProvider = testSourceProvider; } public void execute(RunnerTestDescriptor runnerTestDescriptor) { diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java index 1abeff30b9cc..22e841e6765a 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java @@ -28,7 +28,6 @@ import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.vintage.engine.VintageUniqueIdBuilder; import org.junit.vintage.engine.descriptor.RunnerTestDescriptor; -import org.junit.vintage.engine.descriptor.TestSourceProvider; import org.junit.vintage.engine.samples.junit4.IgnoredJUnit4TestCase; import org.junit.vintage.engine.samples.junit4.IgnoredJUnit4TestCaseWithNotFilterableRunner; import org.junit.vintage.engine.samples.junit4.NotFilterableRunner; @@ -75,8 +74,7 @@ private void resolve(DiscoverySelector selector) { mock(LauncherDiscoveryListener.class)).build(); TestDescriptor engineDescriptor = new VintageDiscoverer().discover(request, VintageUniqueIdBuilder.engineId()); var runnerTestDescriptor = (RunnerTestDescriptor) getOnlyElement(engineDescriptor.getChildren()); - new RunnerTestDescriptorPostProcessor(new TestSourceProvider()).applyFiltersAndCreateDescendants( - runnerTestDescriptor); + new RunnerTestDescriptorPostProcessor().applyFiltersAndCreateDescendants(runnerTestDescriptor); } } From ee3f9c36cd58c40085748948b7f01398d0c326f7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 31 Dec 2020 13:23:46 +0100 Subject: [PATCH 0147/1433] Platform: Avoid SerializedForm reference Prior to this commit each `TestIdentifier` instance required memory for storing a `null` reference. --- .../platform/launcher/TestIdentifier.java | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java index da698a8307bb..8253ccb95938 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java @@ -51,16 +51,14 @@ public final class TestIdentifier implements Serializable { private static final ObjectStreamField[] serialPersistentFields = ObjectStreamClass.lookup( SerializedForm.class).getFields(); - // Only set during deserialization process - private SerializedForm serializedForm; - - private final UniqueId uniqueId; - private final UniqueId parentId; - private final String displayName; - private final String legacyReportingName; - private final TestSource source; - private final Set tags; - private final Type type; + // These are effectively final but not technically due to late initialization when deserializing + private /* final */ UniqueId uniqueId; + private /* final */ UniqueId parentId; + private /* final */ String displayName; + private /* final */ String legacyReportingName; + private /* final */ TestSource source; + private /* final */ Set tags; + private /* final */ Type type; /** * Factory for creating a new {@link TestIdentifier} from a {@link TestDescriptor}. @@ -78,12 +76,6 @@ public static TestIdentifier from(TestDescriptor testDescriptor) { return new TestIdentifier(uniqueId, displayName, source, tags, type, parentId, legacyReportingName); } - private TestIdentifier(SerializedForm serializedForm) { - this(UniqueId.parse(serializedForm.uniqueId), serializedForm.displayName, serializedForm.source, - serializedForm.tags, serializedForm.type, UniqueId.parse(serializedForm.parentId), - serializedForm.legacyReportingName); - } - private TestIdentifier(UniqueId uniqueId, String displayName, TestSource source, Set tags, Type type, UniqueId parentId, String legacyReportingName) { Preconditions.notNull(type, "TestDescriptor.Type must not be null"); @@ -286,11 +278,14 @@ private void writeObject(ObjectOutputStream s) throws IOException { } private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { - serializedForm = SerializedForm.deserialize(s); - } - - private Object readResolve() { - return new TestIdentifier(serializedForm); + SerializedForm serializedForm = SerializedForm.deserialize(s); + uniqueId = UniqueId.parse(serializedForm.uniqueId); + displayName = serializedForm.displayName; + source = serializedForm.source; + tags = serializedForm.tags; + type = serializedForm.type; + parentId = UniqueId.parse(serializedForm.parentId); + legacyReportingName = serializedForm.legacyReportingName; } /** From 0be0e784f6ad227eb323201891760440626d6f51 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 8 Jan 2021 20:27:24 +0100 Subject: [PATCH 0148/1433] Document memory improvements in release notes --- .../asciidoc/release-notes/release-notes-5.8.0-M1.adoc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 952a6bbfa8fc..43601da40a94 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -36,6 +36,8 @@ on GitHub. * Custom `LauncherDiscoveryListener` implementations can now be registered via Java’s `ServiceLoader` mechanism. * Documented constant value of `ExclusiveResource.GLOBAL_KEY`. +* Instances of `TestIdentifier` and `UniqueId` now retain less memory because they no + longer store `String` representations of unique IDs. [[release-notes-5.8.0-M1-junit-jupiter]] @@ -61,6 +63,8 @@ on GitHub. * Documented constant values in `Resources`. * New `assertInstanceOf` methods as a replacement for `assertTrue(obj instanceof X)` which provide better error messages comparable to those of `assertThrows`. +* Dynamic tests now require less memory thanks to a number of improvements to internal + data structures. [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage @@ -75,4 +79,5 @@ on GitHub. ==== New Features and Improvements -* ❓ +* The JUnit Vintage engine now requires less memory and allows for earlier garbage + collection thanks to a number of improvements to internal data structures. From 5ad0de43d8195fbb935d4483d45e0902f3a6f5da Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 9 Jan 2021 13:54:11 +0100 Subject: [PATCH 0149/1433] Enable dependency verification --- buildSrc/build.gradle.kts | 2 +- .../kotlin/testing-conventions.gradle.kts | 5 +- gradle.properties | 2 + gradle/verification-metadata.xml | 665 ++++++++++++++++++ 4 files changed, 669 insertions(+), 5 deletions(-) create mode 100644 gradle/verification-metadata.xml diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index d97ba94cbd15..478b0435d680 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -5,8 +5,8 @@ plugins { } repositories { - mavenCentral() gradlePluginPortal() + mavenCentral() } dependencies { diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 137d0d9e67d6..22c9b30c34da 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -37,10 +37,7 @@ dependencies { } if (project.name != "junit-jupiter-engine") { - "testImplementation"(project(":junit-jupiter-api")) - "testImplementation"(project(":junit-jupiter-params")) - - "testRuntimeOnly"(project(":junit-jupiter-engine")) + "testImplementation"(project(":junit-jupiter")) } "testImplementation"(testFixtures(project(":junit-jupiter-api"))) diff --git a/gradle.properties b/gradle.properties index 87227a7c26c8..32d2056a63aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,8 +13,10 @@ defaultBuiltBy = JUnit Team # We need more metaspace due to apparent memory leak in Asciidoctor/JRuby org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError + org.gradle.caching=true org.gradle.parallel=true +org.gradle.dependency.verification.console=verbose # Dependencies apiguardian.version=1.1.1 diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml new file mode 100644 index 000000000000..f9f82ab54692 --- /dev/null +++ b/gradle/verification-metadata.xml @@ -0,0 +1,665 @@ + + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ab436ac0137cf2f42b0b3baffc3066d8f0dce3f8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 9 Jan 2021 17:48:34 +0100 Subject: [PATCH 0150/1433] Add missing dependency verification metadata --- gradle/verification-metadata.xml | 154 +++++++++++++++++++++++++------ 1 file changed, 126 insertions(+), 28 deletions(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index f9f82ab54692..547f0aab7588 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -14,28 +14,64 @@ - - + + + + + + + + - - + + + + + + + + - - + + + + + + + + - - + + + + + + + + - - - + + + + + + + + + + + + - + + + + @@ -47,17 +83,36 @@ - + + + + - - + + + + + + + + - + + + + + - - + + + + + + + + @@ -69,31 +124,54 @@ - - + + + + + + + + + + - + + + + - - + + + + + + + + - + + + + - + + + + @@ -102,11 +180,21 @@ - + + + + + - - + + + + + + + + @@ -447,6 +535,11 @@ + + + + + @@ -605,6 +698,11 @@ + + + + + From ba60a0f8b5cf5449bba39c19075257d6e8858e08 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 9 Jan 2021 17:52:44 +0100 Subject: [PATCH 0151/1433] Revert "Add missing dependency verification metadata" This reverts commit ab436ac0137cf2f42b0b3baffc3066d8f0dce3f8. --- gradle/verification-metadata.xml | 154 ++++++------------------------- 1 file changed, 28 insertions(+), 126 deletions(-) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 547f0aab7588..f9f82ab54692 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -14,64 +14,28 @@ - - - - - - - - + + - - - - - - - - + + - - - - - - - - + + - - - - - - - - + + - - - - - - - - - - - - + + + - - - - + @@ -83,36 +47,17 @@ - - - - + - - - - - - - - + + - - - - - + - - - - - - - - + + @@ -124,54 +69,31 @@ - - - - - - - - + + - - - - - - + - - - - - - - - + + - - - - + - - - - + @@ -180,21 +102,11 @@ - - - - + - - - - - - - - - + + @@ -535,11 +447,6 @@ - - - - - @@ -698,11 +605,6 @@ - - - - - From fe7d2ec6654a2128226d8feea720f1738d988887 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 9 Jan 2021 17:52:50 +0100 Subject: [PATCH 0152/1433] Revert "Enable dependency verification" This reverts commit 5ad0de43d8195fbb935d4483d45e0902f3a6f5da. --- buildSrc/build.gradle.kts | 2 +- .../kotlin/testing-conventions.gradle.kts | 5 +- gradle.properties | 2 - gradle/verification-metadata.xml | 665 ------------------ 4 files changed, 5 insertions(+), 669 deletions(-) delete mode 100644 gradle/verification-metadata.xml diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 478b0435d680..d97ba94cbd15 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -5,8 +5,8 @@ plugins { } repositories { - gradlePluginPortal() mavenCentral() + gradlePluginPortal() } dependencies { diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 22c9b30c34da..137d0d9e67d6 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -37,7 +37,10 @@ dependencies { } if (project.name != "junit-jupiter-engine") { - "testImplementation"(project(":junit-jupiter")) + "testImplementation"(project(":junit-jupiter-api")) + "testImplementation"(project(":junit-jupiter-params")) + + "testRuntimeOnly"(project(":junit-jupiter-engine")) } "testImplementation"(testFixtures(project(":junit-jupiter-api"))) diff --git a/gradle.properties b/gradle.properties index 32d2056a63aa..87227a7c26c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,10 +13,8 @@ defaultBuiltBy = JUnit Team # We need more metaspace due to apparent memory leak in Asciidoctor/JRuby org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError - org.gradle.caching=true org.gradle.parallel=true -org.gradle.dependency.verification.console=verbose # Dependencies apiguardian.version=1.1.1 diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml deleted file mode 100644 index f9f82ab54692..000000000000 --- a/gradle/verification-metadata.xml +++ /dev/null @@ -1,665 +0,0 @@ - - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 02a3e1fbb4848cc234cfde44f855f560dcd9ca75 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Mon, 11 Jan 2021 13:09:05 +0100 Subject: [PATCH 0153/1433] Remove spurious usage of the word simply The word "simply" is used in roughly two situations: * When used in instructional documentation the word simply often conveys a value judgement about the complexity of a task. Not only is this unnecessary, it makes a number of assumptions about the readers familiarity with the concepts involved and can come across as condescending. * When used to describe a default implementation, the word simply is used to to convey that the description is a complete description of the implementation. This should be unnecessary given the context. As such nearly all usages of the world simply can be removed without a loss of clarity. For more context and a longer argument I found the arguments made Jim Fisher in his talk "Don't Say Simply" at Write the Docs Prague 2018[1] to be quite compelling. 1. https://www.youtube.com/watch?v=gsT2BBWBVmM Closes #2522 --- .../asciidoc/user-guide/running-tests.adoc | 6 ++--- .../testkit/EngineTestKitAllEventsDemo.java | 2 +- .../junit/jupiter/api/AssertLinesMatch.java | 2 +- .../org/junit/jupiter/api/Assertions.java | 6 ++--- ...isabledIfEnvironmentVariableCondition.java | 2 +- ...EnabledIfEnvironmentVariableCondition.java | 2 +- .../api/extension/InvocationInterceptor.java | 2 +- .../extension/TestInstanceFactoryTests.java | 2 +- .../commons/support/AnnotationSupport.java | 4 ++-- .../commons/util/ReflectionUtils.java | 9 ++++--- .../junit/platform/engine/TestDescriptor.java | 2 +- .../org/junit/platform/engine/TestEngine.java | 4 ++-- .../engine/discovery/MethodSelector.java | 2 +- .../support/discovery/SelectorResolver.java | 24 +++++++++---------- .../platform/launcher/TestIdentifier.java | 2 +- .../junit/platform/runner/JUnitPlatform.java | 12 +++++----- 16 files changed, 41 insertions(+), 42 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index 6f609123b09f..9e66659de68f 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -639,14 +639,14 @@ You need the following artifacts and their dependencies on the classpath. See ==== Display Names vs. Technical Names To define a custom _display name_ for the class run via `@RunWith(JUnitPlatform.class)` -simply annotate the class with `@SuiteDisplayName` and provide a custom value. +annotate the class with `@SuiteDisplayName` and provide a custom value. By default, _display names_ will be used for test artifacts; however, when the `JUnitPlatform` runner is used to execute tests with a build tool such as Gradle or Maven, the generated test report often needs to include the _technical names_ of test artifacts — for example, fully qualified class names — instead of shorter display names like the simple name of a test class or a custom display name containing special -characters. To enable technical names for reporting purposes, simply declare the +characters. To enable technical names for reporting purposes, declare the `@UseTechnicalNames` annotation alongside `@RunWith(JUnitPlatform.class)`. Note that the presence of `@UseTechnicalNames` overrides any custom display name @@ -808,7 +808,7 @@ expressions can be useful. === Capturing Standard Output/Error Since version 1.3, the JUnit Platform provides opt-in support for capturing output -printed to `System.out` and `System.err`. To enable it, simply set the +printed to `System.out` and `System.err`. To enable it, set the `junit.platform.output.capture.stdout` and/or `junit.platform.output.capture.stderr` <> to `true`. In addition, you may configure the maximum number of buffered bytes to be used per executed test or container diff --git a/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java b/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java index 21f05d439caf..03f0ffdc62e2 100644 --- a/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java +++ b/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java @@ -41,7 +41,7 @@ class EngineTestKitAllEventsDemo { void verifyAllJupiterEvents() { Writer writer = // create a java.io.Writer for debug output // end::user_guide[] - // For the demo, we are simply swallowing the debug output. + // For the demo, we are swallowing the debug output. new StringWriter(); // tag::user_guide[] diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java index 2e65d69995a3..138b46e523bd 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java @@ -127,7 +127,7 @@ void assertLinesMatchWithFastForward() { } String actualLine = actualDeque.peek(); - // trivial case: take the fast path when they simply match + // trivial case: take the fast path when they match if (matches(expectedLine, actualLine)) { actualDeque.pop(); continue; // main diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java index 5d130ddea6d0..bf17b39e0a51 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java @@ -3002,7 +3002,7 @@ public static void assertAll(String heading, Stream executables) thr * thrown, this method will fail. * *

    If you do not want to perform additional checks on the exception instance, - * simply ignore the return value. + * ignore the return value. */ public static T assertThrows(Class expectedType, Executable executable) { return AssertThrows.assertThrows(expectedType, executable); @@ -3016,7 +3016,7 @@ public static T assertThrows(Class expectedType, Execut * thrown, this method will fail. * *

    If you do not want to perform additional checks on the exception instance, - * simply ignore the return value. + * ignore the return value. * *

    Fails with the supplied failure {@code message}. */ @@ -3035,7 +3035,7 @@ public static T assertThrows(Class expectedType, Execut * supplied {@code messageSupplier}. * *

    If you do not want to perform additional checks on the exception instance, - * simply ignore the return value. + * ignore the return value. */ public static T assertThrows(Class expectedType, Executable executable, Supplier messageSupplier) { diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java index 68b98de8172c..8bf49646b251 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java @@ -64,7 +64,7 @@ protected ConditionEvaluationResult evaluate(DisabledIfEnvironmentVariable annot /** * Get the value of the named environment variable. * - *

    The default implementation simply delegates to + *

    The default implementation delegates to * {@link System#getenv(String)}. Can be overridden in a subclass for * testing purposes. */ diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java index bbc8cb8065c7..b23fa0315689 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java @@ -63,7 +63,7 @@ protected ConditionEvaluationResult evaluate(EnabledIfEnvironmentVariable annota /** * Get the value of the named environment variable. * - *

    The default implementation simply delegates to + *

    The default implementation delegates to * {@link System#getenv(String)}. Can be overridden in a subclass for * testing purposes. */ diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java index 31ac35535705..a002168fab5d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java @@ -36,7 +36,7 @@ * Invocation#skip()} exactly once on the supplied invocation. Otherwise, the * enclosing test or container will be reported as failed. * - *

    The default implementation simply calls {@link Invocation#proceed() + *

    The default implementation calls {@link Invocation#proceed() * proceed()} on the supplied {@linkplain Invocation invocation}. * *

    Constructor Requirements

    diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java index 092473785ba8..2bb66e500f62 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java @@ -642,7 +642,7 @@ public Object createTestInstance(TestInstanceFactoryContext factoryContext, Exte } /** - * This does not actually create a proxy. Rather, it simply simulates what + * This does not actually create a proxy. Rather, it simulates what * a proxy-based implementation might do, by loading the class from a * different {@link ClassLoader}. */ diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java index 632ee93f9789..4f1a102fb176 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java @@ -177,8 +177,8 @@ public static List findRepeatableAnnotations(Optional< * discovered within the class hierarchy, this method will additionally * search on interfaces implemented by each class in the hierarchy. * - *

    If the supplied {@code element} is {@code null}, this method simply - * returns an empty list. + *

    If the supplied {@code element} is {@code null}, this method returns + * an empty list. * *

    As of JUnit Platform 1.5, the search algorithm will also find * repeatable annotations used as meta-annotations on other repeatable diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java index 1a084f76415b..1182dd7f649c 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java @@ -108,7 +108,7 @@ public enum HierarchyTraversalMode { *

    The pattern intentionally captures the last bracket with the * capital letter so that the combination can be looked up via * {@link #classNameToTypeMap}. For example, the last matched group - * will contain {@code "[I"} instead of simply {@code "I"}. + * will contain {@code "[I"} instead of {@code "I"}. * * @see Class#getName() */ @@ -891,8 +891,8 @@ else if (methodPart.endsWith(")")) { * Get the outermost instance of the required type, searching recursively * through enclosing instances. * - *

    If the supplied inner object is of the required type, it will simply - * be returned. + *

    If the supplied inner object is of the required type, it will be + * returned. * * @param inner the inner object from which to begin the search; never {@code null} * @param requiredType the required type of the outermost instance; never {@code null} @@ -1705,8 +1705,7 @@ private static boolean isSearchable(Class clazz) { * {@link InvocationTargetException}, this method will be invoked * recursively with the underlying * {@linkplain InvocationTargetException#getTargetException() target - * exception}; otherwise, this method simply returns the supplied - * {@code Throwable}. + * exception}; otherwise, this method returns the supplied {@code Throwable}. */ private static Throwable getUnderlyingCause(Throwable t) { if (t instanceof InvocationTargetException) { diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java index 38380848314d..8971c92e1836 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java @@ -60,7 +60,7 @@ public interface TestDescriptor { * reporting infrastructure — for example, for reporting systems built * on the Ant-based XML reporting format for JUnit 4. * - *

    The default implementation simply delegates to {@link #getDisplayName()}. + *

    The default implementation delegates to {@link #getDisplayName()}. * * @return the legacy reporting name; never {@code null} or blank */ diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java index 6a838dba4cac..258c4980dc75 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java @@ -91,7 +91,7 @@ public interface TestEngine { * *

    This information is used solely for debugging and reporting purposes. * - *

    The default implementation simply returns an empty {@link Optional}, + *

    The default implementation returns an empty {@link Optional}, * signaling that the group ID is unknown. * *

    Concrete test engine implementations may override this method in @@ -121,7 +121,7 @@ default Optional getGroupId() { * {@link Package} instance with the attributes from the manifest. * *

    If the implementation title cannot be queried from the package - * attributes, the default implementation simply returns an empty + * attributes, the default implementation returns an empty * {@link Optional}. * *

    Concrete test engine implementations may override this method in diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java index 9daa8d65670e..344403360eae 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java @@ -32,7 +32,7 @@ *

    If a Java {@link Method} is provided, the selector will return that * {@linkplain #getJavaMethod() method} and its method name, class name, and * parameter types accordingly. If a {@link Class} and method name, a class name - * and method name, or simply a fully qualified method name is provided, + * and method name, or a fully qualified method name is provided, * this selector will only attempt to lazily load the {@link Class} and * {@link Method} if {@link #getJavaClass()} or {@link #getJavaMethod()} is * invoked. diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java index 1ac44600b371..53a10f65b618 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java @@ -74,7 +74,7 @@ public interface SelectorResolver { * Resolve the supplied {@link ClasspathResourceSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -93,7 +93,7 @@ default Resolution resolve(ClasspathResourceSelector selector, Context context) * Resolve the supplied {@link ClasspathRootSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -112,7 +112,7 @@ default Resolution resolve(ClasspathRootSelector selector, Context context) { * Resolve the supplied {@link ClassSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -131,7 +131,7 @@ default Resolution resolve(ClassSelector selector, Context context) { * Resolve the supplied {@link NestedClassSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -150,7 +150,7 @@ default Resolution resolve(NestedClassSelector selector, Context context) { * Resolve the supplied {@link DirectorySelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -169,7 +169,7 @@ default Resolution resolve(DirectorySelector selector, Context context) { * Resolve the supplied {@link FileSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -188,7 +188,7 @@ default Resolution resolve(FileSelector selector, Context context) { * Resolve the supplied {@link MethodSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -207,7 +207,7 @@ default Resolution resolve(MethodSelector selector, Context context) { * Resolve the supplied {@link NestedMethodSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -226,7 +226,7 @@ default Resolution resolve(NestedMethodSelector selector, Context context) { * Resolve the supplied {@link ModuleSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -245,7 +245,7 @@ default Resolution resolve(ModuleSelector selector, Context context) { * Resolve the supplied {@link PackageSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -264,7 +264,7 @@ default Resolution resolve(PackageSelector selector, Context context) { * Resolve the supplied {@link UniqueIdSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} @@ -283,7 +283,7 @@ default Resolution resolve(UniqueIdSelector selector, Context context) { * Resolve the supplied {@link UriSelector} using the supplied * {@link Context Context}. * - *

    The default implementation simply delegates to {@link + *

    The default implementation delegates to {@link * #resolve(DiscoverySelector, Context)}. * * @param selector the selector to be resolved; never {@code null} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java index 8253ccb95938..29681e3048b1 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java @@ -181,7 +181,7 @@ public String getDisplayName() { * reporting infrastructure — for example, for reporting systems built * on the Ant-based XML reporting format for JUnit 4. * - *

    The default implementation simply delegates to {@link #getDisplayName()}. + *

    The default implementation delegates to {@link #getDisplayName()}. * * @return the legacy reporting name; never {@code null} or blank * @see org.junit.platform.engine.TestDescriptor#getLegacyReportingName() diff --git a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java index e9944745158e..29b7e1ef7e84 100644 --- a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java +++ b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java @@ -78,11 +78,11 @@ * package for configuration options. * *

    If you do not use any configuration annotations from the - * {@code org.junit.platform.suite.api} package, you can simply use this runner - * on a test class whose programming model is supported on the JUnit Platform - * — for example, a JUnit Jupiter test class. Note, however, that any test - * class run with this runner must be {@code public} in order to be picked up by - * IDEs and build tools. + * {@code org.junit.platform.suite.api} package, you can use this runner on a + * test class whose programming model is supported on the JUnit Platform — + * for example, a JUnit Jupiter test class. Note, however, that any test class + * run with this runner must be {@code public} in order to be picked up by IDEs + * and build tools. * *

    When used on a class that serves as a test suite and the * {@link IncludeClassNamePatterns @IncludeClassNamePatterns} annotation is not @@ -147,7 +147,7 @@ private JUnitPlatformTestTree generateTestTree(LauncherDiscoveryRequest discover private LauncherDiscoveryRequest createDiscoveryRequest() { List selectors = getSelectorsFromAnnotations(); - // Allows to simply add @RunWith(JUnitPlatform.class) to any test case + // Allows @RunWith(JUnitPlatform.class) to be added to any test case boolean isSuite = !selectors.isEmpty(); if (!isSuite) { selectors.add(selectClass(this.testClass)); From a58ef50a8d6eb72f0430ce1f0da8ffccba2af7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonard=20Br=C3=BCnings?= Date: Tue, 12 Jan 2021 12:49:20 +0100 Subject: [PATCH 0154/1433] Allow parallel execution of child nodes if only read locks are acquired (#2515) --- .../release-notes/release-notes-5.8.0-M1.adoc | 3 +- .../support/hierarchical/NodeTreeWalker.java | 34 ++++-- .../NodeTreeWalkerIntegrationTests.java | 100 ++++++++++++++++++ 3 files changed, 128 insertions(+), 9 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 43601da40a94..f40414c2fe2e 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -38,7 +38,8 @@ on GitHub. * Documented constant value of `ExclusiveResource.GLOBAL_KEY`. * Instances of `TestIdentifier` and `UniqueId` now retain less memory because they no longer store `String` representations of unique IDs. - +* Improvement of `ExclusiveResource` handling, if a `Node` has only read locks and no read-write locks, + then descendants are not forced into `SAME_THREAD` execution, and can run concurrently. [[release-notes-5.8.0-M1-junit-jupiter]] === JUnit Jupiter diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java index 3d09201c1c60..01a6ce3faabe 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java @@ -57,21 +57,39 @@ private void walk(TestDescriptor globalLockDescriptor, TestDescriptor testDescri } else { Set allResources = new HashSet<>(exclusiveResources); - advisor.forceDescendantExecutionMode(testDescriptor, SAME_THREAD); - doForChildrenRecursively(testDescriptor, child -> { - allResources.addAll(getExclusiveResources(child)); - advisor.forceDescendantExecutionMode(child, SAME_THREAD); - }); + if (isReadOnly(allResources)) { + doForChildrenRecursively(testDescriptor, child -> allResources.addAll(getExclusiveResources(child))); + if (!isReadOnly(allResources)) { + forceDescendantExecutionModeRecursively(advisor, testDescriptor); + } + } + else { + advisor.forceDescendantExecutionMode(testDescriptor, SAME_THREAD); + doForChildrenRecursively(testDescriptor, child -> { + allResources.addAll(getExclusiveResources(child)); + advisor.forceDescendantExecutionMode(child, SAME_THREAD); + }); + } if (!globalLockDescriptor.equals(testDescriptor) && allResources.contains(GLOBAL_READ_WRITE)) { - advisor.forceDescendantExecutionMode(globalLockDescriptor, SAME_THREAD); - doForChildrenRecursively(globalLockDescriptor, - child -> advisor.forceDescendantExecutionMode(child, SAME_THREAD)); + forceDescendantExecutionModeRecursively(advisor, globalLockDescriptor); advisor.useResourceLock(globalLockDescriptor, globalReadWriteLock); } advisor.useResourceLock(testDescriptor, lockManager.getLockForResources(allResources)); } } + private void forceDescendantExecutionModeRecursively(NodeExecutionAdvisor advisor, + TestDescriptor globalLockDescriptor) { + advisor.forceDescendantExecutionMode(globalLockDescriptor, SAME_THREAD); + doForChildrenRecursively(globalLockDescriptor, + child -> advisor.forceDescendantExecutionMode(child, SAME_THREAD)); + } + + private boolean isReadOnly(Set exclusiveResources) { + return exclusiveResources.stream().allMatch( + exclusiveResource -> exclusiveResource.getLockMode() == ExclusiveResource.LockMode.READ); + } + private Set getExclusiveResources(TestDescriptor testDescriptor) { return NodeUtils.asNode(testDescriptor).getExclusiveResources(); } diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java index 88c397b59e1c..7cb996d3e2d7 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java @@ -15,6 +15,7 @@ import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; import static org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_READ; import static org.junit.platform.engine.support.hierarchical.ExclusiveResource.GLOBAL_READ_WRITE; +import static org.junit.platform.engine.support.hierarchical.ExclusiveResource.LockMode.READ; import static org.junit.platform.engine.support.hierarchical.ExclusiveResource.LockMode.READ_WRITE; import static org.junit.platform.engine.support.hierarchical.Node.ExecutionMode.SAME_THREAD; import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; @@ -25,6 +26,7 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceAccessMode; import org.junit.jupiter.api.parallel.ResourceLock; import org.junit.jupiter.engine.JupiterTestEngine; import org.junit.platform.engine.TestDescriptor; @@ -54,6 +56,70 @@ void pullUpExclusiveChildResourcesToTestClass() { assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).contains(SAME_THREAD); } + @Test + void setsForceExecutionModeForChildrenWithWriteLocksOnClass() { + var engineDescriptor = discover(TestCaseWithResourceWriteLockOnClass.class); + + var advisor = nodeTreeWalker.walk(engineDescriptor); + + var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // + .isEqualTo(List.of(getReadWriteLock("a"))); + assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); + + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()).isEqualTo(List.of()); + assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).contains(SAME_THREAD); + } + + @Test + void doesntSetForceExecutionModeForChildrenWithReadLocksOnClass() { + var engineDescriptor = discover(TestCaseWithResourceReadLockOnClass.class); + + var advisor = nodeTreeWalker.walk(engineDescriptor); + + var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // + .isEqualTo(List.of(getReadLock("a"))); + assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); + + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()).isEqualTo(List.of()); + assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).isEmpty(); + } + + @Test + void setsForceExecutionModeForChildrenWithReadLocksOnClassAndWriteLockOnTest() { + var engineDescriptor = discover(TestCaseWithResourceReadLockOnClassAndWriteClockOnTest.class); + + var advisor = nodeTreeWalker.walk(engineDescriptor); + + var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // + .isEqualTo(List.of(getReadWriteLock("a"))); + assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); + + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()).isEqualTo(List.of()); + assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).contains(SAME_THREAD); + } + + @Test + void doesntSetForceExecutionModeForChildrenWithReadLocksOnClassAndReadLockOnTest() { + var engineDescriptor = discover(TestCaseWithResourceReadLockOnClassAndReadClockOnTest.class); + + var advisor = nodeTreeWalker.walk(engineDescriptor); + + var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // + .isEqualTo(List.of(getReadLock("a"), getReadLock("b"))); + assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); + + var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); + assertThat(advisor.getResourceLock(testMethodDescriptor)).extracting(allLocks()).isEqualTo(List.of()); + assertThat(advisor.getForcedExecutionMode(testMethodDescriptor)).isEmpty(); + } + @Test void leavesResourceLockOnTestMethodWhenClassDoesNotUseResource() { var engineDescriptor = discover(TestCaseWithoutResourceLock.class); @@ -112,6 +178,10 @@ private Lock getReadWriteLock(String key) { return getLock(new ExclusiveResource(key, READ_WRITE)); } + private Lock getReadLock(String key) { + return getLock(new ExclusiveResource(key, READ)); + } + private Lock getLock(ExclusiveResource exclusiveResource) { return getOnlyElement(ResourceLockSupport.getLocks(lockManager.getLockForResource(exclusiveResource))); } @@ -154,4 +224,34 @@ void test() { } } } + + @ResourceLock("a") + static class TestCaseWithResourceWriteLockOnClass { + @Test + void test() { + } + } + + @ResourceLock(value = "a", mode = ResourceAccessMode.READ) + static class TestCaseWithResourceReadLockOnClass { + @Test + void test() { + } + } + + @ResourceLock(value = "a", mode = ResourceAccessMode.READ) + static class TestCaseWithResourceReadLockOnClassAndWriteClockOnTest { + @Test + @ResourceLock("a") + void test() { + } + } + + @ResourceLock(value = "a", mode = ResourceAccessMode.READ) + static class TestCaseWithResourceReadLockOnClassAndReadClockOnTest { + @Test + @ResourceLock(value = "b", mode = ResourceAccessMode.READ) + void test() { + } + } } From 03db7151f3d8a8b8d0037a01f4db671139c0b36b Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 3 Jan 2021 15:12:20 +0100 Subject: [PATCH 0155/1433] Allow registering discovery listeners on Launcher --- .../org/junit/platform/launcher/Launcher.java | 10 ++ .../launcher/LauncherDiscoveryListener.java | 4 +- .../core/CompositeTestExecutionListener.java | 112 ++++++++++++++ .../launcher/core/DefaultLauncher.java | 30 ++-- .../core/EngineDiscoveryOrchestrator.java | 25 ++-- .../core/EngineExecutionOrchestrator.java | 23 ++- .../launcher/core/LauncherFactory.java | 12 +- .../launcher/core/ListenerRegistry.java | 84 +++++++++++ ...reamInterceptingTestExecutionListener.java | 2 +- .../core/TestExecutionListenerRegistry.java | 141 ------------------ .../discovery/LauncherDiscoveryListeners.java | 5 +- .../testkit/engine/EngineTestKit.java | 2 +- ... CompositeTestExecutionListenerTests.java} | 64 ++++---- .../launcher/core/DefaultLauncherTests.java | 29 ---- .../launcher/core/LauncherFactoryTests.java | 14 +- .../launcher/core/ListenerRegistryTests.java | 48 ++++++ .../src/test/resources/log4j2-test.xml | 2 +- 17 files changed, 343 insertions(+), 264 deletions(-) create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java delete mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/TestExecutionListenerRegistry.java rename platform-tests/src/test/java/org/junit/platform/launcher/core/{TestExecutionListenerRegistryTests.java => CompositeTestExecutionListenerTests.java} (76%) create mode 100644 platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java index e303defbe8b1..3ca1dcd21eed 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java @@ -10,6 +10,7 @@ package org.junit.platform.launcher; +import static org.apiguardian.api.API.Status.EXPERIMENTAL; import static org.apiguardian.api.API.Status.STABLE; import org.apiguardian.api.API; @@ -51,6 +52,15 @@ @API(status = STABLE, since = "1.0") public interface Launcher { + /** + * Register one or more listeners for test discovery. + * + * @param listeners the listeners to be notified of test discovery events; + * never {@code null} or empty + */ + @API(status = EXPERIMENTAL, since = "1.8") + void registerLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners); + /** * Register one or more listeners for test execution. * diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index 75498f500607..dd4b58d72ec3 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -18,8 +18,8 @@ /** * Register a concrete implementation of this interface with a - * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} - * to be notified of events that occur during test discovery. + * {@link org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder} or + * {@link Launcher} to be notified of events that occur during test discovery. * *

    All methods in this interface have empty default implementations. * Concrete implementations may therefore override one or more of these methods diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java new file mode 100644 index 000000000000..7fc64521fd29 --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java @@ -0,0 +1,112 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import static java.util.stream.Collectors.toList; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Supplier; + +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; +import org.junit.platform.commons.util.UnrecoverableExceptions; +import org.junit.platform.engine.TestExecutionResult; +import org.junit.platform.engine.reporting.ReportEntry; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.TestIdentifier; +import org.junit.platform.launcher.TestPlan; + +class CompositeTestExecutionListener implements TestExecutionListener { + + private static final Logger LOGGER = LoggerFactory.getLogger(CompositeTestExecutionListener.class); + + private final List testExecutionListeners; + private final List eagerTestExecutionListeners; + + CompositeTestExecutionListener(List testExecutionListeners) { + this.testExecutionListeners = new ArrayList<>(testExecutionListeners); + this.eagerTestExecutionListeners = this.testExecutionListeners.stream() // + .filter(EagerTestExecutionListener.class::isInstance) // + .map(EagerTestExecutionListener.class::cast) // + .collect(toList()); + } + + @Override + public void dynamicTestRegistered(TestIdentifier testIdentifier) { + notifyEach(testExecutionListeners, listener -> listener.dynamicTestRegistered(testIdentifier), + () -> "dynamicTestRegistered(" + testIdentifier + ")"); + } + + @Override + public void executionSkipped(TestIdentifier testIdentifier, String reason) { + notifyEach(testExecutionListeners, listener -> listener.executionSkipped(testIdentifier, reason), + () -> "executionSkipped(" + testIdentifier + ", " + reason + ")"); + } + + @Override + public void executionStarted(TestIdentifier testIdentifier) { + notifyEach(eagerTestExecutionListeners, listener -> listener.executionJustStarted(testIdentifier), + () -> "executionJustStarted(" + testIdentifier + ")"); + notifyEach(testExecutionListeners, listener -> listener.executionStarted(testIdentifier), + () -> "executionStarted(" + testIdentifier + ")"); + } + + @Override + public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { + notifyEach(eagerTestExecutionListeners, + listener -> listener.executionJustFinished(testIdentifier, testExecutionResult), + () -> "executionJustFinished(" + testIdentifier + ", " + testExecutionResult + ")"); + notifyEach(testExecutionListeners, listener -> listener.executionFinished(testIdentifier, testExecutionResult), + () -> "executionFinished(" + testIdentifier + ", " + testExecutionResult + ")"); + } + + @Override + public void testPlanExecutionStarted(TestPlan testPlan) { + notifyEach(testExecutionListeners, listener -> listener.testPlanExecutionStarted(testPlan), + () -> "testPlanExecutionStarted(" + testPlan + ")"); + } + + @Override + public void testPlanExecutionFinished(TestPlan testPlan) { + notifyEach(testExecutionListeners, listener -> listener.testPlanExecutionFinished(testPlan), + () -> "testPlanExecutionFinished(" + testPlan + ")"); + } + + @Override + public void reportingEntryPublished(TestIdentifier testIdentifier, ReportEntry entry) { + notifyEach(testExecutionListeners, listener -> listener.reportingEntryPublished(testIdentifier, entry), + () -> "reportingEntryPublished(" + testIdentifier + ", " + entry + ")"); + } + + private static void notifyEach(List listeners, Consumer consumer, + Supplier description) { + listeners.forEach(listener -> { + try { + consumer.accept(listener); + } + catch (Throwable throwable) { + UnrecoverableExceptions.rethrowIfUnrecoverable(throwable); + LOGGER.warn(throwable, () -> String.format("TestExecutionListener [%s] threw exception for method: %s", + listener.getClass().getName(), description.get())); + } + }); + } + + interface EagerTestExecutionListener extends TestExecutionListener { + default void executionJustStarted(TestIdentifier testIdentifier) { + } + + default void executionJustFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { + } + } +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java index 5e1516fe45c1..d6fcfbb4bf6b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java @@ -37,8 +37,10 @@ */ class DefaultLauncher implements Launcher { - private final TestExecutionListenerRegistry listenerRegistry = new TestExecutionListenerRegistry(); - private final EngineExecutionOrchestrator executionOrchestrator = new EngineExecutionOrchestrator(listenerRegistry); + private final ListenerRegistry launcherDiscoveryListenerRegistry = ListenerRegistry.forLauncherDiscoveryListeners(); + private final ListenerRegistry testExecutionListenerRegistry = ListenerRegistry.forTestExecutionListeners(); + private final EngineExecutionOrchestrator executionOrchestrator = new EngineExecutionOrchestrator( + testExecutionListenerRegistry); private final EngineDiscoveryOrchestrator discoveryOrchestrator; /** @@ -48,11 +50,8 @@ class DefaultLauncher implements Launcher { * empty * @param postDiscoveryFilters the additional post discovery filters for * discovery requests; never {@code null} - * @param launcherDiscoveryListeners the additional launcher discovery - * listeners for discovery requests; never {@code null} */ - DefaultLauncher(Iterable testEngines, Collection postDiscoveryFilters, - Collection launcherDiscoveryListeners) { + DefaultLauncher(Iterable testEngines, Collection postDiscoveryFilters) { Preconditions.condition(testEngines != null && testEngines.iterator().hasNext(), () -> "Cannot create Launcher without at least one TestEngine; " + "consider adding an engine implementation JAR to the classpath"); @@ -60,14 +59,17 @@ class DefaultLauncher implements Launcher { Preconditions.containsNoNullElements(postDiscoveryFilters, "PostDiscoveryFilter array must not contain null elements"); this.discoveryOrchestrator = new EngineDiscoveryOrchestrator(EngineIdValidator.validate(testEngines), - unmodifiableCollection(postDiscoveryFilters), unmodifiableCollection(launcherDiscoveryListeners)); + unmodifiableCollection(postDiscoveryFilters), launcherDiscoveryListenerRegistry); + } + + @Override + public void registerLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners) { + this.launcherDiscoveryListenerRegistry.addAll(listeners); } @Override public void registerTestExecutionListeners(TestExecutionListener... listeners) { - Preconditions.notEmpty(listeners, "listeners array must not be null or empty"); - Preconditions.containsNoNullElements(listeners, "individual listeners must not be null"); - this.listenerRegistry.registerListeners(listeners); + this.testExecutionListenerRegistry.addAll(listeners); } @Override @@ -93,12 +95,12 @@ public void execute(TestPlan testPlan, TestExecutionListener... listeners) { execute((InternalTestPlan) testPlan, listeners); } - TestExecutionListenerRegistry getTestExecutionListenerRegistry() { - return listenerRegistry; + ListenerRegistry getTestExecutionListenerRegistry() { + return testExecutionListenerRegistry; } - LauncherDiscoveryListener getLauncherDiscoveryListener(LauncherDiscoveryRequest discoveryRequest) { - return discoveryOrchestrator.getLauncherDiscoveryListener(discoveryRequest); + ListenerRegistry getLauncherDiscoveryListenerRegistry() { + return launcherDiscoveryListenerRegistry; } private LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java index 3b9ea03be8d4..c0853d311140 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java @@ -11,7 +11,6 @@ package org.junit.platform.launcher.core; import static java.util.stream.Collectors.joining; -import static java.util.stream.Collectors.toList; import static org.apiguardian.api.API.Status.INTERNAL; import static org.junit.platform.engine.Filter.composeFilters; @@ -22,7 +21,6 @@ import java.util.Locale; import java.util.Map; import java.util.Optional; -import java.util.stream.Stream; import org.apiguardian.api.API; import org.junit.platform.commons.JUnitException; @@ -38,7 +36,6 @@ import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.PostDiscoveryFilter; -import org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners; /** * Orchestrates test discovery using the configured test engines. @@ -53,14 +50,18 @@ public class EngineDiscoveryOrchestrator { private final EngineDiscoveryResultValidator discoveryResultValidator = new EngineDiscoveryResultValidator(); private final Iterable testEngines; private final Collection postDiscoveryFilters; - private final Collection launcherDiscoveryListeners; + private final ListenerRegistry launcherDiscoveryListenerRegistry; public EngineDiscoveryOrchestrator(Iterable testEngines, - Collection postDiscoveryFilters, - Collection launcherDiscoveryListeners) { + Collection postDiscoveryFilters) { + this(testEngines, postDiscoveryFilters, ListenerRegistry.forLauncherDiscoveryListeners()); + } + + EngineDiscoveryOrchestrator(Iterable testEngines, Collection postDiscoveryFilters, + ListenerRegistry launcherDiscoveryListenerRegistry) { this.testEngines = testEngines; this.postDiscoveryFilters = postDiscoveryFilters; - this.launcherDiscoveryListeners = launcherDiscoveryListeners; + this.launcherDiscoveryListenerRegistry = launcherDiscoveryListenerRegistry; } /** @@ -134,13 +135,9 @@ private TestDescriptor discoverEngineRoot(TestEngine testEngine, LauncherDiscove } LauncherDiscoveryListener getLauncherDiscoveryListener(LauncherDiscoveryRequest discoveryRequest) { - LauncherDiscoveryListener discoveryListener = discoveryRequest.getDiscoveryListener(); - if (!launcherDiscoveryListeners.isEmpty()) { - List allDiscoveryListeners = Stream.concat(Stream.of(discoveryListener), - launcherDiscoveryListeners.stream()).collect(toList()); - discoveryListener = LauncherDiscoveryListeners.composite(allDiscoveryListeners); - } - return discoveryListener; + return ListenerRegistry.copyOf(launcherDiscoveryListenerRegistry) // + .add(discoveryRequest.getDiscoveryListener()) // + .getCompositeListener(); } private void applyPostDiscoveryFilters(Map testEngineDescriptors, diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java index 8d75ccd45b03..68271ea446fb 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java @@ -34,13 +34,13 @@ @API(status = INTERNAL, since = "1.7", consumers = "testkit") public class EngineExecutionOrchestrator { - private final TestExecutionListenerRegistry listenerRegistry; + private final ListenerRegistry listenerRegistry; public EngineExecutionOrchestrator() { - this(new TestExecutionListenerRegistry()); + this(ListenerRegistry.forTestExecutionListeners()); } - EngineExecutionOrchestrator(TestExecutionListenerRegistry listenerRegistry) { + EngineExecutionOrchestrator(ListenerRegistry listenerRegistry) { this.listenerRegistry = listenerRegistry; } @@ -48,7 +48,7 @@ void execute(InternalTestPlan internalTestPlan, TestExecutionListener... listene internalTestPlan.markStarted(); LauncherDiscoveryResult discoveryResult = internalTestPlan.getDiscoveryResult(); ConfigurationParameters configurationParameters = discoveryResult.getConfigurationParameters(); - TestExecutionListenerRegistry listenerRegistry = buildListenerRegistryForExecution(listeners); + ListenerRegistry listenerRegistry = buildListenerRegistryForExecution(listeners); withInterceptedStreams(configurationParameters, listenerRegistry, testExecutionListener -> { testExecutionListener.testPlanExecutionStarted(internalTestPlan); execute(discoveryResult, new ExecutionListenerAdapter(internalTestPlan, testExecutionListener)); @@ -57,14 +57,14 @@ void execute(InternalTestPlan internalTestPlan, TestExecutionListener... listene } private void withInterceptedStreams(ConfigurationParameters configurationParameters, - TestExecutionListenerRegistry listenerRegistry, Consumer action) { + ListenerRegistry listenerRegistry, Consumer action) { - TestExecutionListener testExecutionListener = listenerRegistry.getCompositeTestExecutionListener(); + TestExecutionListener testExecutionListener = listenerRegistry.getCompositeListener(); Optional streamInterceptingTestExecutionListener = StreamInterceptingTestExecutionListener.create( configurationParameters, testExecutionListener::reportingEntryPublished); - streamInterceptingTestExecutionListener.ifPresent(listenerRegistry::registerListeners); + streamInterceptingTestExecutionListener.ifPresent(listenerRegistry::add); try { - action.accept(testExecutionListener); + action.accept(listenerRegistry.getCompositeListener()); } finally { streamInterceptingTestExecutionListener.ifPresent(StreamInterceptingTestExecutionListener::unregister); @@ -90,13 +90,12 @@ public void execute(LauncherDiscoveryResult discoveryResult, EngineExecutionList } } - private TestExecutionListenerRegistry buildListenerRegistryForExecution(TestExecutionListener... listeners) { + private ListenerRegistry buildListenerRegistryForExecution( + TestExecutionListener... listeners) { if (listeners.length == 0) { return this.listenerRegistry; } - TestExecutionListenerRegistry registry = new TestExecutionListenerRegistry(this.listenerRegistry); - registry.registerListeners(listeners); - return registry; + return ListenerRegistry.copyOf(this.listenerRegistry).addAll(listeners); } private void execute(TestDescriptor engineDescriptor, EngineExecutionListener listener, diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java index 6b1ee7d93d8c..d102d987ba11 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java @@ -28,7 +28,6 @@ import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.TestEngine; import org.junit.platform.launcher.Launcher; -import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; @@ -93,10 +92,10 @@ public static Launcher create(LauncherConfig config) throws PreconditionViolatio Set engines = collectTestEngines(config); List filters = collectPostDiscoveryFilters(config); - List discoveryListeners = collectLauncherDiscoveryListeners(config); - Launcher launcher = new DefaultLauncher(engines, filters, discoveryListeners); + Launcher launcher = new DefaultLauncher(engines, filters); + registerLauncherDiscoveryListeners(config, launcher); registerTestExecutionListeners(config, launcher); return launcher; @@ -120,12 +119,11 @@ private static List collectPostDiscoveryFilters(LauncherCon return filters; } - private static List collectLauncherDiscoveryListeners(LauncherConfig config) { - List discoveryListeners = new ArrayList<>(); + private static void registerLauncherDiscoveryListeners(LauncherConfig config, Launcher launcher) { if (config.isLauncherDiscoveryListenerAutoRegistrationEnabled()) { - new ServiceLoaderLauncherDiscoveryListenerRegistry().loadListeners().forEach(discoveryListeners::add); + new ServiceLoaderLauncherDiscoveryListenerRegistry().loadListeners().forEach( + launcher::registerLauncherDiscoveryListeners); } - return discoveryListeners; } private static void registerTestExecutionListeners(LauncherConfig config, Launcher launcher) { diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java new file mode 100644 index 000000000000..b38c38d274d2 --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java @@ -0,0 +1,84 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.function.Function; + +import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners; + +class ListenerRegistry { + + private final Function, T> compositeListenerFactory; + + static ListenerRegistry forLauncherDiscoveryListeners() { + return create(LauncherDiscoveryListeners::composite); + } + + static ListenerRegistry forTestExecutionListeners() { + return create(CompositeTestExecutionListener::new); + } + + static ListenerRegistry create(Function, T> compositeListenerFactory) { + return new ListenerRegistry<>(compositeListenerFactory); + } + + static ListenerRegistry copyOf(ListenerRegistry source) { + ListenerRegistry registry = new ListenerRegistry<>(source.compositeListenerFactory); + if (!source.listeners.isEmpty()) { + registry.addAll(source.listeners); + } + return registry; + } + + private final ArrayList listeners = new ArrayList<>(); + + private ListenerRegistry(Function, T> compositeListenerFactory) { + this.compositeListenerFactory = compositeListenerFactory; + } + + ListenerRegistry add(T listener) { + Preconditions.notNull(listener, "listener must not be null"); + this.listeners.add(listener); + return this; + } + + @SafeVarargs + @SuppressWarnings("varargs") + final ListenerRegistry addAll(T... listeners) { + Preconditions.notEmpty(listeners, "listeners array must not be null or empty"); + return addAll(Arrays.asList(listeners)); + } + + ListenerRegistry addAll(Collection listeners) { + Preconditions.notEmpty(listeners, "listeners collection must not be null or empty"); + Preconditions.containsNoNullElements(listeners, "individual listeners must not be null"); + this.listeners.addAll(listeners); + return this; + } + + T getCompositeListener() { + this.listeners.trimToSize(); + return compositeListenerFactory.apply(this.listeners); + } + + List getListeners() { + return Collections.unmodifiableList(this.listeners); + } + +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java index 9ae8cdf148d2..139b32dc4070 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java @@ -27,7 +27,7 @@ import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.reporting.ReportEntry; import org.junit.platform.launcher.TestIdentifier; -import org.junit.platform.launcher.core.TestExecutionListenerRegistry.EagerTestExecutionListener; +import org.junit.platform.launcher.core.CompositeTestExecutionListener.EagerTestExecutionListener; /** * @since 1.3 diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/TestExecutionListenerRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/TestExecutionListenerRegistry.java deleted file mode 100644 index a765144a6bf1..000000000000 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/TestExecutionListenerRegistry.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2015-2020 the original author or authors. - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which - * accompanies this distribution and is available at - * - * https://www.eclipse.org/legal/epl-v20.html - */ - -package org.junit.platform.launcher.core; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import org.junit.platform.commons.logging.Logger; -import org.junit.platform.commons.logging.LoggerFactory; -import org.junit.platform.commons.util.UnrecoverableExceptions; -import org.junit.platform.engine.TestExecutionResult; -import org.junit.platform.engine.reporting.ReportEntry; -import org.junit.platform.launcher.TestExecutionListener; -import org.junit.platform.launcher.TestIdentifier; -import org.junit.platform.launcher.TestPlan; - -/** - * @since 1.0 - */ -class TestExecutionListenerRegistry { - private static final Logger logger = LoggerFactory.getLogger(TestExecutionListenerRegistry.class); - - private final List testExecutionListeners = new ArrayList<>(); - private final List eagerTestExecutionListeners = new ArrayList<>(); - - TestExecutionListenerRegistry() { - this(null); - } - - TestExecutionListenerRegistry(TestExecutionListenerRegistry source) { - if (source != null) { - this.testExecutionListeners.addAll(source.testExecutionListeners); - this.eagerTestExecutionListeners.addAll(source.eagerTestExecutionListeners); - } - } - - List getTestExecutionListeners() { - return testExecutionListeners; - } - - void registerListeners(TestExecutionListener... listeners) { - Collections.addAll(this.testExecutionListeners, listeners); - // @formatter:off - Arrays.stream(listeners) - .filter(EagerTestExecutionListener.class::isInstance) - .map(EagerTestExecutionListener.class::cast) - .forEach(this.eagerTestExecutionListeners::add); - // @formatter:on - } - - private void notifyEach(List listeners, Consumer consumer, - Supplier description) { - listeners.forEach(listener -> { - try { - consumer.accept(listener); - } - catch (Throwable throwable) { - UnrecoverableExceptions.rethrowIfUnrecoverable(throwable); - logger.warn(throwable, () -> String.format("TestExecutionListener [%s] threw exception for method: %s", - listener.getClass().getName(), description.get())); - } - }); - } - - TestExecutionListener getCompositeTestExecutionListener() { - return new CompositeTestExecutionListener(); - } - - private class CompositeTestExecutionListener implements TestExecutionListener { - - @Override - public void dynamicTestRegistered(TestIdentifier testIdentifier) { - notifyEach(testExecutionListeners, listener -> listener.dynamicTestRegistered(testIdentifier), - () -> "dynamicTestRegistered(" + testIdentifier + ")"); - } - - @Override - public void executionSkipped(TestIdentifier testIdentifier, String reason) { - notifyEach(testExecutionListeners, listener -> listener.executionSkipped(testIdentifier, reason), - () -> "executionSkipped(" + testIdentifier + ", " + reason + ")"); - } - - @Override - public void executionStarted(TestIdentifier testIdentifier) { - notifyEach(eagerTestExecutionListeners, listener -> listener.executionJustStarted(testIdentifier), - () -> "executionJustStarted(" + testIdentifier + ")"); - notifyEach(testExecutionListeners, listener -> listener.executionStarted(testIdentifier), - () -> "executionStarted(" + testIdentifier + ")"); - } - - @Override - public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { - notifyEach(eagerTestExecutionListeners, - listener -> listener.executionJustFinished(testIdentifier, testExecutionResult), - () -> "executionJustFinished(" + testIdentifier + ", " + testExecutionResult + ")"); - notifyEach(testExecutionListeners, - listener -> listener.executionFinished(testIdentifier, testExecutionResult), - () -> "executionFinished(" + testIdentifier + ", " + testExecutionResult + ")"); - } - - @Override - public void testPlanExecutionStarted(TestPlan testPlan) { - notifyEach(testExecutionListeners, listener -> listener.testPlanExecutionStarted(testPlan), - () -> "testPlanExecutionStarted(" + testPlan + ")"); - } - - @Override - public void testPlanExecutionFinished(TestPlan testPlan) { - notifyEach(testExecutionListeners, listener -> listener.testPlanExecutionFinished(testPlan), - () -> "testPlanExecutionFinished(" + testPlan + ")"); - } - - @Override - public void reportingEntryPublished(TestIdentifier testIdentifier, ReportEntry entry) { - notifyEach(testExecutionListeners, listener -> listener.reportingEntryPublished(testIdentifier, entry), - () -> "reportingEntryPublished(" + testIdentifier + ", " + entry + ")"); - } - - } - - interface EagerTestExecutionListener extends TestExecutionListener { - default void executionJustStarted(TestIdentifier testIdentifier) { - } - - default void executionJustFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { - } - } - -} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java index e6d7ba2b277c..b04940c02cce 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java @@ -74,8 +74,11 @@ public static LauncherDiscoveryListener logging() { @API(status = INTERNAL, since = "1.6") public static LauncherDiscoveryListener composite(List listeners) { - Preconditions.notEmpty(listeners, "listeners must not be empty"); + Preconditions.notNull(listeners, "listeners must not be null"); Preconditions.containsNoNullElements(listeners, "listeners must not contain any null elements"); + if (listeners.isEmpty()) { + return LauncherDiscoveryListener.NOOP; + } if (listeners.size() == 1) { return listeners.get(0); } diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java index 76b7594ccacd..b50c3111bd61 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java @@ -266,7 +266,7 @@ private static void executeDirectly(TestEngine testEngine, EngineDiscoveryReques private static void executeUsingLauncherOrchestration(TestEngine testEngine, LauncherDiscoveryRequest discoveryRequest, EngineExecutionListener listener) { TestDescriptor engineTestDescriptor; - LauncherDiscoveryResult discoveryResult = new EngineDiscoveryOrchestrator(singleton(testEngine), emptySet(), + LauncherDiscoveryResult discoveryResult = new EngineDiscoveryOrchestrator(singleton(testEngine), emptySet()).discover(discoveryRequest, EXECUTION); engineTestDescriptor = discoveryResult.getEngineTestDescriptor(testEngine); Preconditions.notNull(engineTestDescriptor, "TestEngine did not yield a TestDescriptor"); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java similarity index 76% rename from platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java rename to platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java index 35d999c0ba4f..9da3af4a23b4 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/TestExecutionListenerRegistryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java @@ -14,11 +14,12 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.mock; +import java.util.ArrayList; +import java.util.List; import java.util.Set; import java.util.logging.Level; import java.util.logging.LogRecord; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.fixtures.TrackLogRecords; import org.junit.platform.commons.logging.LogRecordListener; @@ -30,24 +31,18 @@ import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; +import org.junit.platform.launcher.core.CompositeTestExecutionListener.EagerTestExecutionListener; @TrackLogRecords -class TestExecutionListenerRegistryTests { +class CompositeTestExecutionListenerTests { - private TestExecutionListenerRegistry registry = new TestExecutionListenerRegistry(); - private TestExecutionListener compositeTestExecutionListener; - - @BeforeEach - void setUp() { - registry.registerListeners(new ThrowingTestExecutionListener()); - compositeTestExecutionListener = registry.getCompositeTestExecutionListener(); - } + private final List listeners = new ArrayList<>(List.of(new ThrowingTestExecutionListener())); @Test void shouldNotThrowExceptionButLogIfDynamicTestRegisteredListenerMethodFails(LogRecordListener logRecordListener) { var testIdentifier = getSampleMethodTestIdentifier(); - compositeTestExecutionListener.dynamicTestRegistered(testIdentifier); + compositeTestExecutionListener().dynamicTestRegistered(testIdentifier); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "dynamicTestRegistered"); @@ -57,7 +52,7 @@ void shouldNotThrowExceptionButLogIfDynamicTestRegisteredListenerMethodFails(Log void shouldNotThrowExceptionButLogIfExecutionStartedListenerMethodFails(LogRecordListener logRecordListener) { var testIdentifier = getSampleMethodTestIdentifier(); - compositeTestExecutionListener.executionStarted(testIdentifier); + compositeTestExecutionListener().executionStarted(testIdentifier); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "executionStarted"); } @@ -66,7 +61,7 @@ void shouldNotThrowExceptionButLogIfExecutionStartedListenerMethodFails(LogRecor void shouldNotThrowExceptionButLogIfExecutionSkippedListenerMethodFails(LogRecordListener logRecordListener) { var testIdentifier = getSampleMethodTestIdentifier(); - compositeTestExecutionListener.executionSkipped(testIdentifier, "deliberately skipped container"); + compositeTestExecutionListener().executionSkipped(testIdentifier, "deliberately skipped container"); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "executionSkipped"); } @@ -75,7 +70,7 @@ void shouldNotThrowExceptionButLogIfExecutionSkippedListenerMethodFails(LogRecor void shouldNotThrowExceptionButLogIfExecutionFinishedListenerMethodFails(LogRecordListener logRecordListener) { var testIdentifier = getSampleMethodTestIdentifier(); - compositeTestExecutionListener.executionFinished(testIdentifier, mock(TestExecutionResult.class)); + compositeTestExecutionListener().executionFinished(testIdentifier, mock(TestExecutionResult.class)); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "executionFinished"); } @@ -85,7 +80,7 @@ void shouldNotThrowExceptionButLogIfReportingEntryPublishedListenerMethodFails( LogRecordListener logRecordListener) { var testIdentifier = getSampleMethodTestIdentifier(); - compositeTestExecutionListener.reportingEntryPublished(testIdentifier, ReportEntry.from("one", "two")); + compositeTestExecutionListener().reportingEntryPublished(testIdentifier, ReportEntry.from("one", "two")); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "reportingEntryPublished"); @@ -96,7 +91,7 @@ void shouldNotThrowExceptionButLogIfTesPlanExecutionStartedListenerMethodFails( LogRecordListener logRecordListener) { var testDescriptor = getDemoMethodTestDescriptor(); - compositeTestExecutionListener.testPlanExecutionStarted(TestPlan.from(Set.of(testDescriptor))); + compositeTestExecutionListener().testPlanExecutionStarted(TestPlan.from(Set.of(testDescriptor))); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "testPlanExecutionStarted"); @@ -107,7 +102,7 @@ void shouldNotThrowExceptionButLogIfTesPlanExecutionFinishedListenerMethodFails( LogRecordListener logRecordListener) { var testDescriptor = getDemoMethodTestDescriptor(); - compositeTestExecutionListener.testPlanExecutionFinished(TestPlan.from(Set.of(testDescriptor))); + compositeTestExecutionListener().testPlanExecutionFinished(TestPlan.from(Set.of(testDescriptor))); assertThatTestListenerErrorLogged(logRecordListener, ThrowingTestExecutionListener.class, "testPlanExecutionFinished"); @@ -116,10 +111,10 @@ void shouldNotThrowExceptionButLogIfTesPlanExecutionFinishedListenerMethodFails( @Test void shouldNotThrowExceptionButLogIfExecutionJustStartedEagerTestListenerMethodFails( LogRecordListener logRecordListener) { - registry.registerListeners(new ThrowingEagerTestExecutionListener()); + listeners.add(new ThrowingEagerTestExecutionListener()); var testIdentifier = getSampleMethodTestIdentifier(); - compositeTestExecutionListener.executionStarted(testIdentifier); + compositeTestExecutionListener().executionStarted(testIdentifier); assertThatTestListenerErrorLogged(logRecordListener, ThrowingEagerTestExecutionListener.class, "executionJustStarted"); @@ -128,10 +123,10 @@ void shouldNotThrowExceptionButLogIfExecutionJustStartedEagerTestListenerMethodF @Test void shouldNotThrowExceptionButLogIfExecutionJustFinishedEagerTestListenerMethodFails( LogRecordListener logRecordListener) { - registry.registerListeners(new ThrowingEagerTestExecutionListener()); + listeners.add(new ThrowingEagerTestExecutionListener()); var testIdentifier = getSampleMethodTestIdentifier(); - compositeTestExecutionListener.executionFinished(testIdentifier, mock(TestExecutionResult.class)); + compositeTestExecutionListener().executionFinished(testIdentifier, mock(TestExecutionResult.class)); assertThatTestListenerErrorLogged(logRecordListener, ThrowingEagerTestExecutionListener.class, "executionJustFinished"); @@ -139,45 +134,46 @@ void shouldNotThrowExceptionButLogIfExecutionJustFinishedEagerTestListenerMethod @Test void shouldThrowOutOfMemoryExceptionAndStopListenerWithoutLog(LogRecordListener logRecordListener) { - var registry = new TestExecutionListenerRegistry(); - registry.registerListeners(new TestExecutionListener() { + listeners.clear(); + listeners.add(new TestExecutionListener() { @Override public void executionStarted(TestIdentifier testIdentifier) { throw new OutOfMemoryError(); } }); var testIdentifier = getSampleMethodTestIdentifier(); - assertThatThrownBy( - () -> registry.getCompositeTestExecutionListener().executionStarted(testIdentifier)).isInstanceOf( - OutOfMemoryError.class); + assertThatThrownBy(() -> compositeTestExecutionListener().executionStarted(testIdentifier)).isInstanceOf( + OutOfMemoryError.class); assertNotLogs(logRecordListener); } @Test void shouldThrowOutOfMemoryExceptionAndStopEagerListenerWithoutLog(LogRecordListener logRecordListener) { - var registry = new TestExecutionListenerRegistry(); - registry.registerListeners(new TestExecutionListenerRegistry.EagerTestExecutionListener() { + listeners.add(new EagerTestExecutionListener() { @Override public void executionJustStarted(TestIdentifier testIdentifier) { throw new OutOfMemoryError(); } }); var testIdentifier = getSampleMethodTestIdentifier(); - assertThatThrownBy( - () -> registry.getCompositeTestExecutionListener().executionStarted(testIdentifier)).isInstanceOf( - OutOfMemoryError.class); + assertThatThrownBy(() -> compositeTestExecutionListener().executionStarted(testIdentifier)).isInstanceOf( + OutOfMemoryError.class); assertNotLogs(logRecordListener); } + private TestExecutionListener compositeTestExecutionListener() { + return new CompositeTestExecutionListener(listeners); + } + private LogRecord firstWarnLogRecord(LogRecordListener logRecordListener) throws AssertionError { - return logRecordListener.stream(TestExecutionListenerRegistry.class, Level.WARNING).findFirst().orElseThrow( + return logRecordListener.stream(CompositeTestExecutionListener.class, Level.WARNING).findFirst().orElseThrow( () -> new AssertionError("Failed to find error log record")); } private void assertNotLogs(LogRecordListener logRecordListener) throws AssertionError { - assertThat(logRecordListener.stream(TestExecutionListenerRegistry.class, Level.WARNING).count()).isZero(); + assertThat(logRecordListener.stream(CompositeTestExecutionListener.class, Level.WARNING).count()).isZero(); } private TestIdentifier getSampleMethodTestIdentifier() { @@ -198,7 +194,7 @@ private DemoMethodTestDescriptor getDemoMethodTestDescriptor() { } private static class ThrowingEagerTestExecutionListener extends ThrowingTestExecutionListener - implements TestExecutionListenerRegistry.EagerTestExecutionListener { + implements EagerTestExecutionListener { @Override public void executionJustStarted(TestIdentifier testIdentifier) { throw new RuntimeException("failed to invoke listener"); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java index 8910104380a8..0ff85c43cc1b 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java @@ -94,35 +94,6 @@ void constructLauncherWithMultipleTestEnginesWithDuplicateIds() { assertThat(exception).hasMessageContaining("multiple engines with the same ID"); } - @Test - void registerTestExecutionListenersWithNullArray() { - var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); - - var exception = assertThrows(PreconditionViolationException.class, - () -> launcher.registerTestExecutionListeners((TestExecutionListener[]) null)); - - assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); - } - - @Test - void registerTestExecutionListenersWithEmptyArray() { - var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); - - var exception = assertThrows(PreconditionViolationException.class, launcher::registerTestExecutionListeners); - - assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); - } - - @Test - void registerTestExecutionListenersWithArrayContainingNullElements() { - var launcher = createLauncher(new DemoHierarchicalTestEngine("dummy id")); - - var exception = assertThrows(PreconditionViolationException.class, - () -> launcher.registerTestExecutionListeners(new TestExecutionListener[] { null })); - - assertThat(exception).hasMessageContaining("individual listeners must not be null"); - } - @Test void discoverEmptyTestPlanWithEngineWithoutAnyTests() { var launcher = createLauncher(new DemoHierarchicalTestEngine()); diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java index 13200078408c..982cd9b8b5bb 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java @@ -15,7 +15,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; -import static org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners.abortOnFailure; import java.net.URL; import java.net.URLClassLoader; @@ -24,6 +23,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.engine.JupiterTestEngine; import org.junit.platform.commons.PreconditionViolationException; +import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TagFilter; import org.junit.platform.launcher.TestIdentifier; @@ -46,7 +46,7 @@ void preconditions() { void noopTestExecutionListenerIsLoadedViaServiceApi() { withTestServices(() -> { var launcher = (DefaultLauncher) LauncherFactory.create(); - var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); + var listeners = launcher.getTestExecutionListenerRegistry().getListeners(); var listener = listeners.stream().filter(NoopTestExecutionListener.class::isInstance).findFirst(); assertThat(listener).isPresent(); }); @@ -56,7 +56,7 @@ void noopTestExecutionListenerIsLoadedViaServiceApi() { void unusedTestExecutionListenerIsNotLoadedViaServiceApi() { withTestServices(() -> { var launcher = (DefaultLauncher) LauncherFactory.create(); - var listeners = launcher.getTestExecutionListenerRegistry().getTestExecutionListeners(); + var listeners = launcher.getTestExecutionListenerRegistry().getListeners(); assertThat(listeners).filteredOn(AnotherUnusedTestExecutionListener.class::isInstance).isEmpty(); assertThat(listeners).filteredOn(UnusedTestExecutionListener.class::isInstance).isEmpty(); @@ -173,9 +173,9 @@ void doesNotDiscoverLauncherDiscoverRequestListenerViaServiceApiWhenDisabled() { withTestServices(() -> { var launcher = (DefaultLauncher) LauncherFactory.create( LauncherConfig.builder().enableLauncherDiscoveryListenerAutoRegistration(false).build()); - var launcherDiscoveryListener = launcher.getLauncherDiscoveryListener(request().build()); + var launcherDiscoveryListener = launcher.getLauncherDiscoveryListenerRegistry().getCompositeListener(); - assertThat(launcherDiscoveryListener).isEqualTo(abortOnFailure()); + assertThat(launcherDiscoveryListener).isSameAs(LauncherDiscoveryListener.NOOP); }); } @@ -183,11 +183,11 @@ void doesNotDiscoverLauncherDiscoverRequestListenerViaServiceApiWhenDisabled() { void discoversLauncherDiscoverRequestListenerViaServiceApiByDefault() { withTestServices(() -> { var launcher = (DefaultLauncher) LauncherFactory.create(); - var launcherDiscoveryListener = launcher.getLauncherDiscoveryListener(request().build()); + var launcherDiscoveryListener = launcher.getLauncherDiscoveryListenerRegistry().getCompositeListener(); assertThat(launcherDiscoveryListener.getClass().getSimpleName()).startsWith("Composite"); assertThat(launcherDiscoveryListener).extracting("listeners").asList() // - .contains(new TestLauncherDiscoveryListener(), abortOnFailure()); + .contains(new TestLauncherDiscoveryListener()); }); } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java new file mode 100644 index 000000000000..68c7b6b5478f --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java @@ -0,0 +1,48 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; +import org.junit.platform.commons.PreconditionViolationException; + +public class ListenerRegistryTests { + + @Test + void registerWithNullArray() { + var registry = ListenerRegistry.create(l -> l.get(0)); + + var exception = assertThrows(PreconditionViolationException.class, () -> registry.addAll((Object[]) null)); + + assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); + } + + @Test + void registerWithEmptyArray() { + var registry = ListenerRegistry.create(l -> l.get(0)); + + var exception = assertThrows(PreconditionViolationException.class, registry::addAll); + + assertThat(exception).hasMessageContaining("listeners array must not be null or empty"); + } + + @Test + void registerWithArrayContainingNullElements() { + var registry = ListenerRegistry.create(l -> l.get(0)); + + var exception = assertThrows(PreconditionViolationException.class, + () -> registry.addAll(new Object[] { null })); + + assertThat(exception).hasMessageContaining("individual listeners must not be null"); + } +} diff --git a/platform-tests/src/test/resources/log4j2-test.xml b/platform-tests/src/test/resources/log4j2-test.xml index 0490911338f5..653e2017872e 100644 --- a/platform-tests/src/test/resources/log4j2-test.xml +++ b/platform-tests/src/test/resources/log4j2-test.xml @@ -11,7 +11,7 @@ - + From 7be6fdec7c6b0cbed5f1349a8e550f13eaf7834c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 4 Jan 2021 21:43:19 +0100 Subject: [PATCH 0156/1433] Introduce LauncherSession{Listener} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implementations of `TestExecutionListener` and (starting with 5.8) `LauncherDiscoveryListener` can be registered via ServiceLoader on each `Launcher` created via `LauncherFactory`. Implementing one of those listeners, in particular the former, allows to have custom setup or teardown code executed once for the entire test run across multiple test engines. Use cases include starting and stopping an external process, replacing the class loader, initializing some library etc. However, subsequent calls to `Launcher.execute` currently cause that setup / teardown code to be executed again which is not desirable, especially if it’s slow. However, for example the Maven Surefire plugin attempts to rerun failed tests if `rerunFailingTestsCount` is set or (when https://issues.apache.org/jira/browse/SUREFIRE-1725 is released) will even execute every test class in a separate request. We could make the `Launcher` interface extend `AutoCloseable`. Calling `close()` would signal that it’s no longer used and any teardown code should be run. Since we can’t change `Launcher` in that way without breaking existing usages (which wouldn’t call `close()`), this commit introduces a new concept: a closeable `LauncherSession`. Tools that potentially call `Launcher.discover` or `Launcher.execute` multiple times should first open a session and close it when they’re done. Instances of `LauncherSessionListener` — which are registered via ServiceLoader (by default, can be disabled) or explicitly via a `LauncherConfig` — are called when the session is opened and closed. Each listener can then get access to the `Launcher` to register discovery/execution listeners via `LauncherSession.getLauncher`, e.g. to postpone setup until the first execution. To ensure `LauncherSessionListener` gets called even by tools that do not (yet) use sessions, the `Launcher` created via `LauncherFactory.create` opens and closes a session for each call to `Launcher.discover` or `Launcher.execute`. --- documentation/documentation.gradle.kts | 6 +- .../src/docs/asciidoc/link-attributes.adoc | 7 +- .../release-notes/release-notes-5.8.0-M1.adoc | 7 +- .../docs/asciidoc/user-guide/extensions.adoc | 6 +- .../asciidoc/user-guide/launcher-api.adoc | 62 +++++---- .../java/example/UsingTheLauncherDemo.java | 55 ++++++-- .../launcher/LauncherDiscoveryListener.java | 1 + .../platform/launcher/LauncherSession.java | 49 +++++++ .../launcher/LauncherSessionListener.java | 64 +++++++++ .../launcher/core/DefaultLauncher.java | 8 +- .../launcher/core/DefaultLauncherConfig.java | 26 ++++ .../launcher/core/DefaultLauncherSession.java | 127 ++++++++++++++++++ .../launcher/core/InternalLauncher.java | 25 ++++ .../launcher/core/LauncherConfig.java | 104 +++++++++++++- .../launcher/core/LauncherFactory.java | 66 +++++++-- .../launcher/core/ListenerRegistry.java | 6 + ...aderLauncherDiscoveryListenerRegistry.java | 38 ------ ...viceLoaderPostDiscoveryFilterRegistry.java | 38 ------ ...gistry.java => ServiceLoaderRegistry.java} | 14 +- .../core/SessionPerRequestLauncher.java | 77 +++++++++++ .../CompositeLauncherSessionListener.java | 41 ++++++ .../session/LauncherSessionListeners.java | 45 +++++++ .../listeners/session/package-info.java | 9 ++ .../module-info.java | 1 + ...LauncherFactoryForTestingPurposesOnly.java | 11 +- .../launcher/TestLauncherSessionListener.java | 30 +++++ .../launcher/core/LauncherConfigTests.java | 28 +++- .../launcher/core/LauncherFactoryTests.java | 29 +++- .../launcher/core/LauncherSessionTests.java | 106 +++++++++++++++ ....platform.launcher.LauncherSessionListener | 1 + .../junit-platform-launcher.expected.txt | 1 + .../projects/standalone/expected-err.txt | 8 +- 32 files changed, 942 insertions(+), 154 deletions(-) create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java delete mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java delete mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderPostDiscoveryFilterRegistry.java rename junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/{ServiceLoaderTestExecutionListenerRegistry.java => ServiceLoaderRegistry.java} (66%) create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/package-info.java create mode 100644 platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java create mode 100644 platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java create mode 100644 platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherSessionListener diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 4cb26b1433ca..f3b6cb564ce5 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -93,6 +93,7 @@ val consoleLauncherOptionsFile = File(generatedAsciiDocPath, "console-launcher-o val experimentalApisTableFile = File(generatedAsciiDocPath, "experimental-apis-table.txt") val deprecatedApisTableFile = File(generatedAsciiDocPath, "deprecated-apis-table.txt") +val jdkJavadocBaseUrl = "https://docs.oracle.com/en/java/javase/11/docs/api" val elementListsDir = file("$buildDir/elementLists") val externalModulesWithoutModularJavadoc = mapOf( "org.apiguardian.api" to "https://apiguardian-team.github.io/apiguardian/docs/$apiGuardianDocVersion/api/", @@ -181,7 +182,8 @@ tasks { "icons" to "font", "sectanchors" to true, "idprefix" to "", - "idseparator" to "-" + "idseparator" to "-", + "jdk-javadoc-base-url" to jdkJavadocBaseUrl )) sourceSets["test"].apply { @@ -268,7 +270,7 @@ tasks { "implNote:a:Implementation Note:" ) - links("https://docs.oracle.com/en/java/javase/11/docs/api/") + links(jdkJavadocBaseUrl) links("https://junit.org/junit4/javadoc/${versions.junit4}/") externalModulesWithoutModularJavadoc.forEach { (moduleName, baseUrl) -> linksOffline(baseUrl, "$elementListsDir/$moduleName") diff --git a/documentation/src/docs/asciidoc/link-attributes.adoc b/documentation/src/docs/asciidoc/link-attributes.adoc index a994609b335a..0c0efa94d34c 100644 --- a/documentation/src/docs/asciidoc/link-attributes.adoc +++ b/documentation/src/docs/asciidoc/link-attributes.adoc @@ -27,11 +27,15 @@ endif::[] // Platform Launcher API :junit-platform-launcher: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/package-summary.html[junit-platform-launcher] :Launcher: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/Launcher.html[Launcher] +:LauncherConfig: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/core/LauncherConfig.html[LauncherConfig] :LauncherDiscoveryListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/LauncherDiscoveryListener.html[LauncherDiscoveryListener] :LauncherDiscoveryRequest: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/LauncherDiscoveryRequest.html[LauncherDiscoveryRequest] -:PostDiscoveryFilter: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/PostDiscoveryFilter.html[PostDiscoveryFilter] :LauncherDiscoveryRequestBuilder: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.html[LauncherDiscoveryRequestBuilder] +:LauncherFactory: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/core/LauncherFactory.html[LauncherFactory] +:LauncherSession: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/LauncherSession.html[LauncherSession] +:LauncherSessionListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/LauncherSessionListener.html[LauncherSessionListener] :LoggingListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/listeners/LoggingListener.html[LoggingListener] +:PostDiscoveryFilter: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/PostDiscoveryFilter.html[PostDiscoveryFilter] :SummaryGeneratingListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/listeners/SummaryGeneratingListener.html[SummaryGeneratingListener] :TestExecutionListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/TestExecutionListener.html[TestExecutionListener] :TestPlan: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/TestPlan.html[TestPlan] @@ -163,6 +167,7 @@ endif::[] :LogManager: https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogManager.html[LogManager] :Maven_Central: https://search.maven.org/[Maven Central] :MockitoExtension: https://github.com/mockito/mockito/blob/release/2.x/subprojects/junit-jupiter/src/main/java/org/mockito/junit/jupiter/MockitoExtension.java[MockitoExtension] +:ServiceLoader: {jdk-javadoc-base-url}/java.base/java/util/ServiceLoader.html[ServiceLoader] :SpringExtension: https://github.com/spring-projects/spring-framework/tree/HEAD/spring-test/src/main/java/org/springframework/test/context/junit/jupiter/SpringExtension.java[SpringExtension] :StackOverflow: https://stackoverflow.com/questions/tagged/junit5[Stack Overflow] :Truth: https://truth.dev/[Truth] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index f40414c2fe2e..77d5e0c5267c 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -34,12 +34,17 @@ on GitHub. * The `junit-platform-jfr` module now also reports test discovery events for the launcher and registered test engines. * Custom `LauncherDiscoveryListener` implementations can now be registered via Java’s - `ServiceLoader` mechanism. + `{ServiceLoader}` mechanism. * Documented constant value of `ExclusiveResource.GLOBAL_KEY`. * Instances of `TestIdentifier` and `UniqueId` now retain less memory because they no longer store `String` representations of unique IDs. * Improvement of `ExclusiveResource` handling, if a `Node` has only read locks and no read-write locks, then descendants are not forced into `SAME_THREAD` execution, and can run concurrently. +* Tools that make multiple calls to the `Launcher` API should now create a + `LauncherSession` instead in order to allow for executing global setup and teardown code + exactly once via the new `LauncherSessionListener` interface that can be registered via + Java’s `{ServiceLoader}` mechanism. + [[release-notes-5.8.0-M1-junit-jupiter]] === JUnit Jupiter diff --git a/documentation/src/docs/asciidoc/user-guide/extensions.adoc b/documentation/src/docs/asciidoc/user-guide/extensions.adoc index 3ad1310f8a26..b31110332c12 100644 --- a/documentation/src/docs/asciidoc/user-guide/extensions.adoc +++ b/documentation/src/docs/asciidoc/user-guide/extensions.adoc @@ -206,8 +206,8 @@ include::{testDir}/example/registration/DocumentationDemo.java[tags=user_guide] In addition to <> and <> support using annotations, JUnit Jupiter also supports _global extension registration_ via Java's -`java.util.ServiceLoader` mechanism, allowing third-party extensions to be auto-detected -and automatically registered based on what is available in the classpath. +`{ServiceLoader}` mechanism, allowing third-party extensions to be auto-detected and +automatically registered based on what is available in the classpath. Specifically, a custom extension can be registered by supplying its fully qualified class name in a file named `org.junit.jupiter.api.extension.Extension` within the @@ -227,7 +227,7 @@ following system property. `-Djunit.jupiter.extensions.autodetection.enabled=true` -When auto-detection is enabled, extensions discovered via the `ServiceLoader` mechanism +When auto-detection is enabled, extensions discovered via the `{ServiceLoader}` mechanism will be added to the extension registry after JUnit Jupiter's global extensions (e.g., support for `TestInfo`, `TestReporter`, etc.). diff --git a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc index c22b70ef12e2..441f8f7b8376 100644 --- a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc +++ b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc @@ -80,11 +80,10 @@ JUnit currently provides two `{TestEngine}` implementations. Third parties may also contribute their own `TestEngine` by implementing the interfaces in the {junit-platform-engine} module and _registering_ their engine. By default, engine -registration is supported via Java's `java.util.ServiceLoader` mechanism. For example, -the `junit-jupiter-engine` module registers its -`org.junit.jupiter.engine.JupiterTestEngine` in a file named -`org.junit.platform.engine.TestEngine` within the `/META-INF/services` in the -`junit-jupiter-engine` JAR. +registration is supported via Java's `{ServiceLoader}` mechanism. For example, the +`junit-jupiter-engine` module registers its `org.junit.jupiter.engine.JupiterTestEngine` +in a file named `org.junit.platform.engine.TestEngine` within the `/META-INF/services` in +the `junit-jupiter-engine` JAR. NOTE: `{HierarchicalTestEngine}` is a convenient abstract base implementation (used by the `{junit-jupiter-engine}`) that only requires implementors to provide the logic for @@ -110,36 +109,52 @@ by the JUnit Team may use the `junit-` prefix for their `TestEngine` IDs. In addition to specifying post-discovery filters as part of a `{LauncherDiscoveryRequest}` passed to the `{Launcher}` API, by default custom `{PostDiscoveryFilter}` implementations -will be discovered at runtime via Java's `java.util.ServiceLoader` mechanism and -automatically applied by the `Launcher` in addition to those that are part of the request. +will be discovered at runtime via Java's `{ServiceLoader}` mechanism and automatically +applied by the `Launcher` in addition to those that are part of the request. For example, an `example.CustomTagFilter` class implementing `{PostDiscoveryFilter}` and declared within the `/META-INF/services/org.junit.platform.launcher.PostDiscoveryFilter` file is loaded and applied automatically. +[[launcher-api-launcher-session-listeners-custom]] +==== Plugging in your own Launcher Sessions Listeners + +Registered implementations of `{LauncherSessionListener}` are notified when a +`{LauncherSession}` is opened, i.e. before a `{Launcher}` first discovers and executes +tests, and closed, i.e. when no more tests will be discovered or executed. They can be +registered programmatically on the `{LauncherConfig}` that is passed to +`{LauncherFactory}` or, unless disabled, will be discovered at runtime via Java's +`{ServiceLoader}` mechanism and automatically registered with `{LauncherSession}`. + +For example, an `example.CustomLauncherSessionListener` class implementing +`{LauncherSessionListener}` and declared within the +`/META-INF/services/org.junit.platform.launcher.LauncherSessionListener` file is loaded +and registered automatically. + [[launcher-api-launcher-discovery-listeners-custom]] ==== Plugging in your own Discovery Listeners -In addition to specifying post-discovery filters as part of a `{LauncherDiscoveryRequest}` -passed to the `{Launcher}` API, custom `{LauncherDiscoveryListener}` implementations can -be discovered at runtime via Java's `java.util.ServiceLoader` mechanism and automatically -automatically registered with the `Launcher` created via the `LauncherFactory`. +In addition to specifying discovery listeners as part of a `{LauncherDiscoveryRequest}` +or registering them programmatically using the public `{Launcher}` API method, custom +`{LauncherDiscoveryListener}` implementations can be discovered at runtime via Java's +`{ServiceLoader}` mechanism and automatically registered with the `{Launcher}` created via +the `{LauncherFactory}`. For example, an `example.CustomLauncherDiscoveryListener` class implementing `{LauncherDiscoveryListener}` and declared within the `/META-INF/services/org.junit.platform.launcher.LauncherDiscoveryListener` file is loaded -and applied automatically. +and registered automatically. [[launcher-api-listeners-custom]] ==== Plugging in your own Execution Listener In addition to the public `{Launcher}` API method for registering test execution listeners programmatically, by default custom `{TestExecutionListener}` implementations -will be discovered at runtime via Java's `java.util.ServiceLoader` mechanism and -automatically registered with the `Launcher` created via the `LauncherFactory`. +will be discovered at runtime via Java's `{ServiceLoader}` mechanism and automatically +registered with the `{Launcher}` created via the `{LauncherFactory}`. -For example, an `example.TestInfoPrinter` class implementing `{TestExecutionListener}` and -declared within the +For example, an `example.CustomTestExecutionListener` class implementing +`{TestExecutionListener}` and declared within the `/META-INF/services/org.junit.platform.launcher.TestExecutionListener` file is loaded and registered automatically. @@ -147,7 +162,7 @@ registered automatically. ==== Deactivating Execution Listeners Sometimes it can be useful to run a test suite _without_ certain execution listeners being -active. For example, you might have custom a `TestExecutionListener` that sends the test +active. For example, you might have custom a `{TestExecutionListener}` that sends the test results to an external system for reporting purposes, and while debugging you might not want these _debug_ results to be reported. To do this, provide a pattern for the `junit.platform.execution.listeners.deactivate` _configuration parameter_ to specify which @@ -155,17 +170,17 @@ execution listeners should be deactivated (i.e. not registered) for the current [NOTE] ==== -Only listeners registered via the `ServiceLoader` mechanism within the +Only listeners registered via the `{ServiceLoader}` mechanism within the `/META-INF/services/org.junit.platform.launcher.TestExecutionListener` file can be deactivated. In other words, any `TestExecutionListener` registered explicitly via the -`LauncherDiscoveryRequest` cannot be deactivated via the +`{LauncherDiscoveryRequest}` cannot be deactivated via the `junit.platform.execution.listeners.deactivate` _configuration parameter_. In addition, since execution listeners are registered before the test run starts, the `junit.platform.execution.listeners.deactivate` _configuration parameter_ can only be supplied as a JVM system property or via the JUnit Platform configuration file (see <> for details). This _configuration parameter_ cannot be -supplied in the `LauncherDiscoveryRequest` that is passed to the `Launcher`. +supplied in the `{LauncherDiscoveryRequest}` that is passed to the `{Launcher}`. ==== [[launcher-api-listeners-custom-deactivation-pattern]] @@ -195,10 +210,9 @@ implementations that can be used for reporting purposes. See `{LoggingListener}` ==== Configuring the Launcher If you require fine-grained control over automatic detection and registration of test -engines and test execution listeners, you may create an instance of `LauncherConfig` and -supply that to the `LauncherFactory.create(LauncherConfig)` method. Typically an instance -of `LauncherConfig` is created via the built-in fluent _builder_ API, as demonstrated in -the following example. +engines and test execution listeners, you may create an instance of `{LauncherConfig}` and +supply that to the `{LauncherFactory}`. Typically, an instance of `{LauncherConfig}` is +created via the built-in fluent _builder_ API, as demonstrated in the following example. [source,java,indent=0] ---- diff --git a/documentation/src/test/java/example/UsingTheLauncherDemo.java b/documentation/src/test/java/example/UsingTheLauncherDemo.java index e7e2dbe001b3..2ecba15089d6 100644 --- a/documentation/src/test/java/example/UsingTheLauncherDemo.java +++ b/documentation/src/test/java/example/UsingTheLauncherDemo.java @@ -19,8 +19,14 @@ import java.nio.file.Path; import java.nio.file.Paths; +import org.junit.platform.engine.FilterResult; +import org.junit.platform.engine.TestDescriptor; import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.LauncherSession; +import org.junit.platform.launcher.LauncherSessionListener; +import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestPlan; import org.junit.platform.launcher.core.LauncherConfig; @@ -51,9 +57,11 @@ void discovery() { ) .build(); - Launcher launcher = LauncherFactory.create(); + try (LauncherSession session = LauncherFactory.openSession()) { + TestPlan testPlan = session.getLauncher().discover(request); - TestPlan testPlan = launcher.discover(request); + // ... discover additional test plans or execute tests + } // end::discovery[] // @formatter:on } @@ -73,16 +81,22 @@ void execution() { ) .build(); - Launcher launcher = LauncherFactory.create(); - - // Register a listener of your choice SummaryGeneratingListener listener = new SummaryGeneratingListener(); - launcher.registerTestExecutionListeners(listener); - launcher.execute(request); + try (LauncherSession session = LauncherFactory.openSession()) { + Launcher launcher = session.getLauncher(); + // Register a listener of your choice + launcher.registerTestExecutionListeners(listener); + // Discover tests and build a test plan + TestPlan testPlan = launcher.discover(request); + // Execute test plan + launcher.execute(testPlan); + // Alternatively, execute the request directly + launcher.execute(request); + } TestExecutionSummary summary = listener.getSummary(); - // Do something with the TestExecutionSummary. + // Do something with the summary... // end::execution[] // @formatter:on @@ -96,19 +110,25 @@ void launcherConfig() { // tag::launcherConfig[] LauncherConfig launcherConfig = LauncherConfig.builder() .enableTestEngineAutoRegistration(false) + .enableLauncherSessionListenerAutoRegistration(false) + .enableLauncherDiscoveryListenerAutoRegistration(false) + .enablePostDiscoveryFilterAutoRegistration(false) .enableTestExecutionListenerAutoRegistration(false) .addTestEngines(new CustomTestEngine()) + .addLauncherSessionListeners(new CustomLauncherSessionListener()) + .addLauncherDiscoveryListeners(new CustomLauncherDiscoveryListener()) + .addPostDiscoveryFilters(new CustomPostDiscoveryFilter()) .addTestExecutionListeners(new LegacyXmlReportGeneratingListener(reportsDir, out)) .addTestExecutionListeners(new CustomTestExecutionListener()) .build(); - Launcher launcher = LauncherFactory.create(launcherConfig); - LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request() .selectors(selectPackage("com.example.mytests")) .build(); - launcher.execute(request); + try (LauncherSession session = LauncherFactory.openSession(launcherConfig)) { + session.getLauncher().execute(request); + } // end::launcherConfig[] // @formatter:on } @@ -120,3 +140,16 @@ class MyTestClass { class CustomTestExecutionListener implements TestExecutionListener { } + +class CustomLauncherSessionListener implements LauncherSessionListener { +} + +class CustomLauncherDiscoveryListener implements LauncherDiscoveryListener { +} + +class CustomPostDiscoveryFilter implements PostDiscoveryFilter { + @Override + public FilterResult apply(TestDescriptor object) { + return FilterResult.included("includes everything"); + } +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index dd4b58d72ec3..2e1dbf99017c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -35,6 +35,7 @@ * * @see org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners * @see LauncherDiscoveryRequest#getDiscoveryListener() + * @see org.junit.platform.launcher.core.LauncherConfig.Builder#addLauncherDiscoveryListeners * @since 1.6 */ @API(status = EXPERIMENTAL, since = "1.6") diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java new file mode 100644 index 000000000000..7be37218c5c4 --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java @@ -0,0 +1,49 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher; + +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import org.apiguardian.api.API; +import org.junit.platform.launcher.core.LauncherFactory; + +/** + * The {@code LauncherSession} API is the main entry point for client code that + * wishes to repeatedly discover and execute tests using one + * or more {@linkplain org.junit.platform.engine.TestEngine test engines}. + * + * @see Launcher + * @see LauncherSessionListener + * @see LauncherFactory + * @since 1.8 + */ +@API(status = EXPERIMENTAL, since = "1.8") +public interface LauncherSession extends AutoCloseable { + + /** + * Get the {@link Launcher} associated with this session. + * + *

    Any call to the launcher returned by this method after the session has + * been closed, will throw an exception. + */ + Launcher getLauncher(); + + /** + * Close this session and notify all registered + * {@link LauncherSessionListener LauncherSessionListeners}. + * + * @apiNote The behavior of calling this method concurrently with any call + * to the {@link Launcher} returned by {@link #getLauncher()} is currently + * undefined. + */ + @Override + void close(); +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java new file mode 100644 index 000000000000..eedc7ff4405a --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java @@ -0,0 +1,64 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher; + +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import org.apiguardian.api.API; +import org.junit.platform.launcher.core.LauncherConfig; +import org.junit.platform.launcher.core.LauncherFactory; + +/** + * Register an implementation of this interface with the + * {@link LauncherConfig.Builder#addLauncherSessionListeners LauncherConfig} + * passed to + * {@link LauncherFactory#openSession(LauncherConfig) LauncherFactory} or via + * ServiceLoader to be notified when a {@link LauncherSession} is opened and + * closed. + * + *

    All methods in this class have empty default implementations. + * Subclasses may therefore override one or more of these methods to be notified + * of the selected events. + * + *

    The methods declared in this interface are called by the {@link Launcher} + * or {@link LauncherSession} created via the {@link LauncherFactory}. + * + * @see LauncherSession + * @see LauncherConfig.Builder#addLauncherSessionListeners + * @see LauncherFactory + * @since 1.8 + */ +@API(status = EXPERIMENTAL, since = "1.8") +public interface LauncherSessionListener { + + /** + * No-op implementation of {@code LauncherSessionListener} + */ + LauncherSessionListener NOOP = new LauncherSessionListener() { + }; + + /** + * Called when a launcher session was opened. + * + * @param session the opened session + */ + default void launcherSessionOpened(LauncherSession session) { + } + + /** + * Called when a launcher session was closed. + * + * @param session the closed session + */ + default void launcherSessionClosed(LauncherSession session) { + } + +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java index d6fcfbb4bf6b..8e2a5c97597c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java @@ -35,7 +35,7 @@ * @see Launcher * @see LauncherFactory */ -class DefaultLauncher implements Launcher { +class DefaultLauncher implements InternalLauncher { private final ListenerRegistry launcherDiscoveryListenerRegistry = ListenerRegistry.forLauncherDiscoveryListeners(); private final ListenerRegistry testExecutionListenerRegistry = ListenerRegistry.forTestExecutionListeners(); @@ -95,11 +95,13 @@ public void execute(TestPlan testPlan, TestExecutionListener... listeners) { execute((InternalTestPlan) testPlan, listeners); } - ListenerRegistry getTestExecutionListenerRegistry() { + @Override + public ListenerRegistry getTestExecutionListenerRegistry() { return testExecutionListenerRegistry; } - ListenerRegistry getLauncherDiscoveryListenerRegistry() { + @Override + public ListenerRegistry getLauncherDiscoveryListenerRegistry() { return launcherDiscoveryListenerRegistry; } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java index 7ca4875e0544..be1046cc4bac 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java @@ -15,6 +15,8 @@ import java.util.Collection; import org.junit.platform.engine.TestEngine; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherSessionListener; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; @@ -26,24 +28,33 @@ class DefaultLauncherConfig implements LauncherConfig { private final boolean testEngineAutoRegistrationEnabled; + private final boolean launcherSessionListenerAutoRegistrationEnabled; private final boolean launcherDiscoveryListenerAutoRegistrationEnabled; private final boolean testExecutionListenerAutoRegistrationEnabled; private final boolean postDiscoveryFilterAutoRegistrationEnabled; private final Collection additionalTestEngines; + private final Collection additionalLauncherSessionListeners; + private final Collection additionalLauncherDiscoveryListeners; private final Collection additionalTestExecutionListeners; private final Collection additionalPostDiscoveryFilters; DefaultLauncherConfig(boolean testEngineAutoRegistrationEnabled, + boolean launcherSessionListenerAutoRegistrationEnabled, boolean launcherDiscoveryListenerAutoRegistrationEnabled, boolean testExecutionListenerAutoRegistrationEnabled, boolean postDiscoveryFilterAutoRegistrationEnabled, Collection additionalTestEngines, + Collection additionalLauncherSessionListeners, + Collection additionalLauncherDiscoveryListeners, Collection additionalTestExecutionListeners, Collection additionalPostDiscoveryFilters) { + this.launcherSessionListenerAutoRegistrationEnabled = launcherSessionListenerAutoRegistrationEnabled; this.launcherDiscoveryListenerAutoRegistrationEnabled = launcherDiscoveryListenerAutoRegistrationEnabled; this.testExecutionListenerAutoRegistrationEnabled = testExecutionListenerAutoRegistrationEnabled; this.testEngineAutoRegistrationEnabled = testEngineAutoRegistrationEnabled; this.postDiscoveryFilterAutoRegistrationEnabled = postDiscoveryFilterAutoRegistrationEnabled; this.additionalTestEngines = unmodifiableCollection(additionalTestEngines); + this.additionalLauncherSessionListeners = unmodifiableCollection(additionalLauncherSessionListeners); + this.additionalLauncherDiscoveryListeners = unmodifiableCollection(additionalLauncherDiscoveryListeners); this.additionalTestExecutionListeners = unmodifiableCollection(additionalTestExecutionListeners); this.additionalPostDiscoveryFilters = unmodifiableCollection(additionalPostDiscoveryFilters); } @@ -53,6 +64,11 @@ public boolean isTestEngineAutoRegistrationEnabled() { return this.testEngineAutoRegistrationEnabled; } + @Override + public boolean isLauncherSessionListenerAutoRegistrationEnabled() { + return launcherSessionListenerAutoRegistrationEnabled; + } + @Override public boolean isLauncherDiscoveryListenerAutoRegistrationEnabled() { return launcherDiscoveryListenerAutoRegistrationEnabled; @@ -73,6 +89,16 @@ public Collection getAdditionalTestEngines() { return this.additionalTestEngines; } + @Override + public Collection getAdditionalLauncherSessionListeners() { + return additionalLauncherSessionListeners; + } + + @Override + public Collection getAdditionalLauncherDiscoveryListeners() { + return additionalLauncherDiscoveryListeners; + } + @Override public Collection getAdditionalTestExecutionListeners() { return this.additionalTestExecutionListeners; diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java new file mode 100644 index 000000000000..f9e19979a48f --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java @@ -0,0 +1,127 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import org.junit.platform.commons.PreconditionViolationException; +import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.LauncherSession; +import org.junit.platform.launcher.LauncherSessionListener; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.TestPlan; + +/** + * @since 1.8 + */ +class DefaultLauncherSession implements LauncherSession { + + private final DelegatingLauncher launcher; + private final LauncherSessionListener listener; + + DefaultLauncherSession(Launcher launcher, LauncherSessionListener listener) { + this.launcher = new DelegatingLauncher(launcher); + this.listener = listener; + listener.launcherSessionOpened(this); + } + + @Override + public Launcher getLauncher() { + return launcher; + } + + LauncherSessionListener getListener() { + return listener; + } + + @Override + public void close() { + if (launcher.getDelegate() != ClosedLauncher.INSTANCE) { + launcher.setDelegate(ClosedLauncher.INSTANCE); + listener.launcherSessionClosed(this); + } + } + + private static class DelegatingLauncher implements Launcher { + + private Launcher delegate; + + DelegatingLauncher(Launcher delegate) { + this.delegate = delegate; + } + + public Launcher getDelegate() { + return delegate; + } + + public void setDelegate(Launcher delegate) { + this.delegate = delegate; + } + + @Override + public void registerLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners) { + delegate.registerLauncherDiscoveryListeners(listeners); + } + + @Override + public void registerTestExecutionListeners(TestExecutionListener... listeners) { + delegate.registerTestExecutionListeners(listeners); + } + + @Override + public TestPlan discover(LauncherDiscoveryRequest launcherDiscoveryRequest) { + return delegate.discover(launcherDiscoveryRequest); + } + + @Override + public void execute(LauncherDiscoveryRequest launcherDiscoveryRequest, TestExecutionListener... listeners) { + delegate.execute(launcherDiscoveryRequest, listeners); + } + + @Override + public void execute(TestPlan testPlan, TestExecutionListener... listeners) { + delegate.execute(testPlan, listeners); + } + } + + private static class ClosedLauncher implements Launcher { + + static final ClosedLauncher INSTANCE = new ClosedLauncher(); + + private ClosedLauncher() { + } + + @Override + public void registerLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners) { + throw new PreconditionViolationException("Launcher session has already been closed"); + } + + @Override + public void registerTestExecutionListeners(TestExecutionListener... listeners) { + throw new PreconditionViolationException("Launcher session has already been closed"); + } + + @Override + public TestPlan discover(LauncherDiscoveryRequest launcherDiscoveryRequest) { + throw new PreconditionViolationException("Launcher session has already been closed"); + } + + @Override + public void execute(LauncherDiscoveryRequest launcherDiscoveryRequest, TestExecutionListener... listeners) { + throw new PreconditionViolationException("Launcher session has already been closed"); + } + + @Override + public void execute(TestPlan testPlan, TestExecutionListener... listeners) { + throw new PreconditionViolationException("Launcher session has already been closed"); + } + } +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java new file mode 100644 index 000000000000..53aba88068e9 --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java @@ -0,0 +1,25 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.TestExecutionListener; + +/** + * @since 1.8 + */ +interface InternalLauncher extends Launcher { + + ListenerRegistry getTestExecutionListenerRegistry(); + + ListenerRegistry getLauncherDiscoveryListenerRegistry(); +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java index f973d8fc4c1f..06eb1b6790f5 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java @@ -21,6 +21,8 @@ import org.junit.platform.commons.util.Preconditions; import org.junit.platform.engine.TestEngine; import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherSessionListener; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; @@ -51,6 +53,12 @@ @API(status = STABLE, since = "1.7") public interface LauncherConfig { + /** + * The default {@code LauncherConfig} which uses automatic registration for + * test engines, supported listeners, and post-discovery filters. + */ + LauncherConfig DEFAULT = builder().build(); + /** * Determine if test engines should be discovered at runtime using the * {@link java.util.ServiceLoader ServiceLoader} mechanism and @@ -60,6 +68,18 @@ public interface LauncherConfig { */ boolean isTestEngineAutoRegistrationEnabled(); + /** + * Determine if launcher session listeners should be discovered at runtime + * using the {@link java.util.ServiceLoader ServiceLoader} mechanism and + * automatically registered. + * + * @return {@code true} if launcher session listeners should be + * automatically registered + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + boolean isLauncherSessionListenerAutoRegistrationEnabled(); + /** * Determine if launcher discovery listeners should be discovered at runtime * using the {@link java.util.ServiceLoader ServiceLoader} mechanism and @@ -103,6 +123,28 @@ public interface LauncherConfig { */ Collection getAdditionalTestEngines(); + /** + * Get the collection of additional launcher session listeners that should + * be added to the {@link Launcher}. + * + * @return the collection of additional launcher session listeners; never + * {@code null} but potentially empty + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + Collection getAdditionalLauncherSessionListeners(); + + /** + * Get the collection of additional launcher discovery listeners that should + * be added to the {@link Launcher}. + * + * @return the collection of additional launcher discovery listeners; never + * {@code null} but potentially empty + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + Collection getAdditionalLauncherDiscoveryListeners(); + /** * Get the collection of additional test execution listeners that should be * added to the {@link Launcher}. @@ -138,17 +180,37 @@ static Builder builder() { class Builder { private boolean engineAutoRegistrationEnabled = true; + private boolean launcherSessionListenerAutoRegistrationEnabled = true; private boolean launcherDiscoveryListenerAutoRegistrationEnabled = true; private boolean testExecutionListenerAutoRegistrationEnabled = true; private boolean postDiscoveryFilterAutoRegistrationEnabled = true; private final Collection engines = new LinkedHashSet<>(); - private final Collection listeners = new LinkedHashSet<>(); + private final Collection sessionListeners = new LinkedHashSet<>(); + private final Collection discoveryListeners = new LinkedHashSet<>(); + private final Collection executionListeners = new LinkedHashSet<>(); private final Collection postDiscoveryFilters = new LinkedHashSet<>(); private Builder() { /* no-op */ } + /** + * Configure the auto-registration flag for launcher session + * listeners. + * + *

    Defaults to {@code true}. + * + * @param enabled {@code true} if launcher session listeners should be + * automatically registered + * @return this builder for method chaining + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + public Builder enableLauncherSessionListenerAutoRegistration(boolean enabled) { + this.launcherSessionListenerAutoRegistrationEnabled = enabled; + return this; + } + /** * Configure the auto-registration flag for launcher discovery * listeners. @@ -211,7 +273,7 @@ public Builder enablePostDiscoveryFilterAutoRegistration(boolean enabled) { } /** - * Add all of the supplied {@code engines} to the configuration. + * Add all of the supplied test engines to the configuration. * * @param engines additional test engines to register; never {@code null} * or containing {@code null} @@ -225,7 +287,37 @@ public Builder addTestEngines(TestEngine... engines) { } /** - * Add all of the supplied {@code listeners} to the configuration. + * Add all of the supplied launcher session listeners to the configuration. + * + * @param listeners additional launcher session listeners to register; + * never {@code null} or containing {@code null} + * @return this builder for method chaining + */ + public Builder addLauncherSessionListeners(LauncherSessionListener... listeners) { + Preconditions.notNull(listeners, "LauncherSessionListener array must not be null"); + Preconditions.containsNoNullElements(listeners, + "LauncherSessionListener array must not contain null elements"); + Collections.addAll(this.sessionListeners, listeners); + return this; + } + + /** + * Add all of the supplied launcher discovery listeners to the configuration. + * + * @param listeners additional launcher discovery listeners to register; + * never {@code null} or containing {@code null} + * @return this builder for method chaining + */ + public Builder addLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners) { + Preconditions.notNull(listeners, "LauncherDiscoveryListener array must not be null"); + Preconditions.containsNoNullElements(listeners, + "LauncherDiscoveryListener array must not contain null elements"); + Collections.addAll(this.discoveryListeners, listeners); + return this; + } + + /** + * Add all of the supplied test execution listeners to the configuration. * * @param listeners additional test execution listeners to register; * never {@code null} or containing {@code null} @@ -235,7 +327,7 @@ public Builder addTestExecutionListeners(TestExecutionListener... listeners) { Preconditions.notNull(listeners, "TestExecutionListener array must not be null"); Preconditions.containsNoNullElements(listeners, "TestExecutionListener array must not contain null elements"); - Collections.addAll(this.listeners, listeners); + Collections.addAll(this.executionListeners, listeners); return this; } @@ -261,9 +353,11 @@ public Builder addPostDiscoveryFilters(PostDiscoveryFilter... filters) { */ public LauncherConfig build() { return new DefaultLauncherConfig(this.engineAutoRegistrationEnabled, + this.launcherSessionListenerAutoRegistrationEnabled, this.launcherDiscoveryListenerAutoRegistrationEnabled, this.testExecutionListenerAutoRegistrationEnabled, this.postDiscoveryFilterAutoRegistrationEnabled, - this.engines, this.listeners, this.postDiscoveryFilters); + this.engines, this.sessionListeners, this.discoveryListeners, this.executionListeners, + this.postDiscoveryFilters); } } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java index d102d987ba11..4fda66637101 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java @@ -28,6 +28,9 @@ import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.TestEngine; import org.junit.platform.launcher.Launcher; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherSession; +import org.junit.platform.launcher.LauncherSessionListener; import org.junit.platform.launcher.PostDiscoveryFilter; import org.junit.platform.launcher.TestExecutionListener; @@ -60,19 +63,50 @@ @API(status = STABLE, since = "1.0") public class LauncherFactory { + private static final ServiceLoaderRegistry SERVICE_LOADER_REGISTRY = new ServiceLoaderRegistry(); + private LauncherFactory() { /* no-op */ } /** - * Factory method for creating a new {@link Launcher} using automatic - * registration for test engines and test execution listeners. + * Factory method for opening a new {@link LauncherSession} using the + * {@linkplain LauncherConfig#DEFAULT default} {@link LauncherConfig}. + * + * @throws PreconditionViolationException if no test engines are detected + * @see #openSession(LauncherConfig) + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + public static LauncherSession openSession() throws PreconditionViolationException { + return openSession(LauncherConfig.DEFAULT); + } + + /** + * Factory method for opening a new {@link LauncherSession} using the + * supplied {@link LauncherConfig}. + * + * @param config the configuration for the session and the launcher; never + * {@code null} + * @throws PreconditionViolationException if the supplied configuration is + * {@code null}, or if no test engines are detected or + * @see #openSession() + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + public static LauncherSession openSession(LauncherConfig config) throws PreconditionViolationException { + return new DefaultLauncherSession(createDefaultLauncher(config), createLauncherSessionListener(config)); + } + + /** + * Factory method for creating a new {@link Launcher} using the + * {@linkplain LauncherConfig#DEFAULT default} {@link LauncherConfig}. * * @throws PreconditionViolationException if no test engines are detected * @see #create(LauncherConfig) */ public static Launcher create() throws PreconditionViolationException { - return create(LauncherConfig.builder().build()); + return create(LauncherConfig.DEFAULT); } /** @@ -80,20 +114,24 @@ public static Launcher create() throws PreconditionViolationException { * {@link LauncherConfig}. * * @param config the configuration for the launcher; never {@code null} - * @throws PreconditionViolationException if the supplied launcher - * configuration is {@code null}, or if no test engines are detected or + * @throws PreconditionViolationException if the supplied configuration is + * {@code null}, or if no test engines are detected or * registered * @see #create() * @since 1.3 */ @API(status = EXPERIMENTAL, since = "1.3") public static Launcher create(LauncherConfig config) throws PreconditionViolationException { + return new SessionPerRequestLauncher(createDefaultLauncher(config), createLauncherSessionListener(config)); + } + + private static DefaultLauncher createDefaultLauncher(LauncherConfig config) { Preconditions.notNull(config, "LauncherConfig must not be null"); Set engines = collectTestEngines(config); List filters = collectPostDiscoveryFilters(config); - Launcher launcher = new DefaultLauncher(engines, filters); + DefaultLauncher launcher = new DefaultLauncher(engines, filters); registerLauncherDiscoveryListeners(config, launcher); registerTestExecutionListeners(config, launcher); @@ -110,10 +148,19 @@ private static Set collectTestEngines(LauncherConfig config) { return engines; } + private static LauncherSessionListener createLauncherSessionListener(LauncherConfig config) { + ListenerRegistry listenerRegistry = ListenerRegistry.forLauncherSessionListeners(); + if (config.isLauncherSessionListenerAutoRegistrationEnabled()) { + SERVICE_LOADER_REGISTRY.load(LauncherSessionListener.class).forEach(listenerRegistry::add); + } + config.getAdditionalLauncherSessionListeners().forEach(listenerRegistry::add); + return listenerRegistry.getCompositeListener(); + } + private static List collectPostDiscoveryFilters(LauncherConfig config) { List filters = new ArrayList<>(); if (config.isPostDiscoveryFilterAutoRegistrationEnabled()) { - new ServiceLoaderPostDiscoveryFilterRegistry().loadPostDiscoveryFilters().forEach(filters::add); + SERVICE_LOADER_REGISTRY.load(PostDiscoveryFilter.class).forEach(filters::add); } filters.addAll(config.getAdditionalPostDiscoveryFilters()); return filters; @@ -121,9 +168,10 @@ private static List collectPostDiscoveryFilters(LauncherCon private static void registerLauncherDiscoveryListeners(LauncherConfig config, Launcher launcher) { if (config.isLauncherDiscoveryListenerAutoRegistrationEnabled()) { - new ServiceLoaderLauncherDiscoveryListenerRegistry().loadListeners().forEach( + SERVICE_LOADER_REGISTRY.load(LauncherDiscoveryListener.class).forEach( launcher::registerLauncherDiscoveryListeners); } + config.getAdditionalLauncherDiscoveryListeners().forEach(launcher::registerLauncherDiscoveryListeners); } private static void registerTestExecutionListeners(LauncherConfig config, Launcher launcher) { @@ -134,7 +182,7 @@ private static void registerTestExecutionListeners(LauncherConfig config, Launch } private static Stream loadAndFilterTestExecutionListeners() { - Iterable listeners = new ServiceLoaderTestExecutionListenerRegistry().loadListeners(); + Iterable listeners = SERVICE_LOADER_REGISTRY.load(TestExecutionListener.class); ConfigurationParameters configurationParameters = LauncherConfigurationParameters.builder().build(); String deactivatedListenersPattern = configurationParameters.get( DEACTIVATE_LISTENERS_PATTERN_PROPERTY_NAME).orElse(null); diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java index b38c38d274d2..6946ef2c2a64 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java @@ -19,13 +19,19 @@ import org.junit.platform.commons.util.Preconditions; import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherSessionListener; import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListeners; +import org.junit.platform.launcher.listeners.session.LauncherSessionListeners; class ListenerRegistry { private final Function, T> compositeListenerFactory; + static ListenerRegistry forLauncherSessionListeners() { + return create(LauncherSessionListeners::composite); + } + static ListenerRegistry forLauncherDiscoveryListeners() { return create(LauncherDiscoveryListeners::composite); } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java deleted file mode 100644 index ca4788adaff5..000000000000 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderLauncherDiscoveryListenerRegistry.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2015-2020 the original author or authors. - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which - * accompanies this distribution and is available at - * - * https://www.eclipse.org/legal/epl-v20.html - */ - -package org.junit.platform.launcher.core; - -import static java.util.stream.Collectors.toList; -import static java.util.stream.StreamSupport.stream; - -import java.util.ServiceLoader; - -import org.junit.platform.commons.logging.Logger; -import org.junit.platform.commons.logging.LoggerFactory; -import org.junit.platform.commons.util.ClassLoaderUtils; -import org.junit.platform.launcher.LauncherDiscoveryListener; - -/** - * @since 1.8 - */ -class ServiceLoaderLauncherDiscoveryListenerRegistry { - - private static final Logger logger = LoggerFactory.getLogger(ServiceLoaderLauncherDiscoveryListenerRegistry.class); - - Iterable loadListeners() { - Iterable listeners = ServiceLoader.load(LauncherDiscoveryListener.class, - ClassLoaderUtils.getDefaultClassLoader()); - logger.config(() -> "Loaded LauncherDiscoveryListener instances: " - + stream(listeners.spliterator(), false).map(Object::toString).collect(toList())); - return listeners; - } - -} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderPostDiscoveryFilterRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderPostDiscoveryFilterRegistry.java deleted file mode 100644 index 9a02c4e9a2ef..000000000000 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderPostDiscoveryFilterRegistry.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2015-2020 the original author or authors. - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which - * accompanies this distribution and is available at - * - * https://www.eclipse.org/legal/epl-v20.html - */ - -package org.junit.platform.launcher.core; - -import static java.util.stream.Collectors.toList; -import static java.util.stream.StreamSupport.stream; - -import java.util.ServiceLoader; - -import org.junit.platform.commons.logging.Logger; -import org.junit.platform.commons.logging.LoggerFactory; -import org.junit.platform.commons.util.ClassLoaderUtils; -import org.junit.platform.launcher.PostDiscoveryFilter; - -/** - * @since 1.7 - */ -class ServiceLoaderPostDiscoveryFilterRegistry { - - private static final Logger logger = LoggerFactory.getLogger(ServiceLoaderPostDiscoveryFilterRegistry.class); - - Iterable loadPostDiscoveryFilters() { - Iterable filters = ServiceLoader.load(PostDiscoveryFilter.class, - ClassLoaderUtils.getDefaultClassLoader()); - logger.config(() -> "Loaded PostDiscoveryFilter instances: " - + stream(filters.spliterator(), false).map(Object::toString).collect(toList())); - return filters; - } - -} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestExecutionListenerRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java similarity index 66% rename from junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestExecutionListenerRegistry.java rename to junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java index 7226f9278f52..9adcd1711e88 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestExecutionListenerRegistry.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java @@ -18,19 +18,17 @@ import org.junit.platform.commons.logging.Logger; import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.commons.util.ClassLoaderUtils; -import org.junit.platform.launcher.TestExecutionListener; /** - * @since 1.0 + * @since 1.8 */ -class ServiceLoaderTestExecutionListenerRegistry { +class ServiceLoaderRegistry { - private static final Logger logger = LoggerFactory.getLogger(ServiceLoaderTestExecutionListenerRegistry.class); + private static final Logger logger = LoggerFactory.getLogger(ServiceLoaderRegistry.class); - Iterable loadListeners() { - Iterable listeners = ServiceLoader.load(TestExecutionListener.class, - ClassLoaderUtils.getDefaultClassLoader()); - logger.config(() -> "Loaded TestExecutionListener instances: " + Iterable load(Class serviceProviderClass) { + Iterable listeners = ServiceLoader.load(serviceProviderClass, ClassLoaderUtils.getDefaultClassLoader()); + logger.config(() -> "Loaded " + serviceProviderClass.getSimpleName() + " instances: " + stream(listeners.spliterator(), false).map(Object::toString).collect(toList())); return listeners; } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java new file mode 100644 index 000000000000..6d54315b86df --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java @@ -0,0 +1,77 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.LauncherSession; +import org.junit.platform.launcher.LauncherSessionListener; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.TestPlan; + +/** + * @since 1.8 + */ +class SessionPerRequestLauncher implements InternalLauncher { + + private final InternalLauncher delegate; + private final LauncherSessionListener sessionListener; + + SessionPerRequestLauncher(InternalLauncher delegate, LauncherSessionListener sessionListener) { + this.delegate = delegate; + this.sessionListener = sessionListener; + } + + @Override + public void registerLauncherDiscoveryListeners(LauncherDiscoveryListener... listeners) { + delegate.registerLauncherDiscoveryListeners(listeners); + } + + @Override + public void registerTestExecutionListeners(TestExecutionListener... listeners) { + delegate.registerTestExecutionListeners(listeners); + } + + @Override + public TestPlan discover(LauncherDiscoveryRequest launcherDiscoveryRequest) { + try (LauncherSession session = createSession()) { + return session.getLauncher().discover(launcherDiscoveryRequest); + } + } + + @Override + public void execute(LauncherDiscoveryRequest launcherDiscoveryRequest, TestExecutionListener... listeners) { + try (LauncherSession session = createSession()) { + session.getLauncher().execute(launcherDiscoveryRequest, listeners); + } + } + + @Override + public void execute(TestPlan testPlan, TestExecutionListener... listeners) { + try (LauncherSession session = createSession()) { + session.getLauncher().execute(testPlan, listeners); + } + } + + @Override + public ListenerRegistry getTestExecutionListenerRegistry() { + return delegate.getTestExecutionListenerRegistry(); + } + + @Override + public ListenerRegistry getLauncherDiscoveryListenerRegistry() { + return delegate.getLauncherDiscoveryListenerRegistry(); + } + + private LauncherSession createSession() { + return new DefaultLauncherSession(delegate, sessionListener); + } +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java new file mode 100644 index 000000000000..8b5ba267214b --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java @@ -0,0 +1,41 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.listeners.session; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.junit.platform.launcher.LauncherSession; +import org.junit.platform.launcher.LauncherSessionListener; + +/** + * @since 1.8 + * @see LauncherSessionListeners#composite(List) + */ +class CompositeLauncherSessionListener implements LauncherSessionListener { + + private final List listeners; + + CompositeLauncherSessionListener(List listeners) { + this.listeners = Collections.unmodifiableList(new ArrayList<>(listeners)); + } + + @Override + public void launcherSessionOpened(LauncherSession session) { + listeners.forEach(delegate -> delegate.launcherSessionOpened(session)); + } + + @Override + public void launcherSessionClosed(LauncherSession session) { + listeners.forEach(delegate -> delegate.launcherSessionClosed(session)); + } +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java new file mode 100644 index 000000000000..1aa0428a2ac1 --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java @@ -0,0 +1,45 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.listeners.session; + +import static org.apiguardian.api.API.Status.INTERNAL; + +import java.util.List; + +import org.apiguardian.api.API; +import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.launcher.LauncherSessionListener; + +/** + * Collection of {@code static} factory methods for creating + * {@link LauncherSessionListener LauncherSessionListeners}. + * + * @since 1.8 + */ +@API(status = INTERNAL, since = "1.8") +public class LauncherSessionListeners { + + private LauncherSessionListeners() { + } + + public static LauncherSessionListener composite(List listeners) { + Preconditions.notNull(listeners, "listeners must not be null"); + Preconditions.containsNoNullElements(listeners, "listeners must not contain any null elements"); + if (listeners.isEmpty()) { + return LauncherSessionListener.NOOP; + } + if (listeners.size() == 1) { + return listeners.get(0); + } + return new CompositeLauncherSessionListener(listeners); + } + +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/package-info.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/package-info.java new file mode 100644 index 000000000000..97541a153cba --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/package-info.java @@ -0,0 +1,9 @@ +/** + * Common {@link org.junit.platform.launcher.LauncherSessionListener} + * implementations and factory methods. + * + * @see org.junit.platform.launcher.listeners.session.LauncherSessionListeners + * @since 1.8 + */ + +package org.junit.platform.launcher.listeners.session; diff --git a/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java b/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java index 9ccde3666d41..ee0fc5627728 100644 --- a/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java +++ b/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java @@ -32,6 +32,7 @@ uses org.junit.platform.engine.TestEngine; uses org.junit.platform.launcher.LauncherDiscoveryListener; + uses org.junit.platform.launcher.LauncherSessionListener; uses org.junit.platform.launcher.PostDiscoveryFilter; uses org.junit.platform.launcher.TestExecutionListener; } diff --git a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java index e71c334b3869..2a9962578abd 100644 --- a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java +++ b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java @@ -19,13 +19,18 @@ public class LauncherFactoryForTestingPurposesOnly { public static Launcher createLauncher(TestEngine... engines) { - return LauncherFactory.create(LauncherConfig.builder() // - .enableTestEngineAutoRegistration(false) // + return LauncherFactory.create(createLauncherConfigBuilderWithDisabledServiceLoading() // .addTestEngines(engines) // + .build()); + } + + public static LauncherConfig.Builder createLauncherConfigBuilderWithDisabledServiceLoading() { + return LauncherConfig.builder() // + .enableTestEngineAutoRegistration(false) // .enableLauncherDiscoveryListenerAutoRegistration(false) // .enableTestExecutionListenerAutoRegistration(false) // .enablePostDiscoveryFilterAutoRegistration(false) // - .build()); + .enableLauncherSessionListenerAutoRegistration(false); } } diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java new file mode 100644 index 000000000000..335ba892d693 --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher; + +public class TestLauncherSessionListener implements LauncherSessionListener { + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + return getClass() == obj.getClass(); + } + + @Override + public int hashCode() { + return 1; + } +} diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java index cd233214e13e..5f9712f76d67 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java @@ -19,6 +19,8 @@ import org.junit.platform.commons.PreconditionViolationException; import org.junit.platform.engine.TestEngine; import org.junit.platform.fakes.TestEngineStub; +import org.junit.platform.launcher.LauncherDiscoveryListener; +import org.junit.platform.launcher.LauncherSessionListener; import org.junit.platform.launcher.TestExecutionListener; /** @@ -46,7 +48,7 @@ void preconditions() { @Test void defaultConfig() { - var config = LauncherConfig.builder().build(); + var config = LauncherConfig.DEFAULT; assertTrue(config.isTestEngineAutoRegistrationEnabled(), "Test engine auto-registration should be enabled by default"); @@ -100,6 +102,30 @@ void addTestEngines() { assertThat(config.getAdditionalTestEngines()).containsOnly(first, second); } + @Test + void addLauncherSessionListeners() { + var first = new LauncherSessionListener() { + }; + var second = new LauncherSessionListener() { + }; + + var config = LauncherConfig.builder().addLauncherSessionListeners(first, second).build(); + + assertThat(config.getAdditionalLauncherSessionListeners()).containsOnly(first, second); + } + + @Test + void addLauncherDiscoveryListeners() { + var first = new LauncherDiscoveryListener() { + }; + var second = new LauncherDiscoveryListener() { + }; + + var config = LauncherConfig.builder().addLauncherDiscoveryListeners(first, second).build(); + + assertThat(config.getAdditionalLauncherDiscoveryListeners()).containsOnly(first, second); + } + @Test void addTestExecutionListeners() { var first = new TestExecutionListener() { diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java index 982cd9b8b5bb..5a42197c9ce2 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java @@ -25,9 +25,11 @@ import org.junit.platform.commons.PreconditionViolationException; import org.junit.platform.launcher.LauncherDiscoveryListener; import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.LauncherSessionListener; import org.junit.platform.launcher.TagFilter; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestLauncherDiscoveryListener; +import org.junit.platform.launcher.TestLauncherSessionListener; import org.junit.platform.launcher.listeners.AnotherUnusedTestExecutionListener; import org.junit.platform.launcher.listeners.NoopTestExecutionListener; import org.junit.platform.launcher.listeners.UnusedTestExecutionListener; @@ -45,7 +47,7 @@ void preconditions() { @Test void noopTestExecutionListenerIsLoadedViaServiceApi() { withTestServices(() -> { - var launcher = (DefaultLauncher) LauncherFactory.create(); + var launcher = (InternalLauncher) LauncherFactory.create(); var listeners = launcher.getTestExecutionListenerRegistry().getListeners(); var listener = listeners.stream().filter(NoopTestExecutionListener.class::isInstance).findFirst(); assertThat(listener).isPresent(); @@ -55,7 +57,7 @@ void noopTestExecutionListenerIsLoadedViaServiceApi() { @Test void unusedTestExecutionListenerIsNotLoadedViaServiceApi() { withTestServices(() -> { - var launcher = (DefaultLauncher) LauncherFactory.create(); + var launcher = (InternalLauncher) LauncherFactory.create(); var listeners = launcher.getTestExecutionListenerRegistry().getListeners(); assertThat(listeners).filteredOn(AnotherUnusedTestExecutionListener.class::isInstance).isEmpty(); @@ -171,7 +173,7 @@ void notApplyIfDisabledPostDiscoveryFiltersViaServiceApi() { @Test void doesNotDiscoverLauncherDiscoverRequestListenerViaServiceApiWhenDisabled() { withTestServices(() -> { - var launcher = (DefaultLauncher) LauncherFactory.create( + var launcher = (InternalLauncher) LauncherFactory.create( LauncherConfig.builder().enableLauncherDiscoveryListenerAutoRegistration(false).build()); var launcherDiscoveryListener = launcher.getLauncherDiscoveryListenerRegistry().getCompositeListener(); @@ -182,7 +184,7 @@ void doesNotDiscoverLauncherDiscoverRequestListenerViaServiceApiWhenDisabled() { @Test void discoversLauncherDiscoverRequestListenerViaServiceApiByDefault() { withTestServices(() -> { - var launcher = (DefaultLauncher) LauncherFactory.create(); + var launcher = (InternalLauncher) LauncherFactory.create(); var launcherDiscoveryListener = launcher.getLauncherDiscoveryListenerRegistry().getCompositeListener(); assertThat(launcherDiscoveryListener.getClass().getSimpleName()).startsWith("Composite"); @@ -191,6 +193,25 @@ void discoversLauncherDiscoverRequestListenerViaServiceApiByDefault() { }); } + @Test + void doesNotDiscoverLauncherSessionListenerViaServiceApiWhenDisabled() { + withTestServices(() -> { + var session = (DefaultLauncherSession) LauncherFactory.openSession( + LauncherConfig.builder().enableLauncherSessionListenerAutoRegistration(false).build()); + + assertThat(session.getListener()).isSameAs(LauncherSessionListener.NOOP); + }); + } + + @Test + void discoversLauncherSessionListenerViaServiceApiByDefault() { + withTestServices(() -> { + var session = (DefaultLauncherSession) LauncherFactory.openSession(); + + assertThat(session.getListener()).isEqualTo(new TestLauncherSessionListener()); + }); + } + private static void withTestServices(Runnable runnable) { var current = Thread.currentThread().getContextClassLoader(); try { diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java new file mode 100644 index 000000000000..25488058b727 --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java @@ -0,0 +1,106 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.core; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.platform.launcher.core.LauncherFactoryForTestingPurposesOnly.createLauncherConfigBuilderWithDisabledServiceLoading; +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verifyNoMoreInteractions; + +import org.junit.jupiter.api.Test; +import org.junit.platform.commons.PreconditionViolationException; +import org.junit.platform.fakes.TestEngineStub; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.LauncherSession; +import org.junit.platform.launcher.LauncherSessionListener; +import org.mockito.ArgumentCaptor; + +public class LauncherSessionTests { + + LauncherSessionListener firstSessionListener = mock(LauncherSessionListener.class); + LauncherSessionListener secondSessionListener = mock(LauncherSessionListener.class); + LauncherConfig launcherConfig = createLauncherConfigBuilderWithDisabledServiceLoading() // + .addLauncherSessionListeners(firstSessionListener, secondSessionListener) // + .addTestEngines(new TestEngineStub()) // + .build(); + LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request().build(); + + @Test + void callsRegisteredListenersWhenLauncherIsUsedDirectly() { + var launcher = LauncherFactory.create(launcherConfig); + + var testPlan = launcher.discover(request); + + var inOrder = inOrder(firstSessionListener, secondSessionListener); + var launcherSession = ArgumentCaptor.forClass(LauncherSession.class); + inOrder.verify(firstSessionListener).launcherSessionOpened(launcherSession.capture()); + inOrder.verify(secondSessionListener).launcherSessionOpened(launcherSession.getValue()); + inOrder.verify(firstSessionListener).launcherSessionClosed(launcherSession.getValue()); + inOrder.verify(secondSessionListener).launcherSessionClosed(launcherSession.getValue()); + + launcher.execute(testPlan); + + inOrder.verify(firstSessionListener).launcherSessionOpened(launcherSession.capture()); + inOrder.verify(secondSessionListener).launcherSessionOpened(launcherSession.getValue()); + inOrder.verify(firstSessionListener).launcherSessionClosed(launcherSession.getValue()); + inOrder.verify(secondSessionListener).launcherSessionClosed(launcherSession.getValue()); + + launcher.execute(request); + + inOrder.verify(firstSessionListener).launcherSessionOpened(launcherSession.capture()); + inOrder.verify(secondSessionListener).launcherSessionOpened(launcherSession.getValue()); + inOrder.verify(firstSessionListener).launcherSessionClosed(launcherSession.getValue()); + inOrder.verify(secondSessionListener).launcherSessionClosed(launcherSession.getValue()); + } + + @Test + void callsRegisteredListenersWhenLauncherIsUsedViaSession() { + var session = LauncherFactory.openSession(launcherConfig); + var launcher = session.getLauncher(); + + var inOrder = inOrder(firstSessionListener, secondSessionListener); + inOrder.verify(firstSessionListener).launcherSessionOpened(session); + inOrder.verify(secondSessionListener).launcherSessionOpened(session); + verifyNoMoreInteractions(firstSessionListener, secondSessionListener); + + var testPlan = launcher.discover(request); + + verifyNoMoreInteractions(firstSessionListener, secondSessionListener); + + launcher.execute(testPlan); + + verifyNoMoreInteractions(firstSessionListener, secondSessionListener); + + launcher.execute(request); + + verifyNoMoreInteractions(firstSessionListener, secondSessionListener); + + session.close(); + + inOrder.verify(firstSessionListener).launcherSessionClosed(session); + inOrder.verify(secondSessionListener).launcherSessionClosed(session); + verifyNoMoreInteractions(firstSessionListener, secondSessionListener); + } + + @Test + void closedSessionCannotBeUsed() { + var session = LauncherFactory.openSession(launcherConfig); + var launcher = session.getLauncher(); + var testPlan = launcher.discover(request); + + session.close(); + + assertThrows(PreconditionViolationException.class, () -> launcher.discover(request)); + assertThrows(PreconditionViolationException.class, () -> launcher.execute(testPlan)); + assertThrows(PreconditionViolationException.class, () -> launcher.execute(request)); + } +} diff --git a/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherSessionListener b/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherSessionListener new file mode 100644 index 000000000000..a41b4e59ab99 --- /dev/null +++ b/platform-tests/src/test/resources/testservices/META-INF/services/org.junit.platform.launcher.LauncherSessionListener @@ -0,0 +1 @@ +org.junit.platform.launcher.TestLauncherSessionListener diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt index 82f90fef731d..bd0e934131eb 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt @@ -10,5 +10,6 @@ requires org.junit.platform.commons transitive requires org.junit.platform.engine transitive uses org.junit.platform.engine.TestEngine uses org.junit.platform.launcher.LauncherDiscoveryListener +uses org.junit.platform.launcher.LauncherSessionListener uses org.junit.platform.launcher.PostDiscoveryFilter uses org.junit.platform.launcher.TestExecutionListener diff --git a/platform-tooling-support-tests/projects/standalone/expected-err.txt b/platform-tooling-support-tests/projects/standalone/expected-err.txt index 27c15985896b..d49887b2d69b 100644 --- a/platform-tooling-support-tests/projects/standalone/expected-err.txt +++ b/platform-tooling-support-tests/projects/standalone/expected-err.txt @@ -1,8 +1,10 @@ .+ org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry loadTestEngines .+ Discovered TestEngines with IDs. .junit-jupiter .+ junit-vintage .+ -.+ org.junit.platform.launcher.core.ServiceLoaderPostDiscoveryFilterRegistry loadPostDiscoveryFilters +.+ org.junit.platform.launcher.core.ServiceLoaderRegistry load .+ Loaded PostDiscoveryFilter instances: .. -.+ org.junit.platform.launcher.core.ServiceLoaderLauncherDiscoveryListenerRegistry loadListeners +.+ org.junit.platform.launcher.core.ServiceLoaderRegistry load .+ Loaded LauncherDiscoveryListener instances: .. -.+ org.junit.platform.launcher.core.ServiceLoaderTestExecutionListenerRegistry loadListeners +.+ org.junit.platform.launcher.core.ServiceLoaderRegistry load .+ Loaded TestExecutionListener instances: .. +.+ org.junit.platform.launcher.core.ServiceLoaderRegistry load +.+ Loaded LauncherSessionListener instances: .. From 12cc35dd1c98dcb841dfba617d173f93e48c2ee6 Mon Sep 17 00:00:00 2001 From: Ville Saalo Date: Fri, 15 Jan 2021 21:51:10 +0200 Subject: [PATCH 0157/1433] Allow rows in @CsvSource to start with a number sign (#) (#2528) Previously lines starting with # were treated as comments which led to parameterized tests failing because they had no arguments. --- .../release-notes/release-notes-5.8.0-M1.adoc | 1 + .../jupiter/params/provider/CsvParserFactory.java | 14 +++++++++----- .../params/provider/CsvArgumentsProviderTests.java | 9 +++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 77d5e0c5267c..c5fc61e15ac3 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -71,6 +71,7 @@ on GitHub. provide better error messages comparable to those of `assertThrows`. * Dynamic tests now require less memory thanks to a number of improvements to internal data structures. +* Allow rows in `@CsvSource` to start with a number sign (#) [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java index 9711fbd05041..6a4cf1a84809 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java @@ -27,17 +27,19 @@ class CsvParserFactory { private static final char SINGLE_QUOTE = '\''; private static final char DOUBLE_QUOTE = '"'; private static final char EMPTY_CHAR = '\0'; + private static final boolean COMMENT_PROCESSING_FOR_CSV_SOURCE = false; + private static final boolean COMMENT_PROCESSING_FOR_CSV_FILE_SOURCE = true; static CsvParser createParserFor(CsvSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, LINE_SEPARATOR, SINGLE_QUOTE, annotation.emptyValue(), - annotation.maxCharsPerColumn()); + annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_SOURCE); } static CsvParser createParserFor(CsvFileSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, annotation.lineSeparator(), DOUBLE_QUOTE, annotation.emptyValue(), - annotation.maxCharsPerColumn()); + annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_FILE_SOURCE); } private static String selectDelimiter(Annotation annotation, char delimiter, String delimiterString) { @@ -54,12 +56,13 @@ private static String selectDelimiter(Annotation annotation, char delimiter, Str } private static CsvParser createParser(String delimiter, String lineSeparator, char quote, String emptyValue, - int maxCharsPerColumn) { - return new CsvParser(createParserSettings(delimiter, lineSeparator, quote, emptyValue, maxCharsPerColumn)); + int maxCharsPerColumn, boolean commentProcessingEnabled) { + return new CsvParser(createParserSettings(delimiter, lineSeparator, quote, emptyValue, maxCharsPerColumn, + commentProcessingEnabled)); } private static CsvParserSettings createParserSettings(String delimiter, String lineSeparator, char quote, - String emptyValue, int maxCharsPerColumn) { + String emptyValue, int maxCharsPerColumn, boolean commentProcessingEnabled) { CsvParserSettings settings = new CsvParserSettings(); settings.getFormat().setDelimiter(delimiter); @@ -67,6 +70,7 @@ private static CsvParserSettings createParserSettings(String delimiter, String l settings.getFormat().setQuote(quote); settings.getFormat().setQuoteEscape(quote); settings.setEmptyValue(emptyValue); + settings.setCommentProcessingEnabled(commentProcessingEnabled); settings.setAutoConfigurationEnabled(false); Preconditions.condition(maxCharsPerColumn > 0, () -> "maxCharsPerColumn must be a positive number: " + maxCharsPerColumn); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java index 8279869a0f9d..14944ff3b0db 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java @@ -221,6 +221,15 @@ void throwsExceptionWhenMaxCharsPerColumnIsNotPositiveNumber() { .withMessageStartingWith("maxCharsPerColumn must be a positive number: -1"); } + @Test + void doesNotMindSoCalledCommentCharacters() { + var annotation = csvSource("#foo", "#bar,baz", "baz,#quux"); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly(array("#foo"), array("#bar", "baz"), array("baz", "#quux")); + } + private Stream provideArguments(CsvSource annotation) { var provider = new CsvArgumentsProvider(); provider.accept(annotation); From 179c9ce4fc7ed24bae006142214d62d71e6c7364 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 15 Jan 2021 21:02:23 +0100 Subject: [PATCH 0158/1433] Remove no longer used package from import order --- src/eclipse/junit-eclipse.importorder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eclipse/junit-eclipse.importorder b/src/eclipse/junit-eclipse.importorder index 23c5f8987eff..daded8e1f6af 100644 --- a/src/eclipse/junit-eclipse.importorder +++ b/src/eclipse/junit-eclipse.importorder @@ -1,7 +1,7 @@ #Organize Import Order 0=java 1=javax -2=joptsimple +2=jdk 3=com 4=io 5=org From d3afd77152ae16cc109bf0f7d725da296c8b9e6a Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 15 Jan 2021 21:15:54 +0100 Subject: [PATCH 0159/1433] Disable automatic fetching of branch protection rules in IDEA Since fetching those rules is enabled by default but seems to require admin privileges, it caused constant changes to `vcs.xml`. --- .idea/vcs.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index cac68bbbeb72..7c23889dd37b 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,5 +1,8 @@ + +

    Must be a boolean value. + * + *

    Defaults to {@code true}. + * + * @since 5.8 + */ + @API(status = EXPERIMENTAL, since = "5.8") + boolean ignoreTrailingAndLeadingWhitespace() default true; } diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java index 6a4cf1a84809..d9961687697e 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java @@ -33,13 +33,15 @@ class CsvParserFactory { static CsvParser createParserFor(CsvSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, LINE_SEPARATOR, SINGLE_QUOTE, annotation.emptyValue(), - annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_SOURCE); + annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_SOURCE, + annotation.ignoreTrailingAndLeadingWhitespace()); } static CsvParser createParserFor(CsvFileSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, annotation.lineSeparator(), DOUBLE_QUOTE, annotation.emptyValue(), - annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_FILE_SOURCE); + annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_FILE_SOURCE, + annotation.ignoreTrailingAndLeadingWhitespace()); } private static String selectDelimiter(Annotation annotation, char delimiter, String delimiterString) { @@ -56,13 +58,14 @@ private static String selectDelimiter(Annotation annotation, char delimiter, Str } private static CsvParser createParser(String delimiter, String lineSeparator, char quote, String emptyValue, - int maxCharsPerColumn, boolean commentProcessingEnabled) { + int maxCharsPerColumn, boolean commentProcessingEnabled, boolean ignoreTrailingAndLeadingWhitespace) { return new CsvParser(createParserSettings(delimiter, lineSeparator, quote, emptyValue, maxCharsPerColumn, - commentProcessingEnabled)); + commentProcessingEnabled, ignoreTrailingAndLeadingWhitespace)); } private static CsvParserSettings createParserSettings(String delimiter, String lineSeparator, char quote, - String emptyValue, int maxCharsPerColumn, boolean commentProcessingEnabled) { + String emptyValue, int maxCharsPerColumn, boolean commentProcessingEnabled, + boolean ignoreTrailingAndLeadingWhitespace) { CsvParserSettings settings = new CsvParserSettings(); settings.getFormat().setDelimiter(delimiter); @@ -72,6 +75,8 @@ private static CsvParserSettings createParserSettings(String delimiter, String l settings.setEmptyValue(emptyValue); settings.setCommentProcessingEnabled(commentProcessingEnabled); settings.setAutoConfigurationEnabled(false); + settings.setIgnoreLeadingWhitespaces(ignoreTrailingAndLeadingWhitespace); + settings.setIgnoreTrailingWhitespaces(ignoreTrailingAndLeadingWhitespace); Preconditions.condition(maxCharsPerColumn > 0, () -> "maxCharsPerColumn must be a positive number: " + maxCharsPerColumn); settings.setMaxCharsPerColumn(maxCharsPerColumn); diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java index 852711d014b1..b65756b9b6da 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java @@ -118,4 +118,15 @@ @API(status = EXPERIMENTAL, since = "5.7") int maxCharsPerColumn() default 4096; + /** + * Identifies whether leading and trailing whitespace characters of unquoted CSV columns should be ignored. + * + *

    Must be a boolean value. + * + *

    Defaults to {@code true}. + * + * @since 5.8 + */ + @API(status = EXPERIMENTAL, since = "5.8") + boolean ignoreTrailingAndLeadingWhitespace() default true; } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java index fb106aa2faf3..c58a71523ce8 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java @@ -164,6 +164,34 @@ void executesWithAggregator() { event(test(), displayName("[2] ef, gh"), finishedWithFailure(message("concatenation: efgh")))); } + @Test + void executesWithIgnoreTrailingAndLeadingSetToFalseForCsvSource() { + var results = execute("testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse", String.class); + results.allEvents().assertThatEvents().haveAtLeast(1, + event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + } + + @Test + void executesWithIgnoreTrailingAndLeadingSetToTrueForCsvSource() { + var results = execute("testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue", String.class); + results.allEvents().assertThatEvents().haveAtLeast(1, + event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + } + + @Test + void executesWithIgnoreTrailingAndLeadingSetToFalseForCsvFileSource() { + var results = execute("testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse", String.class); + results.allEvents().assertThatEvents().haveAtLeast(1, + event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + } + + @Test + void executesWithIgnoreTrailingAndLeadingSetToTrueForCsvFileSource() { + var results = execute("testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue", String.class); + results.allEvents().assertThatEvents().haveAtLeast(1, + event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + } + @Test void failsContainerOnEmptyName() { var results = execute("testWithEmptyName", String.class); @@ -695,6 +723,30 @@ void testWithAggregator(@AggregateWith(StringAggregator.class) String concatenat fail("concatenation: " + concatenation); } + @ParameterizedTest + @CsvSource(value = { " ab, cd", "ef, gh" }, ignoreTrailingAndLeadingWhitespace = false) + void testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse(String argument) { + fail("arg:" + argument); + } + + @ParameterizedTest + @CsvSource(value = { " ab, cd", "ef, gh" }, ignoreTrailingAndLeadingWhitespace = true) + void testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue(String argument) { + fail("arg:" + argument); + } + + @ParameterizedTest + @CsvFileSource(resources = "/trailing-leading-spaces.csv", ignoreTrailingAndLeadingWhitespace = false) + void testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse(String argument) { + fail("arg:" + argument); + } + + @ParameterizedTest + @CsvFileSource(resources = "/trailing-leading-spaces.csv", ignoreTrailingAndLeadingWhitespace = true) + void testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue(String argument) { + fail("arg:" + argument); + } + } static class NullSourceTestCase { diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java index 14944ff3b0db..df2b47bd0165 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java @@ -143,6 +143,60 @@ void defaultEmptyValueAndDefaultNullValue() { assertThat(arguments).containsExactly(array("", "null", null, "apple")); } + @Test + void defaultLeadingSpaces() { + var annotation = csvSource(" as, null, , apple"); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly(array("as", "null", null, "apple")); + } + + @Test + void defaultLeadingSpacesWithIgnoredTrailingAndLeadingWhitespace() { + var annotation = csvSource(false, " as, null, , apple"); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly(array(" as", "null", null, "apple")); + } + + @Test + void defaultTrailingSpaces() { + var annotation = csvSource("as , null, , apple"); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly(array("as", "null", null, "apple")); + } + + @Test + void defaultTrailingSpacesWithIgnoredTrailingAndLeadingSpaces() { + var annotation = csvSource(false, "as , null, , apple"); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly(array("as ", "null", null, "apple")); + } + + @Test + void defaultLeadingAndTrailingSpaces() { + var annotation = csvSource(" as , null, , apple"); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly(array("as", "null", null, "apple")); + } + + @Test + void defaultLeadingAndTrailingSpacesWithIgnoredTrailingAndLeadingSpaces() { + var annotation = csvSource(false, " as ,orange,apple"); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly(array(" as ", "orange", "apple")); + } + @Test void customEmptyValueAndDefaultNullValue() { var annotation = csvSource().emptyValue("EMPTY").lines("'', null, , apple").build(); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java index 8db64501a74d..c6e1f11e5759 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java @@ -431,6 +431,37 @@ void throwsExceptionForExceedsMaxCharsFileWithDefaultConfig(@TempDir Path tempDi .hasRootCauseInstanceOf(ArrayIndexOutOfBoundsException.class); } + @Test + void ignoreTrimLeadingAndTrailingSpaces(@TempDir Path tempDir) throws java.io.IOException { + var csvFile = writeClasspathResourceToFile("/trailing-leading-spaces.csv", + tempDir.resolve("trailing-leading-spaces.csv")); + var annotation = csvFileSource()// + .encoding("ISO-8859-1")// + .resources("/trailing-leading-spaces.csv")// + .files(csvFile.toAbsolutePath().toString())// + .build(true); + System.out.println(annotation.ignoreTrailingAndLeadingWhitespace()); + var arguments = provideArguments(new ByteArrayInputStream(Files.readAllBytes(csvFile)), annotation); + + assertThat(arguments).containsExactly(array("a", "b", "c")); + } + + @Test + void notIgnoreTrimLeadingAndTrailingSpaces(@TempDir Path tempDir) throws IOException { + var csvFile = writeClasspathResourceToFile("/trailing-leading-spaces.csv", + tempDir.resolve("trailing-leading-spaces.csv")); + var annotation = csvFileSource()// + .encoding("ISO-8859-1")// + .resources("/trailing-leading-spaces.csv")// + .files(csvFile.toAbsolutePath().toString())// + .delimiter(',')// + .build(false); + + var arguments = provideArguments(new ByteArrayInputStream(Files.readAllBytes(csvFile)), annotation); + + assertThat(arguments).containsExactly(array("a", "b", "c")); + } + private Stream provideArguments(CsvFileSource annotation, String content) { return provideArguments(new ByteArrayInputStream(content.getBytes(UTF_8)), annotation); } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java index c17dd52462ea..c8c1101c2975 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java @@ -24,6 +24,10 @@ static CsvSource csvSource(String... lines) { return csvSource().lines(lines).build(); } + static CsvSource csvSource(boolean ignoreTrailingAndLeadingWhitespace, String... lines) { + return csvSource().lines(lines).build(ignoreTrailingAndLeadingWhitespace); + } + static MockCsvSourceBuilder csvSource() { return new MockCsvSourceBuilder(); } @@ -39,6 +43,7 @@ static MockCsvFileSourceBuilder csvFileSource() { protected String emptyValue = ""; protected String[] nullValues = new String[0]; protected int maxCharsPerColumn = 4096; + protected boolean ignoreTrailingAndLeadingWhitespace = true; private MockCsvAnnotationBuilder() { } @@ -70,6 +75,11 @@ B maxCharsPerColumn(int maxCharsPerColumn) { return getSelf(); } + B ignoreTrailingAndLeadingWhitespace(boolean ignoreTrailingAndLeadingWhitespace) { + this.ignoreTrailingAndLeadingWhitespace = ignoreTrailingAndLeadingWhitespace; + return getSelf(); + } + abstract A build(); // ------------------------------------------------------------------------- @@ -98,6 +108,24 @@ CsvSource build() { when(annotation.emptyValue()).thenReturn(super.emptyValue); when(annotation.nullValues()).thenReturn(super.nullValues); when(annotation.maxCharsPerColumn()).thenReturn(super.maxCharsPerColumn); + when(annotation.ignoreTrailingAndLeadingWhitespace()).thenReturn(super.ignoreTrailingAndLeadingWhitespace); + + // @CsvSource + when(annotation.value()).thenReturn(this.lines); + + return annotation; + } + + CsvSource build(boolean ignoreTrailingAndLeadingWhitespace) { + var annotation = mock(CsvSource.class); + + // Common + when(annotation.delimiter()).thenReturn(super.delimiter); + when(annotation.delimiterString()).thenReturn(super.delimiterString); + when(annotation.emptyValue()).thenReturn(super.emptyValue); + when(annotation.nullValues()).thenReturn(super.nullValues); + when(annotation.maxCharsPerColumn()).thenReturn(super.maxCharsPerColumn); + when(annotation.ignoreTrailingAndLeadingWhitespace()).thenReturn(ignoreTrailingAndLeadingWhitespace); // @CsvSource when(annotation.value()).thenReturn(this.lines); @@ -114,6 +142,7 @@ static class MockCsvFileSourceBuilder extends MockCsvAnnotationBuilder Date: Sun, 3 Jan 2021 16:19:23 +0100 Subject: [PATCH 0162/1433] Polish changes introduced in #2491 --- .../params/provider/CsvFileSource.java | 2 +- .../params/provider/CsvParserFactory.java | 14 ++-- .../jupiter/params/provider/CsvSource.java | 2 +- .../ParameterizedTestIntegrationTests.java | 64 ++++++++++-------- .../provider/CsvArgumentsProviderTests.java | 65 ++++--------------- .../CsvFileArgumentsProviderTests.java | 28 ++++---- .../provider/MockCsvAnnotationBuilder.java | 57 ++-------------- .../resources/leading-trailing-spaces.csv | 2 + .../resources/trailing-leading-spaces.csv | 1 - 9 files changed, 78 insertions(+), 157 deletions(-) create mode 100644 junit-jupiter-params/src/test/resources/leading-trailing-spaces.csv delete mode 100644 junit-jupiter-params/src/test/resources/trailing-leading-spaces.csv diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java index 1484a82ee075..8c3bb2be24ef 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java @@ -156,5 +156,5 @@ * @since 5.8 */ @API(status = EXPERIMENTAL, since = "5.8") - boolean ignoreTrailingAndLeadingWhitespace() default true; + boolean ignoreLeadingAndTrailingWhitespace() default true; } diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java index d9961687697e..18df453cf4fc 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java @@ -34,14 +34,14 @@ static CsvParser createParserFor(CsvSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, LINE_SEPARATOR, SINGLE_QUOTE, annotation.emptyValue(), annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_SOURCE, - annotation.ignoreTrailingAndLeadingWhitespace()); + annotation.ignoreLeadingAndTrailingWhitespace()); } static CsvParser createParserFor(CsvFileSource annotation) { String delimiter = selectDelimiter(annotation, annotation.delimiter(), annotation.delimiterString()); return createParser(delimiter, annotation.lineSeparator(), DOUBLE_QUOTE, annotation.emptyValue(), annotation.maxCharsPerColumn(), COMMENT_PROCESSING_FOR_CSV_FILE_SOURCE, - annotation.ignoreTrailingAndLeadingWhitespace()); + annotation.ignoreLeadingAndTrailingWhitespace()); } private static String selectDelimiter(Annotation annotation, char delimiter, String delimiterString) { @@ -58,14 +58,14 @@ private static String selectDelimiter(Annotation annotation, char delimiter, Str } private static CsvParser createParser(String delimiter, String lineSeparator, char quote, String emptyValue, - int maxCharsPerColumn, boolean commentProcessingEnabled, boolean ignoreTrailingAndLeadingWhitespace) { + int maxCharsPerColumn, boolean commentProcessingEnabled, boolean ignoreLeadingAndTrailingWhitespace) { return new CsvParser(createParserSettings(delimiter, lineSeparator, quote, emptyValue, maxCharsPerColumn, - commentProcessingEnabled, ignoreTrailingAndLeadingWhitespace)); + commentProcessingEnabled, ignoreLeadingAndTrailingWhitespace)); } private static CsvParserSettings createParserSettings(String delimiter, String lineSeparator, char quote, String emptyValue, int maxCharsPerColumn, boolean commentProcessingEnabled, - boolean ignoreTrailingAndLeadingWhitespace) { + boolean ignoreLeadingAndTrailingWhitespace) { CsvParserSettings settings = new CsvParserSettings(); settings.getFormat().setDelimiter(delimiter); @@ -75,8 +75,8 @@ private static CsvParserSettings createParserSettings(String delimiter, String l settings.setEmptyValue(emptyValue); settings.setCommentProcessingEnabled(commentProcessingEnabled); settings.setAutoConfigurationEnabled(false); - settings.setIgnoreLeadingWhitespaces(ignoreTrailingAndLeadingWhitespace); - settings.setIgnoreTrailingWhitespaces(ignoreTrailingAndLeadingWhitespace); + settings.setIgnoreLeadingWhitespaces(ignoreLeadingAndTrailingWhitespace); + settings.setIgnoreTrailingWhitespaces(ignoreLeadingAndTrailingWhitespace); Preconditions.condition(maxCharsPerColumn > 0, () -> "maxCharsPerColumn must be a positive number: " + maxCharsPerColumn); settings.setMaxCharsPerColumn(maxCharsPerColumn); diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java index b65756b9b6da..47aabcc36902 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java @@ -128,5 +128,5 @@ * @since 5.8 */ @API(status = EXPERIMENTAL, since = "5.8") - boolean ignoreTrailingAndLeadingWhitespace() default true; + boolean ignoreLeadingAndTrailingWhitespace() default true; } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java index c58a71523ce8..ed0f9e32465f 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java @@ -165,31 +165,39 @@ void executesWithAggregator() { } @Test - void executesWithIgnoreTrailingAndLeadingSetToFalseForCsvSource() { - var results = execute("testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse", String.class); - results.allEvents().assertThatEvents().haveAtLeast(1, - event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + void executesWithIgnoreLeadingAndTrailingSetToFalseForCsvSource() { + var results = execute("testWithIgnoreLeadingAndTrailingWhitespaceSetToFalseForCsvSource", String.class, + String.class); + results.allEvents().assertThatEvents() // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: ' ab ', ' cd'")))) // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: 'ef ', 'gh'")))); } @Test - void executesWithIgnoreTrailingAndLeadingSetToTrueForCsvSource() { - var results = execute("testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue", String.class); - results.allEvents().assertThatEvents().haveAtLeast(1, - event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + void executesWithIgnoreLeadingAndTrailingSetToTrueForCsvSource() { + var results = execute("testWithIgnoreLeadingAndTrailingWhitespaceSetToTrueForCsvSource", String.class, + String.class); + results.allEvents().assertThatEvents() // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: 'ab', 'cd'")))) // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: 'ef', 'gh'")))); } @Test - void executesWithIgnoreTrailingAndLeadingSetToFalseForCsvFileSource() { - var results = execute("testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse", String.class); - results.allEvents().assertThatEvents().haveAtLeast(1, - event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + void executesWithIgnoreLeadingAndTrailingSetToFalseForCsvFileSource() { + var results = execute("testWithIgnoreLeadingAndTrailingWhitespaceSetToFalseForCsvFileSource", String.class, + String.class); + results.allEvents().assertThatEvents() // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: ' ab ', ' cd'")))) // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: 'ef ', 'gh'")))); } @Test - void executesWithIgnoreTrailingAndLeadingSetToTrueForCsvFileSource() { - var results = execute("testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue", String.class); - results.allEvents().assertThatEvents().haveAtLeast(1, - event(test(), finishedWithFailure(instanceOf(AssertionError.class)))); + void executesWithIgnoreLeadingAndTrailingSetToTrueForCsvFileSource() { + var results = execute("testWithIgnoreLeadingAndTrailingWhitespaceSetToTrueForCsvFileSource", String.class, + String.class); + results.allEvents().assertThatEvents() // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: 'ab', 'cd'")))) // + .haveExactly(1, event(test(), finishedWithFailure(message("arguments: 'ef', 'gh'")))); } @Test @@ -724,27 +732,27 @@ void testWithAggregator(@AggregateWith(StringAggregator.class) String concatenat } @ParameterizedTest - @CsvSource(value = { " ab, cd", "ef, gh" }, ignoreTrailingAndLeadingWhitespace = false) - void testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse(String argument) { - fail("arg:" + argument); + @CsvSource(value = { " ab , cd", "ef ,gh" }, ignoreLeadingAndTrailingWhitespace = false) + void testWithIgnoreLeadingAndTrailingWhitespaceSetToFalseForCsvSource(String argument1, String argument2) { + fail("arguments: '" + argument1 + "', '" + argument2 + "'"); } @ParameterizedTest - @CsvSource(value = { " ab, cd", "ef, gh" }, ignoreTrailingAndLeadingWhitespace = true) - void testCsvSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue(String argument) { - fail("arg:" + argument); + @CsvSource(value = { " ab , cd", "ef ,gh" }, ignoreLeadingAndTrailingWhitespace = true) + void testWithIgnoreLeadingAndTrailingWhitespaceSetToTrueForCsvSource(String argument1, String argument2) { + fail("arguments: '" + argument1 + "', '" + argument2 + "'"); } @ParameterizedTest - @CsvFileSource(resources = "/trailing-leading-spaces.csv", ignoreTrailingAndLeadingWhitespace = false) - void testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToFalse(String argument) { - fail("arg:" + argument); + @CsvFileSource(resources = "/leading-trailing-spaces.csv", ignoreLeadingAndTrailingWhitespace = false) + void testWithIgnoreLeadingAndTrailingWhitespaceSetToFalseForCsvFileSource(String argument1, String argument2) { + fail("arguments: '" + argument1 + "', '" + argument2 + "'"); } @ParameterizedTest - @CsvFileSource(resources = "/trailing-leading-spaces.csv", ignoreTrailingAndLeadingWhitespace = true) - void testCsvFileSourceWithIgnoreTrailingAndLeadingWhitespaceSetToTrue(String argument) { - fail("arg:" + argument); + @CsvFileSource(resources = "/leading-trailing-spaces.csv", ignoreLeadingAndTrailingWhitespace = true) + void testWithIgnoreLeadingAndTrailingWhitespaceSetToTrueForCsvFileSource(String argument1, String argument2) { + fail("arguments: '" + argument1 + "', '" + argument2 + "'"); } } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java index df2b47bd0165..bbe3baab612d 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java @@ -79,6 +79,17 @@ void trimsTrailingSpaces() { assertThat(arguments).containsExactly(new Object[][] { { "1", "" }, { "2", "" }, { "3", "" }, { "4", "" } }); } + @Test + void ignoresLeadingAndTrailingSpaces() { + var annotation = csvSource().lines("1,a", "2, b", "3,c ", "4, d ") // + .ignoreLeadingAndTrailingWhitespace(false).build(); + + var arguments = provideArguments(annotation); + + assertThat(arguments).containsExactly( + new Object[][] { { "1", "a" }, { "2", " b" }, { "3", "c " }, { "4", " d " } }); + } + @Test void understandsQuotes() { var annotation = csvSource("'foo, bar'"); @@ -143,60 +154,6 @@ void defaultEmptyValueAndDefaultNullValue() { assertThat(arguments).containsExactly(array("", "null", null, "apple")); } - @Test - void defaultLeadingSpaces() { - var annotation = csvSource(" as, null, , apple"); - - var arguments = provideArguments(annotation); - - assertThat(arguments).containsExactly(array("as", "null", null, "apple")); - } - - @Test - void defaultLeadingSpacesWithIgnoredTrailingAndLeadingWhitespace() { - var annotation = csvSource(false, " as, null, , apple"); - - var arguments = provideArguments(annotation); - - assertThat(arguments).containsExactly(array(" as", "null", null, "apple")); - } - - @Test - void defaultTrailingSpaces() { - var annotation = csvSource("as , null, , apple"); - - var arguments = provideArguments(annotation); - - assertThat(arguments).containsExactly(array("as", "null", null, "apple")); - } - - @Test - void defaultTrailingSpacesWithIgnoredTrailingAndLeadingSpaces() { - var annotation = csvSource(false, "as , null, , apple"); - - var arguments = provideArguments(annotation); - - assertThat(arguments).containsExactly(array("as ", "null", null, "apple")); - } - - @Test - void defaultLeadingAndTrailingSpaces() { - var annotation = csvSource(" as , null, , apple"); - - var arguments = provideArguments(annotation); - - assertThat(arguments).containsExactly(array("as", "null", null, "apple")); - } - - @Test - void defaultLeadingAndTrailingSpacesWithIgnoredTrailingAndLeadingSpaces() { - var annotation = csvSource(false, " as ,orange,apple"); - - var arguments = provideArguments(annotation); - - assertThat(arguments).containsExactly(array(" as ", "orange", "apple")); - } - @Test void customEmptyValueAndDefaultNullValue() { var annotation = csvSource().emptyValue("EMPTY").lines("'', null, , apple").build(); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java index c6e1f11e5759..43e6087e2e1d 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java @@ -432,34 +432,36 @@ void throwsExceptionForExceedsMaxCharsFileWithDefaultConfig(@TempDir Path tempDi } @Test - void ignoreTrimLeadingAndTrailingSpaces(@TempDir Path tempDir) throws java.io.IOException { - var csvFile = writeClasspathResourceToFile("/trailing-leading-spaces.csv", - tempDir.resolve("trailing-leading-spaces.csv")); + void ignoresLeadingAndTrailingSpaces(@TempDir Path tempDir) throws IOException { + var csvFile = writeClasspathResourceToFile("/leading-trailing-spaces.csv", + tempDir.resolve("leading-trailing-spaces.csv")); var annotation = csvFileSource()// .encoding("ISO-8859-1")// - .resources("/trailing-leading-spaces.csv")// + .resources("/leading-trailing-spaces.csv")// .files(csvFile.toAbsolutePath().toString())// - .build(true); - System.out.println(annotation.ignoreTrailingAndLeadingWhitespace()); + .ignoreLeadingAndTrailingWhitespace(true)// + .build(); + var arguments = provideArguments(new ByteArrayInputStream(Files.readAllBytes(csvFile)), annotation); - assertThat(arguments).containsExactly(array("a", "b", "c")); + assertThat(arguments).containsExactly(array("ab", "cd"), array("ef", "gh")); } @Test - void notIgnoreTrimLeadingAndTrailingSpaces(@TempDir Path tempDir) throws IOException { - var csvFile = writeClasspathResourceToFile("/trailing-leading-spaces.csv", - tempDir.resolve("trailing-leading-spaces.csv")); + void trimsLeadingAndTrailingSpaces(@TempDir Path tempDir) throws IOException { + var csvFile = writeClasspathResourceToFile("/leading-trailing-spaces.csv", + tempDir.resolve("leading-trailing-spaces.csv")); var annotation = csvFileSource()// .encoding("ISO-8859-1")// - .resources("/trailing-leading-spaces.csv")// + .resources("/leading-trailing-spaces.csv")// .files(csvFile.toAbsolutePath().toString())// .delimiter(',')// - .build(false); + .ignoreLeadingAndTrailingWhitespace(false)// + .build(); var arguments = provideArguments(new ByteArrayInputStream(Files.readAllBytes(csvFile)), annotation); - assertThat(arguments).containsExactly(array("a", "b", "c")); + assertThat(arguments).containsExactly(array(" ab ", " cd"), array("ef ", "gh")); } private Stream provideArguments(CsvFileSource annotation, String content) { diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java index c8c1101c2975..438393631c5a 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java @@ -24,10 +24,6 @@ static CsvSource csvSource(String... lines) { return csvSource().lines(lines).build(); } - static CsvSource csvSource(boolean ignoreTrailingAndLeadingWhitespace, String... lines) { - return csvSource().lines(lines).build(ignoreTrailingAndLeadingWhitespace); - } - static MockCsvSourceBuilder csvSource() { return new MockCsvSourceBuilder(); } @@ -43,7 +39,7 @@ static MockCsvFileSourceBuilder csvFileSource() { protected String emptyValue = ""; protected String[] nullValues = new String[0]; protected int maxCharsPerColumn = 4096; - protected boolean ignoreTrailingAndLeadingWhitespace = true; + protected boolean ignoreLeadingAndTrailingWhitespace = true; private MockCsvAnnotationBuilder() { } @@ -75,8 +71,8 @@ B maxCharsPerColumn(int maxCharsPerColumn) { return getSelf(); } - B ignoreTrailingAndLeadingWhitespace(boolean ignoreTrailingAndLeadingWhitespace) { - this.ignoreTrailingAndLeadingWhitespace = ignoreTrailingAndLeadingWhitespace; + B ignoreLeadingAndTrailingWhitespace(boolean ignoreLeadingAndTrailingWhitespace) { + this.ignoreLeadingAndTrailingWhitespace = ignoreLeadingAndTrailingWhitespace; return getSelf(); } @@ -108,24 +104,7 @@ CsvSource build() { when(annotation.emptyValue()).thenReturn(super.emptyValue); when(annotation.nullValues()).thenReturn(super.nullValues); when(annotation.maxCharsPerColumn()).thenReturn(super.maxCharsPerColumn); - when(annotation.ignoreTrailingAndLeadingWhitespace()).thenReturn(super.ignoreTrailingAndLeadingWhitespace); - - // @CsvSource - when(annotation.value()).thenReturn(this.lines); - - return annotation; - } - - CsvSource build(boolean ignoreTrailingAndLeadingWhitespace) { - var annotation = mock(CsvSource.class); - - // Common - when(annotation.delimiter()).thenReturn(super.delimiter); - when(annotation.delimiterString()).thenReturn(super.delimiterString); - when(annotation.emptyValue()).thenReturn(super.emptyValue); - when(annotation.nullValues()).thenReturn(super.nullValues); - when(annotation.maxCharsPerColumn()).thenReturn(super.maxCharsPerColumn); - when(annotation.ignoreTrailingAndLeadingWhitespace()).thenReturn(ignoreTrailingAndLeadingWhitespace); + when(annotation.ignoreLeadingAndTrailingWhitespace()).thenReturn(super.ignoreLeadingAndTrailingWhitespace); // @CsvSource when(annotation.value()).thenReturn(this.lines); @@ -142,7 +121,6 @@ static class MockCsvFileSourceBuilder extends MockCsvAnnotationBuilder Date: Sun, 3 Jan 2021 16:25:41 +0100 Subject: [PATCH 0163/1433] Add documentation and release note following #2491 --- .../release-notes/release-notes-5.8.0-M1.adoc | 2 ++ .../asciidoc/user-guide/writing-tests.adoc | 23 +++++++++++++------ .../params/provider/CsvFileSource.java | 5 ++-- .../jupiter/params/provider/CsvSource.java | 5 ++-- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index c5fc61e15ac3..889669b54a38 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -72,6 +72,8 @@ on GitHub. * Dynamic tests now require less memory thanks to a number of improvements to internal data structures. * Allow rows in `@CsvSource` to start with a number sign (#) +* New `ignoreLeadingAndTrailingWhitespace` attribute to control whether or not to trim + whitespaces in `@CsvSource` and `@CsvFileSource` (set to `true` by default). [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 4e4500018543..8f247e7fa0d9 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -1260,15 +1260,20 @@ reference is a primitive type. NOTE: An _unquoted_ empty value will always be converted to a `null` reference regardless of any custom values configured via the `nullValues` attribute. +Unless it starts with a quote character, leading and trailing whitespaces of a +CSV column are trimmed by default. This behavior can be changed by setting the +`ignoreLeadingAndTrailingWhitespace` attribute to `true`. + [cols="50,50"] |=== -| Example Input | Resulting Argument List - -| `@CsvSource({ "apple, banana" })` | `"apple"`, `"banana"` -| `@CsvSource({ "apple, 'lemon, lime'" })` | `"apple"`, `"lemon, lime"` -| `@CsvSource({ "apple, ''" })` | `"apple"`, `""` -| `@CsvSource({ "apple, " })` | `"apple"`, `null` -| `@CsvSource(value = { "apple, banana, NIL" }, nullValues = "NIL")` | `"apple"`, `"banana"`, `null` +| Example Input | Resulting Argument List + +| `@CsvSource({ "apple, banana" })` | `"apple"`, `"banana"` +| `@CsvSource({ "apple, 'lemon, lime'" })` | `"apple"`, `"lemon, lime"` +| `@CsvSource({ "apple, ''" })` | `"apple"`, `""` +| `@CsvSource({ "apple, " })` | `"apple"`, `null` +| `@CsvSource(value = { "apple, banana, NIL" }, nullValues = "NIL")` | `"apple"`, `"banana"`, `null` +| `@CsvSource(value = { " apple , banana" }, ignoreLeadingAndTrailingWhitespace = false)` | `" apple "`, `" banana"` |=== [[writing-tests-parameterized-tests-sources-CsvFileSource]] @@ -1308,6 +1313,10 @@ reference is a primitive type. NOTE: An _unquoted_ empty value will always be converted to a `null` reference regardless of any custom values configured via the `nullValues` attribute. +Unless it starts with a quote character, leading and trailing whitespaces of a +CSV column are trimmed by default. This behavior can be changed by setting the +`ignoreLeadingAndTrailingWhitespace` attribute to `true`. + [[writing-tests-parameterized-tests-sources-ArgumentsSource]] ===== @ArgumentsSource diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java index 8c3bb2be24ef..5e19035da09c 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java @@ -147,9 +147,8 @@ int maxCharsPerColumn() default 4096; /** - * Identifies whether leading and trailing whitespace characters of unquoted CSV columns should be ignored. - * - *

    Must be a boolean value. + * Identifies whether leading and trailing whitespace characters of + * unquoted CSV columns should be ignored. * *

    Defaults to {@code true}. * diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java index 47aabcc36902..194341bf6630 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java @@ -119,9 +119,8 @@ int maxCharsPerColumn() default 4096; /** - * Identifies whether leading and trailing whitespace characters of unquoted CSV columns should be ignored. - * - *

    Must be a boolean value. + * Identifies whether leading and trailing whitespace characters of + * unquoted CSV columns should be ignored. * *

    Defaults to {@code true}. * From cbea9170e100f17a8d2596ebb646166360dfcc52 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 16 Jan 2021 20:55:14 +0100 Subject: [PATCH 0164/1433] Allow publishing build scans to scans.gradle.com (#2533) Prior to this commit, only members of the JUnit team were able to publish build scans because ge.junit.org was configured as server and requires authentication. Now, CI builds for external branches publish scans to scans.gradle.com and contributors can manually publish scans by specifying Gradle's `--scan` option and accepting Gradle's terms and conditions. --- settings.gradle.kts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 94e155dab7e8..0f3cc86dbbfd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,12 +28,28 @@ val junitBuildCachePassword: String? by extra gradleEnterprise { buildScan { - server = gradleEnterpriseServer isCaptureTaskInputFiles = true isUploadInBackground = !isCiServer - publishAlways() - this as BuildScanExtensionWithHiddenFeatures - publishIfAuthenticated() + + fun accessKeysAreMissingOrBlank(): Boolean { + val accessKeys = File(gradle.gradleUserHomeDir, "enterprise/keys.properties") + return !accessKeys.isFile || accessKeys.readText().isBlank() + } + + if (gradle.startParameter.isBuildScan || (isCiServer && accessKeysAreMissingOrBlank())) { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + } else { + server = gradleEnterpriseServer + publishAlways() + this as BuildScanExtensionWithHiddenFeatures + publishIfAuthenticated() + } + + if (isCiServer) { + publishAlways() + termsOfServiceAgree = "yes" + } + obfuscation { if (isCiServer) { username { "github" } From 276973e218694c9b01cfbfa86349165985069edd Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 16 Jan 2021 21:17:05 +0100 Subject: [PATCH 0165/1433] Remove explicit --scan arguments so that CI publishes to ge.gradle.org again, if possible. --- .github/workflows/cross-version.yml | 2 +- .github/workflows/main.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index afc53e9d4e6a..bb2b9332c347 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -49,4 +49,4 @@ jobs: - name: Test run: | ./gradlew --version - ./gradlew --scan --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" + ./gradlew --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 396911c24813..cc4a46f444b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: - name: Test and Coverage run: | ./gradlew --version - ./gradlew --scan --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo build jacocoRootReport + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo build jacocoRootReport - name: Upload to Codecov.io uses: codecov/codecov-action@v1 @@ -94,7 +94,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew --scan --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build ./gradlew --stop mac: @@ -131,7 +131,7 @@ jobs: - name: 'Test' run: | ./gradlew --version - ./gradlew --scan --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true build publish_artifacts: name: Publish Snapshot Artifacts @@ -160,7 +160,7 @@ jobs: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - run: ./gradlew --scan publish -x check + run: ./gradlew publish -x check update_documentation: name: Update Snapshot Documentation From aba78ffb638b95ba8284489f9a7f919b7ac06582 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 16 Jan 2021 21:41:00 +0100 Subject: [PATCH 0166/1433] Ensure tests are executed on all operating systems on CI --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 137d0d9e67d6..32c14b50524c 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -1,5 +1,6 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED +import org.gradle.internal.os.OperatingSystem plugins { id("org.gradle.test-retry") @@ -28,6 +29,8 @@ tasks.withType().configureEach { "-XX:FlightRecorderOptions=stackdepth=1024" ) } + // Track OS as input so that tests are executed on all configured operating systems on CI + inputs.property("os", OperatingSystem.current().familyName) } dependencies { From 17d3b440f3b6c3ba4616fc927e7782e74582ea86 Mon Sep 17 00:00:00 2001 From: JUnit Team Date: Sun, 17 Jan 2021 14:25:04 +0100 Subject: [PATCH 0167/1433] Update copyright --- documentation/src/main/java/example/domain/Person.java | 2 +- documentation/src/main/java/example/registration/WebClient.java | 2 +- .../src/main/java/example/registration/WebResponse.java | 2 +- .../src/main/java/example/registration/WebServerExtension.java | 2 +- documentation/src/main/java/example/util/Calculator.java | 2 +- documentation/src/main/java/example/util/ListWriter.java | 2 +- documentation/src/main/java/example/util/StringUtils.java | 2 +- documentation/src/test/java/example/AssertionsDemo.java | 2 +- documentation/src/test/java/example/AssumptionsDemo.java | 2 +- .../src/test/java/example/ConditionalTestExecutionDemo.java | 2 +- documentation/src/test/java/example/CustomTestEngine.java | 2 +- documentation/src/test/java/example/DisabledClassDemo.java | 2 +- documentation/src/test/java/example/DisabledTestsDemo.java | 2 +- documentation/src/test/java/example/DisplayNameDemo.java | 2 +- .../src/test/java/example/DisplayNameGeneratorDemo.java | 2 +- documentation/src/test/java/example/DocumentationTestSuite.java | 2 +- documentation/src/test/java/example/DynamicTestsDemo.java | 2 +- documentation/src/test/java/example/ExampleTestCase.java | 2 +- .../src/test/java/example/ExternalMethodSourceDemo.java | 2 +- documentation/src/test/java/example/Fast.java | 2 +- documentation/src/test/java/example/FastTest.java | 2 +- documentation/src/test/java/example/HamcrestAssertionsDemo.java | 2 +- documentation/src/test/java/example/IgnoredTestsDemo.java | 2 +- documentation/src/test/java/example/JUnit4Tests.java | 2 +- documentation/src/test/java/example/JUnitPlatformClassDemo.java | 2 +- documentation/src/test/java/example/JUnitPlatformSuiteDemo.java | 2 +- .../src/test/java/example/MyFirstJUnitJupiterTests.java | 2 +- documentation/src/test/java/example/OrderedTestsDemo.java | 2 +- documentation/src/test/java/example/ParameterizedTestDemo.java | 2 +- documentation/src/test/java/example/PollingTimeoutDemo.java | 2 +- documentation/src/test/java/example/RepeatedTestsDemo.java | 2 +- documentation/src/test/java/example/SharedResourcesDemo.java | 2 +- documentation/src/test/java/example/SlowTests.java | 2 +- documentation/src/test/java/example/StandardTests.java | 2 +- documentation/src/test/java/example/TaggingDemo.java | 2 +- documentation/src/test/java/example/TempDirectoryDemo.java | 2 +- documentation/src/test/java/example/TestInfoDemo.java | 2 +- documentation/src/test/java/example/TestReporterDemo.java | 2 +- documentation/src/test/java/example/TestTemplateDemo.java | 2 +- documentation/src/test/java/example/TestingAStackDemo.java | 2 +- documentation/src/test/java/example/TimeoutDemo.java | 2 +- documentation/src/test/java/example/UsingTheLauncherDemo.java | 2 +- .../src/test/java/example/callbacks/AbstractDatabaseTests.java | 2 +- .../java/example/callbacks/BrokenLifecycleMethodConfigDemo.java | 2 +- .../src/test/java/example/callbacks/DatabaseTestsDemo.java | 2 +- documentation/src/test/java/example/callbacks/Extension1.java | 2 +- documentation/src/test/java/example/callbacks/Extension2.java | 2 +- documentation/src/test/java/example/callbacks/Logger.java | 2 +- .../test/java/example/defaultmethods/ComparableContract.java | 2 +- .../src/test/java/example/defaultmethods/EqualsContract.java | 2 +- .../src/test/java/example/defaultmethods/StringTests.java | 2 +- .../src/test/java/example/defaultmethods/Testable.java | 2 +- .../test/java/example/exception/IgnoreIOExceptionExtension.java | 2 +- .../src/test/java/example/exception/IgnoreIOExceptionTests.java | 2 +- .../test/java/example/exception/MultipleHandlersTestCase.java | 2 +- .../java/example/exception/RecordStateOnErrorExtension.java | 2 +- .../src/test/java/example/interceptor/SwingEdtInterceptor.java | 2 +- .../src/test/java/example/registration/DocumentationDemo.java | 2 +- .../src/test/java/example/registration/WebServerDemo.java | 2 +- .../src/test/java/example/testinterface/TestInterfaceDemo.java | 2 +- .../example/testinterface/TestInterfaceDynamicTestsDemo.java | 2 +- .../test/java/example/testinterface/TestLifecycleLogger.java | 2 +- .../test/java/example/testinterface/TimeExecutionLogger.java | 2 +- .../test/java/example/testkit/EngineTestKitAllEventsDemo.java | 2 +- .../java/example/testkit/EngineTestKitFailedMethodDemo.java | 2 +- .../java/example/testkit/EngineTestKitSkippedMethodDemo.java | 2 +- .../test/java/example/testkit/EngineTestKitStatisticsDemo.java | 2 +- documentation/src/test/java/example/timing/TimingExtension.java | 2 +- .../src/test/java/example/timing/TimingExtensionTests.java | 2 +- documentation/src/test/java/extensions/ExpectToFail.java | 2 +- .../test/java/org/junit/api/tools/AbstractApiReportWriter.java | 2 +- documentation/src/test/java/org/junit/api/tools/ApiReport.java | 2 +- .../src/test/java/org/junit/api/tools/ApiReportGenerator.java | 2 +- .../src/test/java/org/junit/api/tools/ApiReportWriter.java | 2 +- .../test/java/org/junit/api/tools/AsciidocApiReportWriter.java | 2 +- .../src/test/java/org/junit/api/tools/HtmlApiReportWriter.java | 2 +- .../test/java/org/junit/api/tools/MarkdownApiReportWriter.java | 2 +- documentation/src/test/kotlin/example/FibonacciCalculator.kt | 2 +- documentation/src/test/kotlin/example/KotlinAssertionsDemo.kt | 2 +- .../src/test/kotlin/example/registration/KotlinWebServerDemo.kt | 2 +- .../src/main/java/org/junit/jupiter/api/AfterAll.java | 2 +- .../src/main/java/org/junit/jupiter/api/AfterEach.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertAll.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertArrayEquals.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertDoesNotThrow.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertEquals.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertFalse.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertInstanceOf.java | 2 +- .../main/java/org/junit/jupiter/api/AssertIterableEquals.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertLinesMatch.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertNotEquals.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertNotNull.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertNotSame.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertNull.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertSame.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertThrows.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertTimeout.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertTrue.java | 2 +- .../src/main/java/org/junit/jupiter/api/AssertionUtils.java | 2 +- .../src/main/java/org/junit/jupiter/api/Assertions.java | 2 +- .../src/main/java/org/junit/jupiter/api/Assumptions.java | 2 +- .../src/main/java/org/junit/jupiter/api/BeforeAll.java | 2 +- .../src/main/java/org/junit/jupiter/api/BeforeEach.java | 2 +- .../src/main/java/org/junit/jupiter/api/Disabled.java | 2 +- .../src/main/java/org/junit/jupiter/api/DisplayName.java | 2 +- .../main/java/org/junit/jupiter/api/DisplayNameGeneration.java | 2 +- .../main/java/org/junit/jupiter/api/DisplayNameGenerator.java | 2 +- .../src/main/java/org/junit/jupiter/api/DynamicContainer.java | 2 +- .../src/main/java/org/junit/jupiter/api/DynamicNode.java | 2 +- .../src/main/java/org/junit/jupiter/api/DynamicTest.java | 2 +- .../org/junit/jupiter/api/IndicativeSentencesGeneration.java | 2 +- .../src/main/java/org/junit/jupiter/api/MethodDescriptor.java | 2 +- .../src/main/java/org/junit/jupiter/api/MethodOrderer.java | 2 +- .../main/java/org/junit/jupiter/api/MethodOrdererContext.java | 2 +- .../src/main/java/org/junit/jupiter/api/Nested.java | 2 +- .../src/main/java/org/junit/jupiter/api/Order.java | 2 +- .../src/main/java/org/junit/jupiter/api/RepeatedTest.java | 2 +- .../src/main/java/org/junit/jupiter/api/RepetitionInfo.java | 2 +- junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tag.java | 2 +- junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tags.java | 2 +- junit-jupiter-api/src/main/java/org/junit/jupiter/api/Test.java | 2 +- .../src/main/java/org/junit/jupiter/api/TestFactory.java | 2 +- .../src/main/java/org/junit/jupiter/api/TestInfo.java | 2 +- .../src/main/java/org/junit/jupiter/api/TestInstance.java | 2 +- .../src/main/java/org/junit/jupiter/api/TestMethodOrder.java | 2 +- .../src/main/java/org/junit/jupiter/api/TestReporter.java | 2 +- .../src/main/java/org/junit/jupiter/api/TestTemplate.java | 2 +- .../src/main/java/org/junit/jupiter/api/Timeout.java | 2 +- .../api/condition/AbstractRepeatableAnnotationCondition.java | 2 +- .../junit/jupiter/api/condition/BooleanExecutionCondition.java | 2 +- .../org/junit/jupiter/api/condition/DisabledForJreRange.java | 2 +- .../jupiter/api/condition/DisabledForJreRangeCondition.java | 2 +- .../main/java/org/junit/jupiter/api/condition/DisabledIf.java | 2 +- .../org/junit/jupiter/api/condition/DisabledIfCondition.java | 2 +- .../jupiter/api/condition/DisabledIfEnvironmentVariable.java | 2 +- .../api/condition/DisabledIfEnvironmentVariableCondition.java | 2 +- .../jupiter/api/condition/DisabledIfEnvironmentVariables.java | 2 +- .../junit/jupiter/api/condition/DisabledIfSystemProperties.java | 2 +- .../junit/jupiter/api/condition/DisabledIfSystemProperty.java | 2 +- .../api/condition/DisabledIfSystemPropertyCondition.java | 2 +- .../java/org/junit/jupiter/api/condition/DisabledOnJre.java | 2 +- .../org/junit/jupiter/api/condition/DisabledOnJreCondition.java | 2 +- .../main/java/org/junit/jupiter/api/condition/DisabledOnOs.java | 2 +- .../org/junit/jupiter/api/condition/DisabledOnOsCondition.java | 2 +- .../org/junit/jupiter/api/condition/EnabledForJreRange.java | 2 +- .../jupiter/api/condition/EnabledForJreRangeCondition.java | 2 +- .../main/java/org/junit/jupiter/api/condition/EnabledIf.java | 2 +- .../org/junit/jupiter/api/condition/EnabledIfCondition.java | 2 +- .../jupiter/api/condition/EnabledIfEnvironmentVariable.java | 2 +- .../api/condition/EnabledIfEnvironmentVariableCondition.java | 2 +- .../jupiter/api/condition/EnabledIfEnvironmentVariables.java | 2 +- .../junit/jupiter/api/condition/EnabledIfSystemProperties.java | 2 +- .../junit/jupiter/api/condition/EnabledIfSystemProperty.java | 2 +- .../jupiter/api/condition/EnabledIfSystemPropertyCondition.java | 2 +- .../main/java/org/junit/jupiter/api/condition/EnabledOnJre.java | 2 +- .../org/junit/jupiter/api/condition/EnabledOnJreCondition.java | 2 +- .../main/java/org/junit/jupiter/api/condition/EnabledOnOs.java | 2 +- .../org/junit/jupiter/api/condition/EnabledOnOsCondition.java | 2 +- .../src/main/java/org/junit/jupiter/api/condition/JRE.java | 2 +- .../org/junit/jupiter/api/condition/MethodBasedCondition.java | 2 +- .../src/main/java/org/junit/jupiter/api/condition/OS.java | 2 +- .../java/org/junit/jupiter/api/extension/AfterAllCallback.java | 2 +- .../java/org/junit/jupiter/api/extension/AfterEachCallback.java | 2 +- .../junit/jupiter/api/extension/AfterTestExecutionCallback.java | 2 +- .../java/org/junit/jupiter/api/extension/BeforeAllCallback.java | 2 +- .../org/junit/jupiter/api/extension/BeforeEachCallback.java | 2 +- .../jupiter/api/extension/BeforeTestExecutionCallback.java | 2 +- .../junit/jupiter/api/extension/ConditionEvaluationResult.java | 2 +- .../jupiter/api/extension/DynamicTestInvocationContext.java | 2 +- .../org/junit/jupiter/api/extension/ExecutionCondition.java | 2 +- .../main/java/org/junit/jupiter/api/extension/ExtendWith.java | 2 +- .../main/java/org/junit/jupiter/api/extension/Extension.java | 2 +- .../jupiter/api/extension/ExtensionConfigurationException.java | 2 +- .../java/org/junit/jupiter/api/extension/ExtensionContext.java | 2 +- .../junit/jupiter/api/extension/ExtensionContextException.java | 2 +- .../main/java/org/junit/jupiter/api/extension/Extensions.java | 2 +- .../org/junit/jupiter/api/extension/InvocationInterceptor.java | 2 +- .../api/extension/LifecycleMethodExecutionExceptionHandler.java | 2 +- .../java/org/junit/jupiter/api/extension/ParameterContext.java | 2 +- .../jupiter/api/extension/ParameterResolutionException.java | 2 +- .../java/org/junit/jupiter/api/extension/ParameterResolver.java | 2 +- .../jupiter/api/extension/ReflectiveInvocationContext.java | 2 +- .../java/org/junit/jupiter/api/extension/RegisterExtension.java | 2 +- .../jupiter/api/extension/TestExecutionExceptionHandler.java | 2 +- .../org/junit/jupiter/api/extension/TestInstanceFactory.java | 2 +- .../junit/jupiter/api/extension/TestInstanceFactoryContext.java | 2 +- .../junit/jupiter/api/extension/TestInstancePostProcessor.java | 2 +- .../jupiter/api/extension/TestInstancePreDestroyCallback.java | 2 +- .../java/org/junit/jupiter/api/extension/TestInstances.java | 2 +- .../junit/jupiter/api/extension/TestInstantiationException.java | 2 +- .../jupiter/api/extension/TestTemplateInvocationContext.java | 2 +- .../api/extension/TestTemplateInvocationContextProvider.java | 2 +- .../main/java/org/junit/jupiter/api/extension/TestWatcher.java | 2 +- .../api/extension/support/TypeBasedParameterResolver.java | 2 +- .../main/java/org/junit/jupiter/api/function/Executable.java | 2 +- .../java/org/junit/jupiter/api/function/ThrowingConsumer.java | 2 +- .../java/org/junit/jupiter/api/function/ThrowingSupplier.java | 2 +- .../src/main/java/org/junit/jupiter/api/io/TempDir.java | 2 +- .../src/main/java/org/junit/jupiter/api/parallel/Execution.java | 2 +- .../main/java/org/junit/jupiter/api/parallel/ExecutionMode.java | 2 +- .../src/main/java/org/junit/jupiter/api/parallel/Isolated.java | 2 +- .../java/org/junit/jupiter/api/parallel/ResourceAccessMode.java | 2 +- .../main/java/org/junit/jupiter/api/parallel/ResourceLock.java | 2 +- .../main/java/org/junit/jupiter/api/parallel/ResourceLocks.java | 2 +- .../src/main/java/org/junit/jupiter/api/parallel/Resources.java | 2 +- .../src/main/kotlin/org/junit/jupiter/api/Assertions.kt | 2 +- .../src/module/org.junit.jupiter.api/module-info.java | 2 +- .../api/extension/ExtensionContextParameterResolver.java | 2 +- .../java/org/junit/jupiter/api/fixtures/TrackLogRecords.java | 2 +- .../src/main/java/org/junit/jupiter/engine/Constants.java | 2 +- .../main/java/org/junit/jupiter/engine/JupiterTestEngine.java | 2 +- .../jupiter/engine/config/CachingJupiterConfiguration.java | 2 +- .../jupiter/engine/config/DefaultJupiterConfiguration.java | 2 +- .../engine/config/EnumConfigurationParameterConverter.java | 2 +- .../config/InstantiatingConfigurationParameterConverter.java | 2 +- .../org/junit/jupiter/engine/config/JupiterConfiguration.java | 2 +- .../jupiter/engine/descriptor/AbstractExtensionContext.java | 2 +- .../jupiter/engine/descriptor/ClassBasedTestDescriptor.java | 2 +- .../junit/jupiter/engine/descriptor/ClassExtensionContext.java | 2 +- .../junit/jupiter/engine/descriptor/ClassTestDescriptor.java | 2 +- .../engine/descriptor/DefaultDynamicTestInvocationContext.java | 2 +- .../engine/descriptor/DefaultTestInstanceFactoryContext.java | 2 +- .../org/junit/jupiter/engine/descriptor/DisplayNameUtils.java | 2 +- .../engine/descriptor/DynamicContainerTestDescriptor.java | 2 +- .../jupiter/engine/descriptor/DynamicDescendantFilter.java | 2 +- .../jupiter/engine/descriptor/DynamicExtensionContext.java | 2 +- .../jupiter/engine/descriptor/DynamicNodeTestDescriptor.java | 2 +- .../jupiter/engine/descriptor/DynamicTestTestDescriptor.java | 2 +- .../org/junit/jupiter/engine/descriptor/ExtensionUtils.java | 2 +- .../java/org/junit/jupiter/engine/descriptor/Filterable.java | 2 +- .../jupiter/engine/descriptor/JupiterEngineDescriptor.java | 2 +- .../engine/descriptor/JupiterEngineExtensionContext.java | 2 +- .../junit/jupiter/engine/descriptor/JupiterTestDescriptor.java | 2 +- .../junit/jupiter/engine/descriptor/LifecycleMethodUtils.java | 2 +- .../jupiter/engine/descriptor/MethodBasedTestDescriptor.java | 2 +- .../junit/jupiter/engine/descriptor/MethodExtensionContext.java | 2 +- .../junit/jupiter/engine/descriptor/MethodSourceSupport.java | 2 +- .../jupiter/engine/descriptor/NestedClassTestDescriptor.java | 2 +- .../jupiter/engine/descriptor/TestFactoryTestDescriptor.java | 2 +- .../jupiter/engine/descriptor/TestInstanceLifecycleUtils.java | 2 +- .../jupiter/engine/descriptor/TestMethodTestDescriptor.java | 2 +- .../jupiter/engine/descriptor/TestTemplateExtensionContext.java | 2 +- .../engine/descriptor/TestTemplateInvocationTestDescriptor.java | 2 +- .../jupiter/engine/descriptor/TestTemplateTestDescriptor.java | 2 +- .../junit/jupiter/engine/discovery/ClassSelectorResolver.java | 2 +- .../junit/jupiter/engine/discovery/DefaultMethodDescriptor.java | 2 +- .../jupiter/engine/discovery/DefaultMethodOrdererContext.java | 2 +- .../jupiter/engine/discovery/DiscoverySelectorResolver.java | 2 +- .../java/org/junit/jupiter/engine/discovery/MethodFinder.java | 2 +- .../junit/jupiter/engine/discovery/MethodOrderingVisitor.java | 2 +- .../junit/jupiter/engine/discovery/MethodSelectorResolver.java | 2 +- .../junit/jupiter/engine/discovery/predicates/IsInnerClass.java | 2 +- .../jupiter/engine/discovery/predicates/IsNestedTestClass.java | 2 +- .../engine/discovery/predicates/IsPotentialTestContainer.java | 2 +- .../engine/discovery/predicates/IsTestClassWithTests.java | 2 +- .../engine/discovery/predicates/IsTestFactoryMethod.java | 2 +- .../junit/jupiter/engine/discovery/predicates/IsTestMethod.java | 2 +- .../engine/discovery/predicates/IsTestTemplateMethod.java | 2 +- .../jupiter/engine/discovery/predicates/IsTestableMethod.java | 2 +- .../junit/jupiter/engine/execution/AfterEachMethodAdapter.java | 2 +- .../junit/jupiter/engine/execution/BeforeEachMethodAdapter.java | 2 +- .../jupiter/engine/execution/ConditionEvaluationException.java | 2 +- .../org/junit/jupiter/engine/execution/ConditionEvaluator.java | 2 +- .../junit/jupiter/engine/execution/ConstructorInvocation.java | 2 +- .../junit/jupiter/engine/execution/DefaultParameterContext.java | 2 +- .../junit/jupiter/engine/execution/DefaultTestInstances.java | 2 +- .../org/junit/jupiter/engine/execution/ExecutableInvoker.java | 2 +- .../junit/jupiter/engine/execution/ExtensionValuesStore.java | 2 +- .../jupiter/engine/execution/InvocationInterceptorChain.java | 2 +- .../jupiter/engine/execution/JupiterEngineExecutionContext.java | 2 +- .../org/junit/jupiter/engine/execution/MethodInvocation.java | 2 +- .../org/junit/jupiter/engine/execution/NamespaceAwareStore.java | 2 +- .../junit/jupiter/engine/execution/TestInstancesProvider.java | 2 +- .../org/junit/jupiter/engine/extension/DisabledCondition.java | 2 +- .../org/junit/jupiter/engine/extension/ExtensionRegistrar.java | 2 +- .../org/junit/jupiter/engine/extension/ExtensionRegistry.java | 2 +- .../jupiter/engine/extension/MutableExtensionRegistry.java | 2 +- .../engine/extension/RepeatedTestDisplayNameFormatter.java | 2 +- .../junit/jupiter/engine/extension/RepeatedTestExtension.java | 2 +- .../jupiter/engine/extension/RepeatedTestInvocationContext.java | 2 +- .../engine/extension/RepetitionInfoParameterResolver.java | 2 +- .../java/org/junit/jupiter/engine/extension/TempDirectory.java | 2 +- .../jupiter/engine/extension/TestInfoParameterResolver.java | 2 +- .../jupiter/engine/extension/TestReporterParameterResolver.java | 2 +- .../junit/jupiter/engine/extension/TimeoutConfiguration.java | 2 +- .../org/junit/jupiter/engine/extension/TimeoutDuration.java | 2 +- .../junit/jupiter/engine/extension/TimeoutDurationParser.java | 2 +- .../org/junit/jupiter/engine/extension/TimeoutExtension.java | 2 +- .../org/junit/jupiter/engine/extension/TimeoutInvocation.java | 2 +- .../engine/support/JupiterThrowableCollectorFactory.java | 2 +- .../support/OpenTest4JAndJUnit4AwareThrowableCollector.java | 2 +- .../src/module/org.junit.jupiter.engine/module-info.java | 2 +- .../groovy/org/junit/jupiter/api/GroovyAssertEqualsTests.groovy | 2 +- .../org/junit/jupiter/api/GroovyAssertNotEqualsTests.groovy | 2 +- .../org/junit/jupiter/api/PrimitiveAndWrapperTypeHelpers.groovy | 2 +- junit-jupiter-engine/src/test/java/DefaultPackageTestCase.java | 2 +- .../src/test/java/org/junit/jupiter/JupiterTestSuite.java | 2 +- .../java/org/junit/jupiter/api/AssertAllAssertionsTests.java | 2 +- .../org/junit/jupiter/api/AssertArrayEqualsAssertionsTests.java | 2 +- .../junit/jupiter/api/AssertDoesNotThrowAssertionsTests.java | 2 +- .../java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java | 2 +- .../java/org/junit/jupiter/api/AssertFalseAssertionsTests.java | 2 +- .../org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java | 2 +- .../junit/jupiter/api/AssertIterableEqualsAssertionsTests.java | 2 +- .../org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java | 2 +- .../org/junit/jupiter/api/AssertNotEqualsAssertionsTests.java | 2 +- .../org/junit/jupiter/api/AssertNotNullAssertionsTests.java | 2 +- .../org/junit/jupiter/api/AssertNotSameAssertionsTests.java | 2 +- .../java/org/junit/jupiter/api/AssertNullAssertionsTests.java | 2 +- .../java/org/junit/jupiter/api/AssertSameAssertionsTests.java | 2 +- .../java/org/junit/jupiter/api/AssertThrowsAssertionsTests.java | 2 +- .../org/junit/jupiter/api/AssertTimeoutAssertionsTests.java | 2 +- .../java/org/junit/jupiter/api/AssertTrueAssertionsTests.java | 2 +- .../src/test/java/org/junit/jupiter/api/AssertionTestUtils.java | 2 +- .../src/test/java/org/junit/jupiter/api/AssumptionsTests.java | 2 +- .../java/org/junit/jupiter/api/DisplayNameGenerationTests.java | 2 +- .../src/test/java/org/junit/jupiter/api/DynamicTestTests.java | 2 +- .../src/test/java/org/junit/jupiter/api/EnigmaThrowable.java | 2 +- .../test/java/org/junit/jupiter/api/FailAssertionsTests.java | 2 +- .../src/test/java/org/junit/jupiter/api/IterableFactory.java | 2 +- .../jupiter/api/condition/AbstractExecutionConditionTests.java | 2 +- .../api/condition/DisabledForJreRangeConditionTests.java | 2 +- .../api/condition/DisabledForJreRangeIntegrationTests.java | 2 +- .../junit/jupiter/api/condition/DisabledIfConditionTests.java | 2 +- .../condition/DisabledIfEnvironmentVariableConditionTests.java | 2 +- .../DisabledIfEnvironmentVariableIntegrationTests.java | 2 +- .../junit/jupiter/api/condition/DisabledIfIntegrationTests.java | 2 +- .../api/condition/DisabledIfSystemPropertyConditionTests.java | 2 +- .../api/condition/DisabledIfSystemPropertyIntegrationTests.java | 2 +- .../jupiter/api/condition/DisabledOnJreConditionTests.java | 2 +- .../jupiter/api/condition/DisabledOnJreIntegrationTests.java | 2 +- .../junit/jupiter/api/condition/DisabledOnOsConditionTests.java | 2 +- .../jupiter/api/condition/DisabledOnOsIntegrationTests.java | 2 +- .../jupiter/api/condition/EnabledForJreRangeConditionTests.java | 2 +- .../api/condition/EnabledForJreRangeIntegrationTests.java | 2 +- .../junit/jupiter/api/condition/EnabledIfConditionTests.java | 2 +- .../condition/EnabledIfEnvironmentVariableConditionTests.java | 2 +- .../condition/EnabledIfEnvironmentVariableIntegrationTests.java | 2 +- .../junit/jupiter/api/condition/EnabledIfIntegrationTests.java | 2 +- .../api/condition/EnabledIfSystemPropertyConditionTests.java | 2 +- .../api/condition/EnabledIfSystemPropertyIntegrationTests.java | 2 +- .../junit/jupiter/api/condition/EnabledOnJreConditionTests.java | 2 +- .../jupiter/api/condition/EnabledOnJreIntegrationTests.java | 2 +- .../junit/jupiter/api/condition/EnabledOnOsConditionTests.java | 2 +- .../jupiter/api/condition/EnabledOnOsIntegrationTests.java | 2 +- .../src/test/java/org/junit/jupiter/api/condition/JRETests.java | 2 +- .../org/junit/jupiter/api/condition/StaticConditionMethods.java | 2 +- .../api/extension/CloseableResourceIntegrationTests.java | 2 +- .../jupiter/api/extension/ExtensionComposabilityTests.java | 2 +- .../org/junit/jupiter/api/extension/KitchenSinkExtension.java | 2 +- .../api/extension/support/TypeBasedParameterResolverTests.java | 2 +- .../junit/jupiter/api/subpackage/SubclassedAssertionsTests.java | 2 +- .../jupiter/api/subpackage/SubclassedAssumptionsTests.java | 2 +- .../junit/jupiter/engine/AbstractJupiterTestEngineTests.java | 2 +- .../org/junit/jupiter/engine/AtypicalJvmMethodNameTests.java | 2 +- .../engine/BeforeAllAndAfterAllComposedAnnotationTests.java | 2 +- .../engine/BeforeEachAndAfterEachComposedAnnotationTests.java | 2 +- .../org/junit/jupiter/engine/DefaultExecutionModeTests.java | 2 +- .../test/java/org/junit/jupiter/engine/DefaultMethodTests.java | 2 +- .../src/test/java/org/junit/jupiter/engine/DisabledTests.java | 2 +- .../org/junit/jupiter/engine/DynamicNodeGenerationTests.java | 2 +- .../java/org/junit/jupiter/engine/ExceptionHandlingTests.java | 2 +- .../java/org/junit/jupiter/engine/FailedAssumptionsTests.java | 2 +- .../engine/InvalidLifecycleMethodConfigurationTests.java | 2 +- .../org/junit/jupiter/engine/JupiterTestEngineBasicTests.java | 2 +- .../junit/jupiter/engine/MultipleTestableAnnotationsTests.java | 2 +- .../java/org/junit/jupiter/engine/NestedTestClassesTests.java | 2 +- .../org/junit/jupiter/engine/NestedWithInheritanceTests.java | 2 +- .../jupiter/engine/NestedWithSeparateInheritanceTests.java | 2 +- .../jupiter/engine/NonVoidTestableMethodIntegrationTests.java | 2 +- .../org/junit/jupiter/engine/OverloadedTestMethodTests.java | 2 +- .../src/test/java/org/junit/jupiter/engine/ReportingTests.java | 2 +- .../java/org/junit/jupiter/engine/StandardTestClassTests.java | 2 +- .../org/junit/jupiter/engine/TestClassInheritanceTests.java | 2 +- .../jupiter/engine/TestInstanceLifecycleConfigurationTests.java | 2 +- .../junit/jupiter/engine/TestInstanceLifecycleKotlinTests.java | 2 +- .../org/junit/jupiter/engine/TestInstanceLifecycleTests.java | 2 +- .../org/junit/jupiter/engine/TestTemplateInvocationTests.java | 2 +- .../junit/jupiter/engine/bridge/AbstractNonGenericTests.java | 2 +- .../org/junit/jupiter/engine/bridge/AbstractNumberTests.java | 2 +- .../java/org/junit/jupiter/engine/bridge/BridgeMethodTests.java | 2 +- .../org/junit/jupiter/engine/bridge/ChildWithBridgeMethods.java | 2 +- .../junit/jupiter/engine/bridge/ChildWithoutBridgeMethods.java | 2 +- .../java/org/junit/jupiter/engine/bridge/NumberResolver.java | 2 +- .../java/org/junit/jupiter/engine/bridge/NumberTestGroup.java | 2 +- .../org/junit/jupiter/engine/bridge/PackagePrivateParent.java | 2 +- .../jupiter/engine/config/CachingJupiterConfigurationTests.java | 2 +- .../jupiter/engine/config/DefaultJupiterConfigurationTests.java | 2 +- .../InstantiatingConfigurationParameterConverterTests.java | 2 +- .../jupiter/engine/descriptor/CustomDisplayNameGenerator.java | 2 +- .../junit/jupiter/engine/descriptor/DisplayNameUtilsTests.java | 2 +- .../junit/jupiter/engine/descriptor/ExtensionContextTests.java | 2 +- .../jupiter/engine/descriptor/JupiterTestDescriptorTests.java | 2 +- .../jupiter/engine/descriptor/LifecycleMethodUtilsTests.java | 2 +- .../engine/descriptor/TestFactoryTestDescriptorTests.java | 2 +- .../engine/descriptor/TestInstanceLifecycleUtilsTests.java | 2 +- .../descriptor/TestTemplateInvocationTestDescriptorTests.java | 2 +- .../engine/descriptor/TestTemplateTestDescriptorTests.java | 2 +- .../engine/descriptor/subpackage/Class1WithTestCases.java | 2 +- .../engine/descriptor/subpackage/Class2WithTestCases.java | 2 +- .../descriptor/subpackage/ClassWithStaticInnerTestCases.java | 2 +- .../engine/descriptor/subpackage/ClassWithoutTestCases.java | 2 +- .../engine/discovery/DiscoverySelectorResolverTests.java | 2 +- .../java/org/junit/jupiter/engine/discovery/DiscoveryTests.java | 2 +- .../junit/jupiter/engine/discovery/JupiterUniqueIdBuilder.java | 2 +- .../jupiter/engine/discovery/predicates/IsInnerClassTests.java | 2 +- .../engine/discovery/predicates/IsNestedTestClassTests.java | 2 +- .../discovery/predicates/IsPotentialTestContainerTests.java | 2 +- .../engine/discovery/predicates/IsTestClassWithTestsTests.java | 2 +- .../engine/discovery/predicates/IsTestFactoryMethodTests.java | 2 +- .../jupiter/engine/discovery/predicates/IsTestMethodTests.java | 2 +- .../engine/discovery/predicates/IsTestTemplateMethodTests.java | 2 +- .../jupiter/engine/execution/DefaultTestInstancesTests.java | 2 +- .../jupiter/engine/execution/DynamicTestIntegrationTests.java | 2 +- .../junit/jupiter/engine/execution/ExecutableInvokerTests.java | 2 +- .../engine/execution/ExtensionContextStoreConcurrencyTests.java | 2 +- .../jupiter/engine/execution/ExtensionContextStoreTests.java | 2 +- .../jupiter/engine/execution/ExtensionValuesStoreTests.java | 2 +- .../engine/execution/JupiterEngineExecutionContextTests.java | 2 +- .../UniqueIdParsingForArrayParameterIntegrationTests.java | 2 +- .../engine/execution/injection/sample/CustomAnnotation.java | 2 +- .../injection/sample/CustomAnnotationParameterResolver.java | 2 +- .../jupiter/engine/execution/injection/sample/CustomType.java | 2 +- .../execution/injection/sample/CustomTypeParameterResolver.java | 2 +- .../execution/injection/sample/DoubleParameterResolver.java | 2 +- .../execution/injection/sample/LongParameterResolver.java | 2 +- .../injection/sample/MapOfListsTypeBasedParameterResolver.java | 2 +- .../injection/sample/MapOfStringsParameterResolver.java | 2 +- .../injection/sample/NullIntegerParameterResolver.java | 2 +- .../execution/injection/sample/NumberParameterResolver.java | 2 +- .../injection/sample/PrimitiveArrayParameterResolver.java | 2 +- .../injection/sample/PrimitiveIntegerParameterResolver.java | 2 +- .../junit/jupiter/engine/extension/BeforeAndAfterAllTests.java | 2 +- .../junit/jupiter/engine/extension/BeforeAndAfterEachTests.java | 2 +- .../extension/BeforeAndAfterTestExecutionCallbackTests.java | 2 +- .../org/junit/jupiter/engine/extension/EnigmaException.java | 2 +- .../engine/extension/EventuallyInterruptibleInvocation.java | 2 +- .../junit/jupiter/engine/extension/ExecutionConditionTests.java | 2 +- .../engine/extension/ExtensionContextExecutionTests.java | 2 +- .../junit/jupiter/engine/extension/ExtensionRegistryTests.java | 2 +- .../jupiter/engine/extension/InvocationInterceptorTests.java | 2 +- .../LifecycleMethodExecutionExceptionHandlerTests.java | 2 +- .../org/junit/jupiter/engine/extension/OrderedMethodTests.java | 2 +- .../OrderedProgrammaticExtensionRegistrationTests.java | 2 +- .../junit/jupiter/engine/extension/ParameterResolverTests.java | 2 +- .../extension/ProgrammaticExtensionRegistrationTests.java | 2 +- .../org/junit/jupiter/engine/extension/RepeatedTestTests.java | 2 +- .../junit/jupiter/engine/extension/ServiceLoaderExtension.java | 2 +- .../org/junit/jupiter/engine/extension/TempDirectoryTests.java | 2 +- .../engine/extension/TestExecutionExceptionHandlerTests.java | 2 +- .../engine/extension/TestInfoParameterResolverTests.java | 2 +- .../jupiter/engine/extension/TestInstanceFactoryTests.java | 2 +- .../TestInstancePostProcessorAndPreDestroyCallbackTests.java | 2 +- .../engine/extension/TestInstancePostProcessorTests.java | 2 +- .../engine/extension/TestInstancePreDestroyCallbackTests.java | 2 +- .../TestInstancePreDestroyCallbackUtilityMethodTests.java | 2 +- .../engine/extension/TestReporterParameterResolverTests.java | 2 +- .../org/junit/jupiter/engine/extension/TestWatcherTests.java | 2 +- .../jupiter/engine/extension/TimeoutConfigurationTests.java | 2 +- .../jupiter/engine/extension/TimeoutDurationParserTests.java | 2 +- .../junit/jupiter/engine/extension/TimeoutDurationTests.java | 2 +- .../junit/jupiter/engine/extension/TimeoutExtensionTests.java | 2 +- .../junit/jupiter/engine/extension/TimeoutInvocationTests.java | 2 +- .../jupiter/engine/extension/sub/AlwaysDisabledCondition.java | 2 +- .../engine/extension/sub/AnotherAlwaysDisabledCondition.java | 2 +- .../jupiter/engine/extension/sub/SystemPropertyCondition.java | 2 +- .../OpenTest4JAndJUnit4AwareThrowableCollectorTests.java | 2 +- .../org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt | 2 +- .../test/kotlin/org/junit/jupiter/api/KotlinAssertionsTests.kt | 2 +- .../kotlin/org/junit/jupiter/api/KotlinFailAssertionsTests.kt | 2 +- .../jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt | 2 +- .../jupiter/engine/kotlin/InstancePerClassKotlinTestCase.kt | 2 +- .../jupiter/engine/kotlin/InstancePerMethodKotlinTestCase.kt | 2 +- .../jupiter/migrationsupport/EnableJUnit4MigrationSupport.java | 2 +- .../jupiter/migrationsupport/conditions/IgnoreCondition.java | 2 +- .../migrationsupport/rules/EnableRuleMigrationSupport.java | 2 +- .../migrationsupport/rules/ExpectedExceptionSupport.java | 2 +- .../jupiter/migrationsupport/rules/ExternalResourceSupport.java | 2 +- .../junit/jupiter/migrationsupport/rules/TestRuleSupport.java | 2 +- .../junit/jupiter/migrationsupport/rules/VerifierSupport.java | 2 +- .../migrationsupport/rules/adapter/AbstractTestRuleAdapter.java | 2 +- .../rules/adapter/ExpectedExceptionAdapter.java | 2 +- .../migrationsupport/rules/adapter/ExternalResourceAdapter.java | 2 +- .../rules/adapter/GenericBeforeAndAfterAdvice.java | 2 +- .../jupiter/migrationsupport/rules/adapter/VerifierAdapter.java | 2 +- .../rules/member/AbstractTestRuleAnnotatedMember.java | 2 +- .../migrationsupport/rules/member/TestRuleAnnotatedField.java | 2 +- .../migrationsupport/rules/member/TestRuleAnnotatedMember.java | 2 +- .../migrationsupport/rules/member/TestRuleAnnotatedMethod.java | 2 +- .../module/org.junit.jupiter.migrationsupport/module-info.java | 2 +- .../migrationsupport/JupiterMigrationSupportTestSuite.java | 2 +- .../conditions/IgnoreAnnotationIntegrationTests.java | 2 +- .../migrationsupport/conditions/IgnoreConditionTests.java | 2 +- .../migrationsupport/rules/AbstractTestRuleAdapterTests.java | 2 +- .../rules/EnableRuleMigrationSupportWithBothRuleTypesTests.java | 2 +- .../migrationsupport/rules/ExpectedExceptionSupportTests.java | 2 +- ...esourceSupportForDifferentDeclaredReturnTypesRulesTests.java | 2 +- ...ExternalResourceSupportForMixedMethodAndFieldRulesTests.java | 2 +- .../ExternalResourceSupportForMultipleFieldRulesTests.java | 2 +- .../ExternalResourceSupportForMultipleMethodRulesTests.java | 2 +- .../ExternalResourceSupportForTemporaryFolderFieldTests.java | 2 +- .../rules/ExternalResourceSupportWithInheritanceTests.java | 2 +- .../rules/ExternalResourceWithoutAdapterTests.java | 2 +- .../jupiter/migrationsupport/rules/FailAfterAllHelper.java | 2 +- .../rules/LauncherBasedEnableRuleMigrationSupportTests.java | 2 +- .../rules/VerifierSupportForMixedMethodAndFieldRulesTests.java | 2 +- .../rules/WrongExtendWithForVerifierFieldTests.java | 2 +- .../rules/WrongExtendWithForVerifierMethodTests.java | 2 +- .../main/java/org/junit/jupiter/params/ParameterizedTest.java | 2 +- .../org/junit/jupiter/params/ParameterizedTestExtension.java | 2 +- .../jupiter/params/ParameterizedTestInvocationContext.java | 2 +- .../junit/jupiter/params/ParameterizedTestMethodContext.java | 2 +- .../junit/jupiter/params/ParameterizedTestNameFormatter.java | 2 +- .../jupiter/params/ParameterizedTestParameterResolver.java | 2 +- .../java/org/junit/jupiter/params/aggregator/AggregateWith.java | 2 +- .../jupiter/params/aggregator/ArgumentAccessException.java | 2 +- .../org/junit/jupiter/params/aggregator/ArgumentsAccessor.java | 2 +- .../params/aggregator/ArgumentsAggregationException.java | 2 +- .../junit/jupiter/params/aggregator/ArgumentsAggregator.java | 2 +- .../jupiter/params/aggregator/DefaultArgumentsAccessor.java | 2 +- .../jupiter/params/converter/ArgumentConversionException.java | 2 +- .../org/junit/jupiter/params/converter/ArgumentConverter.java | 2 +- .../java/org/junit/jupiter/params/converter/ConvertWith.java | 2 +- .../jupiter/params/converter/DefaultArgumentConverter.java | 2 +- .../params/converter/FallbackStringToObjectConverter.java | 2 +- .../jupiter/params/converter/JavaTimeArgumentConverter.java | 2 +- .../jupiter/params/converter/JavaTimeConversionPattern.java | 2 +- .../junit/jupiter/params/converter/SimpleArgumentConverter.java | 2 +- .../junit/jupiter/params/converter/TypedArgumentConverter.java | 2 +- .../main/java/org/junit/jupiter/params/provider/Arguments.java | 2 +- .../org/junit/jupiter/params/provider/ArgumentsProvider.java | 2 +- .../java/org/junit/jupiter/params/provider/ArgumentsSource.java | 2 +- .../org/junit/jupiter/params/provider/ArgumentsSources.java | 2 +- .../org/junit/jupiter/params/provider/CsvArgumentsProvider.java | 2 +- .../junit/jupiter/params/provider/CsvFileArgumentsProvider.java | 2 +- .../java/org/junit/jupiter/params/provider/CsvFileSource.java | 2 +- .../org/junit/jupiter/params/provider/CsvParserFactory.java | 2 +- .../org/junit/jupiter/params/provider/CsvParsingException.java | 2 +- .../main/java/org/junit/jupiter/params/provider/CsvSource.java | 2 +- .../junit/jupiter/params/provider/EmptyArgumentsProvider.java | 2 +- .../java/org/junit/jupiter/params/provider/EmptySource.java | 2 +- .../junit/jupiter/params/provider/EnumArgumentsProvider.java | 2 +- .../main/java/org/junit/jupiter/params/provider/EnumSource.java | 2 +- .../junit/jupiter/params/provider/MethodArgumentsProvider.java | 2 +- .../java/org/junit/jupiter/params/provider/MethodSource.java | 2 +- .../org/junit/jupiter/params/provider/NullAndEmptySource.java | 2 +- .../junit/jupiter/params/provider/NullArgumentsProvider.java | 2 +- .../main/java/org/junit/jupiter/params/provider/NullEnum.java | 2 +- .../main/java/org/junit/jupiter/params/provider/NullSource.java | 2 +- .../junit/jupiter/params/provider/ValueArgumentsProvider.java | 2 +- .../java/org/junit/jupiter/params/provider/ValueSource.java | 2 +- .../org/junit/jupiter/params/support/AnnotationConsumer.java | 2 +- .../jupiter/params/support/AnnotationConsumerInitializer.java | 2 +- .../org/junit/jupiter/params/aggregator/ArgumentsAccessor.kt | 2 +- .../src/module/org.junit.jupiter.params/module-info.java | 2 +- .../junit/jupiter/params/ParameterizedTestExtensionTests.java | 2 +- .../junit/jupiter/params/ParameterizedTestIntegrationTests.java | 2 +- .../jupiter/params/ParameterizedTestMethodContextTests.java | 2 +- .../jupiter/params/ParameterizedTestNameFormatterTests.java | 2 +- .../java/org/junit/jupiter/params/ParameterizedTestSuite.java | 2 +- .../jupiter/params/aggregator/AggregatorIntegrationTests.java | 2 +- .../params/aggregator/DefaultArgumentsAccessorTests.java | 2 +- .../jupiter/params/converter/DefaultArgumentConverterTests.java | 2 +- .../params/converter/FallbackStringToObjectConverterTests.java | 2 +- .../params/converter/JavaTimeArgumentConverterTests.java | 2 +- .../jupiter/params/converter/TypedArgumentConverterTest.java | 2 +- .../java/org/junit/jupiter/params/provider/ArgumentsTests.java | 2 +- .../jupiter/params/provider/CsvArgumentsProviderTests.java | 2 +- .../jupiter/params/provider/CsvFileArgumentsProviderTests.java | 2 +- .../jupiter/params/provider/EnumArgumentsProviderTests.java | 2 +- .../java/org/junit/jupiter/params/provider/EnumSourceTests.java | 2 +- .../jupiter/params/provider/MethodArgumentsProviderTests.java | 2 +- .../junit/jupiter/params/provider/MockCsvAnnotationBuilder.java | 2 +- .../jupiter/params/provider/ValueArgumentsProviderTests.java | 2 +- .../jupiter/params/aggregator/ArgumentsAccessorKotlinTests.kt | 2 +- .../org/junit/jupiter/params/aggregator/DisplayNameTests.kt | 2 +- junit-jupiter/src/module/org.junit.jupiter/module-info.java | 2 +- .../main/java/org/junit/platform/commons/JUnitException.java | 2 +- .../junit/platform/commons/PreconditionViolationException.java | 2 +- .../java/org/junit/platform/commons/annotation/Testable.java | 2 +- .../src/main/java/org/junit/platform/commons/function/Try.java | 2 +- .../org/junit/platform/commons/logging/LogRecordListener.java | 2 +- .../main/java/org/junit/platform/commons/logging/Logger.java | 2 +- .../java/org/junit/platform/commons/logging/LoggerFactory.java | 2 +- .../org/junit/platform/commons/support/AnnotationSupport.java | 2 +- .../java/org/junit/platform/commons/support/ClassSupport.java | 2 +- .../junit/platform/commons/support/HierarchyTraversalMode.java | 2 +- .../org/junit/platform/commons/support/ModifierSupport.java | 2 +- .../org/junit/platform/commons/support/ReflectionSupport.java | 2 +- .../java/org/junit/platform/commons/util/AnnotationUtils.java | 2 +- .../org/junit/platform/commons/util/BlacklistedExceptions.java | 2 +- .../java/org/junit/platform/commons/util/ClassFileVisitor.java | 2 +- .../main/java/org/junit/platform/commons/util/ClassFilter.java | 2 +- .../java/org/junit/platform/commons/util/ClassLoaderUtils.java | 2 +- .../platform/commons/util/ClassNamePatternFilterUtils.java | 2 +- .../main/java/org/junit/platform/commons/util/ClassUtils.java | 2 +- .../java/org/junit/platform/commons/util/ClasspathScanner.java | 2 +- .../java/org/junit/platform/commons/util/CloseablePath.java | 2 +- .../java/org/junit/platform/commons/util/CollectionUtils.java | 2 +- .../java/org/junit/platform/commons/util/ExceptionUtils.java | 2 +- .../java/org/junit/platform/commons/util/FunctionUtils.java | 2 +- .../src/main/java/org/junit/platform/commons/util/LruCache.java | 2 +- .../main/java/org/junit/platform/commons/util/ModuleUtils.java | 2 +- .../main/java/org/junit/platform/commons/util/PackageUtils.java | 2 +- .../platform/commons/util/PreconditionViolationException.java | 2 +- .../java/org/junit/platform/commons/util/Preconditions.java | 2 +- .../java/org/junit/platform/commons/util/ReflectionUtils.java | 2 +- .../main/java/org/junit/platform/commons/util/RuntimeUtils.java | 2 +- .../main/java/org/junit/platform/commons/util/StringUtils.java | 2 +- .../java/org/junit/platform/commons/util/ToStringBuilder.java | 2 +- .../junit/platform/commons/util/UnrecoverableExceptions.java | 2 +- .../main/java9/org/junit/platform/commons/util/ModuleUtils.java | 2 +- .../src/module/org.junit.platform.commons/module-info.java | 2 +- .../main/java/org/junit/platform/console/ConsoleLauncher.java | 2 +- .../junit/platform/console/ConsoleLauncherExecutionResult.java | 2 +- .../org/junit/platform/console/options/AvailableOptions.java | 2 +- .../org/junit/platform/console/options/CommandLineOptions.java | 2 +- .../platform/console/options/CommandLineOptionsParser.java | 2 +- .../main/java/org/junit/platform/console/options/Details.java | 2 +- .../console/options/PicocliCommandLineOptionsParser.java | 2 +- .../src/main/java/org/junit/platform/console/options/Theme.java | 2 +- .../src/main/java/org/junit/platform/console/tasks/Color.java | 2 +- .../org/junit/platform/console/tasks/ConsoleTestExecutor.java | 2 +- .../console/tasks/CustomContextClassLoaderExecutor.java | 2 +- .../junit/platform/console/tasks/DiscoveryRequestCreator.java | 2 +- .../org/junit/platform/console/tasks/FlatPrintingListener.java | 2 +- .../main/java/org/junit/platform/console/tasks/TreeNode.java | 2 +- .../main/java/org/junit/platform/console/tasks/TreePrinter.java | 2 +- .../org/junit/platform/console/tasks/TreePrintingListener.java | 2 +- .../platform/console/tasks/VerboseTreePrintingListener.java | 2 +- .../org/junit/platform/console/ConsoleLauncherToolProvider.java | 2 +- .../src/module/org.junit.platform.console/module-info.java | 2 +- .../main/java/org/junit/platform/engine/CompositeFilter.java | 2 +- .../java/org/junit/platform/engine/ConfigurationParameters.java | 2 +- .../main/java/org/junit/platform/engine/DiscoveryFilter.java | 2 +- .../main/java/org/junit/platform/engine/DiscoverySelector.java | 2 +- .../java/org/junit/platform/engine/EngineDiscoveryListener.java | 2 +- .../java/org/junit/platform/engine/EngineDiscoveryRequest.java | 2 +- .../java/org/junit/platform/engine/EngineExecutionListener.java | 2 +- .../main/java/org/junit/platform/engine/ExecutionRequest.java | 2 +- .../src/main/java/org/junit/platform/engine/Filter.java | 2 +- .../src/main/java/org/junit/platform/engine/FilterResult.java | 2 +- .../org/junit/platform/engine/SelectorResolutionResult.java | 2 +- .../src/main/java/org/junit/platform/engine/TestDescriptor.java | 2 +- .../src/main/java/org/junit/platform/engine/TestEngine.java | 2 +- .../java/org/junit/platform/engine/TestExecutionResult.java | 2 +- .../src/main/java/org/junit/platform/engine/TestSource.java | 2 +- .../src/main/java/org/junit/platform/engine/TestTag.java | 2 +- .../src/main/java/org/junit/platform/engine/UniqueId.java | 2 +- .../src/main/java/org/junit/platform/engine/UniqueIdFormat.java | 2 +- .../platform/engine/discovery/AbstractClassNameFilter.java | 2 +- .../org/junit/platform/engine/discovery/ClassNameFilter.java | 2 +- .../java/org/junit/platform/engine/discovery/ClassSelector.java | 2 +- .../platform/engine/discovery/ClasspathResourceSelector.java | 2 +- .../junit/platform/engine/discovery/ClasspathRootSelector.java | 2 +- .../org/junit/platform/engine/discovery/DirectorySelector.java | 2 +- .../org/junit/platform/engine/discovery/DiscoverySelectors.java | 2 +- .../junit/platform/engine/discovery/ExcludeClassNameFilter.java | 2 +- .../platform/engine/discovery/ExcludePackageNameFilter.java | 2 +- .../java/org/junit/platform/engine/discovery/FilePosition.java | 2 +- .../java/org/junit/platform/engine/discovery/FileSelector.java | 2 +- .../junit/platform/engine/discovery/IncludeClassNameFilter.java | 2 +- .../platform/engine/discovery/IncludePackageNameFilter.java | 2 +- .../org/junit/platform/engine/discovery/MethodSelector.java | 2 +- .../org/junit/platform/engine/discovery/ModuleSelector.java | 2 +- .../junit/platform/engine/discovery/NestedClassSelector.java | 2 +- .../junit/platform/engine/discovery/NestedMethodSelector.java | 2 +- .../org/junit/platform/engine/discovery/PackageNameFilter.java | 2 +- .../org/junit/platform/engine/discovery/PackageSelector.java | 2 +- .../org/junit/platform/engine/discovery/UniqueIdSelector.java | 2 +- .../java/org/junit/platform/engine/discovery/UriSelector.java | 2 +- .../java/org/junit/platform/engine/reporting/ReportEntry.java | 2 +- .../engine/support/config/PrefixedConfigurationParameters.java | 2 +- .../engine/support/descriptor/AbstractTestDescriptor.java | 2 +- .../junit/platform/engine/support/descriptor/ClassSource.java | 2 +- .../engine/support/descriptor/ClasspathResourceSource.java | 2 +- .../platform/engine/support/descriptor/CompositeTestSource.java | 2 +- .../platform/engine/support/descriptor/DefaultUriSource.java | 2 +- .../platform/engine/support/descriptor/DirectorySource.java | 2 +- .../platform/engine/support/descriptor/EngineDescriptor.java | 2 +- .../junit/platform/engine/support/descriptor/FilePosition.java | 2 +- .../junit/platform/engine/support/descriptor/FileSource.java | 2 +- .../platform/engine/support/descriptor/FileSystemSource.java | 2 +- .../junit/platform/engine/support/descriptor/MethodSource.java | 2 +- .../junit/platform/engine/support/descriptor/PackageSource.java | 2 +- .../junit/platform/engine/support/descriptor/ResourceUtils.java | 2 +- .../org/junit/platform/engine/support/descriptor/UriSource.java | 2 +- .../support/discovery/ClassContainerSelectorResolver.java | 2 +- .../support/discovery/EngineDiscoveryRequestResolution.java | 2 +- .../support/discovery/EngineDiscoveryRequestResolver.java | 2 +- .../platform/engine/support/discovery/SelectorResolver.java | 2 +- .../engine/support/filter/ClasspathScanningSupport.java | 2 +- .../platform/engine/support/hierarchical/CompositeLock.java | 2 +- .../hierarchical/DefaultParallelExecutionConfiguration.java | 2 +- .../DefaultParallelExecutionConfigurationStrategy.java | 2 +- .../engine/support/hierarchical/EngineExecutionContext.java | 2 +- .../platform/engine/support/hierarchical/ExclusiveResource.java | 2 +- .../ForkJoinPoolHierarchicalTestExecutorService.java | 2 +- .../engine/support/hierarchical/HierarchicalTestEngine.java | 2 +- .../engine/support/hierarchical/HierarchicalTestExecutor.java | 2 +- .../support/hierarchical/HierarchicalTestExecutorService.java | 2 +- .../junit/platform/engine/support/hierarchical/LockManager.java | 2 +- .../org/junit/platform/engine/support/hierarchical/Node.java | 2 +- .../engine/support/hierarchical/NodeExecutionAdvisor.java | 2 +- .../platform/engine/support/hierarchical/NodeTestTask.java | 2 +- .../engine/support/hierarchical/NodeTestTaskContext.java | 2 +- .../platform/engine/support/hierarchical/NodeTreeWalker.java | 2 +- .../junit/platform/engine/support/hierarchical/NodeUtils.java | 2 +- .../org/junit/platform/engine/support/hierarchical/NopLock.java | 2 +- .../support/hierarchical/OpenTest4JAwareThrowableCollector.java | 2 +- .../support/hierarchical/ParallelExecutionConfiguration.java | 2 +- .../hierarchical/ParallelExecutionConfigurationStrategy.java | 2 +- .../platform/engine/support/hierarchical/ResourceLock.java | 2 +- .../hierarchical/SameThreadHierarchicalTestExecutorService.java | 2 +- .../junit/platform/engine/support/hierarchical/SingleLock.java | 2 +- .../engine/support/hierarchical/SingleTestExecutor.java | 2 +- .../engine/support/hierarchical/ThrowableCollector.java | 2 +- .../src/module/org.junit.platform.engine/module-info.java | 2 +- .../engine/support/hierarchical/DemoEngineExecutionContext.java | 2 +- .../hierarchical/DemoHierarchicalContainerDescriptor.java | 2 +- .../support/hierarchical/DemoHierarchicalEngineDescriptor.java | 2 +- .../support/hierarchical/DemoHierarchicalTestDescriptor.java | 2 +- .../engine/support/hierarchical/DemoHierarchicalTestEngine.java | 2 +- .../java/org/junit/platform/fakes/TestDescriptorStub.java | 2 +- .../java/org/junit/platform/fakes/TestEngineSpy.java | 2 +- .../java/org/junit/platform/fakes/TestEngineStub.java | 2 +- .../junit/platform/jfr/FlightRecordingDiscoveryListener.java | 2 +- .../junit/platform/jfr/FlightRecordingExecutionListener.java | 2 +- .../src/main/java/org/junit/platform/jfr/UniqueId.java | 2 +- .../src/module/org.junit.platform.jfr/module-info.java | 2 +- .../java/org/junit/platform/launcher/EngineDiscoveryResult.java | 2 +- .../src/main/java/org/junit/platform/launcher/EngineFilter.java | 2 +- .../src/main/java/org/junit/platform/launcher/Launcher.java | 2 +- .../java/org/junit/platform/launcher/LauncherConstants.java | 2 +- .../org/junit/platform/launcher/LauncherDiscoveryListener.java | 2 +- .../org/junit/platform/launcher/LauncherDiscoveryRequest.java | 2 +- .../main/java/org/junit/platform/launcher/LauncherSession.java | 2 +- .../org/junit/platform/launcher/LauncherSessionListener.java | 2 +- .../java/org/junit/platform/launcher/PostDiscoveryFilter.java | 2 +- .../src/main/java/org/junit/platform/launcher/TagFilter.java | 2 +- .../java/org/junit/platform/launcher/TestExecutionListener.java | 2 +- .../main/java/org/junit/platform/launcher/TestIdentifier.java | 2 +- .../src/main/java/org/junit/platform/launcher/TestPlan.java | 2 +- .../platform/launcher/core/CompositeTestExecutionListener.java | 2 +- .../junit/platform/launcher/core/DefaultDiscoveryRequest.java | 2 +- .../java/org/junit/platform/launcher/core/DefaultLauncher.java | 2 +- .../org/junit/platform/launcher/core/DefaultLauncherConfig.java | 2 +- .../junit/platform/launcher/core/DefaultLauncherSession.java | 2 +- .../launcher/core/DelegatingEngineExecutionListener.java | 2 +- .../platform/launcher/core/EngineDiscoveryErrorDescriptor.java | 2 +- .../platform/launcher/core/EngineDiscoveryOrchestrator.java | 2 +- .../platform/launcher/core/EngineDiscoveryResultValidator.java | 2 +- .../platform/launcher/core/EngineExecutionOrchestrator.java | 2 +- .../org/junit/platform/launcher/core/EngineIdValidator.java | 2 +- .../junit/platform/launcher/core/ExecutionListenerAdapter.java | 2 +- .../java/org/junit/platform/launcher/core/InternalLauncher.java | 2 +- .../java/org/junit/platform/launcher/core/InternalTestPlan.java | 2 +- .../java/org/junit/platform/launcher/core/LauncherConfig.java | 2 +- .../platform/launcher/core/LauncherConfigurationParameters.java | 2 +- .../platform/launcher/core/LauncherDiscoveryRequestBuilder.java | 2 +- .../junit/platform/launcher/core/LauncherDiscoveryResult.java | 2 +- .../java/org/junit/platform/launcher/core/LauncherFactory.java | 2 +- .../java/org/junit/platform/launcher/core/ListenerRegistry.java | 2 +- .../launcher/core/OutcomeDelayingEngineExecutionListener.java | 2 +- .../org/junit/platform/launcher/core/ServiceLoaderRegistry.java | 2 +- .../platform/launcher/core/ServiceLoaderTestEngineRegistry.java | 2 +- .../junit/platform/launcher/core/SessionPerRequestLauncher.java | 2 +- .../launcher/core/StreamInterceptingTestExecutionListener.java | 2 +- .../org/junit/platform/launcher/core/StreamInterceptor.java | 2 +- .../junit/platform/launcher/listeners/LegacyReportingUtils.java | 2 +- .../org/junit/platform/launcher/listeners/LoggingListener.java | 2 +- .../launcher/listeners/MutableTestExecutionSummary.java | 2 +- .../platform/launcher/listeners/SummaryGeneratingListener.java | 2 +- .../junit/platform/launcher/listeners/TestExecutionSummary.java | 2 +- .../discovery/AbortOnFailureLauncherDiscoveryListener.java | 2 +- .../listeners/discovery/CompositeLauncherDiscoveryListener.java | 2 +- .../listeners/discovery/LauncherDiscoveryListeners.java | 2 +- .../listeners/discovery/LoggingLauncherDiscoveryListener.java | 2 +- .../listeners/session/CompositeLauncherSessionListener.java | 2 +- .../launcher/listeners/session/LauncherSessionListeners.java | 2 +- .../org/junit/platform/launcher/tagexpression/DequeStack.java | 2 +- .../org/junit/platform/launcher/tagexpression/Operator.java | 2 +- .../org/junit/platform/launcher/tagexpression/Operators.java | 2 +- .../org/junit/platform/launcher/tagexpression/ParseResult.java | 2 +- .../org/junit/platform/launcher/tagexpression/ParseResults.java | 2 +- .../org/junit/platform/launcher/tagexpression/ParseStatus.java | 2 +- .../java/org/junit/platform/launcher/tagexpression/Parser.java | 2 +- .../org/junit/platform/launcher/tagexpression/ShuntingYard.java | 2 +- .../java/org/junit/platform/launcher/tagexpression/Stack.java | 2 +- .../junit/platform/launcher/tagexpression/TagExpression.java | 2 +- .../junit/platform/launcher/tagexpression/TagExpressions.java | 2 +- .../java/org/junit/platform/launcher/tagexpression/Token.java | 2 +- .../org/junit/platform/launcher/tagexpression/TokenWith.java | 2 +- .../org/junit/platform/launcher/tagexpression/Tokenizer.java | 2 +- .../src/module/org.junit.platform.launcher/module-info.java | 2 +- .../launcher/core/ConfigurationParametersFactoryForTests.java | 2 +- .../launcher/core/LauncherFactoryForTestingPurposesOnly.java | 2 +- .../junit/platform/reporting/legacy/LegacyReportingUtils.java | 2 +- .../reporting/legacy/xml/LegacyXmlReportGeneratingListener.java | 2 +- .../org/junit/platform/reporting/legacy/xml/XmlReportData.java | 2 +- .../junit/platform/reporting/legacy/xml/XmlReportWriter.java | 2 +- .../src/module/org.junit.platform.reporting/module-info.java | 2 +- .../src/main/java/org/junit/platform/runner/JUnitPlatform.java | 2 +- .../org/junit/platform/runner/JUnitPlatformRunnerListener.java | 2 +- .../java/org/junit/platform/runner/JUnitPlatformTestTree.java | 2 +- .../src/module/org.junit.platform.runner/module-info.java | 2 +- .../org/junit/platform/suite/api/ExcludeClassNamePatterns.java | 2 +- .../main/java/org/junit/platform/suite/api/ExcludeEngines.java | 2 +- .../main/java/org/junit/platform/suite/api/ExcludePackages.java | 2 +- .../src/main/java/org/junit/platform/suite/api/ExcludeTags.java | 2 +- .../org/junit/platform/suite/api/IncludeClassNamePatterns.java | 2 +- .../main/java/org/junit/platform/suite/api/IncludeEngines.java | 2 +- .../main/java/org/junit/platform/suite/api/IncludePackages.java | 2 +- .../src/main/java/org/junit/platform/suite/api/IncludeTags.java | 2 +- .../main/java/org/junit/platform/suite/api/SelectClasses.java | 2 +- .../main/java/org/junit/platform/suite/api/SelectPackages.java | 2 +- .../java/org/junit/platform/suite/api/SuiteDisplayName.java | 2 +- .../java/org/junit/platform/suite/api/UseTechnicalNames.java | 2 +- .../src/module/org.junit.platform.suite.api/module-info.java | 2 +- .../main/java/org/junit/platform/testkit/engine/Assertions.java | 2 +- .../junit/platform/testkit/engine/EngineExecutionResults.java | 2 +- .../java/org/junit/platform/testkit/engine/EngineTestKit.java | 2 +- .../src/main/java/org/junit/platform/testkit/engine/Event.java | 2 +- .../java/org/junit/platform/testkit/engine/EventConditions.java | 2 +- .../java/org/junit/platform/testkit/engine/EventStatistics.java | 2 +- .../main/java/org/junit/platform/testkit/engine/EventType.java | 2 +- .../src/main/java/org/junit/platform/testkit/engine/Events.java | 2 +- .../main/java/org/junit/platform/testkit/engine/Execution.java | 2 +- .../org/junit/platform/testkit/engine/ExecutionRecorder.java | 2 +- .../main/java/org/junit/platform/testkit/engine/Executions.java | 2 +- .../java/org/junit/platform/testkit/engine/TerminationInfo.java | 2 +- .../platform/testkit/engine/TestExecutionResultConditions.java | 2 +- .../src/module/org.junit.platform.testkit/module-info.java | 2 +- .../main/java/org/junit/vintage/engine/JUnit4VersionCheck.java | 2 +- .../main/java/org/junit/vintage/engine/VintageTestEngine.java | 2 +- .../org/junit/vintage/engine/descriptor/DescriptionUtils.java | 2 +- .../main/java/org/junit/vintage/engine/descriptor/OrFilter.java | 2 +- .../org/junit/vintage/engine/descriptor/RunnerDecorator.java | 2 +- .../java/org/junit/vintage/engine/descriptor/RunnerRequest.java | 2 +- .../junit/vintage/engine/descriptor/RunnerTestDescriptor.java | 2 +- .../org/junit/vintage/engine/descriptor/TestSourceProvider.java | 2 +- .../vintage/engine/descriptor/VintageEngineDescriptor.java | 2 +- .../junit/vintage/engine/descriptor/VintageTestDescriptor.java | 2 +- .../junit/vintage/engine/discovery/ClassSelectorResolver.java | 2 +- .../discovery/DefensiveAllDefaultPossibilitiesBuilder.java | 2 +- .../engine/discovery/FilterableIgnoringRunnerDecorator.java | 2 +- .../junit/vintage/engine/discovery/IgnoringRunnerDecorator.java | 2 +- .../vintage/engine/discovery/IsPotentialJUnit4TestClass.java | 2 +- .../vintage/engine/discovery/IsPotentialJUnit4TestMethod.java | 2 +- .../junit/vintage/engine/discovery/MethodSelectorResolver.java | 2 +- .../engine/discovery/RunnerTestDescriptorPostProcessor.java | 2 +- .../java/org/junit/vintage/engine/discovery/UniqueIdFilter.java | 2 +- .../org/junit/vintage/engine/discovery/VintageDiscoverer.java | 2 +- .../main/java/org/junit/vintage/engine/execution/EventType.java | 2 +- .../org/junit/vintage/engine/execution/RunListenerAdapter.java | 2 +- .../java/org/junit/vintage/engine/execution/RunnerExecutor.java | 2 +- .../main/java/org/junit/vintage/engine/execution/TestRun.java | 2 +- .../java/org/junit/vintage/engine/support/UniqueIdReader.java | 2 +- .../org/junit/vintage/engine/support/UniqueIdStringifier.java | 2 +- .../src/module/org.junit.vintage.engine/module-info.java | 2 +- .../java/org/junit/vintage/engine/JUnit4ParameterizedTests.java | 2 +- .../java/org/junit/vintage/engine/JUnit4VersionCheckTests.java | 2 +- .../junit/vintage/engine/VintageLauncherIntegrationTests.java | 2 +- .../org/junit/vintage/engine/VintageTestEngineBasicTests.java | 2 +- .../junit/vintage/engine/VintageTestEngineDiscoveryTests.java | 2 +- .../junit/vintage/engine/VintageTestEngineExecutionTests.java | 2 +- .../org/junit/vintage/engine/VintageTestEngineTestSuite.java | 2 +- .../java/org/junit/vintage/engine/VintageUniqueIdBuilder.java | 2 +- .../junit/vintage/engine/descriptor/DescriptionUtilsTests.java | 2 +- .../java/org/junit/vintage/engine/descriptor/OrFilterTests.java | 2 +- .../vintage/engine/descriptor/TestSourceProviderTests.java | 2 +- .../vintage/engine/descriptor/VintageTestDescriptorTests.java | 2 +- .../engine/discovery/IsPotentialJUnit4TestClassTests.java | 2 +- .../discovery/RunnerTestDescriptorPostProcessorTests.java | 2 +- .../junit/vintage/engine/discovery/VintageDiscovererTests.java | 2 +- .../java/org/junit/vintage/engine/execution/TestRunTests.java | 2 +- .../org/junit/vintage/engine/support/UniqueIdReaderTests.java | 2 +- .../junit/vintage/engine/support/UniqueIdStringifierTests.java | 2 +- .../samples/PlainOldJavaClassWithoutAnyTestsTestCase.java | 2 +- .../vintage/engine/samples/junit3/AbstractJUnit3TestCase.java | 2 +- .../engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java | 2 +- .../JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java | 2 +- .../vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java | 2 +- .../junit3/PlainJUnit3TestCaseWithSingleTestWhichFails.java | 2 +- .../vintage/engine/samples/junit4/AbstractJUnit4TestCase.java | 2 +- .../junit4/AbstractJunit4TestCaseWithConstructorParameter.java | 2 +- .../org/junit/vintage/engine/samples/junit4/Categories.java | 2 +- .../engine/samples/junit4/CompletelyDynamicTestCase.java | 2 +- .../vintage/engine/samples/junit4/ConcreteJUnit4TestCase.java | 2 +- .../junit/vintage/engine/samples/junit4/ConfigurableRunner.java | 2 +- .../org/junit/vintage/engine/samples/junit4/DynamicRunner.java | 2 +- .../vintage/engine/samples/junit4/EmptyIgnoredTestCase.java | 2 +- .../vintage/engine/samples/junit4/EnclosedJUnit4TestCase.java | 2 +- .../vintage/engine/samples/junit4/ExceptionThrowingRunner.java | 2 +- .../vintage/engine/samples/junit4/IgnoredJUnit4TestCase.java | 2 +- .../junit4/IgnoredJUnit4TestCaseWithNotFilterableRunner.java | 2 +- .../engine/samples/junit4/IgnoredParameterizedTestCase.java | 2 +- .../engine/samples/junit4/JUnit4ParameterizedTestCase.java | 2 +- .../junit4/JUnit4SuiteOfSuiteWithFilterableChildRunner.java | 2 +- .../junit4/JUnit4SuiteOfSuiteWithIgnoredJUnit4TestCase.java | 2 +- ...iteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java | 2 +- ...it4SuiteOfSuiteWithJUnit4TestCaseWithErrorInBeforeClass.java | 2 +- .../samples/junit4/JUnit4SuiteWithExceptionThrowingRunner.java | 2 +- .../samples/junit4/JUnit4SuiteWithIgnoredJUnit4TestCase.java | 2 +- .../junit4/JUnit4SuiteWithJUnit3SuiteWithSingleTestCase.java | 2 +- ...iteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java | 2 +- .../JUnit4SuiteWithJUnit4TestCaseWithErrorInBeforeClass.java | 2 +- ...stCaseWithFailingDescriptionThatIsNotReportedAsFinished.java | 2 +- ...it4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java | 2 +- ...uiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java | 2 +- .../engine/samples/junit4/JUnit4SuiteWithTwoTestCases.java | 2 +- .../JUnit4TestCaseWithAssumptionFailureInBeforeClass.java | 2 +- .../JUnit4TestCaseWithDistinguishableOverloadedMethod.java | 2 +- ...JUnit4TestCaseWithErrorCollectorStoringMultipleFailures.java | 2 +- .../samples/junit4/JUnit4TestCaseWithErrorInAfterClass.java | 2 +- .../samples/junit4/JUnit4TestCaseWithErrorInBeforeClass.java | 2 +- .../junit4/JUnit4TestCaseWithExceptionThrowingRunner.java | 2 +- ...stCaseWithFailingDescriptionThatIsNotReportedAsFinished.java | 2 +- .../JUnit4TestCaseWithIndistinguishableOverloadedMethod.java | 2 +- .../samples/junit4/JUnit4TestCaseWithNotFilterableRunner.java | 2 +- ...it4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java | 2 +- ...estCaseWithRunnerWithDuplicateChangingChildDescriptions.java | 2 +- .../vintage/engine/samples/junit4/MalformedJUnit4TestCase.java | 2 +- .../vintage/engine/samples/junit4/NotFilterableRunner.java | 2 +- .../vintage/engine/samples/junit4/ParameterizedTestCase.java | 2 +- .../samples/junit4/PlainJUnit4TestCaseWithFiveTestMethods.java | 2 +- .../samples/junit4/PlainJUnit4TestCaseWithLifecycleMethods.java | 2 +- .../PlainJUnit4TestCaseWithSingleInheritedTestWhichFails.java | 2 +- .../junit4/PlainJUnit4TestCaseWithSingleTestWhichFails.java | 2 +- .../junit4/PlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java | 2 +- .../samples/junit4/PlainJUnit4TestCaseWithTwoTestMethods.java | 2 +- .../engine/samples/junit4/RunnerThatOnlyReportsFailures.java | 2 +- .../junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java | 2 +- .../engine/samples/junit4/SingleFailingTheoryTestCase.java | 2 +- .../samples/junit4/TestCaseRunWithJUnitPlatformRunner.java | 2 +- .../src/jmh/java/org/junit/jupiter/jmh/AssertionBenchmarks.java | 2 +- platform-tests/src/test/java/DefaultPackageTestCase.java | 2 +- .../src/test/java/org/junit/jupiter/api/condition/OSTests.java | 2 +- .../src/test/java/org/junit/jupiter/extensions/Heavyweight.java | 2 +- .../org/junit/jupiter/extensions/HeavyweightAlphaTests.java | 2 +- .../java/org/junit/jupiter/extensions/HeavyweightBetaTests.java | 2 +- .../java/org/junit/platform/AbstractEqualsAndHashCodeTests.java | 2 +- .../test/java/org/junit/platform/JUnitPlatformTestSuite.java | 2 +- .../src/test/java/org/junit/platform/TestEngineTests.java | 2 +- .../platform/commons/annotation/TestableAnnotationTests.java | 2 +- .../test/java/org/junit/platform/commons/function/TryTests.java | 2 +- .../junit/platform/commons/support/AnnotationSupportTests.java | 2 +- .../org/junit/platform/commons/support/ClassSupportTests.java | 2 +- .../junit/platform/commons/support/ModifierSupportTests.java | 2 +- .../junit/platform/commons/support/PreconditionAssertions.java | 2 +- .../junit/platform/commons/support/ReflectionSupportTests.java | 2 +- .../org/junit/platform/commons/util/AnnotationUtilsTests.java | 2 +- .../org/junit/platform/commons/util/ClassLoaderUtilsTests.java | 2 +- .../platform/commons/util/ClassNamePatternFilterUtilsTests.java | 2 +- .../java/org/junit/platform/commons/util/ClassUtilsTests.java | 2 +- .../org/junit/platform/commons/util/ClasspathScannerTests.java | 2 +- .../org/junit/platform/commons/util/CollectionUtilsTests.java | 2 +- .../org/junit/platform/commons/util/ExceptionUtilsTests.java | 2 +- .../org/junit/platform/commons/util/FunctionUtilsTests.java | 2 +- .../java/org/junit/platform/commons/util/LruCacheTests.java | 2 +- .../java/org/junit/platform/commons/util/ModuleUtilsTests.java | 2 +- .../java/org/junit/platform/commons/util/PackageUtilsTests.java | 2 +- .../org/junit/platform/commons/util/PreconditionsTests.java | 2 +- .../org/junit/platform/commons/util/ReflectionUtilsTests.java | 2 +- .../util/ReflectionUtilsWithGenericTypeHierarchiesTests.java | 2 +- .../java/org/junit/platform/commons/util/RuntimeUtilsTests.java | 2 +- .../org/junit/platform/commons/util/SerializationUtils.java | 2 +- .../java/org/junit/platform/commons/util/StringUtilsTests.java | 2 +- .../org/junit/platform/commons/util/ToStringBuilderTests.java | 2 +- .../platform/commons/util/classes/AExecutionConditionClass.java | 2 +- .../commons/util/classes/ATestExecutionListenerClass.java | 2 +- .../org/junit/platform/commons/util/classes/AVanillaEmpty.java | 2 +- .../platform/commons/util/classes/BExecutionConditionClass.java | 2 +- .../commons/util/classes/BTestExecutionListenerClass.java | 2 +- .../org/junit/platform/commons/util/classes/BVanillaEmpty.java | 2 +- .../java/org/junit/platform/console/ConsoleDetailsTests.java | 2 +- .../platform/console/ConsoleLauncherExecutionResultTests.java | 2 +- .../junit/platform/console/ConsoleLauncherIntegrationTests.java | 2 +- .../java/org/junit/platform/console/ConsoleLauncherTests.java | 2 +- .../java/org/junit/platform/console/ConsoleLauncherWrapper.java | 2 +- .../junit/platform/console/ConsoleLauncherWrapperResult.java | 2 +- .../console/options/PicocliCommandLineOptionsParserTests.java | 2 +- .../java/org/junit/platform/console/options/ThemeTests.java | 2 +- .../platform/console/subpackage/ContainerForInnerTest.java | 2 +- .../platform/console/subpackage/ContainerForInnerTests.java | 2 +- .../console/subpackage/ContainerForStaticNestedTest.java | 2 +- .../console/subpackage/ContainerForStaticNestedTests.java | 2 +- .../java/org/junit/platform/console/subpackage/SecondTest.java | 2 +- .../test/java/org/junit/platform/console/subpackage/Test.java | 2 +- .../test/java/org/junit/platform/console/subpackage/Test1.java | 2 +- .../test/java/org/junit/platform/console/subpackage/Tests.java | 2 +- .../java/org/junit/platform/console/subpackage/ThirdTests.java | 2 +- .../junit/platform/console/tasks/ConsoleTestExecutorTests.java | 2 +- .../console/tasks/CustomContextClassLoaderExecutorTests.java | 2 +- .../platform/console/tasks/DiscoveryRequestCreatorTests.java | 2 +- .../junit/platform/console/tasks/FlatPrintingListenerTests.java | 2 +- .../java/org/junit/platform/console/tasks/TreeNodeTests.java | 2 +- .../java/org/junit/platform/console/tasks/TreePrinterTests.java | 2 +- .../junit/platform/console/tasks/VerboseTreeListenerTests.java | 2 +- .../java/org/junit/platform/engine/FilterCompositionTests.java | 2 +- .../java/org/junit/platform/engine/TestDescriptorTests.java | 2 +- .../src/test/java/org/junit/platform/engine/TestTagTests.java | 2 +- .../java/org/junit/platform/engine/UniqueIdFormatTests.java | 2 +- .../src/test/java/org/junit/platform/engine/UniqueIdTests.java | 2 +- .../junit/platform/engine/discovery/ClassNameFilterTests.java | 2 +- .../org/junit/platform/engine/discovery/ClassSelectorTests.java | 2 +- .../engine/discovery/ClasspathResourceSelectorTests.java | 2 +- .../platform/engine/discovery/ClasspathRootSelectorTests.java | 2 +- .../junit/platform/engine/discovery/DirectorySelectorTests.java | 2 +- .../platform/engine/discovery/DiscoverySelectorsTests.java | 2 +- .../org/junit/platform/engine/discovery/FilePositionTests.java | 2 +- .../org/junit/platform/engine/discovery/FileSelectorTests.java | 2 +- .../junit/platform/engine/discovery/MethodSelectorTests.java | 2 +- .../junit/platform/engine/discovery/ModuleSelectorTests.java | 2 +- .../platform/engine/discovery/NestedClassSelectorTests.java | 2 +- .../platform/engine/discovery/NestedMethodSelectorTests.java | 2 +- .../junit/platform/engine/discovery/PackageNameFilterTests.java | 2 +- .../junit/platform/engine/discovery/PackageSelectorTests.java | 2 +- .../junit/platform/engine/discovery/UniqueIdSelectorTests.java | 2 +- .../org/junit/platform/engine/discovery/UriSelectorTests.java | 2 +- .../support/config/PrefixedConfigurationParametersTests.java | 2 +- .../engine/support/descriptor/AbstractTestDescriptorTests.java | 2 +- .../engine/support/descriptor/AbstractTestSourceTests.java | 2 +- .../platform/engine/support/descriptor/ClassSourceTests.java | 2 +- .../engine/support/descriptor/ClasspathResourceSourceTests.java | 2 +- .../engine/support/descriptor/CompositeTestSourceTests.java | 2 +- .../engine/support/descriptor/DefaultUriSourceTests.java | 2 +- .../engine/support/descriptor/DemoClassTestDescriptor.java | 2 +- .../engine/support/descriptor/DemoMethodTestDescriptor.java | 2 +- .../platform/engine/support/descriptor/FilePositionTests.java | 2 +- .../engine/support/descriptor/FileSystemSourceTests.java | 2 +- .../platform/engine/support/descriptor/MethodSourceTests.java | 2 +- .../platform/engine/support/descriptor/PackageSourceTests.java | 2 +- .../engine/support/hierarchical/CompositeLockTests.java | 2 +- .../DefaultParallelExecutionConfigurationStrategyTests.java | 2 +- .../support/hierarchical/HierarchicalTestExecutorTests.java | 2 +- .../platform/engine/support/hierarchical/LockManagerTests.java | 2 +- .../platform/engine/support/hierarchical/MemoryLeakTests.java | 2 +- .../support/hierarchical/NodeTreeWalkerIntegrationTests.java | 2 +- .../support/hierarchical/ParallelExecutionIntegrationTests.java | 2 +- .../engine/support/hierarchical/ResourceLockSupport.java | 2 +- .../hierarchical/SameThreadExecutionIntegrationTests.java | 2 +- .../platform/engine/support/hierarchical/SingleLockTests.java | 2 +- .../engine/support/hierarchical/SingleTestExecutorTests.java | 2 +- .../engine/support/hierarchical/ThrowableCollectorTests.java | 2 +- .../jfr/FlightRecordingDiscoveryListenerIntegrationTests.java | 2 +- .../jfr/FlightRecordingExecutionListenerIntegrationTests.java | 2 +- .../java/org/junit/platform/launcher/DiscoveryFilterStub.java | 2 +- .../src/test/java/org/junit/platform/launcher/FilterStub.java | 2 +- .../org/junit/platform/launcher/PostDiscoveryFilterStub.java | 2 +- .../test/java/org/junit/platform/launcher/TagFilterTests.java | 2 +- .../java/org/junit/platform/launcher/TagIntegrationTests.java | 2 +- .../java/org/junit/platform/launcher/TestIdentifierTests.java | 2 +- .../junit/platform/launcher/TestLauncherDiscoveryListener.java | 2 +- .../junit/platform/launcher/TestLauncherSessionListener.java | 2 +- .../test/java/org/junit/platform/launcher/TestPlanTests.java | 2 +- .../org/junit/platform/launcher/TestPostDiscoveryTagFilter.java | 2 +- .../launcher/core/CompositeTestExecutionListenerTests.java | 2 +- .../org/junit/platform/launcher/core/DefaultLauncherTests.java | 2 +- .../launcher/core/EngineDiscoveryResultValidatorTests.java | 2 +- .../platform/launcher/core/ExecutionListenerAdapterTests.java | 2 +- .../org/junit/platform/launcher/core/LauncherConfigTests.java | 2 +- .../launcher/core/LauncherConfigurationParametersTests.java | 2 +- .../launcher/core/LauncherDiscoveryRequestBuilderTests.java | 2 +- .../org/junit/platform/launcher/core/LauncherFactoryTests.java | 2 +- .../org/junit/platform/launcher/core/LauncherSessionTests.java | 2 +- .../org/junit/platform/launcher/core/ListenerRegistryTests.java | 2 +- ...StreamInterceptingTestExecutionListenerIntegrationTests.java | 2 +- .../junit/platform/launcher/core/StreamInterceptorTests.java | 2 +- .../launcher/listeners/AnotherUnusedTestExecutionListener.java | 2 +- .../platform/launcher/listeners/NoopTestExecutionListener.java | 2 +- .../platform/launcher/listeners/SummaryGenerationTests.java | 2 +- .../launcher/listeners/UnusedTestExecutionListener.java | 2 +- .../discovery/AbortOnFailureLauncherDiscoveryListenerTests.java | 2 +- .../discovery/AbstractLauncherDiscoveryListenerTests.java | 2 +- .../discovery/LoggingLauncherDiscoveryListenerTests.java | 2 +- .../junit/platform/launcher/tagexpression/ParserErrorTests.java | 2 +- .../org/junit/platform/launcher/tagexpression/ParserTests.java | 2 +- .../platform/launcher/tagexpression/TagExpressionsTests.java | 2 +- .../org/junit/platform/launcher/tagexpression/TokenTests.java | 2 +- .../junit/platform/launcher/tagexpression/TokenizerTests.java | 2 +- .../platform/reporting/legacy/LegacyReportingUtilsTests.java | 2 +- .../junit/platform/reporting/legacy/xml/IncrementingClock.java | 2 +- .../legacy/xml/LegacyXmlReportGeneratingListenerTests.java | 2 +- .../platform/reporting/legacy/xml/XmlReportAssertions.java | 2 +- .../junit/platform/reporting/legacy/xml/XmlReportDataTests.java | 2 +- .../platform/reporting/legacy/xml/XmlReportWriterTests.java | 2 +- .../org/junit/platform/runner/JUnitPlatformRunnerTests.java | 2 +- .../org/junit/platform/testkit/engine/EngineTestKitTests.java | 2 +- .../java/org/junit/platform/testkit/engine/EventsTests.java | 2 +- .../platform/testkit/engine/ExecutionsIntegrationTests.java | 2 +- .../testkit/engine/NestedContainerEventConditionTests.java | 2 +- .../src/main/java/com/example/project/Calculator.java | 2 +- .../src/test/java/com/example/project/CalculatorTests.java | 2 +- .../test/kotlin/com/example/project/ExtensionFunctionsTests.kt | 2 +- .../projects/gradle-missing-engine/src/test/java/FooTests.java | 2 +- .../src/main/java/com/example/project/Calculator.java | 2 +- .../src/test/java/com/example/project/CalculatorTests.java | 2 +- .../src/main/java/com/example/project/Calculator.java | 2 +- .../src/test/java/com/example/project/CalculatorTests.java | 2 +- .../java/integration/integration/JupiterIntegrationTests.java | 2 +- .../src/test/java/integration/integration/ModuleUtilsTests.java | 2 +- .../projects/standalone/src/standalone/JupiterIntegration.java | 2 +- .../standalone/src/standalone/JupiterParamsIntegration.java | 2 +- .../projects/standalone/src/standalone/VintageIntegration.java | 2 +- .../src/main/java/platform/tooling/support/Helper.java | 2 +- .../src/main/java/platform/tooling/support/Request.java | 2 +- .../src/test/java/platform/tooling/support/HelperTests.java | 2 +- .../java/platform/tooling/support/tests/AntStarterTests.java | 2 +- .../test/java/platform/tooling/support/tests/ArchUnitTests.java | 2 +- .../tooling/support/tests/GradleKotlinExtensionsTests.java | 2 +- .../tooling/support/tests/GradleMissingEngineTests.java | 2 +- .../platform/tooling/support/tests/GradleModuleFileTests.java | 2 +- .../java/platform/tooling/support/tests/GradleStarterTests.java | 2 +- .../tooling/support/tests/JarContainsManifestFirstTests.java | 2 +- .../platform/tooling/support/tests/JarDescribeModuleTests.java | 2 +- .../java/platform/tooling/support/tests/JavaVersionsTests.java | 2 +- .../java/platform/tooling/support/tests/JavacModulesTests.java | 2 +- .../test/java/platform/tooling/support/tests/ManifestTests.java | 2 +- .../java/platform/tooling/support/tests/MavenPomFileTests.java | 2 +- .../java/platform/tooling/support/tests/MavenStarterTests.java | 2 +- .../platform/tooling/support/tests/ModularUserGuideTests.java | 2 +- .../platform/tooling/support/tests/MultiReleaseJarTests.java | 2 +- .../tooling/support/tests/PackageCyclesDetectionTests.java | 2 +- .../java/platform/tooling/support/tests/StandaloneTests.java | 2 +- .../java/platform/tooling/support/tests/ToolProviderTests.java | 2 +- .../tooling/support/tests/VintageGradleIntegrationTests.java | 2 +- .../tooling/support/tests/VintageMavenIntegrationTests.java | 2 +- src/spotless/eclipse-public-license-2.0.java | 2 +- 1129 files changed, 1129 insertions(+), 1129 deletions(-) diff --git a/documentation/src/main/java/example/domain/Person.java b/documentation/src/main/java/example/domain/Person.java index f34c00d1b1f6..5a75f7127483 100644 --- a/documentation/src/main/java/example/domain/Person.java +++ b/documentation/src/main/java/example/domain/Person.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/main/java/example/registration/WebClient.java b/documentation/src/main/java/example/registration/WebClient.java index 26088b910f47..c6c3fac7516a 100644 --- a/documentation/src/main/java/example/registration/WebClient.java +++ b/documentation/src/main/java/example/registration/WebClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/main/java/example/registration/WebResponse.java b/documentation/src/main/java/example/registration/WebResponse.java index 0cd2fb438f20..5d396e05bd22 100644 --- a/documentation/src/main/java/example/registration/WebResponse.java +++ b/documentation/src/main/java/example/registration/WebResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/main/java/example/registration/WebServerExtension.java b/documentation/src/main/java/example/registration/WebServerExtension.java index ed9a0c5b7e80..6a0e5021323a 100644 --- a/documentation/src/main/java/example/registration/WebServerExtension.java +++ b/documentation/src/main/java/example/registration/WebServerExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/main/java/example/util/Calculator.java b/documentation/src/main/java/example/util/Calculator.java index 8f6cc877d020..55791891d80b 100644 --- a/documentation/src/main/java/example/util/Calculator.java +++ b/documentation/src/main/java/example/util/Calculator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/main/java/example/util/ListWriter.java b/documentation/src/main/java/example/util/ListWriter.java index b2f0e26177d0..fe17e5bf55cc 100644 --- a/documentation/src/main/java/example/util/ListWriter.java +++ b/documentation/src/main/java/example/util/ListWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/main/java/example/util/StringUtils.java b/documentation/src/main/java/example/util/StringUtils.java index e489cd7be79c..4233e00a2fed 100644 --- a/documentation/src/main/java/example/util/StringUtils.java +++ b/documentation/src/main/java/example/util/StringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/AssertionsDemo.java b/documentation/src/test/java/example/AssertionsDemo.java index 22311e974840..670695e3e3fd 100644 --- a/documentation/src/test/java/example/AssertionsDemo.java +++ b/documentation/src/test/java/example/AssertionsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/AssumptionsDemo.java b/documentation/src/test/java/example/AssumptionsDemo.java index 75914749a7bf..6340feca4eab 100644 --- a/documentation/src/test/java/example/AssumptionsDemo.java +++ b/documentation/src/test/java/example/AssumptionsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/ConditionalTestExecutionDemo.java b/documentation/src/test/java/example/ConditionalTestExecutionDemo.java index fcd7a2dcc4be..7e0a7d060c29 100644 --- a/documentation/src/test/java/example/ConditionalTestExecutionDemo.java +++ b/documentation/src/test/java/example/ConditionalTestExecutionDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/CustomTestEngine.java b/documentation/src/test/java/example/CustomTestEngine.java index b12a8e862c49..cd7974280389 100644 --- a/documentation/src/test/java/example/CustomTestEngine.java +++ b/documentation/src/test/java/example/CustomTestEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/DisabledClassDemo.java b/documentation/src/test/java/example/DisabledClassDemo.java index 761547508255..7874a0048771 100644 --- a/documentation/src/test/java/example/DisabledClassDemo.java +++ b/documentation/src/test/java/example/DisabledClassDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/DisabledTestsDemo.java b/documentation/src/test/java/example/DisabledTestsDemo.java index 93e11e251b51..ad60c5afe539 100644 --- a/documentation/src/test/java/example/DisabledTestsDemo.java +++ b/documentation/src/test/java/example/DisabledTestsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/DisplayNameDemo.java b/documentation/src/test/java/example/DisplayNameDemo.java index b30092e8d7d5..fb98cc889244 100644 --- a/documentation/src/test/java/example/DisplayNameDemo.java +++ b/documentation/src/test/java/example/DisplayNameDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/DisplayNameGeneratorDemo.java b/documentation/src/test/java/example/DisplayNameGeneratorDemo.java index a59f4fd3f157..04b77952e0ed 100644 --- a/documentation/src/test/java/example/DisplayNameGeneratorDemo.java +++ b/documentation/src/test/java/example/DisplayNameGeneratorDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/DocumentationTestSuite.java b/documentation/src/test/java/example/DocumentationTestSuite.java index 1b2f9d575883..c068a7d5b41d 100644 --- a/documentation/src/test/java/example/DocumentationTestSuite.java +++ b/documentation/src/test/java/example/DocumentationTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/DynamicTestsDemo.java b/documentation/src/test/java/example/DynamicTestsDemo.java index 8aa063a57dbe..34360741f672 100644 --- a/documentation/src/test/java/example/DynamicTestsDemo.java +++ b/documentation/src/test/java/example/DynamicTestsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/ExampleTestCase.java b/documentation/src/test/java/example/ExampleTestCase.java index e08950b1df9b..8581b92851bf 100644 --- a/documentation/src/test/java/example/ExampleTestCase.java +++ b/documentation/src/test/java/example/ExampleTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/ExternalMethodSourceDemo.java b/documentation/src/test/java/example/ExternalMethodSourceDemo.java index cda486d775de..d12398508a73 100644 --- a/documentation/src/test/java/example/ExternalMethodSourceDemo.java +++ b/documentation/src/test/java/example/ExternalMethodSourceDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/Fast.java b/documentation/src/test/java/example/Fast.java index 911fdb2df0d7..a1045122dbd0 100644 --- a/documentation/src/test/java/example/Fast.java +++ b/documentation/src/test/java/example/Fast.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/FastTest.java b/documentation/src/test/java/example/FastTest.java index f85066f7db29..e596c7519b27 100644 --- a/documentation/src/test/java/example/FastTest.java +++ b/documentation/src/test/java/example/FastTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/HamcrestAssertionsDemo.java b/documentation/src/test/java/example/HamcrestAssertionsDemo.java index 5f9cd857cb81..2bef36f34cc2 100644 --- a/documentation/src/test/java/example/HamcrestAssertionsDemo.java +++ b/documentation/src/test/java/example/HamcrestAssertionsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/IgnoredTestsDemo.java b/documentation/src/test/java/example/IgnoredTestsDemo.java index 6bddc9134c9f..edf05bb2b5c9 100644 --- a/documentation/src/test/java/example/IgnoredTestsDemo.java +++ b/documentation/src/test/java/example/IgnoredTestsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/JUnit4Tests.java b/documentation/src/test/java/example/JUnit4Tests.java index 2caac8b99351..800ce8a46958 100644 --- a/documentation/src/test/java/example/JUnit4Tests.java +++ b/documentation/src/test/java/example/JUnit4Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/JUnitPlatformClassDemo.java b/documentation/src/test/java/example/JUnitPlatformClassDemo.java index 09acf1b0e24d..8dbfaa25d678 100644 --- a/documentation/src/test/java/example/JUnitPlatformClassDemo.java +++ b/documentation/src/test/java/example/JUnitPlatformClassDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/JUnitPlatformSuiteDemo.java b/documentation/src/test/java/example/JUnitPlatformSuiteDemo.java index a5c698558967..5c9a4d0030d0 100644 --- a/documentation/src/test/java/example/JUnitPlatformSuiteDemo.java +++ b/documentation/src/test/java/example/JUnitPlatformSuiteDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/MyFirstJUnitJupiterTests.java b/documentation/src/test/java/example/MyFirstJUnitJupiterTests.java index 6eea9d7210d6..1166849171a6 100644 --- a/documentation/src/test/java/example/MyFirstJUnitJupiterTests.java +++ b/documentation/src/test/java/example/MyFirstJUnitJupiterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/OrderedTestsDemo.java b/documentation/src/test/java/example/OrderedTestsDemo.java index d54ff5b3fc82..2dbbeca1d66e 100644 --- a/documentation/src/test/java/example/OrderedTestsDemo.java +++ b/documentation/src/test/java/example/OrderedTestsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/ParameterizedTestDemo.java b/documentation/src/test/java/example/ParameterizedTestDemo.java index 40f440d305ee..62ff347d7e9a 100644 --- a/documentation/src/test/java/example/ParameterizedTestDemo.java +++ b/documentation/src/test/java/example/ParameterizedTestDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/PollingTimeoutDemo.java b/documentation/src/test/java/example/PollingTimeoutDemo.java index 2242b6b86c84..cfc2d2d28791 100644 --- a/documentation/src/test/java/example/PollingTimeoutDemo.java +++ b/documentation/src/test/java/example/PollingTimeoutDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/RepeatedTestsDemo.java b/documentation/src/test/java/example/RepeatedTestsDemo.java index 98d552952f4d..07d2e77249f5 100644 --- a/documentation/src/test/java/example/RepeatedTestsDemo.java +++ b/documentation/src/test/java/example/RepeatedTestsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/SharedResourcesDemo.java b/documentation/src/test/java/example/SharedResourcesDemo.java index 99d3727437cc..95c5c3010cb0 100644 --- a/documentation/src/test/java/example/SharedResourcesDemo.java +++ b/documentation/src/test/java/example/SharedResourcesDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/SlowTests.java b/documentation/src/test/java/example/SlowTests.java index a1fba4358f35..b4aee752547b 100644 --- a/documentation/src/test/java/example/SlowTests.java +++ b/documentation/src/test/java/example/SlowTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/StandardTests.java b/documentation/src/test/java/example/StandardTests.java index 91bd871f9ffa..9395b88ea1b7 100644 --- a/documentation/src/test/java/example/StandardTests.java +++ b/documentation/src/test/java/example/StandardTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/TaggingDemo.java b/documentation/src/test/java/example/TaggingDemo.java index 6ab3e162badf..d70205927a3d 100644 --- a/documentation/src/test/java/example/TaggingDemo.java +++ b/documentation/src/test/java/example/TaggingDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/TempDirectoryDemo.java b/documentation/src/test/java/example/TempDirectoryDemo.java index e656b44142dc..217977408229 100644 --- a/documentation/src/test/java/example/TempDirectoryDemo.java +++ b/documentation/src/test/java/example/TempDirectoryDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/TestInfoDemo.java b/documentation/src/test/java/example/TestInfoDemo.java index 806397b9408d..941105942db6 100644 --- a/documentation/src/test/java/example/TestInfoDemo.java +++ b/documentation/src/test/java/example/TestInfoDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/TestReporterDemo.java b/documentation/src/test/java/example/TestReporterDemo.java index 5638d24f19d8..0edb0471fc2a 100644 --- a/documentation/src/test/java/example/TestReporterDemo.java +++ b/documentation/src/test/java/example/TestReporterDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/TestTemplateDemo.java b/documentation/src/test/java/example/TestTemplateDemo.java index e017af9d7db0..da330056d3b1 100644 --- a/documentation/src/test/java/example/TestTemplateDemo.java +++ b/documentation/src/test/java/example/TestTemplateDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/TestingAStackDemo.java b/documentation/src/test/java/example/TestingAStackDemo.java index c9cc1e0adc06..d3a6c7e2c5be 100644 --- a/documentation/src/test/java/example/TestingAStackDemo.java +++ b/documentation/src/test/java/example/TestingAStackDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/TimeoutDemo.java b/documentation/src/test/java/example/TimeoutDemo.java index 5959befda41f..93e5cb810d72 100644 --- a/documentation/src/test/java/example/TimeoutDemo.java +++ b/documentation/src/test/java/example/TimeoutDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/UsingTheLauncherDemo.java b/documentation/src/test/java/example/UsingTheLauncherDemo.java index 2ecba15089d6..544cf960ccdc 100644 --- a/documentation/src/test/java/example/UsingTheLauncherDemo.java +++ b/documentation/src/test/java/example/UsingTheLauncherDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/callbacks/AbstractDatabaseTests.java b/documentation/src/test/java/example/callbacks/AbstractDatabaseTests.java index aec3d20ec30a..58344c1c7c7c 100644 --- a/documentation/src/test/java/example/callbacks/AbstractDatabaseTests.java +++ b/documentation/src/test/java/example/callbacks/AbstractDatabaseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/callbacks/BrokenLifecycleMethodConfigDemo.java b/documentation/src/test/java/example/callbacks/BrokenLifecycleMethodConfigDemo.java index 7d3ed08f75eb..cedeb020be28 100644 --- a/documentation/src/test/java/example/callbacks/BrokenLifecycleMethodConfigDemo.java +++ b/documentation/src/test/java/example/callbacks/BrokenLifecycleMethodConfigDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/callbacks/DatabaseTestsDemo.java b/documentation/src/test/java/example/callbacks/DatabaseTestsDemo.java index aadda9995f2c..e6dc21582ff2 100644 --- a/documentation/src/test/java/example/callbacks/DatabaseTestsDemo.java +++ b/documentation/src/test/java/example/callbacks/DatabaseTestsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/callbacks/Extension1.java b/documentation/src/test/java/example/callbacks/Extension1.java index a02451794e86..6bf297f9550f 100644 --- a/documentation/src/test/java/example/callbacks/Extension1.java +++ b/documentation/src/test/java/example/callbacks/Extension1.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/callbacks/Extension2.java b/documentation/src/test/java/example/callbacks/Extension2.java index ea0cf0467eb7..d4e595167bbf 100644 --- a/documentation/src/test/java/example/callbacks/Extension2.java +++ b/documentation/src/test/java/example/callbacks/Extension2.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/callbacks/Logger.java b/documentation/src/test/java/example/callbacks/Logger.java index e3e3a76dcb65..aa7250cab307 100644 --- a/documentation/src/test/java/example/callbacks/Logger.java +++ b/documentation/src/test/java/example/callbacks/Logger.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/defaultmethods/ComparableContract.java b/documentation/src/test/java/example/defaultmethods/ComparableContract.java index 0002836ebada..ac55e4b7ac69 100644 --- a/documentation/src/test/java/example/defaultmethods/ComparableContract.java +++ b/documentation/src/test/java/example/defaultmethods/ComparableContract.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/defaultmethods/EqualsContract.java b/documentation/src/test/java/example/defaultmethods/EqualsContract.java index 47e1252d6236..357c74146466 100644 --- a/documentation/src/test/java/example/defaultmethods/EqualsContract.java +++ b/documentation/src/test/java/example/defaultmethods/EqualsContract.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/defaultmethods/StringTests.java b/documentation/src/test/java/example/defaultmethods/StringTests.java index 965100debfbd..95973a1b2ccd 100644 --- a/documentation/src/test/java/example/defaultmethods/StringTests.java +++ b/documentation/src/test/java/example/defaultmethods/StringTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/defaultmethods/Testable.java b/documentation/src/test/java/example/defaultmethods/Testable.java index 273a225c20ff..90028b28659b 100644 --- a/documentation/src/test/java/example/defaultmethods/Testable.java +++ b/documentation/src/test/java/example/defaultmethods/Testable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/exception/IgnoreIOExceptionExtension.java b/documentation/src/test/java/example/exception/IgnoreIOExceptionExtension.java index 28505bf3e7a9..1e2e15dfbcb8 100644 --- a/documentation/src/test/java/example/exception/IgnoreIOExceptionExtension.java +++ b/documentation/src/test/java/example/exception/IgnoreIOExceptionExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/exception/IgnoreIOExceptionTests.java b/documentation/src/test/java/example/exception/IgnoreIOExceptionTests.java index f4de1484fad7..690b22dfa328 100644 --- a/documentation/src/test/java/example/exception/IgnoreIOExceptionTests.java +++ b/documentation/src/test/java/example/exception/IgnoreIOExceptionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/exception/MultipleHandlersTestCase.java b/documentation/src/test/java/example/exception/MultipleHandlersTestCase.java index 48ee9ec88d7d..8455247839cd 100644 --- a/documentation/src/test/java/example/exception/MultipleHandlersTestCase.java +++ b/documentation/src/test/java/example/exception/MultipleHandlersTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/exception/RecordStateOnErrorExtension.java b/documentation/src/test/java/example/exception/RecordStateOnErrorExtension.java index 3f0422107036..ddd0a9ad6456 100644 --- a/documentation/src/test/java/example/exception/RecordStateOnErrorExtension.java +++ b/documentation/src/test/java/example/exception/RecordStateOnErrorExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/interceptor/SwingEdtInterceptor.java b/documentation/src/test/java/example/interceptor/SwingEdtInterceptor.java index 78f21e8e3b66..09a805c9dcc1 100644 --- a/documentation/src/test/java/example/interceptor/SwingEdtInterceptor.java +++ b/documentation/src/test/java/example/interceptor/SwingEdtInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/registration/DocumentationDemo.java b/documentation/src/test/java/example/registration/DocumentationDemo.java index fe542cf37c28..008c734b5b94 100644 --- a/documentation/src/test/java/example/registration/DocumentationDemo.java +++ b/documentation/src/test/java/example/registration/DocumentationDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/registration/WebServerDemo.java b/documentation/src/test/java/example/registration/WebServerDemo.java index c99d9c0e70f6..4b839e53a8b4 100644 --- a/documentation/src/test/java/example/registration/WebServerDemo.java +++ b/documentation/src/test/java/example/registration/WebServerDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testinterface/TestInterfaceDemo.java b/documentation/src/test/java/example/testinterface/TestInterfaceDemo.java index 86b64961afb3..51ba1f8bbec5 100644 --- a/documentation/src/test/java/example/testinterface/TestInterfaceDemo.java +++ b/documentation/src/test/java/example/testinterface/TestInterfaceDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testinterface/TestInterfaceDynamicTestsDemo.java b/documentation/src/test/java/example/testinterface/TestInterfaceDynamicTestsDemo.java index ee611239e61d..2e751d622652 100644 --- a/documentation/src/test/java/example/testinterface/TestInterfaceDynamicTestsDemo.java +++ b/documentation/src/test/java/example/testinterface/TestInterfaceDynamicTestsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testinterface/TestLifecycleLogger.java b/documentation/src/test/java/example/testinterface/TestLifecycleLogger.java index d6dae294e16a..935f56133edf 100644 --- a/documentation/src/test/java/example/testinterface/TestLifecycleLogger.java +++ b/documentation/src/test/java/example/testinterface/TestLifecycleLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testinterface/TimeExecutionLogger.java b/documentation/src/test/java/example/testinterface/TimeExecutionLogger.java index 944e7c72ada7..32f88d3c4391 100644 --- a/documentation/src/test/java/example/testinterface/TimeExecutionLogger.java +++ b/documentation/src/test/java/example/testinterface/TimeExecutionLogger.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java b/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java index 03f0ffdc62e2..6090550547fe 100644 --- a/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java +++ b/documentation/src/test/java/example/testkit/EngineTestKitAllEventsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testkit/EngineTestKitFailedMethodDemo.java b/documentation/src/test/java/example/testkit/EngineTestKitFailedMethodDemo.java index 78d2173f2ebd..a2ab5c59baf7 100644 --- a/documentation/src/test/java/example/testkit/EngineTestKitFailedMethodDemo.java +++ b/documentation/src/test/java/example/testkit/EngineTestKitFailedMethodDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testkit/EngineTestKitSkippedMethodDemo.java b/documentation/src/test/java/example/testkit/EngineTestKitSkippedMethodDemo.java index 708dfe598c38..dc4b40ff2bdc 100644 --- a/documentation/src/test/java/example/testkit/EngineTestKitSkippedMethodDemo.java +++ b/documentation/src/test/java/example/testkit/EngineTestKitSkippedMethodDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/testkit/EngineTestKitStatisticsDemo.java b/documentation/src/test/java/example/testkit/EngineTestKitStatisticsDemo.java index ef3ca601494b..399189e67790 100644 --- a/documentation/src/test/java/example/testkit/EngineTestKitStatisticsDemo.java +++ b/documentation/src/test/java/example/testkit/EngineTestKitStatisticsDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/timing/TimingExtension.java b/documentation/src/test/java/example/timing/TimingExtension.java index 6c4fcc73027e..f219e8175214 100644 --- a/documentation/src/test/java/example/timing/TimingExtension.java +++ b/documentation/src/test/java/example/timing/TimingExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/example/timing/TimingExtensionTests.java b/documentation/src/test/java/example/timing/TimingExtensionTests.java index b9b11a1582d6..caa01fc7026b 100644 --- a/documentation/src/test/java/example/timing/TimingExtensionTests.java +++ b/documentation/src/test/java/example/timing/TimingExtensionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/extensions/ExpectToFail.java b/documentation/src/test/java/extensions/ExpectToFail.java index c325a81de5db..4787142e7143 100644 --- a/documentation/src/test/java/extensions/ExpectToFail.java +++ b/documentation/src/test/java/extensions/ExpectToFail.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/org/junit/api/tools/AbstractApiReportWriter.java b/documentation/src/test/java/org/junit/api/tools/AbstractApiReportWriter.java index ed59e28e792b..1e2e30f9e4ed 100644 --- a/documentation/src/test/java/org/junit/api/tools/AbstractApiReportWriter.java +++ b/documentation/src/test/java/org/junit/api/tools/AbstractApiReportWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/org/junit/api/tools/ApiReport.java b/documentation/src/test/java/org/junit/api/tools/ApiReport.java index 067d5318f8eb..c51de7a6b17c 100644 --- a/documentation/src/test/java/org/junit/api/tools/ApiReport.java +++ b/documentation/src/test/java/org/junit/api/tools/ApiReport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/org/junit/api/tools/ApiReportGenerator.java b/documentation/src/test/java/org/junit/api/tools/ApiReportGenerator.java index 963d0c4553cb..b6f88801359e 100644 --- a/documentation/src/test/java/org/junit/api/tools/ApiReportGenerator.java +++ b/documentation/src/test/java/org/junit/api/tools/ApiReportGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/org/junit/api/tools/ApiReportWriter.java b/documentation/src/test/java/org/junit/api/tools/ApiReportWriter.java index 8fcadb342744..12976610581c 100644 --- a/documentation/src/test/java/org/junit/api/tools/ApiReportWriter.java +++ b/documentation/src/test/java/org/junit/api/tools/ApiReportWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/org/junit/api/tools/AsciidocApiReportWriter.java b/documentation/src/test/java/org/junit/api/tools/AsciidocApiReportWriter.java index 98f5f8fb2a51..f29f979bd102 100644 --- a/documentation/src/test/java/org/junit/api/tools/AsciidocApiReportWriter.java +++ b/documentation/src/test/java/org/junit/api/tools/AsciidocApiReportWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/org/junit/api/tools/HtmlApiReportWriter.java b/documentation/src/test/java/org/junit/api/tools/HtmlApiReportWriter.java index b260f8ff1ce3..0498deefff02 100644 --- a/documentation/src/test/java/org/junit/api/tools/HtmlApiReportWriter.java +++ b/documentation/src/test/java/org/junit/api/tools/HtmlApiReportWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/java/org/junit/api/tools/MarkdownApiReportWriter.java b/documentation/src/test/java/org/junit/api/tools/MarkdownApiReportWriter.java index 65f0f918b2f8..653ddc39b5b1 100644 --- a/documentation/src/test/java/org/junit/api/tools/MarkdownApiReportWriter.java +++ b/documentation/src/test/java/org/junit/api/tools/MarkdownApiReportWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/kotlin/example/FibonacciCalculator.kt b/documentation/src/test/kotlin/example/FibonacciCalculator.kt index ae16322fc335..c7c111039bec 100644 --- a/documentation/src/test/kotlin/example/FibonacciCalculator.kt +++ b/documentation/src/test/kotlin/example/FibonacciCalculator.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/kotlin/example/KotlinAssertionsDemo.kt b/documentation/src/test/kotlin/example/KotlinAssertionsDemo.kt index 23c901fa1672..723ea2ac43ae 100644 --- a/documentation/src/test/kotlin/example/KotlinAssertionsDemo.kt +++ b/documentation/src/test/kotlin/example/KotlinAssertionsDemo.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/documentation/src/test/kotlin/example/registration/KotlinWebServerDemo.kt b/documentation/src/test/kotlin/example/registration/KotlinWebServerDemo.kt index 73b36a59365e..84b0d2a70213 100644 --- a/documentation/src/test/kotlin/example/registration/KotlinWebServerDemo.kt +++ b/documentation/src/test/kotlin/example/registration/KotlinWebServerDemo.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterAll.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterAll.java index 6ae092d20b64..746452c7a9c7 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterAll.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterAll.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterEach.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterEach.java index 1c693e922b49..f95ed4f53a47 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterEach.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AfterEach.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java index 0cf00416fde0..ca2c7412cde9 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertAll.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java index 67b75c0bc608..32a0707efd7b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertArrayEquals.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertDoesNotThrow.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertDoesNotThrow.java index 20b9ba749fb5..2e7f00afa57f 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertDoesNotThrow.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertDoesNotThrow.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java index 2ed37d219f6f..a66ff5d3bb38 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertEquals.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java index 01c67a0e87ea..fe3239d354a0 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertFalse.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java index 44e423a99fb2..ef1cf28f1ab6 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java index 98df2ba54493..8cc9f609bebe 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertIterableEquals.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java index 138b46e523bd..f6eadb91807d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertLinesMatch.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java index abc3295e1974..cf1655bd9f66 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotEquals.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java index 9d2fb08f5478..6f6b8f978fed 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotNull.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java index f596080dd42d..b8635cb17f94 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNotSame.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java index d730f2555b27..c0b9185a1e14 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java index 06056746b5e3..620c52a8ac79 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertSame.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java index 675e1b717b8e..0a6b0d4864b4 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java index b8f6a029bea4..e3043ef42804 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java index 853f6051cb48..2aba46841a9c 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertTrue.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java index 0aba77997855..a091cf0947e6 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java index bf17b39e0a51..fca32402ac12 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java index b3ec15998f82..f4711a285274 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeAll.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeAll.java index 057cddd0ae30..98665c5427ce 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeAll.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeAll.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeEach.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeEach.java index 4ea0738f2e59..2fc46372e0c3 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeEach.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/BeforeEach.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Disabled.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Disabled.java index 6b784a958494..fc6db60bf4fd 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Disabled.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Disabled.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayName.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayName.java index 9f6e96937ba7..bb30c8846867 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayName.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayName.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGeneration.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGeneration.java index 237d9b5e1002..b9cb2ffbda2f 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGeneration.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGeneration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java index 94bba94d3bf1..0e6284891266 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DisplayNameGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicContainer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicContainer.java index 09ba38d6edeb..88c40789b96f 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicContainer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicNode.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicNode.java index 3dab77739a5b..f7e2b42b3a6d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicNode.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java index b4b1ef0c350c..23b380df07c5 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/IndicativeSentencesGeneration.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/IndicativeSentencesGeneration.java index 3a5372eeb482..82acc5cfb913 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/IndicativeSentencesGeneration.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/IndicativeSentencesGeneration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodDescriptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodDescriptor.java index ce0db501e3d6..0c9ab15a8670 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodDescriptor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java index 59d8f1318034..4426d97de861 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrdererContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrdererContext.java index db9290c92408..03f414da97d4 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrdererContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrdererContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Nested.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Nested.java index e7f2f4c0dbb0..d22db68298c4 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Nested.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Nested.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java index 3a2e77e2526f..10f48336573c 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepeatedTest.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepeatedTest.java index 3ef06dbe6ff5..23ce4b26f22e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepeatedTest.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepeatedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepetitionInfo.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepetitionInfo.java index b45f5e6e7bbd..d6b0079d2261 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepetitionInfo.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/RepetitionInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tag.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tag.java index 599b365464ed..02467574ab66 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tag.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tag.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tags.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tags.java index afbc8e588425..a5b66474364b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tags.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Tags.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Test.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Test.java index 71736cf1bb89..b4ace03ed44d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Test.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestFactory.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestFactory.java index e4dc0ef90769..f2ed493518f5 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestFactory.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInfo.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInfo.java index 4e6535f5ddbf..3417272f4a7e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInfo.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInstance.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInstance.java index 76c95c4d3a2e..4dce4a2b568b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInstance.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestMethodOrder.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestMethodOrder.java index 9f51eca599ae..2cad2ec58e12 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestMethodOrder.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestMethodOrder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestReporter.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestReporter.java index 90e43768345c..a309c33fe095 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestReporter.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestReporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestTemplate.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestTemplate.java index 1ee31cb84d10..4a1b23181191 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestTemplate.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/TestTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Timeout.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Timeout.java index 046e1b9c4771..4d9c1e3af4ed 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Timeout.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Timeout.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/AbstractRepeatableAnnotationCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/AbstractRepeatableAnnotationCondition.java index 67f33628f94d..0b1b2383f6e5 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/AbstractRepeatableAnnotationCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/AbstractRepeatableAnnotationCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/BooleanExecutionCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/BooleanExecutionCondition.java index ec78cb0f0e48..c31122d7ab82 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/BooleanExecutionCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/BooleanExecutionCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRange.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRange.java index 541f5598e4af..d2266bdcdb73 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRange.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRangeCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRangeCondition.java index 342f01cfd437..f059cd8c3d7d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRangeCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledForJreRangeCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIf.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIf.java index c304ac2bafa7..cfd13aa5db83 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIf.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIf.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfCondition.java index 6c9a44e8d7d7..63aea9a6b43b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariable.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariable.java index 251795aa04cd..0c1a5f0e9a60 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariable.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java index 8bf49646b251..f81891306c29 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariables.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariables.java index e3a2a1319228..91b3eb4bf8f7 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariables.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariables.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperties.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperties.java index 31c0965ebdfe..bc6740925eb3 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperties.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperty.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperty.java index 0727e7545a40..ddbcd6ce5d95 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperty.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyCondition.java index 5d3d37d5e9c0..c81420ac71e7 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJre.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJre.java index 0761da1a7ddd..268c67019006 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJre.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJre.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJreCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJreCondition.java index 29a9f5f1c955..22e3ab32c6da 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJreCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnJreCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOs.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOs.java index 9e2f232cc289..6bf37171846a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOs.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOs.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOsCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOsCondition.java index e22676bc16e8..f5db7b4b7daf 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOsCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/DisabledOnOsCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRange.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRange.java index 70f01c29d986..7df3a0310362 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRange.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRangeCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRangeCondition.java index 95b78b7fa422..b1d45642660f 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRangeCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledForJreRangeCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIf.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIf.java index e53d4f9692f0..e546733e7a4a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIf.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIf.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfCondition.java index 5006bc167a8f..7bd93c0f37cd 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariable.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariable.java index 0db42264f2f8..cb8a5c6d119c 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariable.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java index b23fa0315689..9787da3f4b2e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariables.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariables.java index 76f476d8563e..957b5e1e97e8 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariables.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariables.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperties.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperties.java index feb6cb7e22c4..79f168f5d0d2 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperties.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperty.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperty.java index bbf4620d7ab1..e4fa31447d15 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperty.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyCondition.java index 599d7ddccbcb..d83e4fd4ae1c 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJre.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJre.java index a7155d3d1cfa..12dc4091138a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJre.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJre.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJreCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJreCondition.java index 817a361fb389..11963520c999 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJreCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnJreCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOs.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOs.java index 8fd412e088f6..f4000c3c5673 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOs.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOs.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOsCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOsCondition.java index 832e5cf06f29..222107a68b22 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOsCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/EnabledOnOsCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java index 97dea28c3bc8..200a2df181c6 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/JRE.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/MethodBasedCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/MethodBasedCondition.java index f6ac220137e3..101019a1ec9b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/MethodBasedCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/MethodBasedCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/OS.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/OS.java index 4895d4596c71..4492d9edefb2 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/OS.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/condition/OS.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterAllCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterAllCallback.java index 03402c6d6bbd..8086f90c0ab3 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterAllCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterAllCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterEachCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterEachCallback.java index 8fd7e9da87d6..d3a03a0b578c 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterEachCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterEachCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterTestExecutionCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterTestExecutionCallback.java index d6b59612c711..d2c671b0fd84 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterTestExecutionCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/AfterTestExecutionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeAllCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeAllCallback.java index acac670438d2..ed93069878a0 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeAllCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeAllCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeEachCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeEachCallback.java index 97f3cce8d615..f0ee9a1da463 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeEachCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeEachCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeTestExecutionCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeTestExecutionCallback.java index d5628ddf449a..7051044e57e2 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeTestExecutionCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/BeforeTestExecutionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ConditionEvaluationResult.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ConditionEvaluationResult.java index f28aad531def..72ee94bfbadf 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ConditionEvaluationResult.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ConditionEvaluationResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java index 39ad238cf64e..db1c8bc54a88 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/DynamicTestInvocationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExecutionCondition.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExecutionCondition.java index 2fafc86c8248..6021558bff60 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExecutionCondition.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExecutionCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtendWith.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtendWith.java index 33a66f89e205..3139e3832d77 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtendWith.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtendWith.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extension.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extension.java index c16a1bfae19b..c0b3b0000db7 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extension.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionConfigurationException.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionConfigurationException.java index 4fcc4d75031c..0d0518d3b5ad 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionConfigurationException.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionConfigurationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java index 6a244f950e54..40e5d1eefba8 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContextException.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContextException.java index 46b7ae76dbbb..1d0aa9932cfb 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContextException.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ExtensionContextException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extensions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extensions.java index ad19e103ddc6..f9480b8ec609 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extensions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/Extensions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java index a002168fab5d..918a43d52e41 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/InvocationInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/LifecycleMethodExecutionExceptionHandler.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/LifecycleMethodExecutionExceptionHandler.java index f32f372dc749..0fc8a00f7c3d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/LifecycleMethodExecutionExceptionHandler.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/LifecycleMethodExecutionExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterContext.java index 8f2d0e1a13b4..c6c344f9df43 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolutionException.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolutionException.java index 40defd7d4a8b..42eabf33f36b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolutionException.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolutionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolver.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolver.java index d0a1394126ea..107ed852df60 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolver.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ReflectiveInvocationContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ReflectiveInvocationContext.java index 1dc52e66d99c..03b1f5b1af50 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ReflectiveInvocationContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/ReflectiveInvocationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/RegisterExtension.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/RegisterExtension.java index 7e07f302de38..dfd3ef157c8b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/RegisterExtension.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/RegisterExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestExecutionExceptionHandler.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestExecutionExceptionHandler.java index a63d0df66297..521f7c579ad1 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestExecutionExceptionHandler.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestExecutionExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactory.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactory.java index 68cc766ccbb1..b3e7ed085f1d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactory.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactoryContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactoryContext.java index 0338de102ec0..50a105cf00c5 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactoryContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstanceFactoryContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePostProcessor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePostProcessor.java index db1d09f7ce5c..a86379184abc 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePostProcessor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java index f9509fdcee7a..e29ef7c407a3 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstances.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstances.java index 01a31038011e..f3c5720f8781 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstances.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstances.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstantiationException.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstantiationException.java index 42df1a6db800..55e25579c3c5 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstantiationException.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstantiationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContext.java index f4b9e855305a..51ca08ba683a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContextProvider.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContextProvider.java index 7c462af6cd89..73591bb1b689 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContextProvider.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestTemplateInvocationContextProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestWatcher.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestWatcher.java index 006cbf3f5875..8d00095662e7 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestWatcher.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestWatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolver.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolver.java index b0eed4b2c33b..289c05a8295b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolver.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/Executable.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/Executable.java index 4e1774dfebd6..07feadd14d3a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/Executable.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/Executable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingConsumer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingConsumer.java index 518861538487..5584648de6ff 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingConsumer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingSupplier.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingSupplier.java index c4446add5f2e..857c53086a76 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingSupplier.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/function/ThrowingSupplier.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/TempDir.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/TempDir.java index 4b392444155e..3d9bf2f1ce7b 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/TempDir.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/TempDir.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Execution.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Execution.java index ba98fa9b4aed..a78a8fb4d8f0 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Execution.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Execution.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ExecutionMode.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ExecutionMode.java index 6c7a9e2da0a8..013f8787dfba 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ExecutionMode.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ExecutionMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java index 104e6a44ef62..de656a57785f 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Isolated.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceAccessMode.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceAccessMode.java index a9245526c0a4..042dc334849a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceAccessMode.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceAccessMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLock.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLock.java index c07b32f000a4..b3baee4857d8 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLock.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLocks.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLocks.java index f4465e08ced9..0b9fcf4e8468 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLocks.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/ResourceLocks.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java index 89a22048319e..cf99b6205af3 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel/Resources.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt b/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt index 8ebbcacf02f3..bf9609943877 100644 --- a/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt +++ b/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/module/org.junit.jupiter.api/module-info.java b/junit-jupiter-api/src/module/org.junit.jupiter.api/module-info.java index 6cd3017ed238..ad1578b8243a 100644 --- a/junit-jupiter-api/src/module/org.junit.jupiter.api/module-info.java +++ b/junit-jupiter-api/src/module/org.junit.jupiter.api/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/extension/ExtensionContextParameterResolver.java b/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/extension/ExtensionContextParameterResolver.java index 4c6df517335c..48aa51f87c28 100644 --- a/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/extension/ExtensionContextParameterResolver.java +++ b/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/extension/ExtensionContextParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/fixtures/TrackLogRecords.java b/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/fixtures/TrackLogRecords.java index d37aa792fbaf..2c4ea4ce3f23 100644 --- a/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/fixtures/TrackLogRecords.java +++ b/junit-jupiter-api/src/testFixtures/java/org/junit/jupiter/api/fixtures/TrackLogRecords.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java index 880980ee79f3..5d9f893a78c5 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/JupiterTestEngine.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/JupiterTestEngine.java index c7b920d7679f..87bd99de7149 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/JupiterTestEngine.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/JupiterTestEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java index e9be15598526..2c99046d8f00 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java index 13fdd46218ba..ffb9bf03f822 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/EnumConfigurationParameterConverter.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/EnumConfigurationParameterConverter.java index c4a994d513fc..47cfb8bad03b 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/EnumConfigurationParameterConverter.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/EnumConfigurationParameterConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverter.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverter.java index f9c9a9642a3c..f94e63a96e8d 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverter.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java index b7131230ea82..63963b11dfd8 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/AbstractExtensionContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/AbstractExtensionContext.java index 6bd341afc702..be4ad4f37a77 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/AbstractExtensionContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/AbstractExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java index ab94f86a330d..ef1c47f8ba7e 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassBasedTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassExtensionContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassExtensionContext.java index 9564a6180879..09a9127fff8a 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassExtensionContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassTestDescriptor.java index e6b61e2e8e1e..0630e4a02c1c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ClassTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java index 4b6cb2b34dd7..f12ce3af178e 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultDynamicTestInvocationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultTestInstanceFactoryContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultTestInstanceFactoryContext.java index 3f0500d1ebc7..db82b8482f58 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultTestInstanceFactoryContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DefaultTestInstanceFactoryContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java index 1d1de39d685f..23e9a94428bb 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DisplayNameUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicContainerTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicContainerTestDescriptor.java index d4e8273f59b3..9d9cfca10bca 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicContainerTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicContainerTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicDescendantFilter.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicDescendantFilter.java index 1ab19aa6b178..2f75a6178925 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicDescendantFilter.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicDescendantFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicExtensionContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicExtensionContext.java index bbfd1ef3e809..8d2c7b950bc3 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicExtensionContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicNodeTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicNodeTestDescriptor.java index ef0abc6c9fab..64ef2c12eaef 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicNodeTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicNodeTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java index e35293fa4754..91b53ff33187 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/DynamicTestTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java index 838a432da5be..0c1ed17525ef 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/ExtensionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/Filterable.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/Filterable.java index d5948ff94718..e39e9e5ca72c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/Filterable.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/Filterable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineDescriptor.java index 045afe35c4a2..54439ede3b44 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineExtensionContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineExtensionContext.java index 00a4edd70be0..b6f98d4b1fad 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineExtensionContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterEngineExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptor.java index 706a562ef742..7bff29c261cc 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtils.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtils.java index 90eb3e2969d1..cbec4966d543 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtils.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodBasedTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodBasedTestDescriptor.java index 2bd1a502dbf8..e5ef8e0e66fd 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodBasedTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodBasedTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodExtensionContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodExtensionContext.java index 75c7b5b63497..c7d291b69c0a 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodExtensionContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodSourceSupport.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodSourceSupport.java index a97bc0bde207..a6c0b1b97e56 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodSourceSupport.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/MethodSourceSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/NestedClassTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/NestedClassTestDescriptor.java index 9ef3cb447f5b..2eb93aedba78 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/NestedClassTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/NestedClassTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java index 21358b175844..1f8fc6504aa9 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtils.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtils.java index fcf2c54d15d0..cf18bf33e30c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtils.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestMethodTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestMethodTestDescriptor.java index 09f2a0ccd1ae..e5ca8e640dab 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestMethodTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestMethodTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateExtensionContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateExtensionContext.java index 692a920f1b90..6dc49084b922 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateExtensionContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateExtensionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptor.java index da4fee467a64..71366b56c2b1 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java index 52bd229b50e1..749502ad48ad 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassSelectorResolver.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassSelectorResolver.java index 7497b29553dc..874984a83ca1 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassSelectorResolver.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassSelectorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java index 2b858546fa65..d46e0467487e 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodOrdererContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodOrdererContext.java index e216cd55f171..be873d0a63d7 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodOrdererContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodOrdererContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java index 36975a27b7be..2061f58fe15e 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodFinder.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodFinder.java index b901b8134ce3..bcc3d2c7056a 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodFinder.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodFinder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java index 2e6b797fb8ed..3f9b0c39ebeb 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodSelectorResolver.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodSelectorResolver.java index af3afe7852f1..d85b3d6afd64 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodSelectorResolver.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodSelectorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClass.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClass.java index 46d18eb62509..b60f65000bb1 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClass.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClass.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClass.java index 2f4bd2e610ff..c2d9c0e1513c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClass.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainer.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainer.java index a8b258a19a9e..7c4a9a3cc6a4 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainer.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTests.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTests.java index 4faa8f7776f6..72c8c4378379 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTests.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethod.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethod.java index 7849e3b1521a..312b3a181433 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethod.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethod.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethod.java index a496a1b9d9cf..e7d6d321c8f0 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethod.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethod.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethod.java index e35be4459947..81973bcfc58b 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethod.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestableMethod.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestableMethod.java index 42ac3c05fdc2..97abba7bb103 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestableMethod.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/predicates/IsTestableMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/AfterEachMethodAdapter.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/AfterEachMethodAdapter.java index 75847e2c9c94..b495fa449d9f 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/AfterEachMethodAdapter.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/AfterEachMethodAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/BeforeEachMethodAdapter.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/BeforeEachMethodAdapter.java index f45f683b2741..d480ec8fbfc5 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/BeforeEachMethodAdapter.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/BeforeEachMethodAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluationException.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluationException.java index 99654a1935b6..e859f75e84c2 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluationException.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluator.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluator.java index f01adfd11f12..2b35ea39b195 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluator.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConditionEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java index 7f83e24d8a7c..2dbe5b13baa7 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ConstructorInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultParameterContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultParameterContext.java index 43280ed45605..9ee48c40ae02 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultParameterContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultParameterContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultTestInstances.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultTestInstances.java index 74ae9bce43af..56f62d1abf10 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultTestInstances.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/DefaultTestInstances.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExecutableInvoker.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExecutableInvoker.java index a03fa9e9d522..1f113368b438 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExecutableInvoker.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExecutableInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java index cc1c1d899b77..ebb584517975 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/ExtensionValuesStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java index aeb645163416..b8b24aa1ca21 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContext.java index 55c49ab58202..ecf40625b7fa 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java index d444c818f65c..b3705b4d2ec8 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/MethodInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/NamespaceAwareStore.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/NamespaceAwareStore.java index dee0a94199af..b49c12aab664 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/NamespaceAwareStore.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/NamespaceAwareStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/TestInstancesProvider.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/TestInstancesProvider.java index 51b2e308e5db..23b67c5f8654 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/TestInstancesProvider.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/TestInstancesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java index 1dcaa184b829..bf86b23d5024 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/DisabledCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistrar.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistrar.java index 4a0668e65cce..74dba1afb865 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistrar.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistry.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistry.java index 8e4126d92ee1..1e253bec400a 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistry.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/ExtensionRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/MutableExtensionRegistry.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/MutableExtensionRegistry.java index 56333bd08508..85b709cada51 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/MutableExtensionRegistry.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/MutableExtensionRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestDisplayNameFormatter.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestDisplayNameFormatter.java index b0705e828a7b..220ff19da216 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestDisplayNameFormatter.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestDisplayNameFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestExtension.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestExtension.java index ac6fba49d8a2..1c58efa7e370 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestExtension.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestInvocationContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestInvocationContext.java index cc914b162ff6..eab532dc7336 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestInvocationContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepeatedTestInvocationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepetitionInfoParameterResolver.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepetitionInfoParameterResolver.java index 28eee804b610..a9a7b59eed12 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepetitionInfoParameterResolver.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/RepetitionInfoParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TempDirectory.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TempDirectory.java index c497b3018e87..6b25465bbf60 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TempDirectory.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TempDirectory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestInfoParameterResolver.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestInfoParameterResolver.java index c242198ccc1d..4e0945c6b9dd 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestInfoParameterResolver.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestInfoParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestReporterParameterResolver.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestReporterParameterResolver.java index 36f56360e8b5..9cf84e53e627 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestReporterParameterResolver.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestReporterParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutConfiguration.java index 322bbbd0f539..870ffe21b3f5 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDuration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDuration.java index 501c4c3909f4..00a02c299d2f 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDuration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDuration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDurationParser.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDurationParser.java index cb67f5e682ac..b54228e5c6ee 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDurationParser.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutDurationParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutExtension.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutExtension.java index 54664405ddb0..1fb00792497b 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutExtension.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutInvocation.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutInvocation.java index f67d29e6f20f..87f33e6386cb 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutInvocation.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TimeoutInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/JupiterThrowableCollectorFactory.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/JupiterThrowableCollectorFactory.java index 754da76b08f9..76bd8b17c04e 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/JupiterThrowableCollectorFactory.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/JupiterThrowableCollectorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollector.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollector.java index 3cb95e44f0a2..33d5401cee9b 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollector.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/module/org.junit.jupiter.engine/module-info.java b/junit-jupiter-engine/src/module/org.junit.jupiter.engine/module-info.java index 357455d748fe..69b7097993bf 100644 --- a/junit-jupiter-engine/src/module/org.junit.jupiter.engine/module-info.java +++ b/junit-jupiter-engine/src/module/org.junit.jupiter.engine/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertEqualsTests.groovy b/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertEqualsTests.groovy index ef2b68863fff..7554f9420405 100644 --- a/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertEqualsTests.groovy +++ b/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertEqualsTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertNotEqualsTests.groovy b/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertNotEqualsTests.groovy index 4ea5dacfef7b..bf95310e7931 100644 --- a/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertNotEqualsTests.groovy +++ b/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/GroovyAssertNotEqualsTests.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/PrimitiveAndWrapperTypeHelpers.groovy b/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/PrimitiveAndWrapperTypeHelpers.groovy index a278d677e6d9..a33d8031beef 100644 --- a/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/PrimitiveAndWrapperTypeHelpers.groovy +++ b/junit-jupiter-engine/src/test/groovy/org/junit/jupiter/api/PrimitiveAndWrapperTypeHelpers.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/DefaultPackageTestCase.java b/junit-jupiter-engine/src/test/java/DefaultPackageTestCase.java index c735c46d6609..22c9d0fec493 100644 --- a/junit-jupiter-engine/src/test/java/DefaultPackageTestCase.java +++ b/junit-jupiter-engine/src/test/java/DefaultPackageTestCase.java @@ -1,6 +1,6 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/JupiterTestSuite.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/JupiterTestSuite.java index 3e13ac458a7d..3847801ae13f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/JupiterTestSuite.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/JupiterTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertAllAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertAllAssertionsTests.java index 48758f9920fc..0fdc38d40c6f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertAllAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertAllAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertArrayEqualsAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertArrayEqualsAssertionsTests.java index bde8427c70b3..9c0e6880cc22 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertArrayEqualsAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertArrayEqualsAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertDoesNotThrowAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertDoesNotThrowAssertionsTests.java index c9b2b5b7cdc0..b9b8bab79674 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertDoesNotThrowAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertDoesNotThrowAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java index 9233aeb1353f..e8629ae6ec9f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertFalseAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertFalseAssertionsTests.java index 8d206ba4bcfc..e9e7e410ee03 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertFalseAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertFalseAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java index 2acafd1fdff6..93a4fdd50318 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertInstanceOfAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertIterableEqualsAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertIterableEqualsAssertionsTests.java index 1181113636c2..2a9dd981e063 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertIterableEqualsAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertIterableEqualsAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java index 521f07585d6d..eb6228663df1 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertLinesMatchAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotEqualsAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotEqualsAssertionsTests.java index 820b3c21cb29..e7cf2ef0d43d 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotEqualsAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotEqualsAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotNullAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotNullAssertionsTests.java index db7c265a3d48..e120bd4f9098 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotNullAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotNullAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotSameAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotSameAssertionsTests.java index 1d2f379ed076..f79d3445112c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotSameAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNotSameAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java index e902411a19eb..13e4063e7e11 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertSameAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertSameAssertionsTests.java index 2513485a9cff..acdbe033f4e7 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertSameAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertSameAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertThrowsAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertThrowsAssertionsTests.java index a4d5c5cf2855..d3e20009ed6f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertThrowsAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertThrowsAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTimeoutAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTimeoutAssertionsTests.java index f748faceb417..e37209c503df 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTimeoutAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTimeoutAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTrueAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTrueAssertionsTests.java index 7066f8346284..4f36599c92a2 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTrueAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertTrueAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java index 68cbb9ec7a69..a95c27212ab1 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssumptionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssumptionsTests.java index 82ba47216b2a..a82403dee77b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssumptionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssumptionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DisplayNameGenerationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DisplayNameGenerationTests.java index cc49eed0eae9..f466c402f2c7 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DisplayNameGenerationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DisplayNameGenerationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java index 25527af98a23..5709868ad41b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/EnigmaThrowable.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/EnigmaThrowable.java index daa07abc65e2..70e58699db7c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/EnigmaThrowable.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/EnigmaThrowable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/FailAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/FailAssertionsTests.java index e260863b1012..16fc8e5af636 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/FailAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/FailAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/IterableFactory.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/IterableFactory.java index d2bdf457714e..d8739bb0ce14 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/IterableFactory.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/IterableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/AbstractExecutionConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/AbstractExecutionConditionTests.java index 038a1c27265e..2eaac6d690e2 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/AbstractExecutionConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/AbstractExecutionConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java index d4ac17ad137e..3cc2162017b0 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java index e6433a92deb1..da27aa6b4a25 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledForJreRangeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfConditionTests.java index 4e596dcbebe7..74468d6eb34b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableConditionTests.java index 1ec83c271879..331fb28fa090 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableIntegrationTests.java index c3e44db98ee9..f1c05d171025 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfEnvironmentVariableIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfIntegrationTests.java index 9cbdd48701cc..901a642da945 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyConditionTests.java index f701c40a9922..2ee17e4e61b3 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyIntegrationTests.java index 77b55553305d..b8e01dfed68c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledIfSystemPropertyIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java index 459a95adaf57..c0428d3e80b5 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java index 16bd2d922e53..3cabc869504e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnJreIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsConditionTests.java index b222c354d728..42322bc47ade 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsIntegrationTests.java index de49d083e946..1b8b035fcc69 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/DisabledOnOsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java index 135e7a47f92e..7f70a1b3937b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java index 8aacf053e46a..241eadb79aeb 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledForJreRangeIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfConditionTests.java index f39640d4b356..6a8fd811103a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableConditionTests.java index c9d06ada811d..bf4602ccb8c3 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableIntegrationTests.java index 02527c553aba..22ad1bc58913 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfEnvironmentVariableIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfIntegrationTests.java index b17baa6a591d..4b2cd6f265f5 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyConditionTests.java index 9fde3dfe0460..8f0920ff71ea 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyIntegrationTests.java index 178e59e4642a..fc5cd647f0f8 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledIfSystemPropertyIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java index fbda32fcd4c5..abe24fa05d10 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java index 8fb9d0902ca6..f170cad98c91 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnJreIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsConditionTests.java index 18ac37114650..bc057012d028 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsIntegrationTests.java index 696c5f4b792a..6784f7931690 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/EnabledOnOsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/JRETests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/JRETests.java index a60d3e7668d1..d488335afbe8 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/JRETests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/JRETests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/StaticConditionMethods.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/StaticConditionMethods.java index 2abf95bd3603..c85ff399cef4 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/StaticConditionMethods.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/condition/StaticConditionMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/CloseableResourceIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/CloseableResourceIntegrationTests.java index 8337dc6ea8d6..4ca92ed4252a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/CloseableResourceIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/CloseableResourceIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java index 254cd4e25095..55b7c5bdf7bd 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/ExtensionComposabilityTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/KitchenSinkExtension.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/KitchenSinkExtension.java index 558ffa305c12..73edebc46ac8 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/KitchenSinkExtension.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/KitchenSinkExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolverTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolverTests.java index 940e25701c5b..851b1a3dcdd2 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolverTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssertionsTests.java index d0f026f6d700..e945c932bcb9 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssertionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssumptionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssumptionsTests.java index 69fab0e67370..6d2f35d1aad5 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssumptionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/subpackage/SubclassedAssumptionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AbstractJupiterTestEngineTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AbstractJupiterTestEngineTests.java index 96c5adb4513c..4c00b8147bc6 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AbstractJupiterTestEngineTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AbstractJupiterTestEngineTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AtypicalJvmMethodNameTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AtypicalJvmMethodNameTests.java index dd7205edd425..e266c405b885 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AtypicalJvmMethodNameTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AtypicalJvmMethodNameTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeAllAndAfterAllComposedAnnotationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeAllAndAfterAllComposedAnnotationTests.java index 51ca976195f9..984c884bb586 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeAllAndAfterAllComposedAnnotationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeAllAndAfterAllComposedAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeEachAndAfterEachComposedAnnotationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeEachAndAfterEachComposedAnnotationTests.java index 9689d534c90a..bee53a29afba 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeEachAndAfterEachComposedAnnotationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/BeforeEachAndAfterEachComposedAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultExecutionModeTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultExecutionModeTests.java index 69b1cb108be7..a2e15e6bb4f3 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultExecutionModeTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultExecutionModeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultMethodTests.java index 28fed1fe7e95..da3400f70d34 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DisabledTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DisabledTests.java index 632e2e72d75e..021a34c7a453 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DisabledTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DisabledTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DynamicNodeGenerationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DynamicNodeGenerationTests.java index b9e0d847d0dc..9ad5a33b6f3f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DynamicNodeGenerationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DynamicNodeGenerationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ExceptionHandlingTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ExceptionHandlingTests.java index 74ee98cae27c..a7a3898c3c2b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ExceptionHandlingTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ExceptionHandlingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/FailedAssumptionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/FailedAssumptionsTests.java index 56fa9e3e62a1..b97c4536f574 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/FailedAssumptionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/FailedAssumptionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/InvalidLifecycleMethodConfigurationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/InvalidLifecycleMethodConfigurationTests.java index 955772b9fb95..7124447ca4c5 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/InvalidLifecycleMethodConfigurationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/InvalidLifecycleMethodConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/JupiterTestEngineBasicTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/JupiterTestEngineBasicTests.java index f08b35edaa8b..e66dd1cec817 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/JupiterTestEngineBasicTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/JupiterTestEngineBasicTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/MultipleTestableAnnotationsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/MultipleTestableAnnotationsTests.java index 40aa762b1fbf..345301d3cb8c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/MultipleTestableAnnotationsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/MultipleTestableAnnotationsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedTestClassesTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedTestClassesTests.java index 2a12f6c199d3..3237b230c779 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedTestClassesTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedTestClassesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithInheritanceTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithInheritanceTests.java index ab8779932280..b6d01e3cf0ff 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithInheritanceTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithInheritanceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithSeparateInheritanceTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithSeparateInheritanceTests.java index ec7860159a2a..2dede7ef0ac6 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithSeparateInheritanceTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedWithSeparateInheritanceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NonVoidTestableMethodIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NonVoidTestableMethodIntegrationTests.java index a68454540819..f509efd41e2c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NonVoidTestableMethodIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NonVoidTestableMethodIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/OverloadedTestMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/OverloadedTestMethodTests.java index f3e5c8e28cfb..1beb46ab3615 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/OverloadedTestMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/OverloadedTestMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ReportingTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ReportingTests.java index 6e9e6c3330de..31ef077bc1ac 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ReportingTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ReportingTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/StandardTestClassTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/StandardTestClassTests.java index 3357c2091da2..088a642ca0fe 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/StandardTestClassTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/StandardTestClassTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestClassInheritanceTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestClassInheritanceTests.java index c7ec092b2b7d..35fefe9bc600 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestClassInheritanceTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestClassInheritanceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleConfigurationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleConfigurationTests.java index 65918853ce01..8d7551299055 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleConfigurationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleKotlinTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleKotlinTests.java index ad3fbd9483c1..44f04b2816b0 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleKotlinTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleKotlinTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java index fd160212ff55..72eb7039ab24 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java index 6abe26936542..7a5fe3426e98 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestTemplateInvocationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNonGenericTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNonGenericTests.java index 0697904a6d87..68dd2e33cb32 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNonGenericTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNonGenericTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNumberTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNumberTests.java index 1b295b060d07..d5c0776903bd 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNumberTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/AbstractNumberTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/BridgeMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/BridgeMethodTests.java index 196e5b77b45d..0f5057efd6d7 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/BridgeMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/BridgeMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithBridgeMethods.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithBridgeMethods.java index 92ec5713f704..d2c85118748d 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithBridgeMethods.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithBridgeMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithoutBridgeMethods.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithoutBridgeMethods.java index a94c6ebec1df..732d1b7f68f0 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithoutBridgeMethods.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/ChildWithoutBridgeMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberResolver.java index 0c5969573d22..21ad5715194f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberTestGroup.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberTestGroup.java index 8263dfe233d7..54cde15680cb 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberTestGroup.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/NumberTestGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/PackagePrivateParent.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/PackagePrivateParent.java index 98a04de0174d..81c9a10dc988 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/PackagePrivateParent.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/PackagePrivateParent.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/CachingJupiterConfigurationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/CachingJupiterConfigurationTests.java index c7d770e9761d..de3a389ccbe6 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/CachingJupiterConfigurationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/CachingJupiterConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/DefaultJupiterConfigurationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/DefaultJupiterConfigurationTests.java index 9bd3f9d4e4e8..5a27ae57ce60 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/DefaultJupiterConfigurationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/DefaultJupiterConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverterTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverterTests.java index 7fe365ae8e65..8577f372197a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverterTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/config/InstantiatingConfigurationParameterConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/CustomDisplayNameGenerator.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/CustomDisplayNameGenerator.java index b26e191666bc..fffdb00ed3fb 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/CustomDisplayNameGenerator.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/CustomDisplayNameGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/DisplayNameUtilsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/DisplayNameUtilsTests.java index 489141706aff..79b5d3656537 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/DisplayNameUtilsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/DisplayNameUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/ExtensionContextTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/ExtensionContextTests.java index 37b9342efaa0..c8df68ee224d 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/ExtensionContextTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/ExtensionContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptorTests.java index 854023218e8b..02b8c1ee92ff 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/JupiterTestDescriptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtilsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtilsTests.java index 68cc2f27f315..ed43d8d446d2 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtilsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/LifecycleMethodUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptorTests.java index 8bb5ed3a5b63..a4d852f2f8be 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestFactoryTestDescriptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtilsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtilsTests.java index eaa81791334e..aaadf2b1c419 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtilsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestInstanceLifecycleUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptorTests.java index abbbf9f770ef..750317f4d4f7 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateInvocationTestDescriptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptorTests.java index 2b85df39249b..79e78425b9eb 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/TestTemplateTestDescriptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class1WithTestCases.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class1WithTestCases.java index f99c8258cf8c..2f8c65076aad 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class1WithTestCases.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class1WithTestCases.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class2WithTestCases.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class2WithTestCases.java index 5e8af983f0ff..937c00d235c1 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class2WithTestCases.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/Class2WithTestCases.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithStaticInnerTestCases.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithStaticInnerTestCases.java index 3ee0899ecc60..e7b506f14270 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithStaticInnerTestCases.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithStaticInnerTestCases.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithoutTestCases.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithoutTestCases.java index 0db061fb624c..5bc49398517b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithoutTestCases.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/descriptor/subpackage/ClassWithoutTestCases.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolverTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolverTests.java index fca80ea73372..e191e2e0d5ab 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolverTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoveryTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoveryTests.java index 6d32a3f2d2be..be77a5868d3d 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoveryTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/DiscoveryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/JupiterUniqueIdBuilder.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/JupiterUniqueIdBuilder.java index 2ca495513886..4ee8a5ee6e8b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/JupiterUniqueIdBuilder.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/JupiterUniqueIdBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClassTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClassTests.java index ab0b7f67e923..fd73fa409622 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClassTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsInnerClassTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClassTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClassTests.java index 93debe18ea1c..7d595c528993 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClassTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsNestedTestClassTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainerTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainerTests.java index 2be23703d5e6..87b62e7be62a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainerTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsPotentialTestContainerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTestsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTestsTests.java index 9605a0c2e397..1d97d6cf3ff4 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTestsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestClassWithTestsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethodTests.java index 282769baf3b4..a69b1693f53f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestFactoryMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethodTests.java index c9a7604b6fb6..c4ce4cdb49ae 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethodTests.java index 3bc6537c7003..04078c65688f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/discovery/predicates/IsTestTemplateMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DefaultTestInstancesTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DefaultTestInstancesTests.java index 16a54d02eabe..22094796a83f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DefaultTestInstancesTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DefaultTestInstancesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DynamicTestIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DynamicTestIntegrationTests.java index 1f26714bfc94..a39c756aebec 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DynamicTestIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/DynamicTestIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExecutableInvokerTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExecutableInvokerTests.java index 008fbb02adf2..e3cd1351a077 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExecutableInvokerTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExecutableInvokerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreConcurrencyTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreConcurrencyTests.java index 155f2e282c1b..3cf14688f82c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreConcurrencyTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreConcurrencyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java index b0bb8299e402..a2ebe331f840 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionContextStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java index 5036d8bf5008..661f6087f86a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContextTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContextTests.java index 08859eb72d41..bd7dbd63e2fe 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContextTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/JupiterEngineExecutionContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/UniqueIdParsingForArrayParameterIntegrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/UniqueIdParsingForArrayParameterIntegrationTests.java index b12479d0b9de..91aae317ed3b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/UniqueIdParsingForArrayParameterIntegrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/UniqueIdParsingForArrayParameterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotation.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotation.java index 0ead5fef5474..f37369227ab7 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotation.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotation.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotationParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotationParameterResolver.java index f097d2b8386a..67555f98d1c3 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotationParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotationParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomType.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomType.java index b11c3e78ec7b..f1f95a8f1ac1 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomType.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomType.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomTypeParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomTypeParameterResolver.java index 8d4d2cbe6fb5..93eb37909bf6 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomTypeParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomTypeParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/DoubleParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/DoubleParameterResolver.java index 39f8955b664c..931495f61206 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/DoubleParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/DoubleParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/LongParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/LongParameterResolver.java index 0e625dde4431..422f956aed76 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/LongParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/LongParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfListsTypeBasedParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfListsTypeBasedParameterResolver.java index 199100ae18cb..6d653eefd845 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfListsTypeBasedParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfListsTypeBasedParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfStringsParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfStringsParameterResolver.java index 9d87b872a5ba..dcc1acbe1940 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfStringsParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfStringsParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NullIntegerParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NullIntegerParameterResolver.java index 8c879f79fcc8..e7143d2dda9c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NullIntegerParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NullIntegerParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NumberParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NumberParameterResolver.java index 6db36b39c63b..56b123d4442f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NumberParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/NumberParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveArrayParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveArrayParameterResolver.java index e3971b1c5d88..0cca20002c3e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveArrayParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveArrayParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveIntegerParameterResolver.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveIntegerParameterResolver.java index 218ba2dec6de..a55fd0bade6f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveIntegerParameterResolver.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/PrimitiveIntegerParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterAllTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterAllTests.java index 290e87d4be1f..82c9c90be262 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterAllTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterAllTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterEachTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterEachTests.java index eadff2325223..33bc9260a34f 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterEachTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterEachTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterTestExecutionCallbackTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterTestExecutionCallbackTests.java index 4cd24a3faff7..a3062fce0cc1 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterTestExecutionCallbackTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterTestExecutionCallbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EnigmaException.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EnigmaException.java index db030c8645cd..0a144163da7c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EnigmaException.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EnigmaException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EventuallyInterruptibleInvocation.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EventuallyInterruptibleInvocation.java index 65a36ed8df83..3d290bdfa69c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EventuallyInterruptibleInvocation.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/EventuallyInterruptibleInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExecutionConditionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExecutionConditionTests.java index 80ef0e96eb97..3c7d8a8247d9 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExecutionConditionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExecutionConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionContextExecutionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionContextExecutionTests.java index 86469c8f8a92..9ea8c8e66cec 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionContextExecutionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionContextExecutionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionRegistryTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionRegistryTests.java index 234a3f7470de..54856358ffbf 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionRegistryTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionRegistryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java index 880681c4bcae..04479927e4d9 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/InvocationInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/LifecycleMethodExecutionExceptionHandlerTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/LifecycleMethodExecutionExceptionHandlerTests.java index 1bbd09cab02a..83a1c1f4bc11 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/LifecycleMethodExecutionExceptionHandlerTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/LifecycleMethodExecutionExceptionHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java index 9733f8f97d85..04de0e29521e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedProgrammaticExtensionRegistrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedProgrammaticExtensionRegistrationTests.java index 48d93d952474..2dc6d03717a5 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedProgrammaticExtensionRegistrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedProgrammaticExtensionRegistrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ParameterResolverTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ParameterResolverTests.java index 9a6e0156dd2c..c407f42b62b3 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ParameterResolverTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ParameterResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ProgrammaticExtensionRegistrationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ProgrammaticExtensionRegistrationTests.java index 8334b560263f..29fcadc9385c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ProgrammaticExtensionRegistrationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ProgrammaticExtensionRegistrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RepeatedTestTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RepeatedTestTests.java index 1c37027a2d11..cdb1d65c0698 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RepeatedTestTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RepeatedTestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ServiceLoaderExtension.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ServiceLoaderExtension.java index 173f147e637a..35c3fac0e114 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ServiceLoaderExtension.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ServiceLoaderExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryTests.java index 7d4ab1a752d8..7350a771c9e6 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TempDirectoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestExecutionExceptionHandlerTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestExecutionExceptionHandlerTests.java index 46b91488a142..64c8442c2f13 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestExecutionExceptionHandlerTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestExecutionExceptionHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInfoParameterResolverTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInfoParameterResolverTests.java index 06ed0f1cb9d6..8e66af3c0cc8 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInfoParameterResolverTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInfoParameterResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java index 2bb66e500f62..153522ac6a31 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorAndPreDestroyCallbackTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorAndPreDestroyCallbackTests.java index d9e8e1a51472..7d20f80278d7 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorAndPreDestroyCallbackTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorAndPreDestroyCallbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorTests.java index 6d14539fbbb3..431550b71f6e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackTests.java index 26af331d941b..6d021fd5cdcb 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java index f6f5c3908239..fd555d8a3c76 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePreDestroyCallbackUtilityMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestReporterParameterResolverTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestReporterParameterResolverTests.java index cfbc0d01eaa7..19e668b67728 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestReporterParameterResolverTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestReporterParameterResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestWatcherTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestWatcherTests.java index 7ed5e3503bfb..ad81f4c72425 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestWatcherTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestWatcherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutConfigurationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutConfigurationTests.java index 01aa1832dff5..a396e7f975df 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutConfigurationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationParserTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationParserTests.java index 23937e6768b6..d50d7d816a9e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationParserTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationTests.java index 85d4d4f4ab2c..139e28488d76 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutDurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutExtensionTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutExtensionTests.java index e75e3f00ef37..7f7b6013240e 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutExtensionTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutExtensionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutInvocationTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutInvocationTests.java index 2ab4d8f50243..164e240a8b1b 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutInvocationTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TimeoutInvocationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AlwaysDisabledCondition.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AlwaysDisabledCondition.java index e99df4e25100..812f993e7ba3 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AlwaysDisabledCondition.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AlwaysDisabledCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AnotherAlwaysDisabledCondition.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AnotherAlwaysDisabledCondition.java index cb513429c66d..311888850620 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AnotherAlwaysDisabledCondition.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/AnotherAlwaysDisabledCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/SystemPropertyCondition.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/SystemPropertyCondition.java index 6740305b8230..fa44b0f8bb4a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/SystemPropertyCondition.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/sub/SystemPropertyCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollectorTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollectorTests.java index ae9ed0b4f854..a2b057400791 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollectorTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/support/OpenTest4JAndJUnit4AwareThrowableCollectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt index 3366d1e70b5f..0a4889b81c7e 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertTimeoutAssertionsTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertionsTests.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertionsTests.kt index ab03031d1a09..d90a1e11ca2f 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertionsTests.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinAssertionsTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinFailAssertionsTests.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinFailAssertionsTests.kt index c2d85b287003..f2c631bef939 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinFailAssertionsTests.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/api/KotlinFailAssertionsTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt index a7ba382c5d69..2f94a3f71124 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/ArbitraryNamingKotlinTestCase.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerClassKotlinTestCase.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerClassKotlinTestCase.kt index 68480a32cc26..9638bd733e3f 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerClassKotlinTestCase.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerClassKotlinTestCase.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerMethodKotlinTestCase.kt b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerMethodKotlinTestCase.kt index 5db066530ea2..f2fb8b4e6eba 100644 --- a/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerMethodKotlinTestCase.kt +++ b/junit-jupiter-engine/src/test/kotlin/org/junit/jupiter/engine/kotlin/InstancePerMethodKotlinTestCase.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/EnableJUnit4MigrationSupport.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/EnableJUnit4MigrationSupport.java index b7bb452c07b4..5899ccc7e254 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/EnableJUnit4MigrationSupport.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/EnableJUnit4MigrationSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java index f99562fd0f0a..5680c09a2ca1 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/conditions/IgnoreCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupport.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupport.java index a898357a27f7..a9e9e10d0f0c 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupport.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupport.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupport.java index f37052e6f422..42a0032734d8 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupport.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java index 79fb40e7e526..2c822c0e3add 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/TestRuleSupport.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/TestRuleSupport.java index 8c85adc0e83a..1ac9f65b7b2d 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/TestRuleSupport.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/TestRuleSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java index 73c76d5bcd51..4b6a9d5ad7cb 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/VerifierSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/AbstractTestRuleAdapter.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/AbstractTestRuleAdapter.java index 1f7b6655f72b..84929dd24bf0 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/AbstractTestRuleAdapter.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/AbstractTestRuleAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExpectedExceptionAdapter.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExpectedExceptionAdapter.java index df83797bf230..b45b934f39bd 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExpectedExceptionAdapter.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExpectedExceptionAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExternalResourceAdapter.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExternalResourceAdapter.java index ed221489ac21..d74a5d6787ac 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExternalResourceAdapter.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/ExternalResourceAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/GenericBeforeAndAfterAdvice.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/GenericBeforeAndAfterAdvice.java index 668d195e7ca9..be2d221e0d40 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/GenericBeforeAndAfterAdvice.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/GenericBeforeAndAfterAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/VerifierAdapter.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/VerifierAdapter.java index 3a902b25d678..ed55d3230c66 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/VerifierAdapter.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/adapter/VerifierAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/AbstractTestRuleAnnotatedMember.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/AbstractTestRuleAnnotatedMember.java index 09d5b70c521a..992cbc69e94f 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/AbstractTestRuleAnnotatedMember.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/AbstractTestRuleAnnotatedMember.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedField.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedField.java index ed70f35078d2..d8790a4afa4a 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedField.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedField.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMember.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMember.java index 9ed11aa43215..9e0359ceb8fa 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMember.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMember.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMethod.java b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMethod.java index 28f258a7c318..5e25e9264918 100644 --- a/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMethod.java +++ b/junit-jupiter-migrationsupport/src/main/java/org/junit/jupiter/migrationsupport/rules/member/TestRuleAnnotatedMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/module/org.junit.jupiter.migrationsupport/module-info.java b/junit-jupiter-migrationsupport/src/module/org.junit.jupiter.migrationsupport/module-info.java index c54b6e041d0c..c33255747653 100644 --- a/junit-jupiter-migrationsupport/src/module/org.junit.jupiter.migrationsupport/module-info.java +++ b/junit-jupiter-migrationsupport/src/module/org.junit.jupiter.migrationsupport/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/JupiterMigrationSupportTestSuite.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/JupiterMigrationSupportTestSuite.java index 2962009cee42..bb1d88cbc220 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/JupiterMigrationSupportTestSuite.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/JupiterMigrationSupportTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreAnnotationIntegrationTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreAnnotationIntegrationTests.java index 620744be4420..ed547ca9682f 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreAnnotationIntegrationTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreAnnotationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreConditionTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreConditionTests.java index 8879904dfd1e..d7fbd7e30575 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreConditionTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/conditions/IgnoreConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/AbstractTestRuleAdapterTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/AbstractTestRuleAdapterTests.java index 7be4b83c9a94..f465cc1eb356 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/AbstractTestRuleAdapterTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/AbstractTestRuleAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupportWithBothRuleTypesTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupportWithBothRuleTypesTests.java index 3b80f664af29..f360438b29c3 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupportWithBothRuleTypesTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupportWithBothRuleTypesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupportTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupportTests.java index cd9bd0803753..5212d35399b8 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupportTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForDifferentDeclaredReturnTypesRulesTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForDifferentDeclaredReturnTypesRulesTests.java index 90cfad031fce..290d979cc765 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForDifferentDeclaredReturnTypesRulesTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForDifferentDeclaredReturnTypesRulesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMixedMethodAndFieldRulesTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMixedMethodAndFieldRulesTests.java index e4c37fc559d8..a01f5d33ae6e 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMixedMethodAndFieldRulesTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMixedMethodAndFieldRulesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleFieldRulesTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleFieldRulesTests.java index 19a0ec5733a4..92fab45ed474 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleFieldRulesTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleFieldRulesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleMethodRulesTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleMethodRulesTests.java index 523663613ef3..6766fd97809a 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleMethodRulesTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForMultipleMethodRulesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForTemporaryFolderFieldTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForTemporaryFolderFieldTests.java index 0d0100ffde94..943f04727f14 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForTemporaryFolderFieldTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportForTemporaryFolderFieldTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportWithInheritanceTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportWithInheritanceTests.java index 4656e5038a8c..7c8650267152 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportWithInheritanceTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceSupportWithInheritanceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceWithoutAdapterTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceWithoutAdapterTests.java index 39eccc964be8..27ca31190142 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceWithoutAdapterTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/ExternalResourceWithoutAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/FailAfterAllHelper.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/FailAfterAllHelper.java index 28a6fc969a72..6639b7599276 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/FailAfterAllHelper.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/FailAfterAllHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/LauncherBasedEnableRuleMigrationSupportTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/LauncherBasedEnableRuleMigrationSupportTests.java index c93bb8d81f6e..59ac457115d2 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/LauncherBasedEnableRuleMigrationSupportTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/LauncherBasedEnableRuleMigrationSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/VerifierSupportForMixedMethodAndFieldRulesTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/VerifierSupportForMixedMethodAndFieldRulesTests.java index 0a8d61b59b9a..4fde2321d9e0 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/VerifierSupportForMixedMethodAndFieldRulesTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/VerifierSupportForMixedMethodAndFieldRulesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierFieldTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierFieldTests.java index 8df022024189..b5ac3c51c6d0 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierFieldTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierFieldTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierMethodTests.java b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierMethodTests.java index 6a0fd13cc3d7..7dd517ea89a7 100644 --- a/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierMethodTests.java +++ b/junit-jupiter-migrationsupport/src/test/java/org/junit/jupiter/migrationsupport/rules/WrongExtendWithForVerifierMethodTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java index 39f4e0d5ddd8..f2faa61bbe20 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java index 65dde70187f4..e50d8bcfc0c7 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestInvocationContext.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestInvocationContext.java index 47b40e6a893e..0746f24b33f4 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestInvocationContext.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestInvocationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestMethodContext.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestMethodContext.java index bf28d46130df..5d82fc06555d 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestMethodContext.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestMethodContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java index 937e91f60103..49cf34c39320 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java index 970a75c6f16e..d47889f8cd15 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/AggregateWith.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/AggregateWith.java index 55ee74286491..496f89abe6ad 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/AggregateWith.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/AggregateWith.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentAccessException.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentAccessException.java index a6b87baa386e..6108428fcf1e 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentAccessException.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAccessor.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAccessor.java index ba41d656c488..4e8aaefce950 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAccessor.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregationException.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregationException.java index 3fefa5ee1990..4df6c313ee20 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregationException.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregator.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregator.java index 4686ec96a2b5..bab7592fa662 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregator.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/ArgumentsAggregator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessor.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessor.java index 899f5e680a13..d4258eb759cb 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessor.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConversionException.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConversionException.java index 6e5aabbed654..72679c4114c8 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConversionException.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConversionException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConverter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConverter.java index 80483a604e79..3baf3a5760f4 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConverter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ArgumentConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ConvertWith.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ConvertWith.java index 68f879a362f6..00360939dd17 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ConvertWith.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/ConvertWith.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java index 72e555f42fe5..70942775b98f 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/DefaultArgumentConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverter.java index 8e863ddc2f5c..99e3aa74310c 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverter.java index 105ea6f599ae..e91e448a6d06 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeConversionPattern.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeConversionPattern.java index db13fed17f13..657bce9620d2 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeConversionPattern.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/JavaTimeConversionPattern.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/SimpleArgumentConverter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/SimpleArgumentConverter.java index 37691d74c673..9832592a2146 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/SimpleArgumentConverter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/SimpleArgumentConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/TypedArgumentConverter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/TypedArgumentConverter.java index c4c88a2c1418..f28171a7240f 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/TypedArgumentConverter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter/TypedArgumentConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/Arguments.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/Arguments.java index 90d85cc8d876..39d07d94c2b5 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/Arguments.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/Arguments.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java index ee9b4112c23f..2d8b5aab526c 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSource.java index 3a2ec546bee1..ecb11db04a2f 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSources.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSources.java index a30b8887c8db..728188895265 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSources.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ArgumentsSources.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java index 78aa438315bc..863a68eace1f 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileArgumentsProvider.java index eb52ed5940ec..eb578b9956b1 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java index 5e19035da09c..7636b208c18f 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvFileSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java index 18df453cf4fc..51c4652c04e2 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParserFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParsingException.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParsingException.java index 488bdf306e1e..374824d3f86c 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParsingException.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvParsingException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java index 194341bf6630..eb7c6f18be66 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/CsvSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptyArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptyArgumentsProvider.java index 1db8f32a79d2..c1c84e279a89 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptyArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptyArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptySource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptySource.java index b3e526aa1237..d7ca266a85de 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptySource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EmptySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumArgumentsProvider.java index eabdd2cd147e..561099e8603d 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumSource.java index 53cb77e1676f..928fda84a59a 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/EnumSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodArgumentsProvider.java index c7ed2a5a2325..116b751f4d0d 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodSource.java index b6a78e625853..d1fb10374482 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/MethodSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullAndEmptySource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullAndEmptySource.java index 19e3d9bddc9d..d85148f4d6f8 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullAndEmptySource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullAndEmptySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullArgumentsProvider.java index 836b3142e5e9..6c68b94d2df8 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullEnum.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullEnum.java index 05b925e1e825..70213f7895a4 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullEnum.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullEnum.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullSource.java index b6cfb55327a4..c98e65cff76b 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/NullSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueArgumentsProvider.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueArgumentsProvider.java index 98c3642f446c..344c3145d88a 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueArgumentsProvider.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueArgumentsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueSource.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueSource.java index c53eb8bcc3b0..2566b1c470ee 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueSource.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/provider/ValueSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumer.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumer.java index 56620e1ecc84..6f07fcbed749 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumer.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java index 3dfd9dcb6fb7..925243644e38 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/support/AnnotationConsumerInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/main/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessor.kt b/junit-jupiter-params/src/main/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessor.kt index bdbd9310e75c..0028b05827e8 100644 --- a/junit-jupiter-params/src/main/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessor.kt +++ b/junit-jupiter-params/src/main/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessor.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/module/org.junit.jupiter.params/module-info.java b/junit-jupiter-params/src/module/org.junit.jupiter.params/module-info.java index 42f04fd1d7eb..c690245aab51 100644 --- a/junit-jupiter-params/src/module/org.junit.jupiter.params/module-info.java +++ b/junit-jupiter-params/src/module/org.junit.jupiter.params/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java index 6ad6e471fd10..24f4df196a0d 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java index ed0f9e32465f..39332383d443 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java index 82614506ff29..a3dce4932bc7 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestMethodContextTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java index dd97bfc4ec51..f9de719db4e9 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestNameFormatterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestSuite.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestSuite.java index d5073cbe78f8..e3c872925cf6 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestSuite.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java index 34e8738758df..b1bfaffc07ae 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/AggregatorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java index eaf4d22f2ddd..4b36111aee4a 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/aggregator/DefaultArgumentsAccessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java index f9318cacdd2e..0f300132d83b 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/DefaultArgumentConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java index 687482cc4504..6e84738d700f 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/FallbackStringToObjectConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java index 06efb164c17d..e7532f1e9427 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/JavaTimeArgumentConverterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java index 57b78f8e3312..b6843dd7867a 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/converter/TypedArgumentConverterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java index d8f0b7e564bf..45c38da24fd1 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ArgumentsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java index bbe3baab612d..d0a876a17cb9 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvArgumentsProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java index 43e6087e2e1d..7016d86d614e 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/CsvFileArgumentsProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java index 67759795e218..5a3c24f67c3a 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumArgumentsProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java index 48e4c559f8e4..919798c9e887 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/EnumSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java index c254fbb8f440..efd474399cad 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MethodArgumentsProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java index 438393631c5a..097caa0a9cdc 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/MockCsvAnnotationBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java index cf9c789f2a94..bab82fe96451 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/provider/ValueArgumentsProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessorKotlinTests.kt b/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessorKotlinTests.kt index 4ff069f6bce7..6414b755fc4d 100644 --- a/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessorKotlinTests.kt +++ b/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/ArgumentsAccessorKotlinTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/DisplayNameTests.kt b/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/DisplayNameTests.kt index 804e414c7b4f..cd9336bbded9 100644 --- a/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/DisplayNameTests.kt +++ b/junit-jupiter-params/src/test/kotlin/org/junit/jupiter/params/aggregator/DisplayNameTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-jupiter/src/module/org.junit.jupiter/module-info.java b/junit-jupiter/src/module/org.junit.jupiter/module-info.java index dbdc0a6635b8..986039ad9e54 100644 --- a/junit-jupiter/src/module/org.junit.jupiter/module-info.java +++ b/junit-jupiter/src/module/org.junit.jupiter/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/JUnitException.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/JUnitException.java index e3743fe8dcff..4c9eaa084306 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/JUnitException.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/JUnitException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/PreconditionViolationException.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/PreconditionViolationException.java index 6d4a21708d9c..079756e9f1ce 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/PreconditionViolationException.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/PreconditionViolationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/annotation/Testable.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/annotation/Testable.java index 4a0f2315be97..0c45f4e16f43 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/annotation/Testable.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/annotation/Testable.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/function/Try.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/function/Try.java index 0276a9a0101a..43bb1f36cd13 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/function/Try.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/function/Try.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LogRecordListener.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LogRecordListener.java index 47ce1a17df23..f6e17fcdfca3 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LogRecordListener.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LogRecordListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/Logger.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/Logger.java index 9036e31d15ac..6f5073426c38 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/Logger.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/Logger.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LoggerFactory.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LoggerFactory.java index 541a8fb65db6..0ed0ff7fbd76 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LoggerFactory.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/logging/LoggerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java index 4f1a102fb176..315e458c793d 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/AnnotationSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ClassSupport.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ClassSupport.java index 98b61aef3a4f..70d4559e237a 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ClassSupport.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ClassSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/HierarchyTraversalMode.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/HierarchyTraversalMode.java index 54e31b6b9560..fea4699d8b35 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/HierarchyTraversalMode.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/HierarchyTraversalMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ModifierSupport.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ModifierSupport.java index a9ea245656cd..7e290e53cece 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ModifierSupport.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ModifierSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ReflectionSupport.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ReflectionSupport.java index 7c23735c97a5..60d9e1c7a682 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ReflectionSupport.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/support/ReflectionSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/AnnotationUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/AnnotationUtils.java index 7091d54ecd5d..cab0dd7357bb 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/AnnotationUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/AnnotationUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/BlacklistedExceptions.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/BlacklistedExceptions.java index 2a58f72e70b4..ea444b22caed 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/BlacklistedExceptions.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/BlacklistedExceptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFileVisitor.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFileVisitor.java index 1af606dcc9a1..c840442d7f1b 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFileVisitor.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFileVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFilter.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFilter.java index 85005c086e94..203543094175 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFilter.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassLoaderUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassLoaderUtils.java index 083c142bef00..94c2526dfa34 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassLoaderUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassLoaderUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java index 2305bcdde193..2bfe68b09c88 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassUtils.java index df789f5388d0..f65242898641 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java index 3011d96accf7..08a6b3535a7d 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java index 9e4f6a080d58..a7db3bb46196 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CloseablePath.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CollectionUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CollectionUtils.java index 4eae3ca2c44d..06592d4f8b1e 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CollectionUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/CollectionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ExceptionUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ExceptionUtils.java index 39c1cdd71a96..02c208a204d1 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ExceptionUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ExceptionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/FunctionUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/FunctionUtils.java index e88c87286a80..966c110535e7 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/FunctionUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/FunctionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/LruCache.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/LruCache.java index f64ede0b94b7..e814fcbb8f6d 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/LruCache.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/LruCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java index 55d5d544855c..6aa35fe92ba2 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java index 98922e666552..0e220bde4a75 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PreconditionViolationException.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PreconditionViolationException.java index d8e0b573840b..9eb1942e9222 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PreconditionViolationException.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PreconditionViolationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/Preconditions.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/Preconditions.java index e3316b39df4f..96df396aed4e 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/Preconditions.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/Preconditions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java index 1182dd7f649c..da12cd70032e 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ReflectionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/RuntimeUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/RuntimeUtils.java index 2bcbd7cafbaf..28955051f62c 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/RuntimeUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/RuntimeUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java index a704d935e403..8eaeed47b405 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/StringUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ToStringBuilder.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ToStringBuilder.java index 414cda2d1291..3e98c3fb3759 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ToStringBuilder.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ToStringBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/UnrecoverableExceptions.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/UnrecoverableExceptions.java index b4fae56ced65..25df35605f6a 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/UnrecoverableExceptions.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/UnrecoverableExceptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/main/java9/org/junit/platform/commons/util/ModuleUtils.java b/junit-platform-commons/src/main/java9/org/junit/platform/commons/util/ModuleUtils.java index 23f442103ffa..6e02d92b3dd1 100644 --- a/junit-platform-commons/src/main/java9/org/junit/platform/commons/util/ModuleUtils.java +++ b/junit-platform-commons/src/main/java9/org/junit/platform/commons/util/ModuleUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java b/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java index 065111ab9648..b4e0774b29c8 100644 --- a/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java +++ b/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncher.java b/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncher.java index 279a1f7beb17..7e21b7a63f2b 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncher.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncherExecutionResult.java b/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncherExecutionResult.java index fd24004cf82b..6ce97bd088b4 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncherExecutionResult.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/ConsoleLauncherExecutionResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/AvailableOptions.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/AvailableOptions.java index 4348a2c6b30c..5be7162835f5 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/AvailableOptions.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/AvailableOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java index ff245923b882..7607cade328e 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptionsParser.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptionsParser.java index f4f1a1fcfa3e..833c2cac9689 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptionsParser.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptionsParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/Details.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/Details.java index 053cb83e086d..5aee8744827e 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/Details.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/Details.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/PicocliCommandLineOptionsParser.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/PicocliCommandLineOptionsParser.java index 7b559294bcd9..7eca6f911e47 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/PicocliCommandLineOptionsParser.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/PicocliCommandLineOptionsParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/Theme.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/Theme.java index 940ff5071ad2..88f0c5403d43 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/Theme.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/Theme.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/Color.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/Color.java index c0097ad70e31..62b1c1da87b5 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/Color.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/Color.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java index 61b48e66b446..a76d5c93545a 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutor.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutor.java index 07e805779f03..6d6761c6f93b 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutor.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java index 8ebd0909797c..a240ff9db664 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/FlatPrintingListener.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/FlatPrintingListener.java index 87abb2e24467..09188c21be87 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/FlatPrintingListener.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/FlatPrintingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreeNode.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreeNode.java index 96bd05bef3ca..a1ca226d8e05 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreeNode.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreeNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrinter.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrinter.java index 9fdefb3819b6..d189591474f6 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrinter.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrinter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrintingListener.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrintingListener.java index 107ae85f59ce..cf17f1800731 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrintingListener.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/TreePrintingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/VerboseTreePrintingListener.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/VerboseTreePrintingListener.java index a373a9942da4..97035579a99d 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/VerboseTreePrintingListener.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/VerboseTreePrintingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/main/java9/org/junit/platform/console/ConsoleLauncherToolProvider.java b/junit-platform-console/src/main/java9/org/junit/platform/console/ConsoleLauncherToolProvider.java index 885cb34fe894..2543b4a6342b 100644 --- a/junit-platform-console/src/main/java9/org/junit/platform/console/ConsoleLauncherToolProvider.java +++ b/junit-platform-console/src/main/java9/org/junit/platform/console/ConsoleLauncherToolProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-console/src/module/org.junit.platform.console/module-info.java b/junit-platform-console/src/module/org.junit.platform.console/module-info.java index 2a5f7a6a81bd..eddd184b22c3 100644 --- a/junit-platform-console/src/module/org.junit.platform.console/module-info.java +++ b/junit-platform-console/src/module/org.junit.platform.console/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/CompositeFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/CompositeFilter.java index 2d91be35dae3..bc10bdba91d6 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/CompositeFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/CompositeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java index ff57edbb19d7..5110f4536d0a 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoveryFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoveryFilter.java index cef80c6da22e..a198792a45ae 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoveryFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoveryFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java index c0ca4a1f5d69..e73c89b18aa6 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/DiscoverySelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryListener.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryListener.java index 7cf3308301e9..cc825f64822c 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryListener.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryRequest.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryRequest.java index 38f07def0b70..50a95877a082 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryRequest.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineDiscoveryRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineExecutionListener.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineExecutionListener.java index e74ad5fd989a..21e24dbe8594 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineExecutionListener.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/EngineExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/ExecutionRequest.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/ExecutionRequest.java index db3a9dec06a6..ee6654f57b90 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/ExecutionRequest.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/ExecutionRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/Filter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/Filter.java index 500ab4af4be3..26f9bace5a0e 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/Filter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/Filter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/FilterResult.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/FilterResult.java index 9d6e039ffcf2..a6256aba204d 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/FilterResult.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/FilterResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/SelectorResolutionResult.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/SelectorResolutionResult.java index a7abc5ce6f5c..9fde84cfd5ee 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/SelectorResolutionResult.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/SelectorResolutionResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java index 8971c92e1836..3e78954e9994 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java index 258c4980dc75..0bd69e6a0927 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestExecutionResult.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestExecutionResult.java index ebb470c8e635..e35eb262f2f8 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestExecutionResult.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestExecutionResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestSource.java index 821bd411c029..e7a21de3f080 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestTag.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestTag.java index c996a38ba201..110dd5c0c9ec 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/TestTag.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/TestTag.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java index b88926eab24c..ef6e552f90ca 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueIdFormat.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueIdFormat.java index 5f2e843b74f3..852cd7504f29 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueIdFormat.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueIdFormat.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/AbstractClassNameFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/AbstractClassNameFilter.java index 5684d7c3b598..ee6ca96fb020 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/AbstractClassNameFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/AbstractClassNameFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassNameFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassNameFilter.java index e4e83d896018..3c4ded198198 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassNameFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassNameFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java index 25da8dd48cdd..034085991378 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClassSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java index 792d37150909..6098d426fcbc 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathResourceSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java index b5eba5bc2b57..6fcf1dfb9354 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ClasspathRootSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java index 46acd9499015..a06a4cb7fa00 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DirectorySelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java index 47caa2daf621..156e07b628c0 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludeClassNameFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludeClassNameFilter.java index 643dde29308c..68b409ae9ef9 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludeClassNameFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludeClassNameFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludePackageNameFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludePackageNameFilter.java index a7735e209d62..438a0d997a4a 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludePackageNameFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ExcludePackageNameFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FilePosition.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FilePosition.java index 1f2d6cae817c..b2253bc4c2d6 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FilePosition.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FilePosition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java index 0e76c5c68348..187f30235f69 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/FileSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludeClassNameFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludeClassNameFilter.java index d70ba2f46836..932a0e793117 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludeClassNameFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludeClassNameFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludePackageNameFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludePackageNameFilter.java index c545f73ca8be..462f6a32e770 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludePackageNameFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/IncludePackageNameFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java index 344403360eae..967ef7fba61d 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/MethodSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java index bdc909d6ff24..97bc4dfafa13 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/ModuleSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java index d5ff424211c8..68aa2c7334a2 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedClassSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java index cc80b300812d..cd35eef9def4 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/NestedMethodSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageNameFilter.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageNameFilter.java index f2751763c766..e98c6ebfe750 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageNameFilter.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageNameFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java index a60b631da537..f4c50acd4db3 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/PackageSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java index ddc3940ddf3c..9e4c15f2033a 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UniqueIdSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java index 67f6dcbe8952..e23210ed4bd5 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/UriSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java index 6eb2ccaed2d9..b620ee26312a 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/reporting/ReportEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/config/PrefixedConfigurationParameters.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/config/PrefixedConfigurationParameters.java index 53403c69dfa4..2406f5589fc4 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/config/PrefixedConfigurationParameters.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/config/PrefixedConfigurationParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptor.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptor.java index 981a34d645a6..44aa335f1032 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptor.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClassSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClassSource.java index 3e91901b54f2..901db0cf7c80 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClassSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClassSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSource.java index 0a46d31e3874..415371f0d0cb 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/CompositeTestSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/CompositeTestSource.java index 1a96f0ad4f60..35c2fd648be5 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/CompositeTestSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/CompositeTestSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DefaultUriSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DefaultUriSource.java index 2dde27eb4d4a..98601d505d8d 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DefaultUriSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DefaultUriSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DirectorySource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DirectorySource.java index 13c8ef336e59..5426eb884f2b 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DirectorySource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/DirectorySource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/EngineDescriptor.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/EngineDescriptor.java index 090121b594e2..8e69ccb0bf31 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/EngineDescriptor.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/EngineDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FilePosition.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FilePosition.java index e1076fba4e81..269f9b4ff5cf 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FilePosition.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FilePosition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSource.java index 972ea3fae489..7b2b00e31080 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSystemSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSystemSource.java index bcea7ca15749..3d29ee8d9d08 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSystemSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/FileSystemSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/MethodSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/MethodSource.java index b5c861c7891d..f3fd80749646 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/MethodSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/MethodSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/PackageSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/PackageSource.java index 7d9d58aa9afb..11cb04a7c0fa 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/PackageSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/PackageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ResourceUtils.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ResourceUtils.java index 7b90c9757fe5..4bf7ebef0a68 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ResourceUtils.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/ResourceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/UriSource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/UriSource.java index 5b3a69dc16e1..e52e584e4046 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/UriSource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/descriptor/UriSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/ClassContainerSelectorResolver.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/ClassContainerSelectorResolver.java index 7fb3db4d381a..ec6565e1cf1e 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/ClassContainerSelectorResolver.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/ClassContainerSelectorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolution.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolution.java index dc03d251cb27..dcde44dbf9de 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolution.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolution.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolver.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolver.java index cae9543325b0..2deb3e563621 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolver.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/EngineDiscoveryRequestResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java index 53a10f65b618..487339c4f59e 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/discovery/SelectorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/filter/ClasspathScanningSupport.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/filter/ClasspathScanningSupport.java index 51dbe73f45bf..3ab6072fd4ad 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/filter/ClasspathScanningSupport.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/filter/ClasspathScanningSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java index e379771b605d..be97a27da4ca 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/CompositeLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfiguration.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfiguration.java index 3c4085c2abce..57ccabb35e69 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfiguration.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategy.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategy.java index 9383fae6bfc3..d3256ff3de54 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategy.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/EngineExecutionContext.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/EngineExecutionContext.java index 9d2b6afb6276..1199cea0d875 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/EngineExecutionContext.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/EngineExecutionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java index 564350ae10ac..70ac97b25fb9 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ExclusiveResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorService.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorService.java index 6bf2313fd539..063bb3669424 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorService.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ForkJoinPoolHierarchicalTestExecutorService.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java index ee8fbe153eb2..9936ea514dc5 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutor.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutor.java index e238b5626aeb..9cfac92fcb6e 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutor.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService.java index ea20113eb6cf..456efe2389c0 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorService.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/LockManager.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/LockManager.java index e2c79d8cd347..d620cda3558a 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/LockManager.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/LockManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/Node.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/Node.java index 862d39b87a86..5d7817f37bdf 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/Node.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/Node.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeExecutionAdvisor.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeExecutionAdvisor.java index 4b54a115b887..1e95e0516598 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeExecutionAdvisor.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeExecutionAdvisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java index a722a3f51328..1414b5099881 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTask.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTaskContext.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTaskContext.java index 598d685ba01b..a5dee9587b30 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTaskContext.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTestTaskContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java index 01a6ce3faabe..4ba6c20b204e 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeUtils.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeUtils.java index a08036c5e94d..33e9eeb214db 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeUtils.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NopLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NopLock.java index ab385129eccc..426ceb74a69b 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NopLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NopLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/OpenTest4JAwareThrowableCollector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/OpenTest4JAwareThrowableCollector.java index ee2d367e9da5..606db4b7e192 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/OpenTest4JAwareThrowableCollector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/OpenTest4JAwareThrowableCollector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfiguration.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfiguration.java index 35bcf16532a1..e499ad4495d2 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfiguration.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfigurationStrategy.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfigurationStrategy.java index 84648616d5f4..6816b3401464 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfigurationStrategy.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionConfigurationStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ResourceLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ResourceLock.java index 42c8834d71ef..2b7ff304a2ee 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ResourceLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ResourceLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java index 5a5c3d3b8d68..b9bee1fd0837 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SameThreadHierarchicalTestExecutorService.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java index 062e3cba94f2..9fc3a9fe26db 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutor.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutor.java index f4d42a8cee3d..8db798ac61ec 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutor.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ThrowableCollector.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ThrowableCollector.java index 96bc1bbe480a..511f10553937 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ThrowableCollector.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/ThrowableCollector.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/module/org.junit.platform.engine/module-info.java b/junit-platform-engine/src/module/org.junit.platform.engine/module-info.java index 91f4e095fbde..2f3f4528c0d0 100644 --- a/junit-platform-engine/src/module/org.junit.platform.engine/module-info.java +++ b/junit-platform-engine/src/module/org.junit.platform.engine/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java index 53b30d51c6ad..174d51196bcf 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java index 9b51c75c7b57..18afe7707bed 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalContainerDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java index e10efb55eaad..c14fa1921222 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalEngineDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java index 731357e4722d..57058e827a75 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java index 9780098afd09..f389c7682690 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestDescriptorStub.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestDescriptorStub.java index 8f739f06faa0..d97d6ad5762d 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestDescriptorStub.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestDescriptorStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java index 8856d50e11de..ba94ac5ff8b7 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineSpy.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineStub.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineStub.java index e5274abdb0e8..35f5dd9ef4c3 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineStub.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/fakes/TestEngineStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java index c3c52445311a..4cbe23bdc1f0 100644 --- a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingDiscoveryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java index c7013a2aacfd..839b0d02dd6b 100644 --- a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/FlightRecordingExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java index 270d5b5c651b..df7799df5185 100644 --- a/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java +++ b/junit-platform-jfr/src/main/java/org/junit/platform/jfr/UniqueId.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java b/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java index 0636e4eff966..f79379168925 100644 --- a/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java +++ b/junit-platform-jfr/src/module/org.junit.platform.jfr/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineDiscoveryResult.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineDiscoveryResult.java index 265fa8988c43..7f7419401c4b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineDiscoveryResult.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineDiscoveryResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineFilter.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineFilter.java index 4dfd5d6a5d78..53eada499f6e 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineFilter.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/EngineFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java index 3ca1dcd21eed..82421f6e4254 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/Launcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherConstants.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherConstants.java index bc69e3a47534..07715dfd08cc 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherConstants.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java index 2e1dbf99017c..d5b7945b634d 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryRequest.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryRequest.java index edce58483298..aebec8bd5886 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryRequest.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherDiscoveryRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java index 7be37218c5c4..144bbd05572d 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java index eedc7ff4405a..b03601dadc3b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/LauncherSessionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/PostDiscoveryFilter.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/PostDiscoveryFilter.java index 2fecbe1bb613..610d610acb37 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/PostDiscoveryFilter.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/PostDiscoveryFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TagFilter.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TagFilter.java index 641534e29478..edc1bb02f2a4 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TagFilter.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TagFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java index e15413a890f8..b0505e9e213a 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java index 29681e3048b1..15ab32387a23 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestIdentifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java index bc6075d8158e..9e268224b134 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java index 7fc64521fd29..41919c7fdcb4 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultDiscoveryRequest.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultDiscoveryRequest.java index dfe1de3086b3..5e629f150007 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultDiscoveryRequest.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultDiscoveryRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java index 8e2a5c97597c..5b8af43c137a 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java index be1046cc4bac..4fd4d72441f7 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java index f9e19979a48f..0fa19cd7b63b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncherSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DelegatingEngineExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DelegatingEngineExecutionListener.java index ef09b55228d4..763f04a5eb54 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DelegatingEngineExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DelegatingEngineExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryErrorDescriptor.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryErrorDescriptor.java index 103c76dc68ca..f57ce7002cbf 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryErrorDescriptor.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryErrorDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java index c0853d311140..b1752e0219a9 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidator.java index 0bb4023d0986..6c5dcd4e9d15 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java index 68271ea446fb..788303775a3c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java index 7fe0d07878be..f50a2f35e63e 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ExecutionListenerAdapter.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ExecutionListenerAdapter.java index a1bbd258ba7c..7d5af7d8a996 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ExecutionListenerAdapter.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ExecutionListenerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java index 53aba88068e9..c163b64c6daa 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java index aba75ff99280..559d603e885e 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java index 06eb1b6790f5..3238753c3aa2 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfigurationParameters.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfigurationParameters.java index 2e97ea80f81c..ba9dff7de319 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfigurationParameters.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherConfigurationParameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java index 7a27914cad8a..5f4a563d119c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java index 72e4a51101bd..fb1bd04de26b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java index 4fda66637101..df826399fd5b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java index 6946ef2c2a64..0ac9a94a2543 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ListenerRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/OutcomeDelayingEngineExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/OutcomeDelayingEngineExecutionListener.java index b17dcded202c..781c847f8b8a 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/OutcomeDelayingEngineExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/OutcomeDelayingEngineExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java index 9adcd1711e88..490214c19d63 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java index ced5003f7bc1..98671f73a003 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java index 6d54315b86df..df129e586371 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/SessionPerRequestLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java index 139b32dc4070..edda5c1f791d 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptor.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptor.java index 63d36c091d66..b040e8489107 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptor.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/StreamInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java index a39514fa57cb..f025aca3dcb7 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LegacyReportingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LoggingListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LoggingListener.java index 0a1256ef99b2..802a25cf98d8 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LoggingListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/LoggingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java index 24287fcf129b..e1b5af2030fb 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java index bffe5da57d7e..39ce7fe0540e 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/TestExecutionSummary.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/TestExecutionSummary.java index 098335f8fb47..99a7545e08a2 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/TestExecutionSummary.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/TestExecutionSummary.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java index 1f115af2ad9f..a26026d1ae21 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java index 2a504abe0e0c..04a052c16270 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/CompositeLauncherDiscoveryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java index b04940c02cce..546d2bbb9023 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LauncherDiscoveryListeners.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java index edff6d732248..7557de0b78cd 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java index 8b5ba267214b..80473b99d298 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/CompositeLauncherSessionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java index 1aa0428a2ac1..4e654afcf568 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/session/LauncherSessionListeners.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/DequeStack.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/DequeStack.java index ef4e1de9f166..b5263325973e 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/DequeStack.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/DequeStack.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operator.java index 086957f3abf9..9ab15093048f 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operators.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operators.java index a58b11a2d2ba..3795ed95d452 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operators.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Operators.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResult.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResult.java index 329ea7b634c1..2aa92b98f6d9 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResult.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResults.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResults.java index c5ccaa3312ac..cfab5d857586 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResults.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseResults.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseStatus.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseStatus.java index aa05eef45526..38117f1072b4 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseStatus.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ParseStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Parser.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Parser.java index 33b5e3866009..48449c9e8ae6 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Parser.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ShuntingYard.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ShuntingYard.java index a94c35c2b922..405f898b5837 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ShuntingYard.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/ShuntingYard.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Stack.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Stack.java index a431f40de3f6..fc5a1ab6da22 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Stack.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Stack.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpression.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpression.java index 40c9110c05c3..5d791410765d 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpression.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpression.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpressions.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpressions.java index 657741594364..880c7793b4c1 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpressions.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TagExpressions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Token.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Token.java index b3ee66599ef7..efd481e69dcd 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Token.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Token.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TokenWith.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TokenWith.java index 34e0a03a6a59..7443b5dcd4ad 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TokenWith.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/TokenWith.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Tokenizer.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Tokenizer.java index e5820633b7de..7088110b642c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Tokenizer.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/tagexpression/Tokenizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java b/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java index ee0fc5627728..b7484c8df876 100644 --- a/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java +++ b/junit-platform-launcher/src/module/org.junit.platform.launcher/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/ConfigurationParametersFactoryForTests.java b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/ConfigurationParametersFactoryForTests.java index 22256999a35b..272548b82e4c 100644 --- a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/ConfigurationParametersFactoryForTests.java +++ b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/ConfigurationParametersFactoryForTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java index 2a9962578abd..0f90f0438452 100644 --- a/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java +++ b/junit-platform-launcher/src/testFixtures/java/org/junit/platform/launcher/core/LauncherFactoryForTestingPurposesOnly.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/LegacyReportingUtils.java b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/LegacyReportingUtils.java index e8eaa616d56c..39131eb133c2 100644 --- a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/LegacyReportingUtils.java +++ b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/LegacyReportingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListener.java b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListener.java index 672c5cb09d3e..0e2677a60001 100644 --- a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListener.java +++ b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java index 16cf43236705..000fbd7015c7 100644 --- a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java +++ b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java index 8348e179e6ca..4724a36948e6 100644 --- a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java +++ b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-reporting/src/module/org.junit.platform.reporting/module-info.java b/junit-platform-reporting/src/module/org.junit.platform.reporting/module-info.java index 81f57ecc08fc..f452446933a1 100644 --- a/junit-platform-reporting/src/module/org.junit.platform.reporting/module-info.java +++ b/junit-platform-reporting/src/module/org.junit.platform.reporting/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java index 29b7e1ef7e84..4e232ff135bc 100644 --- a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java +++ b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformRunnerListener.java b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformRunnerListener.java index 490de18795a2..bb4f59de8692 100644 --- a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformRunnerListener.java +++ b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformRunnerListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformTestTree.java b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformTestTree.java index 79b209c3ee33..631dab46556a 100644 --- a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformTestTree.java +++ b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformTestTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java b/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java index 57e7e8879cbf..108bd2188189 100644 --- a/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java +++ b/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java index df71781d4e67..4c7bf6194aae 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java index 595dac610ee5..d5b87bf74769 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java index c373489bb3be..11d8113df66e 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java index 8d570157131d..75427acad23e 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java index c94d8111c05d..c4c4d3284477 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java index e57349aef850..7047caea1d40 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java index a7d6244b7db7..bcfe221ff90f 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java index 3b09a1ba12e6..16d94108345c 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java index acecad13afed..a4aeb1cf8dea 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java index 013268bde762..9592461204cc 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java index 36419b0f7322..3d8bf880bb5b 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java index 0e99e0a24c79..596b9137a2dd 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java b/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java index 5294c6e7148e..6b88fc29025d 100644 --- a/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java +++ b/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Assertions.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Assertions.java index 71433337f109..a66ad615bd23 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Assertions.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Assertions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineExecutionResults.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineExecutionResults.java index 3fa46f93a67a..181563681279 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineExecutionResults.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineExecutionResults.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java index b50c3111bd61..f2a1d95767c5 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EngineTestKit.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Event.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Event.java index 15d73909251b..4eddb5255300 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Event.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Event.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java index c99e8875bae1..350453569a02 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventConditions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventStatistics.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventStatistics.java index d3c609fa0dd2..3550a5dd35ca 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventStatistics.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventStatistics.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventType.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventType.java index 266dc0a39303..023003ce8b86 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventType.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/EventType.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Events.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Events.java index 5ba21e04306d..7a4e78477585 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Events.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Events.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Execution.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Execution.java index 28ca07746b0c..2dcce3e28fe6 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Execution.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Execution.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/ExecutionRecorder.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/ExecutionRecorder.java index b301f33f67d5..a927028ead2a 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/ExecutionRecorder.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/ExecutionRecorder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Executions.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Executions.java index 5ca835bf3240..9d487c441ace 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Executions.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/Executions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TerminationInfo.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TerminationInfo.java index 87cb4df332dc..5c8a08c9ca37 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TerminationInfo.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TerminationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TestExecutionResultConditions.java b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TestExecutionResultConditions.java index d6bc10104861..e50ac4c4e94d 100644 --- a/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TestExecutionResultConditions.java +++ b/junit-platform-testkit/src/main/java/org/junit/platform/testkit/engine/TestExecutionResultConditions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-platform-testkit/src/module/org.junit.platform.testkit/module-info.java b/junit-platform-testkit/src/module/org.junit.platform.testkit/module-info.java index 11bc650906a3..ea99b0e8ff92 100644 --- a/junit-platform-testkit/src/module/org.junit.platform.testkit/module-info.java +++ b/junit-platform-testkit/src/module/org.junit.platform.testkit/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/JUnit4VersionCheck.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/JUnit4VersionCheck.java index 3f65d520d5c3..6d9c5e254063 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/JUnit4VersionCheck.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/JUnit4VersionCheck.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java index 0b90e0d58ef8..83ca4ed3a33f 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/VintageTestEngine.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java index a4d632b83da3..950d60faf0d0 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/DescriptionUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/OrFilter.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/OrFilter.java index 568730cadeba..98be1e884d20 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/OrFilter.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/OrFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerDecorator.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerDecorator.java index feaa78282acc..346dab3d4186 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerDecorator.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerRequest.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerRequest.java index 7256c4f3f4b2..b9687efce26c 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerRequest.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java index efd386a04df0..047ce94ebb11 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java index 10976e6b9336..e84224758c2b 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/TestSourceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java index 23f09d7b0b14..63bb392a261a 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageEngineDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java index 7953a29b956d..4431ad4c3401 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/VintageTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/ClassSelectorResolver.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/ClassSelectorResolver.java index 87d33dd321c3..894364861e79 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/ClassSelectorResolver.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/ClassSelectorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/DefensiveAllDefaultPossibilitiesBuilder.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/DefensiveAllDefaultPossibilitiesBuilder.java index c80780be9759..ab108e0f32e1 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/DefensiveAllDefaultPossibilitiesBuilder.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/DefensiveAllDefaultPossibilitiesBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/FilterableIgnoringRunnerDecorator.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/FilterableIgnoringRunnerDecorator.java index e1cd92b89e18..a3972dcba983 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/FilterableIgnoringRunnerDecorator.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/FilterableIgnoringRunnerDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IgnoringRunnerDecorator.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IgnoringRunnerDecorator.java index 1b28c97e6f88..a4ad9b4be3cf 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IgnoringRunnerDecorator.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IgnoringRunnerDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java index 686c80655145..90186a524588 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestMethod.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestMethod.java index 8b99eff78c15..652ea12aad54 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestMethod.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java index c725e4bdc097..aaa29b43763f 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/MethodSelectorResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java index daa518e7f75a..77d15318afa1 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/UniqueIdFilter.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/UniqueIdFilter.java index 50adeed529e5..558e76aa8fb8 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/UniqueIdFilter.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/UniqueIdFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java index 26422dec3484..8a331d211acf 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/discovery/VintageDiscoverer.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/EventType.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/EventType.java index d65b5e076567..30f6d4f0145d 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/EventType.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/EventType.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunListenerAdapter.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunListenerAdapter.java index 821b892fcf6c..a7799ee17e38 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunListenerAdapter.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunListenerAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java index 871a7f28383a..5e486c2ac80a 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/RunnerExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/TestRun.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/TestRun.java index b309b1a5e054..6ec2a8736755 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/TestRun.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/execution/TestRun.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdReader.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdReader.java index 81dcde0ea179..690271cd3836 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdReader.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdStringifier.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdStringifier.java index 4787f87ed462..99897c096dc1 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdStringifier.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/support/UniqueIdStringifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/module/org.junit.vintage.engine/module-info.java b/junit-vintage-engine/src/module/org.junit.vintage.engine/module-info.java index e7c194de7a8b..0baad6dbff1e 100644 --- a/junit-vintage-engine/src/module/org.junit.vintage.engine/module-info.java +++ b/junit-vintage-engine/src/module/org.junit.vintage.engine/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java index cde4f8cc4c17..8eb633df7788 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4ParameterizedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java index ce1198e63833..45212a158416 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java index c33f757ffd0d..2730315e52b3 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java index 01ee771ba42c..00abbdbdedc1 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java index ef40db7b40af..8aa70d01bd5b 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineDiscoveryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java index d7c5f851d17a..e32766a31a97 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineExecutionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineTestSuite.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineTestSuite.java index 8cd277c2f040..80064e4e133e 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineTestSuite.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java index 3d61ccce9b01..e9328423bd84 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageUniqueIdBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java index 49b9f1c5dd7d..c03f613f89fe 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java index 1baaad2091c9..1a937cfc8b2f 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/OrFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java index 857f68e37bd5..530458d7c365 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/TestSourceProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java index f8fe68433350..5eb1786c6ee6 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/VintageTestDescriptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java index db7e02b4eb34..a3168b7a0ee1 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/IsPotentialJUnit4TestClassTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java index 22e841e6765a..e78395c3b8a7 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/RunnerTestDescriptorPostProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java index b50aa69cb4b1..63dddffb44bf 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/discovery/VintageDiscovererTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java index 802f69d5abe3..ef6b555a724b 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/execution/TestRunTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java index a062bfe2678d..4934b2637598 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdReaderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java index 8e6bfa4822e9..7ac2e73fec5c 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/support/UniqueIdStringifierTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/PlainOldJavaClassWithoutAnyTestsTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/PlainOldJavaClassWithoutAnyTestsTestCase.java index 284efad17057..d3e8aee61509 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/PlainOldJavaClassWithoutAnyTestsTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/PlainOldJavaClassWithoutAnyTestsTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/AbstractJUnit3TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/AbstractJUnit3TestCase.java index c1d54606241d..30582b651418 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/AbstractJUnit3TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/AbstractJUnit3TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java index 4242bafd94c6..b58b2497c54f 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3ParallelSuiteWithSubsuites.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java index 3bced3afad82..f7c69ad5caf0 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java index 6656b467c913..697c6ce7fbaf 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/JUnit3SuiteWithSubsuites.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/PlainJUnit3TestCaseWithSingleTestWhichFails.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/PlainJUnit3TestCaseWithSingleTestWhichFails.java index 9dbd46931b80..a1b6cb1a946b 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/PlainJUnit3TestCaseWithSingleTestWhichFails.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit3/PlainJUnit3TestCaseWithSingleTestWhichFails.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java index e57804e27d8b..582aa3e03827 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJunit4TestCaseWithConstructorParameter.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJunit4TestCaseWithConstructorParameter.java index eecfd16bbda4..b18862251a79 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJunit4TestCaseWithConstructorParameter.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJunit4TestCaseWithConstructorParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/Categories.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/Categories.java index 58de29fd1e94..0026a937b93a 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/Categories.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/Categories.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/CompletelyDynamicTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/CompletelyDynamicTestCase.java index add05ce7d9f6..150cf33efb32 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/CompletelyDynamicTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/CompletelyDynamicTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConcreteJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConcreteJUnit4TestCase.java index a6156449f57a..2680cb881b41 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConcreteJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConcreteJUnit4TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java index 00ee9c6cda24..10d640a510ed 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ConfigurableRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/DynamicRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/DynamicRunner.java index e3c04380c07b..8f58db958e00 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/DynamicRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/DynamicRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EmptyIgnoredTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EmptyIgnoredTestCase.java index 1d5cb5634b41..0c86f14738ca 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EmptyIgnoredTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EmptyIgnoredTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EnclosedJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EnclosedJUnit4TestCase.java index a13d7901b925..f6b9ec769115 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EnclosedJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/EnclosedJUnit4TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ExceptionThrowingRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ExceptionThrowingRunner.java index 5c5536ebb773..58d9f6dcb3c5 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ExceptionThrowingRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ExceptionThrowingRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCase.java index a73aff4301ba..19ea74600356 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCaseWithNotFilterableRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCaseWithNotFilterableRunner.java index 92daf578b349..c7a780f6bd78 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCaseWithNotFilterableRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredJUnit4TestCaseWithNotFilterableRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java index ee35d42b54a5..4e3168fa5258 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/IgnoredParameterizedTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java index 281019b85882..7811e4b33ffd 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithFilterableChildRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithFilterableChildRunner.java index 2a0ef130a4c5..8fe310355e28 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithFilterableChildRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithFilterableChildRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithIgnoredJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithIgnoredJUnit4TestCase.java index 77819b3ec5a0..7aec2deefb7f 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithIgnoredJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithIgnoredJUnit4TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java index 5ba7a57fcdc8..60e57a529d83 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithErrorInBeforeClass.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithErrorInBeforeClass.java index c9ddf271f3e8..ae88b62d8ce4 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithErrorInBeforeClass.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteOfSuiteWithJUnit4TestCaseWithErrorInBeforeClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithExceptionThrowingRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithExceptionThrowingRunner.java index a8c0b6a0c104..1bb289adf1d3 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithExceptionThrowingRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithExceptionThrowingRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithIgnoredJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithIgnoredJUnit4TestCase.java index 3112feff9f5f..6f7a0b0a7d02 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithIgnoredJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithIgnoredJUnit4TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit3SuiteWithSingleTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit3SuiteWithSingleTestCase.java index 6dfb96131dc1..98b28e932837 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit3SuiteWithSingleTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit3SuiteWithSingleTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java index 304e40605ca4..c36ff60c1982 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithAssumptionFailureInBeforeClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithErrorInBeforeClass.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithErrorInBeforeClass.java index ca172cf6233d..c5e60d152fca 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithErrorInBeforeClass.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithErrorInBeforeClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java index 196f5302851a..bc0db4f1639a 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java index 008358859a35..6b1718822653 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithJUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java index b0463c61e009..146d004d93a8 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithPlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithTwoTestCases.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithTwoTestCases.java index 486688be1c03..df3afd2b8fb2 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithTwoTestCases.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4SuiteWithTwoTestCases.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithAssumptionFailureInBeforeClass.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithAssumptionFailureInBeforeClass.java index b741baf01681..635562ece9dd 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithAssumptionFailureInBeforeClass.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithAssumptionFailureInBeforeClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java index b1f777662a8c..ad6f1603490b 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithDistinguishableOverloadedMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorCollectorStoringMultipleFailures.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorCollectorStoringMultipleFailures.java index 47ce826d9ced..6b2a53ad977a 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorCollectorStoringMultipleFailures.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorCollectorStoringMultipleFailures.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInAfterClass.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInAfterClass.java index 14f2af0190bc..495c1ee962ab 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInAfterClass.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInAfterClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInBeforeClass.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInBeforeClass.java index a519c7702d10..bce83eee8e71 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInBeforeClass.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithErrorInBeforeClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithExceptionThrowingRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithExceptionThrowingRunner.java index c878e75bc50c..c807d7b17a6a 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithExceptionThrowingRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithExceptionThrowingRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java index 29c611b0026d..82d3f4c1c471 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithFailingDescriptionThatIsNotReportedAsFinished.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithIndistinguishableOverloadedMethod.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithIndistinguishableOverloadedMethod.java index 5024ad818e6a..222c97e54330 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithIndistinguishableOverloadedMethod.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithIndistinguishableOverloadedMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithNotFilterableRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithNotFilterableRunner.java index 646c343a6cfa..f3c901c37e4d 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithNotFilterableRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithNotFilterableRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java index f0c3720a0f42..175cfeec0d26 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java index 3951efd1a568..c79eebdd9d83 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithDuplicateChangingChildDescriptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java index b397cba754a4..0835e614b9a1 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/MalformedJUnit4TestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/NotFilterableRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/NotFilterableRunner.java index 43c2a2581e6f..f0890b7b8ccc 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/NotFilterableRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/NotFilterableRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java index 54c05a3f7235..0f1c0d339cfa 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/ParameterizedTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithFiveTestMethods.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithFiveTestMethods.java index c011490cf9f2..114f65bd7218 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithFiveTestMethods.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithFiveTestMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithLifecycleMethods.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithLifecycleMethods.java index b65aa62ad4bd..b03e9608bb56 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithLifecycleMethods.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithLifecycleMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleInheritedTestWhichFails.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleInheritedTestWhichFails.java index 754357373fde..f5a0a6c0a9f0 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleInheritedTestWhichFails.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleInheritedTestWhichFails.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichFails.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichFails.java index 369ea2284dc8..85b64024c986 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichFails.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichFails.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java index 03674c04eb77..011a7b177128 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithSingleTestWhichIsIgnored.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithTwoTestMethods.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithTwoTestMethods.java index 1143b6c19911..133c0c487883 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithTwoTestMethods.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/PlainJUnit4TestCaseWithTwoTestMethods.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java index 5fe2f0e3efe7..202d96f6da45 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerThatOnlyReportsFailures.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java index 0763719d7b0b..971f19cc642f 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/SingleFailingTheoryTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/SingleFailingTheoryTestCase.java index 30b4658eeec6..054104725c95 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/SingleFailingTheoryTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/SingleFailingTheoryTestCase.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/TestCaseRunWithJUnitPlatformRunner.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/TestCaseRunWithJUnitPlatformRunner.java index 81c6439a574d..99596696558d 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/TestCaseRunWithJUnitPlatformRunner.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/TestCaseRunWithJUnitPlatformRunner.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/jmh/java/org/junit/jupiter/jmh/AssertionBenchmarks.java b/platform-tests/src/jmh/java/org/junit/jupiter/jmh/AssertionBenchmarks.java index b3785ada9fe2..d41d7a86f7d2 100644 --- a/platform-tests/src/jmh/java/org/junit/jupiter/jmh/AssertionBenchmarks.java +++ b/platform-tests/src/jmh/java/org/junit/jupiter/jmh/AssertionBenchmarks.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/DefaultPackageTestCase.java b/platform-tests/src/test/java/DefaultPackageTestCase.java index addd6a31bd68..e902fc670a05 100644 --- a/platform-tests/src/test/java/DefaultPackageTestCase.java +++ b/platform-tests/src/test/java/DefaultPackageTestCase.java @@ -1,6 +1,6 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/jupiter/api/condition/OSTests.java b/platform-tests/src/test/java/org/junit/jupiter/api/condition/OSTests.java index 6c415c3f3513..7b787fcf298f 100644 --- a/platform-tests/src/test/java/org/junit/jupiter/api/condition/OSTests.java +++ b/platform-tests/src/test/java/org/junit/jupiter/api/condition/OSTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java index fce622ec973e..ae8998cb783d 100644 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java +++ b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java index 316acdab1a22..c57687960147 100644 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java +++ b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java index 89ae7d5bd3c9..a2823d758210 100644 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java +++ b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/AbstractEqualsAndHashCodeTests.java b/platform-tests/src/test/java/org/junit/platform/AbstractEqualsAndHashCodeTests.java index 26902302155c..3ec2fba68fea 100644 --- a/platform-tests/src/test/java/org/junit/platform/AbstractEqualsAndHashCodeTests.java +++ b/platform-tests/src/test/java/org/junit/platform/AbstractEqualsAndHashCodeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/JUnitPlatformTestSuite.java b/platform-tests/src/test/java/org/junit/platform/JUnitPlatformTestSuite.java index 4d16c20a99fe..d634d52c9f8b 100644 --- a/platform-tests/src/test/java/org/junit/platform/JUnitPlatformTestSuite.java +++ b/platform-tests/src/test/java/org/junit/platform/JUnitPlatformTestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/TestEngineTests.java b/platform-tests/src/test/java/org/junit/platform/TestEngineTests.java index ec8bd0e19524..4a4d7551c68f 100644 --- a/platform-tests/src/test/java/org/junit/platform/TestEngineTests.java +++ b/platform-tests/src/test/java/org/junit/platform/TestEngineTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/annotation/TestableAnnotationTests.java b/platform-tests/src/test/java/org/junit/platform/commons/annotation/TestableAnnotationTests.java index ec2db2b8e235..de8db8c1ce17 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/annotation/TestableAnnotationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/annotation/TestableAnnotationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java b/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java index 3521213e8c09..87aff28c74cf 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/function/TryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java index 42d46cc57c26..bb68f22feeac 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/AnnotationSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/ClassSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/ClassSupportTests.java index 8a993c563c87..0d5bf3f035c4 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/ClassSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/ClassSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/ModifierSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/ModifierSupportTests.java index 8a9d30acb2e8..c4222bd23c9f 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/ModifierSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/ModifierSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java b/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java index bb51916cd308..a9cb66e78922 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/PreconditionAssertions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java index 8262a31b7a07..46b9dedc1288 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java index 76d9c9fd9862..6f7e2cf00747 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/AnnotationUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java index 13e296cfb8f1..bc4ce0de5d67 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassLoaderUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java index 0567ae3eaeea..12f2dda8e469 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java index 5aa80642e595..1d2e857c59dd 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java index a752394aef77..b1bf941f99ee 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java index d836fdf7bc52..ef55a0344537 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/CollectionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ExceptionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ExceptionUtilsTests.java index e4e0ee28fe96..736273453d2e 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ExceptionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ExceptionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java index 2d4f03a75262..507857f62bf4 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/FunctionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/LruCacheTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/LruCacheTests.java index 7a6775b62d0f..ec0668ac601c 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/LruCacheTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/LruCacheTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ModuleUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ModuleUtilsTests.java index 6834edeeecce..6effa2bcae0b 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ModuleUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ModuleUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java index cc30ab49ee16..ee9fe5b8e26d 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java index edfedaec8a90..cbbc4b82e54f 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/PreconditionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java index d1ae36e6df88..58f9775a39ed 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java index d68b48a36ea4..3f42f01f9a7a 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ReflectionUtilsWithGenericTypeHierarchiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/RuntimeUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/RuntimeUtilsTests.java index ad65dbc84bc6..66cb4fb1baad 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/RuntimeUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/RuntimeUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java b/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java index 838a8e3d0489..847ad5040481 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/SerializationUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java index bbf2cbc4b2c5..54115734a725 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/StringUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java index 9ce48ce795ab..ec2d2ca19adc 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ToStringBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AExecutionConditionClass.java b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AExecutionConditionClass.java index ad3407d1bb44..461b1f325f2a 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AExecutionConditionClass.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AExecutionConditionClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/ATestExecutionListenerClass.java b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/ATestExecutionListenerClass.java index 16aa53e90336..226712dfea11 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/ATestExecutionListenerClass.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/ATestExecutionListenerClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AVanillaEmpty.java b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AVanillaEmpty.java index 81a35b9e79ed..65b45ef2b94b 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AVanillaEmpty.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/AVanillaEmpty.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BExecutionConditionClass.java b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BExecutionConditionClass.java index 04585487289a..ed54d32ba7ca 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BExecutionConditionClass.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BExecutionConditionClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BTestExecutionListenerClass.java b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BTestExecutionListenerClass.java index 3e8e2872afc6..c5790d84e263 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BTestExecutionListenerClass.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BTestExecutionListenerClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BVanillaEmpty.java b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BVanillaEmpty.java index b43b9e85aafe..15ef8bdbcb02 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BVanillaEmpty.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/classes/BVanillaEmpty.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java index 4e39a4a3a802..01b208b62290 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleDetailsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java index bf37a87b39af..2dda1beb0c01 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherExecutionResultTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java index 073bb1c63360..89c999053f37 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java index 363197658cd1..566b0742d136 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java index e010155592c8..05c93d4cfdfd 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapperResult.java b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapperResult.java index bc8808128510..195cb9ed62dd 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapperResult.java +++ b/platform-tests/src/test/java/org/junit/platform/console/ConsoleLauncherWrapperResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java index a4a61fb4a0d3..e163214ef7a1 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/options/ThemeTests.java b/platform-tests/src/test/java/org/junit/platform/console/options/ThemeTests.java index 42ef2fe16ebd..776257e5959e 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/options/ThemeTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/options/ThemeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTest.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTest.java index 5cc0efc2e0c0..38dfc294423c 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTest.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTests.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTests.java index 9b7fe61806ac..a8a1977020ff 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForInnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTest.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTest.java index d9240cb28cc3..1cbd5b9a7b64 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTest.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTests.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTests.java index 6ecca48a183e..a5a872c49a93 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ContainerForStaticNestedTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/SecondTest.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/SecondTest.java index 764a600178d9..2e45164e33c0 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/SecondTest.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/SecondTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test.java index 46d5e7fc0d34..64b66b7dd568 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test1.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test1.java index 341272f37521..0c264b83a487 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test1.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/Test1.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/Tests.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/Tests.java index 631c11133336..8aee33f5c4e1 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/Tests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ThirdTests.java b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ThirdTests.java index 9986d9ebda0a..53bcb1cd8fdb 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/subpackage/ThirdTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/subpackage/ThirdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java index b78479d7a3aa..2ca1e4320de4 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/ConsoleTestExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java index 058d20c5f971..77efc0cdafee 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/CustomContextClassLoaderExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java index 7543298649e7..cb2745359a1f 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/DiscoveryRequestCreatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java index d745ad2ad638..fd731358cae8 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/FlatPrintingListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java index de7a1f3a00ff..8d218170b9ac 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreeNodeTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java index e7487fb9a994..95ea579f9738 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/TreePrinterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java b/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java index a69451ee122a..a172bdcc1995 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/tasks/VerboseTreeListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java b/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java index b3728eb20426..400ce7bc4304 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/FilterCompositionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/TestDescriptorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/TestDescriptorTests.java index 4b184385f6ee..d9198a47ad17 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/TestDescriptorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/TestDescriptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java b/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java index 2352bf19381d..ff57740b1cd4 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/TestTagTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java index 851990fbdef0..3b1298f50488 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdFormatTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java index bbaf6b15d107..f3a01a506da3 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java index 82ca3a17fb4d..85a5959e74b9 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassNameFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java index d4bc907069df..8b07b914b1a8 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClassSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathResourceSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathResourceSelectorTests.java index 67f34d315f00..e07907d9355f 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathResourceSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathResourceSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathRootSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathRootSelectorTests.java index 65ee11c9cfc0..ebf1c08fad54 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathRootSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ClasspathRootSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DirectorySelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DirectorySelectorTests.java index b367e8b86914..91ac2ed262bf 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DirectorySelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DirectorySelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java index c66a17059cf0..c94a4860bdf9 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/DiscoverySelectorsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java index 63fcaca67e50..2f1f46f7388c 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/FilePositionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/FileSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/FileSelectorTests.java index 970815160de1..905f175839db 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/FileSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/FileSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java index 9729b108232a..700987f483f3 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/MethodSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ModuleSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ModuleSelectorTests.java index 9edeaab82492..468415f81c7a 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/ModuleSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/ModuleSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedClassSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedClassSelectorTests.java index 63288527500b..8f9cf88bda69 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedClassSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedClassSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedMethodSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedMethodSelectorTests.java index 405416dbdac7..831f9e636beb 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedMethodSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/NestedMethodSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java index ef672c456ac7..bcb0e078f278 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageNameFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageSelectorTests.java index abc4f76e7029..afa33556b816 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/PackageSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/UniqueIdSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/UniqueIdSelectorTests.java index e29d31223657..de8a24ee3a72 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/UniqueIdSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/UniqueIdSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/discovery/UriSelectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/discovery/UriSelectorTests.java index 796ca31b0219..5cf25cd3c85e 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/discovery/UriSelectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/discovery/UriSelectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java index 21941cb49a16..52a07568cf97 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/config/PrefixedConfigurationParametersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java index 522e08115b11..82de658318ce 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestDescriptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java index 3ebb2a2105e5..bda2bc614a7d 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/AbstractTestSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java index c9ef68082966..cd7688ff3df8 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClassSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java index 82eca17f5c7d..770e6fe3d46d 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/ClasspathResourceSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java index 059fc277bfec..44d5005ead18 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/CompositeTestSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java index 11ba87897b92..1806a72c3724 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DefaultUriSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java index 01307356383c..f435cd9f111c 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoClassTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java index 1401d34997a8..ad128096bd69 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/DemoMethodTestDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java index c93dc0cf98c5..d3b30c5673db 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FilePositionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java index 41debcde238f..a3aaaeb95baa 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/FileSystemSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java index 001cfd77dfe7..f5e0fde6f1e1 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/MethodSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java index 0ef5b8ab69cd..23655be4feae 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/descriptor/PackageSourceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java index 0ae2ec0aedcb..bc1dfe6ce357 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/CompositeLockTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java index c8db3d759403..119caed41735 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/DefaultParallelExecutionConfigurationStrategyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java index 20167699afeb..df89984acb30 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/HierarchicalTestExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java index dac88f8367ff..fad8d16f22ca 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/LockManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/MemoryLeakTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/MemoryLeakTests.java index 18a662392d66..173b09dd5390 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/MemoryLeakTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/MemoryLeakTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java index 7cb996d3e2d7..db399188d59a 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java index c32d73105ee1..e719767df803 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ResourceLockSupport.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ResourceLockSupport.java index caf8d85c894c..fbbfd080d55b 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ResourceLockSupport.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ResourceLockSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SameThreadExecutionIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SameThreadExecutionIntegrationTests.java index 2707428e839c..657515dfe52f 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SameThreadExecutionIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SameThreadExecutionIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java index c0fa0b930cd3..3b39d74d2b0d 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleLockTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java index 6b9daa061f18..514850f814c5 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/SingleTestExecutorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java index a7b9e34c4b3c..89c3459049b5 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ThrowableCollectorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java index c70de8452e61..11257652f8e9 100644 --- a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingDiscoveryListenerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java index 36ff8135f444..9ec0eaa0ecc2 100644 --- a/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/jfr/FlightRecordingExecutionListenerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/DiscoveryFilterStub.java b/platform-tests/src/test/java/org/junit/platform/launcher/DiscoveryFilterStub.java index a81e15f0092f..86999dfeea7b 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/DiscoveryFilterStub.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/DiscoveryFilterStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/FilterStub.java b/platform-tests/src/test/java/org/junit/platform/launcher/FilterStub.java index d8b558b7b6ba..2a9782454475 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/FilterStub.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/FilterStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/PostDiscoveryFilterStub.java b/platform-tests/src/test/java/org/junit/platform/launcher/PostDiscoveryFilterStub.java index a23a6810c171..e9be8894e765 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/PostDiscoveryFilterStub.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/PostDiscoveryFilterStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java index 1880936bbe20..389a48a9ccbf 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TagFilterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TagIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TagIntegrationTests.java index 6f5e9089eb92..c26fdc3142fb 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TagIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TagIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java index b82c02615a99..2d5a29d5b66b 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestIdentifierTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java index c91e9fe3dea0..1c2de148b093 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherDiscoveryListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java index 335ba892d693..46d6cad63f89 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestLauncherSessionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java index f7f77f4e017a..65e313100c2d 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestPlanTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java b/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java index c2941901e504..2a448877ed43 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/TestPostDiscoveryTagFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java index 9da3af4a23b4..7475acee1cc2 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/CompositeTestExecutionListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java index 0ff85c43cc1b..5c3b457d91f8 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/DefaultLauncherTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java index 9b6e453d3cef..13a280be24c1 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/EngineDiscoveryResultValidatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java index a1e7eddc2d9a..88a256addbe4 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/ExecutionListenerAdapterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java index 5f9712f76d67..a419cc8928cf 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java index 217a3705b006..b380b4db7c7f 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherConfigurationParametersTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java index a3d6833987c4..8d0630f5dc45 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherDiscoveryRequestBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java index 5a42197c9ce2..31e0d98080f9 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java index 25488058b727..e4c3523e489a 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherSessionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java index 68c7b6b5478f..abefde4b1d53 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/ListenerRegistryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java index 9c2e2cd99c33..977a5b43ae33 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptingTestExecutionListenerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java index 3c9e9ee18aff..c39550078382 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/StreamInterceptorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/AnotherUnusedTestExecutionListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/AnotherUnusedTestExecutionListener.java index f23538e6afd7..2d41ae6f778a 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/AnotherUnusedTestExecutionListener.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/AnotherUnusedTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/NoopTestExecutionListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/NoopTestExecutionListener.java index 4f8ca1f7ba24..d2cf26b0f506 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/NoopTestExecutionListener.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/NoopTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java index 56fda7ca14d8..85fb04c13524 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UnusedTestExecutionListener.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UnusedTestExecutionListener.java index bef4cec18d4e..6e4bc4390b8f 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UnusedTestExecutionListener.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UnusedTestExecutionListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListenerTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListenerTests.java index a9d647d45c41..17c52de1a978 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbortOnFailureLauncherDiscoveryListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java index f102928d4c9e..8e33cb23d7b4 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/AbstractLauncherDiscoveryListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java index fbac2f47f921..07bcd190a1df 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/discovery/LoggingLauncherDiscoveryListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java index c26431e30fe4..35054e05c125 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserErrorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserTests.java index 4f47b5b7e82f..d60802a39ca6 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/ParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java index 64c68a997519..e13a06dec87d 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TagExpressionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java index 5bacfc948009..ece4d0ff4bb8 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenizerTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenizerTests.java index 9df2a95263db..81762e33995b 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenizerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/tagexpression/TokenizerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java index 1f9343c58a96..0a2acf7774e4 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/LegacyReportingUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/IncrementingClock.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/IncrementingClock.java index 3668640ddb78..570e3d020d82 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/IncrementingClock.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/IncrementingClock.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java index bf834c0ed939..ae6e42870f38 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java index f9428edf52ac..a64c5d758ce0 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java index ca13a6782cb9..7f339554a6ed 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java index c47dae5d1239..923413491208 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java index 2f9b6075a8ea..cb4665600b52 100644 --- a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java index a3f386fa9b03..906ce70cb5ad 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EngineTestKitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java index cca1ddc6eddb..b380eeaaafef 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/EventsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java index 89fbca886766..f32413cea271 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java b/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java index 3d0ffad4d147..729ae1996c9f 100644 --- a/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java +++ b/platform-tests/src/test/java/org/junit/platform/testkit/engine/NestedContainerEventConditionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/ant-starter/src/main/java/com/example/project/Calculator.java b/platform-tooling-support-tests/projects/ant-starter/src/main/java/com/example/project/Calculator.java index c329fa8778cf..91436757229c 100644 --- a/platform-tooling-support-tests/projects/ant-starter/src/main/java/com/example/project/Calculator.java +++ b/platform-tooling-support-tests/projects/ant-starter/src/main/java/com/example/project/Calculator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/ant-starter/src/test/java/com/example/project/CalculatorTests.java b/platform-tooling-support-tests/projects/ant-starter/src/test/java/com/example/project/CalculatorTests.java index cab32965e36f..b0dfc0524564 100644 --- a/platform-tooling-support-tests/projects/ant-starter/src/test/java/com/example/project/CalculatorTests.java +++ b/platform-tooling-support-tests/projects/ant-starter/src/test/java/com/example/project/CalculatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/gradle-kotlin-extensions/src/test/kotlin/com/example/project/ExtensionFunctionsTests.kt b/platform-tooling-support-tests/projects/gradle-kotlin-extensions/src/test/kotlin/com/example/project/ExtensionFunctionsTests.kt index da654d31d4d8..b74c92e28f70 100644 --- a/platform-tooling-support-tests/projects/gradle-kotlin-extensions/src/test/kotlin/com/example/project/ExtensionFunctionsTests.kt +++ b/platform-tooling-support-tests/projects/gradle-kotlin-extensions/src/test/kotlin/com/example/project/ExtensionFunctionsTests.kt @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java b/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java index 1770520072e4..79025029964a 100644 --- a/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java +++ b/platform-tooling-support-tests/projects/gradle-missing-engine/src/test/java/FooTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/gradle-starter/src/main/java/com/example/project/Calculator.java b/platform-tooling-support-tests/projects/gradle-starter/src/main/java/com/example/project/Calculator.java index c329fa8778cf..91436757229c 100644 --- a/platform-tooling-support-tests/projects/gradle-starter/src/main/java/com/example/project/Calculator.java +++ b/platform-tooling-support-tests/projects/gradle-starter/src/main/java/com/example/project/Calculator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/gradle-starter/src/test/java/com/example/project/CalculatorTests.java b/platform-tooling-support-tests/projects/gradle-starter/src/test/java/com/example/project/CalculatorTests.java index cab32965e36f..b0dfc0524564 100644 --- a/platform-tooling-support-tests/projects/gradle-starter/src/test/java/com/example/project/CalculatorTests.java +++ b/platform-tooling-support-tests/projects/gradle-starter/src/test/java/com/example/project/CalculatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/maven-starter/src/main/java/com/example/project/Calculator.java b/platform-tooling-support-tests/projects/maven-starter/src/main/java/com/example/project/Calculator.java index c329fa8778cf..91436757229c 100644 --- a/platform-tooling-support-tests/projects/maven-starter/src/main/java/com/example/project/Calculator.java +++ b/platform-tooling-support-tests/projects/maven-starter/src/main/java/com/example/project/Calculator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/maven-starter/src/test/java/com/example/project/CalculatorTests.java b/platform-tooling-support-tests/projects/maven-starter/src/test/java/com/example/project/CalculatorTests.java index cab32965e36f..b0dfc0524564 100644 --- a/platform-tooling-support-tests/projects/maven-starter/src/test/java/com/example/project/CalculatorTests.java +++ b/platform-tooling-support-tests/projects/maven-starter/src/test/java/com/example/project/CalculatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java b/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java index 1520214c94da..2542b21a8011 100644 --- a/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java +++ b/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/JupiterIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/ModuleUtilsTests.java b/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/ModuleUtilsTests.java index 7c9645e40ede..a4f0442a40c2 100644 --- a/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/ModuleUtilsTests.java +++ b/platform-tooling-support-tests/projects/multi-release-jar/default/src/test/java/integration/integration/ModuleUtilsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterIntegration.java b/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterIntegration.java index ad9978760907..fbedffaffe6a 100644 --- a/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterIntegration.java +++ b/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterIntegration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterParamsIntegration.java b/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterParamsIntegration.java index 739a17a19ab2..d94a2f54ddd0 100644 --- a/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterParamsIntegration.java +++ b/platform-tooling-support-tests/projects/standalone/src/standalone/JupiterParamsIntegration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/projects/standalone/src/standalone/VintageIntegration.java b/platform-tooling-support-tests/projects/standalone/src/standalone/VintageIntegration.java index 9119f6e9fb3e..16bcab6704c6 100644 --- a/platform-tooling-support-tests/projects/standalone/src/standalone/VintageIntegration.java +++ b/platform-tooling-support-tests/projects/standalone/src/standalone/VintageIntegration.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java index 0cf68a0d3381..00ad77862d79 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java index f19c07e3e010..30d7048ce9ff 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Request.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java index 681f184d3391..816504c33e11 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java index 03996a1382a1..89e49437044d 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java index e253f12e3f58..71be9fd0b170 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ArchUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java index d59b1f939710..bc920124e32a 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java index 99f3f1362f82..7aeeb385d13b 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java index fb71356fa8e9..17cdcd5829e6 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java index fc5273efb42f..eafd69e23fc5 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java index dc481de1630a..0b8e60312086 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java index d58fe161e9a2..4b0b3242e9ff 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java index 3eb0dcc4a7c2..ae97a03580bb 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java index 8caf2081a3f6..256432a66317 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java index c66fee5b3258..4c69587bb0ef 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java index 832df24d1e5a..c33a507fbfdf 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java index 3d08523ceeb6..971f2c089d69 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java index c0291d095776..5986b927b988 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java index f4d715329d9d..9784a1030078 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java index 3da83f9a8588..055eb4f0e6f4 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java index ff890a63c46e..55a79bf4c779 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java index f6da542cd3ef..afbae951f852 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java index 140c515ec276..2823ee61cbf3 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index 4916f5761490..e654d896c294 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which diff --git a/src/spotless/eclipse-public-license-2.0.java b/src/spotless/eclipse-public-license-2.0.java index 5d687704ddb7..a74c31a03f26 100644 --- a/src/spotless/eclipse-public-license-2.0.java +++ b/src/spotless/eclipse-public-license-2.0.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-2021 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which From 4b010233e7485223de094f65d0e7b2438168f98f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 16 Jan 2021 21:56:27 +0100 Subject: [PATCH 0168/1433] Update Gradle plugins --- documentation/documentation.gradle.kts | 1 + gradle.properties | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index f3b6cb564ce5..157461ceea79 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -73,6 +73,7 @@ val apiGuardianDocVersion = if (versions.apiguardian.contains("SNAPSHOT")) "snap gitPublish { repoUri.set("https://github.com/junit-team/junit5.git") branch.set("gh-pages") + sign.set(false) contents { from(docsDir) diff --git a/gradle.properties b/gradle.properties index 0d38902b743a..43c9197a1f3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -47,14 +47,14 @@ surefire.version=2.22.2 bnd.version=5.2.0 # Plugins -gradle.enterprise.plugin.version=3.5 +gradle.enterprise.plugin.version=3.5.1 gradle.user-data.plugin.version=1.0.0 versioning.plugin.version=2.14.0 -versions.plugin.version=0.29.0 -spotless.plugin.version=5.6.1 -git-publish.plugin.version=2.1.3 +versions.plugin.version=0.36.0 +spotless.plugin.version=5.9.0 +git-publish.plugin.version=3.0.0 kotlin.plugin.version=1.4.0 asciidoctor-pdf.version=1.5.3 -asciidoctor.plugin.version=3.2.0 -jmh.plugin.version=0.5.0 +asciidoctor.plugin.version=3.3.0 +jmh.plugin.version=0.5.2 nohttp.plugin.version=0.0.5.RELEASE From 2d005728058a532340181bae9093267b262184ff Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 16 Jan 2021 21:57:06 +0100 Subject: [PATCH 0169/1433] Update dependencies --- buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts | 2 +- gradle.properties | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts b/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts index deb9fdced557..2c1dfc17e4d9 100644 --- a/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts +++ b/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts @@ -13,7 +13,7 @@ dependencies { } } pluginManager.withPlugin("osgi-conventions") { - "osgiVerification"("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:4.13_1") + "osgiVerification"("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:${versions["junit4.osgi"]}") } } diff --git a/gradle.properties b/gradle.properties index 43c9197a1f3f..cf2cab231675 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,11 +18,12 @@ org.gradle.parallel=true # Dependencies apiguardian.version=1.1.1 -assertj.version=3.16.1 +assertj.version=3.18.1 junit4.version=4.13.1 +junit4.osgi.version=4.13.1_1 junit4Min.version=4.12 opentest4j.version=1.2.0 -picocli.version=4.5.0 +picocli.version=4.6.1 univocity-parsers.version=2.9.0 # Test Dependencies From 2210c9920ac60f66be82daae23e9d7fa87cd0b80 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 16 Jan 2021 21:57:18 +0100 Subject: [PATCH 0170/1433] Update test dependencies --- gradle.properties | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index cf2cab231675..5eadff992814 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,12 +29,12 @@ univocity-parsers.version=2.9.0 # Test Dependencies archunit.version=0.15.0 bartholdy.version=0.2.3 -classgraph.version=4.8.87 -commons-io.version=2.7 -kotlinx-coroutines-core.version=1.3.9 -groovy.version=3.0.6 -log4j.version=2.13.3 -mockito.version=3.5.0 +classgraph.version=4.8.98 +commons-io.version=2.8.0 +kotlinx-coroutines-core.version=1.4.2 +groovy.version=3.0.7 +log4j.version=2.14.0 +mockito.version=3.7.7 slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 jfrunit.version=main-SNAPSHOT @@ -42,7 +42,7 @@ jfrunit.version=main-SNAPSHOT # Tools checkstyle.version=8.36.2 jacoco.version=0.8.6 -jmh.version=1.25 +jmh.version=1.27 ktlint.version=0.35.0 surefire.version=2.22.2 bnd.version=5.2.0 From e143c52b321acf86cd35dde5d0e8fd7f13c08d34 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 17 Jan 2021 13:48:21 +0100 Subject: [PATCH 0171/1433] Use groovy instead of groovy-all --- dependencies/dependencies.gradle.kts | 6 +++++- junit-jupiter-engine/junit-jupiter-engine.gradle.kts | 2 +- platform-tests/platform-tests.gradle.kts | 2 +- .../platform-tooling-support-tests.gradle.kts | 2 +- .../java/platform/tooling/support/tests/ManifestTests.java | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 27c846279ade..7921c47f032a 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -2,7 +2,12 @@ plugins { `java-platform` } +javaPlatform { + allowDependencies() +} + dependencies { + api(platform("org.codehaus.groovy:groovy-bom:${versions["groovy"]}")) constraints { // api means "the dependency is for both compilation and runtime" // runtime means "the dependency is only for runtime, not for compilation" @@ -13,7 +18,6 @@ dependencies { runtime("org.apache.logging.log4j:log4j-core:${versions["log4j"]}") runtime("org.apache.logging.log4j:log4j-jul:${versions["log4j"]}") api("io.github.classgraph:classgraph:${versions["classgraph"]}") - api("org.codehaus.groovy:groovy-all:${versions["groovy"]}") api("junit:junit:[${versions.junit4Min},)") { version { prefer(versions.junit4) diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 5daa63c41f1a..9f739e03db44 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -19,5 +19,5 @@ dependencies { testImplementation(project(":junit-platform-testkit")) testImplementation("org.jetbrains.kotlin:kotlin-stdlib") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") - testImplementation("org.codehaus.groovy:groovy-all") + testImplementation("org.codehaus.groovy:groovy") } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 596b3ef2bd46..592e0488562d 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -26,7 +26,7 @@ dependencies { // --- Test run-time dependencies --------------------------------------------- testRuntimeOnly(project(":junit-vintage-engine")) - testRuntimeOnly("org.codehaus.groovy:groovy-all") { + testRuntimeOnly("org.codehaus.groovy:groovy") { because("`ReflectionUtilsTests.findNestedClassesWithInvalidNestedClassFile` needs it") } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 1f45aa624309..e14f5271015e 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -25,7 +25,7 @@ dependencies { testImplementation("com.tngtech.archunit:archunit-junit5-api") { because("checking the architecture of JUnit 5") } - testImplementation("org.codehaus.groovy:groovy-all") { + testImplementation("org.codehaus.groovy:groovy") { because("it provides convenience methods to handle process output") exclude(group = "org.junit.platform", module = "junit-platform-launcher") } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java index 4c69587bb0ef..c39660a31b7d 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java @@ -11,9 +11,9 @@ package platform.tooling.support.tests; import static aQute.bnd.osgi.Constants.VERSION_ATTRIBUTE; -import static org.junit.Assert.assertNotNull; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static platform.tooling.support.Helper.createJarPath; import java.io.File; From 22b0cd338e5a1851ae6396a0952bb2923a7543c6 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 17 Jan 2021 14:05:42 +0100 Subject: [PATCH 0172/1433] Suppress illegal reflective access warnings from Groovy 2.5 --- junit-vintage-engine/junit-vintage-engine.gradle.kts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index 833224ac2713..360e763da5af 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -70,6 +70,11 @@ tasks { excludeTags("missing-junit4") } } + withType().configureEach { + // Workaround for Groovy 2.5 + jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED") + jvmArgs("--add-opens", "java.base/java.util=ALL-UNNAMED") + } check { dependsOn(testWithoutJUnit4) } From 16e5fe56b6caee8992dcabfb2e0bbb60a120f0a2 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 17 Jan 2021 14:37:26 +0100 Subject: [PATCH 0173/1433] Suppress ConsoleLauncher output unless there are test failures --- documentation/documentation.gradle.kts | 34 ++++++++++++++++++-------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 157461ceea79..dad56942de3f 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -107,19 +107,33 @@ require(externalModulesWithoutModularJavadoc.values.all { it.endsWith("/") }) { tasks { - val consoleLauncherTest by registering(JavaExec::class) { - dependsOn(testClasses) + val consoleLauncherTest by registering { + val runtimeClasspath = sourceSets["test"].runtimeClasspath + inputs.files(runtimeClasspath).withNormalizer(ClasspathNormalizer::class) val reportsDir = file("$buildDir/test-results") outputs.dir(reportsDir) outputs.cacheIf { true } - classpath = sourceSets["test"].runtimeClasspath - main = "org.junit.platform.console.ConsoleLauncher" - args("--scan-classpath") - args("--include-classname", ".*Tests") - args("--include-classname", ".*Demo") - args("--exclude-tag", "exclude") - args("--reports-dir", reportsDir) - systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") + doFirst { + val output = ByteArrayOutputStream() + val result = javaexec { + classpath = runtimeClasspath + main = "org.junit.platform.console.ConsoleLauncher" + args("--scan-classpath") + args("--include-classname", ".*Tests") + args("--include-classname", ".*Demo") + args("--exclude-tag", "exclude") + args("--reports-dir", reportsDir) + systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") + standardOutput = output + errorOutput = output + isIgnoreExitValue = true + } + if (result.exitValue != 0) { + System.out.write(output.toByteArray()) + System.out.flush() + } + result.rethrowFailure().assertNormalExitValue() + } } test { From bc92844361d4d3133f887786f7b6666e66f4c8d3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 17 Jan 2021 15:14:44 +0100 Subject: [PATCH 0174/1433] Configure Git author for documentation publishing --- documentation/documentation.gradle.kts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index dad56942de3f..917a6dd245c0 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -385,8 +385,19 @@ tasks { into("$docsDir/current") } + val configureGitAuthor by registering { + dependsOn(gitPublishReset) + doFirst { + File(gitPublish.repoDir.get().asFile, ".git/config").appendText(""" + [user] + name = JUnit Team + email = team@junit.org + """.trimIndent()) + } + } + gitPublishCommit { - dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder) + dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder, configureGitAuthor) } } From 8385518cc7f53d0267eaf617a7d6f94c6987b1c8 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 16 Jan 2021 03:54:20 +0100 Subject: [PATCH 0175/1433] Block parallel tests longer on CI Various tests in `ParallelExecutionIntegrationTests` verify that different tests were indeed executed by different threads. To ensure that an incorrect implementation does not block the test suite indefinitely these tests contain an intentional race condition. This race condition assumes awaiting at most 100ms will be sufficient to schedule another thread. This assumption is hardware dependent and does not hold on Github CI[1]. Increasing the maximum time spend waiting by a factor 10 while in CI is hopefully sufficient. 1. https://github.com/junit-team/junit5/pull/2416/checks?check_run_id=1712237454 ``` 2021-01-16T02:00:44.8166959Z > Task :platform-tests:test 2021-01-16T02:00:44.8167430Z 2021-01-16T02:00:44.8168932Z ParallelExecutionIntegrationTests > customContextClassLoader() FAILED 2021-01-16T02:00:44.8177847Z java.lang.AssertionError: 2021-01-16T02:00:44.8178812Z Expected size:<3> but was:<2> in: 2021-01-16T02:00:44.8179762Z <["ForkJoinPool-19-worker-3", "ForkJoinPool-19-worker-5"]> 2021-01-16T02:00:44.8183737Z at org.junit.platform.engine.support.hierarchical.ParallelExecutionIntegrationTests.customContextClassLoader(ParallelExecutionIntegrationTests.java:135) 2021-01-16T02:01:05.6171111Z 2021-01-16T02:01:05.6173697Z ParallelExecutionIntegrationTests > customContextClassLoader() FAILED 2021-01-16T02:01:05.6175991Z java.lang.AssertionError: 2021-01-16T02:01:05.6177743Z Expected size:<3> but was:<2> in: 2021-01-16T02:01:05.6178859Z <["ForkJoinPool-1-worker-3", "ForkJoinPool-1-worker-5"]> 2021-01-16T02:01:05.6183298Z at org.junit.platform.engine.support.hierarchical.ParallelExecutionIntegrationTests.customContextClassLoader(ParallelExecutionIntegrationTests.java:135) 2021-01-16T02:01:09.0267715Z 2021-01-16T02:01:09.0280937Z 2021-01-16T02:01:09.0282574Z ParallelExecutionIntegrationTests > customContextClassLoader() FAILED 2021-01-16T02:01:09.0283978Z 1534 tests completed, 3 failed, 7 skipped 2021-01-16T02:01:09.0284818Z java.lang.AssertionError: 2021-01-16T02:01:09.0290826Z Expected size:<3> but was:<2> in: 2021-01-16T02:01:09.0291728Z <["ForkJoinPool-1-worker-3", "ForkJoinPool-1-worker-5"]> 2021-01-16T02:01:09.0295567Z at org.junit.platform.engine.support.hierarchical.ParallelExecutionIntegrationTests.customContextClassLoader(ParallelExecutionIntegrationTests.java:135) ``` --- .../ParallelExecutionIntegrationTests.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java index e719767df803..a7f5eec8d7bf 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java @@ -766,7 +766,7 @@ private static int incrementAndBlock(AtomicInteger sharedResource, CountDownLatc throws InterruptedException { var value = sharedResource.incrementAndGet(); countDownLatch.countDown(); - countDownLatch.await(100, MILLISECONDS); + countDownLatch.await(estimateSimulatedTestDurationInMiliseconds(), MILLISECONDS); return value; } @@ -774,10 +774,25 @@ private static void storeAndBlockAndCheck(AtomicInteger sharedResource, CountDow throws InterruptedException { var value = sharedResource.get(); countDownLatch.countDown(); - countDownLatch.await(100, MILLISECONDS); + countDownLatch.await(estimateSimulatedTestDurationInMiliseconds(), MILLISECONDS); assertEquals(value, sharedResource.get()); } + /** + * To simulate tests running in parallel tests will modify a shared + * resource, simulate work by waiting, then check if the shared resource was + * not modified by any other thread. + * + * Depending on system performance the simulation of work needs to be longer + * on slower systems to ensure tests can run in parallel. + * + * Currently CI is known to be slow. + */ + private static long estimateSimulatedTestDurationInMiliseconds() { + var runningInCi = Boolean.valueOf(System.getenv("CI")); + return runningInCi ? 1000 : 100; + } + static class ThreadReporter implements AfterTestExecutionCallback { private static Stream getLoaderNames(List events) { From e3d77d40063a9cf1e24e75985fab2ce636d8a0c8 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 18 Jan 2021 18:13:03 +0100 Subject: [PATCH 0176/1433] Fix @since and @API versions in ClassNamePatternFilterUtils --- .../platform/commons/util/ClassNamePatternFilterUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java index 2bfe68b09c88..85e11aaf23e6 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClassNamePatternFilterUtils.java @@ -31,9 +31,9 @@ * itself. Any usage by external parties is not supported. * Use at your own risk! * - * @since 5.7 + * @since 1.7 */ -@API(status = INTERNAL, since = "5.7") +@API(status = INTERNAL, since = "1.7") public class ClassNamePatternFilterUtils { private ClassNamePatternFilterUtils() { From ae9167891568cdd06a244b64bd8ab54afa1f0276 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 18 Jan 2021 18:13:34 +0100 Subject: [PATCH 0177/1433] Fix @since version in ClassNamePatternFilterUtilsTests --- .../platform/commons/util/ClassNamePatternFilterUtilsTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java index 12f2dda8e469..f2ba82645a5f 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClassNamePatternFilterUtilsTests.java @@ -30,7 +30,7 @@ /** * Unit tests for {@link ClassNamePatternFilterUtils}. * - * @since 5.7 + * @since 1.7 */ @TestInstance(Lifecycle.PER_CLASS) class ClassNamePatternFilterUtilsTests { From 0cd71078b4ea62268bcb26626bbb09dcdbc746ae Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 19 Jan 2021 21:09:23 +0100 Subject: [PATCH 0178/1433] Use correct version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5eadff992814..eda9a86e036f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -49,7 +49,7 @@ bnd.version=5.2.0 # Plugins gradle.enterprise.plugin.version=3.5.1 -gradle.user-data.plugin.version=1.0.0 +gradle.user-data.plugin.version=1.0 versioning.plugin.version=2.14.0 versions.plugin.version=0.36.0 spotless.plugin.version=5.9.0 From a4211d8ac7797fc7cabf0192fb8169b833ff0e63 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Sun, 24 Jan 2021 09:48:41 +0100 Subject: [PATCH 0179/1433] Update AssertJ to 3.19.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index eda9a86e036f..9a5a6cbdbb70 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ org.gradle.parallel=true # Dependencies apiguardian.version=1.1.1 -assertj.version=3.18.1 +assertj.version=3.19.0 junit4.version=4.13.1 junit4.osgi.version=4.13.1_1 junit4Min.version=4.12 From e08ab9e6adfc3ed8b0ae3942cc3ac56c2c010fb1 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 24 Jan 2021 11:33:09 +0100 Subject: [PATCH 0180/1433] Upgradle to 6.8.1 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 87e87435cbe3..f604ed1642c0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=e2774e6fb77c43657decde25542dea710aafd78c4022d19b196e7e78d79d8c6c -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +distributionSha256Sum=fd591a34af7385730970399f473afabdb8b28d57fd97d6625c388d090039d6fd +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 33f7d6e7832a6bc05d81c67e43d8bcda6590a795 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Tue, 26 Jan 2021 17:43:04 +0100 Subject: [PATCH 0181/1433] Fix package path computation in ClasspathScanner Prior to this commit no trailing `/` character was appended to the computed package path. Now, except for the default package `""`, a `/` is appended to package path. This leads to corrected and documented behavior even if two modules start with the same name elements. Fixes #2500 --- .../release-notes/release-notes-5.8.0-M1.adoc | 3 +- .../commons/util/ClasspathScanner.java | 6 ++- .../commons/util/ClasspathScannerTests.java | 44 ++++++++++++++---- .../src/test/resources/com.greetings@1-ea.jar | Bin 1380 -> 0 bytes .../modules-2500/foo.bar/FooBar.java | 3 ++ .../modules-2500/foo.bar/module-info.java | 3 ++ .../test/resources/modules-2500/foo/Foo.java | 3 ++ .../modules-2500/foo/module-info.java | 3 ++ .../support/tests/JavacModulesTests.java | 1 + 9 files changed, 54 insertions(+), 12 deletions(-) delete mode 100644 platform-tests/src/test/resources/com.greetings@1-ea.jar create mode 100644 platform-tests/src/test/resources/modules-2500/foo.bar/FooBar.java create mode 100644 platform-tests/src/test/resources/modules-2500/foo.bar/module-info.java create mode 100644 platform-tests/src/test/resources/modules-2500/foo/Foo.java create mode 100644 platform-tests/src/test/resources/modules-2500/foo/module-info.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 889669b54a38..a39045f25bcb 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -15,7 +15,8 @@ on GitHub. ==== Bug Fixes -* ❓ +* Method `scanForClassesInPackage(String)` in `ClasspathScanner` now returns a valid list + of class names when the package name is equal to the name of a module on the module path. ==== Deprecations and Breaking Changes diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java index 08a6b3535a7d..398332d7d25a 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java @@ -211,7 +211,11 @@ private ClassLoader getClassLoader() { } private static String packagePath(String packageName) { - return packageName.replace(PACKAGE_SEPARATOR_CHAR, CLASSPATH_RESOURCE_PATH_SEPARATOR); + if (packageName.isEmpty()) { + return ""; + } + String path = packageName.replace(PACKAGE_SEPARATOR_CHAR, CLASSPATH_RESOURCE_PATH_SEPARATOR); + return path + CLASSPATH_RESOURCE_PATH_SEPARATOR; } private List getRootUrisForPackage(String basePackageName) { diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java index b1bf941f99ee..72b07feccba4 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/ClasspathScannerTests.java @@ -33,6 +33,7 @@ import java.util.function.Predicate; import java.util.logging.Level; import java.util.logging.LogRecord; +import java.util.spi.ToolProvider; import java.util.stream.Collectors; import org.junit.jupiter.api.Test; @@ -180,22 +181,45 @@ void scanForClassesInPackage() { @Test // #2500 - void scanForClassesInPackageWithinModuleSharingNames() throws Exception { - var jarfile = getClass().getResource("/com.greetings@1-ea.jar"); + void scanForClassesInPackageWithinModulesSharingNamePrefix(@TempDir Path temp) throws Exception { + var moduleSourcePath = Path.of(getClass().getResource("/modules-2500/").toURI()).toString(); + run("javac", "--module", "foo,foo.bar", "--module-source-path", moduleSourcePath, "-d", temp.toString()); - var module = "com.greetings"; + checkModules2500(ModuleFinder.of(temp)); // exploded modules + + var foo = temp.resolve("foo.jar"); + var bar = temp.resolve("foo.bar.jar"); + run("jar", "--create", "--file", foo.toString(), "-C", temp.resolve("foo").toString(), "."); + run("jar", "--create", "--file", bar.toString(), "-C", temp.resolve("foo.bar").toString(), "."); + + checkModules2500(ModuleFinder.of(foo, bar)); // jarred modules + + System.gc(); // required on Windows in order to release JAR file handles + } + + private static int run(String tool, String... args) { + return ToolProvider.findFirst(tool).orElseThrow().run(System.out, System.err, args); + } + + private void checkModules2500(ModuleFinder finder) { + var root = "foo.bar"; var before = ModuleFinder.of(); - var finder = ModuleFinder.of(Path.of(jarfile.toURI())); var boot = ModuleLayer.boot(); - var configuration = boot.configuration().resolveAndBind(before, finder, Set.of(module)); + var configuration = boot.configuration().resolve(before, finder, Set.of(root)); var parent = ClassLoader.getPlatformClassLoader(); var layer = ModuleLayer.defineModulesWithOneLoader(configuration, List.of(boot), parent).layer(); - var classpathScanner = new ClasspathScanner(() -> layer.findLoader(module), ReflectionUtils::tryToLoadClass); - - var classes = classpathScanner.scanForClassesInPackage("com.greetings", allClasses); - var classNames = classes.stream().map(Class::getName).collect(Collectors.toList()); - assertThat(classNames).hasSize(1).contains("com.greetings.Main"); + var classpathScanner = new ClasspathScanner(() -> layer.findLoader(root), ReflectionUtils::tryToLoadClass); + { + var classes = classpathScanner.scanForClassesInPackage("foo", allClasses); + var classNames = classes.stream().map(Class::getName).collect(Collectors.toList()); + assertThat(classNames).hasSize(2).contains("foo.Foo", "foo.bar.FooBar"); + } + { + var classes = classpathScanner.scanForClassesInPackage("foo.bar", allClasses); + var classNames = classes.stream().map(Class::getName).collect(Collectors.toList()); + assertThat(classNames).hasSize(1).contains("foo.bar.FooBar"); + } } @Test diff --git a/platform-tests/src/test/resources/com.greetings@1-ea.jar b/platform-tests/src/test/resources/com.greetings@1-ea.jar deleted file mode 100644 index 38c7b065939520c1cc747b02cbb4e2acacdda028..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1380 zcmWIWW@Zs#;Nak35ScF@$bbYm8CV#6T|*poJ^kGD|D9rBU}gyLX6FE@V1gw{R=$JI~Y~A6>8x?o#*50=_>i_%x z3#U4D%G@7anr*&$_7<)dg^C+re;!I|>s1IfS$O#_=M!o7wMtXcoLSTIgZ9U$xoGNc z{_U#0HV))A=Y6ZhqJTEX0Wog32?Awv^HWN5Qgt))((?6^a}tY-eSNL@ngRsogt7?Q za~zBASh!)6$wp(tk1YN%oLzfb)UVAueTcb2<1w?+uA_BnY3XtAj|(3Vk~_Hbg!9Bt zIw$)sF$vzWSFq@ut-zyH$@yr`&sixOKP3wE6darN(Zo1^#!okunXIe-{dg#RgJt&@ zu5V5o`P(mWiMQPI6RSM(S|zn<=gKC|!&NuCUg#u+wFL4`dAB-5qm(`B$FxSpQ@eX7 z&I>LnF?W2CeRV-RE93 zv+nc~$(MJoDc_Kln@81r3nO5X_Z u4ypq=wIf0bl-`j;5tQB$KnfUuAlndn5vf1Go0Scuk_`w8fOgzt2JrxLE2uXB diff --git a/platform-tests/src/test/resources/modules-2500/foo.bar/FooBar.java b/platform-tests/src/test/resources/modules-2500/foo.bar/FooBar.java new file mode 100644 index 000000000000..0b855e5d5b17 --- /dev/null +++ b/platform-tests/src/test/resources/modules-2500/foo.bar/FooBar.java @@ -0,0 +1,3 @@ +package foo.bar; + +public class FooBar {} diff --git a/platform-tests/src/test/resources/modules-2500/foo.bar/module-info.java b/platform-tests/src/test/resources/modules-2500/foo.bar/module-info.java new file mode 100644 index 000000000000..d216af08a2bf --- /dev/null +++ b/platform-tests/src/test/resources/modules-2500/foo.bar/module-info.java @@ -0,0 +1,3 @@ +open module foo.bar { + requires foo; +} diff --git a/platform-tests/src/test/resources/modules-2500/foo/Foo.java b/platform-tests/src/test/resources/modules-2500/foo/Foo.java new file mode 100644 index 000000000000..7f566bafd458 --- /dev/null +++ b/platform-tests/src/test/resources/modules-2500/foo/Foo.java @@ -0,0 +1,3 @@ +package foo; + +public class Foo {} diff --git a/platform-tests/src/test/resources/modules-2500/foo/module-info.java b/platform-tests/src/test/resources/modules-2500/foo/module-info.java new file mode 100644 index 000000000000..430849782b21 --- /dev/null +++ b/platform-tests/src/test/resources/modules-2500/foo/module-info.java @@ -0,0 +1,3 @@ +module foo { + exports foo; +} diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java index 256432a66317..e5affb4b7588 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java @@ -100,6 +100,7 @@ private static List compileModules(Path temp, Writer out, Writer err, Fu try (var walk = Files.walk(base)) { var projects = walk.filter(path -> path.endsWith("module-info.java")) // .map(base::relativize) // + .filter(path -> !path.startsWith("platform-tests")) // .filter(path -> !path.startsWith("platform-tooling-support-tests")) // .map(base::resolve) // .map(Project::new) // From b3ce7aefa14b2157f87c0004c898e8857d66adeb Mon Sep 17 00:00:00 2001 From: ledoyen Date: Tue, 8 Dec 2020 20:51:23 +0100 Subject: [PATCH 0182/1433] Introduce support for ordering test classes This commit introduces support for ordering test classes analogous to the existing support for ordering test methods. Specifically, this commit introduces a new ClassOrderer API and related ClassDescriptor and ClassOrdererContext types. JUnit Jupiter provides the following built-in implementations of the new ClassOrderer API. - ClassOrderer.ClassName - ClassOrderer.DisplayName - ClassOrderer.OrderAnnotation - ClassOrderer.Random The default ClassOrderer implementation can be configured globally via the configuration parameter: junit.jupiter.testclass.order.default See the Javadoc and User Guide for details. Issue: #1948 Closes: #2488 --- .../release-notes/release-notes-5.8.0-M1.adoc | 4 + .../asciidoc/user-guide/writing-tests.adoc | 51 +++- .../junit/jupiter/api/ClassDescriptor.java | 86 +++++++ .../org/junit/jupiter/api/ClassOrderer.java | 235 ++++++++++++++++++ .../jupiter/api/ClassOrdererContext.java | 55 ++++ .../org/junit/jupiter/api/MethodOrderer.java | 5 + .../java/org/junit/jupiter/api/Order.java | 12 +- .../org/junit/jupiter/engine/Constants.java | 11 + .../config/CachingJupiterConfiguration.java | 8 + .../config/DefaultJupiterConfiguration.java | 8 + .../engine/config/JupiterConfiguration.java | 4 + .../AbstractAnnotatedElementDescriptor.java | 58 +++++ .../discovery/AbstractOrderingVisitor.java | 90 +++++++ .../discovery/ClassOrderingVisitor.java | 54 ++++ .../discovery/DefaultClassDescriptor.java | 38 +++ .../discovery/DefaultClassOrdererContext.java | 44 ++++ .../discovery/DefaultMethodDescriptor.java | 41 +-- .../discovery/DiscoverySelectorResolver.java | 1 + .../discovery/MethodOrderingVisitor.java | 73 +----- .../engine/extension/OrderedClassTests.java | 113 +++++++++ .../extension/RandomlyOrderedTests.java | 91 +++++++ 21 files changed, 973 insertions(+), 109 deletions(-) create mode 100644 junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java create mode 100644 junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java create mode 100644 junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java create mode 100644 junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java create mode 100644 junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java create mode 100644 junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java create mode 100644 junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java create mode 100644 junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java create mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java create mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index a39045f25bcb..bc2bd62343ab 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -75,6 +75,10 @@ on GitHub. * Allow rows in `@CsvSource` to start with a number sign (#) * New `ignoreLeadingAndTrailingWhitespace` attribute to control whether or not to trim whitespaces in `@CsvSource` and `@CsvFileSource` (set to `true` by default). +* Top-level test classes can now be ordered by passing the fully-qualified name of a + class implementing `ClassOrderer` as value of the new + `junit.jupiter.testclass.order.default` configuration property. + [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 8f247e7fa0d9..8759e0e4bdc9 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -511,11 +511,15 @@ custom annotations for tags. [[writing-tests-test-execution-order]] === Test Execution Order -By default, test methods will be ordered using an algorithm that is deterministic but -intentionally nonobvious. This ensures that subsequent runs of a test suite execute test -methods in the same order, thereby allowing for repeatable builds. +By default, test classes and methods will be ordered using an algorithm that is +deterministic but intentionally nonobvious. This ensures that subsequent runs of several +test suites execute test methods in the same order, thereby allowing for repeatable +builds. -NOTE: See <> for a definition of _test method_. +NOTE: See <> for a definition of _test method_ and +_test class_. + +==== Method Order Although true _unit tests_ typically should not rely on the order in which they are executed, there are times when it is necessary to enforce a specific test method execution @@ -551,7 +555,7 @@ include::{testDir}/example/OrderedTestsDemo.java[tags=user_guide] ---- [[writing-tests-test-execution-order-default]] -==== Setting the Default Method Orderer +===== Setting the Default Method Orderer You can use the `junit.jupiter.testmethod.order.default` <> to specify the fully qualified class name of the @@ -573,6 +577,43 @@ junit.jupiter.testmethod.order.default = \ Similarly, you can specify the fully qualified name of any custom class that implements `MethodOrderer`. +==== Class Order + +For build optimization purposes, it can be helpful to run _test classes_ in a specific +order. +For example: +* previously failed tests and faster tests first: fail fast +* with parallelism enabled, longer tests first: shortest test execution duration +* etc. + +You can use the `junit.jupiter.testclass.order.default` +<> to specify the fully qualified +class name of the `{ClassOrderer}` you would like to use. The supplied class has to +implement the `ClassOrderer` interface. + +You can implement your own custom `ClassOrderer` or use one of the +following built-in `ClassOrderer` implementations. + +* `{DisplayName}`: sorts test classes _alphanumerically_ based on their display names + (see <>). +* `{ClassName}`: sorts test classes _alphanumerically_ based on their class name. +* `{OrderAnnotation}`: sorts test classes _numerically_ based on values specified via the + `{Order}` annotation. +* `{Random}`: orders test classes _pseudo-randomly_ and supports configuration of a + custom _seed_. + +For example for the `@Order` annotation to be honored on _test classes_, you should set +the `{OrderAnnotation}` class orderer, using the configuration parameter with the +corresponding fully qualified class name (e.g., in +`src/test/resources/junit-platform.properties`): + +[source,properties,indent=0] +---- +junit.jupiter.testclass.order.default = \ + org.junit.jupiter.api.ClassOrderer$OrderAnnotation +---- + [[writing-tests-test-instance-lifecycle]] === Test Instance Lifecycle diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java new file mode 100644 index 000000000000..5eac4e76e402 --- /dev/null +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java @@ -0,0 +1,86 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import java.lang.annotation.Annotation; +import java.util.List; +import java.util.Optional; + +import org.apiguardian.api.API; + +/** + * {@code ClassDescriptor} encapsulates functionality for a given {@link Class}. + * + * @since 5.8 + * @see ClassOrdererContext + */ +@API(status = EXPERIMENTAL, since = "5.8") +public interface ClassDescriptor { + + /** + * Get the class for this descriptor. + * + * @return the class; never {@code null} + */ + Class getTestClass(); + + /** + * Get the display name for this descriptor's {@link #getClass()} () class}. + * + * @return the display name for this descriptor's class; never {@code null} + * or blank + */ + String getDisplayName(); + + /** + * Determine if an annotation of {@code annotationType} is either + * present or meta-present on the {@link Class} for + * this descriptor. + * + * @param annotationType the annotation type to search for; never {@code null} + * @return {@code true} if the annotation is present or meta-present + * @see #findAnnotation(Class) + * @see #findRepeatableAnnotations(Class) + */ + boolean isAnnotated(Class annotationType); + + /** + * Find the first annotation of {@code annotationType} that is either + * present or meta-present on the {@link Class} for + * this descriptor. + * + * @param the annotation type + * @param annotationType the annotation type to search for; never {@code null} + * @return an {@code Optional} containing the annotation; never {@code null} but + * potentially empty + * @see #isAnnotated(Class) + * @see #findRepeatableAnnotations(Class) + */ + Optional findAnnotation(Class annotationType); + + /** + * Find all repeatable {@linkplain Annotation annotations} of + * {@code annotationType} that are either present or + * meta-present on the {@link Class} for this descriptor. + * + * @param the annotation type + * @param annotationType the repeatable annotation type to search for; never + * {@code null} + * @return the list of all such annotations found; neither {@code null} nor + * mutable, but potentially empty + * @see #isAnnotated(Class) + * @see #findAnnotation(Class) + * @see java.lang.annotation.Repeatable + */ + List findRepeatableAnnotations(Class annotationType); +} diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java new file mode 100644 index 000000000000..33453d5de1e2 --- /dev/null +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java @@ -0,0 +1,235 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import static java.util.Comparator.comparingInt; +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import java.util.Collections; +import java.util.Comparator; +import java.util.Optional; + +import org.apiguardian.api.API; +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; + +/** + * {@code ClassOrderer} defines the API for ordering the top-level test classes, + * without considering nested test classes. + * + *

    In this context, the term "test class" refers to any class containing methods annotated with + * {@code @Test}, {@code @RepeatedTest}, {@code @ParameterizedTest}, + * {@code @TestFactory}, or {@code @TestTemplate} and not being annotated with {@code @Nested}. + * + *

    Built-in Implementations

    + * + *

    JUnit Jupiter provides the following built-in {@code ClassOrderer} + * implementations. + * + *

      + *
    • {@link ClassOrderer.ClassName}
    • + *
    • {@link ClassOrderer.DisplayName}
    • + *
    • {@link ClassOrderer.OrderAnnotation}
    • + *
    • {@link ClassOrderer.Random}
    • + *
    + * + * @see ClassOrdererContext + * @see #orderClasses(ClassOrdererContext) + * @since 5.8 + */ +@API(status = EXPERIMENTAL, since = "5.8") +public interface ClassOrderer { + + /** + * Order the classes encapsulated in the supplied {@link ClassOrdererContext}. + * + *

    The classes to order or sort are made indirectly available via + * {@link ClassOrdererContext#getClassDescriptors()} ()}. Since this method + * has a {@code void} return type, the list of class descriptors must be + * modified directly. + * + *

    For example, a simplified implementation of the {@link ClassOrderer.Random} + * {@code ClassOrderer} might look like the following. + * + *

    +	 * public void orderClasses(ClassOrdererContext context) {
    +	 *     Collections.shuffle(context.getClassDescriptors());
    +	 * }
    +	 * 
    + * + * @param context the {@code ClassOrdererContext} containing the + * {@link ClassDescriptor class descriptors} to order; never {@code null} + */ + void orderClasses(ClassOrdererContext context); + + /** + * {@code ClassOrderer} that sorts classes alphanumerically based on their + * qualified names using {@link String#compareTo(String)}. + * + * @since 5.8 + */ + @API(status = EXPERIMENTAL, since = "5.8") + class ClassName implements ClassOrderer { + + /** + * Sort the classes encapsulated in the supplied + * {@link ClassOrdererContext} alphanumerically based on their qualified names. + */ + @Override + public void orderClasses(ClassOrdererContext context) { + context.getClassDescriptors().sort(comparator); + } + + private static final Comparator comparator = Comparator. // + comparing(descriptor -> descriptor.getTestClass().getName()); + } + + /** + * {@code ClassOrderer} that sorts classes alphanumerically based on their + * display names using {@link String#compareTo(String)} + * + * @since 5.8 + */ + @API(status = EXPERIMENTAL, since = "5.8") + class DisplayName implements ClassOrderer { + + /** + * Sort the classes encapsulated in the supplied + * {@link ClassOrdererContext} alphanumerically based on their display + * names. + */ + @Override + public void orderClasses(ClassOrdererContext context) { + context.getClassDescriptors().sort(comparator); + } + + private static final Comparator comparator = Comparator.comparing( + ClassDescriptor::getDisplayName); + } + + /** + * {@code ClassOrderer} that sorts classes based on the {@link Order @Order} + * annotation. + * + *

    Any classes that are assigned the same order value will be sorted + * arbitrarily adjacent to each other. + * + *

    Any classes not annotated with {@code @Order} will be assigned the + * {@link org.junit.jupiter.api.Order#DEFAULT default order} value which will + * effectively cause them to appear at the end of the sorted list, unless + * certain classes are assigned an explicit order value greater than the default + * order value. Any classes assigned an explicit order value greater than the + * default order value will appear after non-annotated classes in the sorted + * list. + */ + class OrderAnnotation implements ClassOrderer { + + /** + * Sort the classes encapsulated in the supplied + * {@link ClassOrdererContext} based on the {@link Order @Order} + * annotation. + */ + @Override + public void orderClasses(ClassOrdererContext context) { + context.getClassDescriptors().sort(comparingInt(OrderAnnotation::getOrder)); + } + + private static int getOrder(ClassDescriptor descriptor) { + return descriptor.findAnnotation(Order.class).map(Order::value).orElse(Order.DEFAULT); + } + } + + /** + * {@code ClassOrderer} that orders classes pseudo-randomly. + * + *

    Custom Seed

    + * + *

    By default, the random seed used for ordering classes is the + * value returned by {@link System#nanoTime()} during static initialization + * of this class. In order to support repeatable builds, the value of the + * default random seed is logged at {@code INFO} level. In addition, a + * custom seed (potentially the default seed from the previous test plan + * execution) may be specified via the {@link Random#RANDOM_SEED_PROPERTY_NAME + * junit.jupiter.execution.class.order.random.seed} configuration parameter + * which can be supplied via the {@code Launcher} API, build tools (e.g., + * Gradle and Maven), a JVM system property, or the JUnit Platform configuration + * file (i.e., a file named {@code junit-platform.properties} in the root of + * the class path). Consult the User Guide for further information. + * + * @see Random#RANDOM_SEED_PROPERTY_NAME + * @see java.util.Random + */ + class Random implements ClassOrderer { + + private static final Logger logger = LoggerFactory.getLogger(Random.class); + + /** + * Default seed, which is generated during initialization of this class + * via {@link System#nanoTime()} for reproducibility of tests. + */ + private static final long DEFAULT_SEED; + + static { + DEFAULT_SEED = System.nanoTime(); + logger.info(() -> "ClassOrderer.Random default seed: " + DEFAULT_SEED); + } + + /** + * Property name used to set the random seed used by this + * {@code ClassOrderer}: {@value} + * + * The same property is used by {@link MethodOrderer.Random} for consistency + * between the two random orderers. + * + *

    Supported Values

    + * + *

    Supported values include any string that can be converted to a + * {@link Long} via {@link Long#valueOf(String)}. + * + *

    If not specified or if the specified value cannot be converted to + * a {@link Long}, the default random seed will be used (see the + * {@linkplain Random class-level Javadoc} for details). + * + * @see MethodOrderer.Random + */ + public static final String RANDOM_SEED_PROPERTY_NAME = MethodOrderer.Random.RANDOM_SEED_PROPERTY_NAME; + + /** + * Order the classes encapsulated in the supplied + * {@link ClassOrdererContext} pseudo-randomly. + */ + @Override + public void orderClasses(ClassOrdererContext context) { + Collections.shuffle(context.getClassDescriptors(), + new java.util.Random(getCustomSeed(context).orElse(DEFAULT_SEED))); + } + + private Optional getCustomSeed(ClassOrdererContext context) { + return context.getConfigurationParameter(RANDOM_SEED_PROPERTY_NAME).map(configurationParameter -> { + Long seed = null; + try { + seed = Long.valueOf(configurationParameter); + logger.config( + () -> String.format("Using custom seed for configuration parameter [%s] with value [%s].", + RANDOM_SEED_PROPERTY_NAME, configurationParameter)); + } + catch (NumberFormatException ex) { + logger.warn(ex, + () -> String.format( + "Failed to convert configuration parameter [%s] with value [%s] to a long. " + + "Using default seed [%s] as fallback.", + RANDOM_SEED_PROPERTY_NAME, configurationParameter, DEFAULT_SEED)); + } + return seed; + }); + } + } +} diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java new file mode 100644 index 000000000000..3857ef73097c --- /dev/null +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java @@ -0,0 +1,55 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import java.util.List; +import java.util.Optional; + +import org.apiguardian.api.API; + +/** + * {@code ClassOrdererContext} encapsulates the context in which + * a {@link ClassOrderer} will be invoked. + * + * @since 5.8 + * @see ClassOrderer + * @see ClassDescriptor + */ +@API(status = EXPERIMENTAL, since = "5.8") +public interface ClassOrdererContext { + + /** + * Get the list of {@linkplain ClassDescriptor class descriptors} to + * order. + * + * @return the list of class descriptors; never {@code null} + */ + List getClassDescriptors(); + + /** + * Get the configuration parameter stored under the specified {@code key}. + * + *

    If no such key is present in the {@code ConfigurationParameters} for + * the JUnit Platform, an attempt will be made to look up the value as a + * JVM system property. If no such system property exists, an attempt will + * be made to look up the value in the JUnit Platform properties file. + * + * @param key the key to look up; never {@code null} or blank + * @return an {@code Optional} containing the value; never {@code null} + * but potentially empty + * + * @see System#getProperty(String) + * @see org.junit.platform.engine.ConfigurationParameters + */ + Optional getConfigurationParameter(String key); +} diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java index 4426d97de861..7cc5b22ec854 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java @@ -260,6 +260,9 @@ class Random implements MethodOrderer { * Property name used to set the random seed used by this * {@code MethodOrderer}: {@value} * + * The same property is used by {@link ClassOrderer.Random} for consistency + * between the two random orderers. + * *

    Supported Values

    * *

    Supported values include any string that can be converted to a @@ -268,6 +271,8 @@ class Random implements MethodOrderer { *

    If not specified or if the specified value cannot be converted to * a {@link Long}, the default random seed will be used (see the * {@linkplain Random class-level Javadoc} for details). + * + * @see ClassOrderer.Random */ public static final String RANDOM_SEED_PROPERTY_NAME = "junit.jupiter.execution.order.random.seed"; diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java index 10f48336573c..ee3c94f6873a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java @@ -23,9 +23,9 @@ /** * {@code @Order} is an annotation that is used to configure the - * {@linkplain #value order} in which the annotated element (i.e., field or - * method) should be evaluated or executed relative to other elements of the - * same category. + * {@linkplain #value order} in which the annotated element (i.e., field, + * method or class) should be evaluated or executed relative to other elements + * of the same category. * *

    When used with * {@link org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension}, @@ -36,11 +36,15 @@ *

    If {@code @Order} is not explicitly declared on an element, the * {@link #DEFAULT} order value will be assigned to the element. * + *

    If {@code @Order} is used on classes, ordering is performed only if + * the matching {@link ClassOrderer.OrderAnnotation} is configured. + * * @since 5.4 * @see MethodOrderer.OrderAnnotation + * @see ClassOrderer.OrderAnnotation * @see org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension */ -@Target({ ElementType.FIELD, ElementType.METHOD }) +@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.TYPE }) @Retention(RetentionPolicy.RUNTIME) @Documented @API(status = EXPERIMENTAL, since = "5.4") diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java index 5d9f893a78c5..3cb58fc2f7e2 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java @@ -463,6 +463,17 @@ public final class Constants { @API(status = EXPERIMENTAL, since = "5.7") public static final String DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME = JupiterConfiguration.DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME; + /** + * Property name used to set the class orderer class name: {@value} + * + *

    Supported Values

    + * + *

    Supported values include fully qualified class names for types that + * implement {@link org.junit.jupiter.api.ClassOrderer}. + */ + @API(status = EXPERIMENTAL, since = "5.8") + public static final String DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME = JupiterConfiguration.DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME; + private Constants() { /* no-op */ } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java index 2c99046d8f00..d49ae5ee386c 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java @@ -18,6 +18,7 @@ import java.util.function.Predicate; import org.apiguardian.api.API; +import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.api.DisplayNameGenerator; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.TestInstance; @@ -98,4 +99,11 @@ public Optional getDefaultTestMethodOrderer() { return (Optional) cache.computeIfAbsent(DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME, key -> delegate.getDefaultTestMethodOrderer()); } + + @SuppressWarnings("unchecked") + @Override + public Optional getTestClassOrderer() { + return (Optional) cache.computeIfAbsent(DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME, + key -> delegate.getTestClassOrderer()); + } } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java index ffb9bf03f822..fffeb14c168e 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java @@ -17,6 +17,7 @@ import java.util.function.Predicate; import org.apiguardian.api.API; +import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.api.DisplayNameGenerator; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.TestInstance.Lifecycle; @@ -46,6 +47,9 @@ public class DefaultJupiterConfiguration implements JupiterConfiguration { private static final InstantiatingConfigurationParameterConverter methodOrdererConverter = // new InstantiatingConfigurationParameterConverter<>(MethodOrderer.class, "method orderer"); + private static final InstantiatingConfigurationParameterConverter classOrdererConverter = // + new InstantiatingConfigurationParameterConverter<>(ClassOrderer.class, "class orderer"); + private final ConfigurationParameters configurationParameters; public DefaultJupiterConfiguration(ConfigurationParameters configurationParameters) { @@ -108,4 +112,8 @@ public Optional getDefaultTestMethodOrderer() { return methodOrdererConverter.get(configurationParameters, DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME); } + @Override + public Optional getTestClassOrderer() { + return classOrdererConverter.get(configurationParameters, DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME); + } } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java index 63963b11dfd8..a4301d881e51 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java @@ -17,6 +17,7 @@ import java.util.function.Predicate; import org.apiguardian.api.API; +import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.api.DisplayNameGenerator; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.TestInstance; @@ -39,6 +40,7 @@ public interface JupiterConfiguration { String DEACTIVATE_ALL_CONDITIONS_PATTERN = ClassNamePatternFilterUtils.DEACTIVATE_ALL_PATTERN; String DEFAULT_DISPLAY_NAME_GENERATOR_PROPERTY_NAME = "junit.jupiter.displayname.generator.default"; String DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME = "junit.jupiter.testmethod.order.default"; + String DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME = "junit.jupiter.testclass.order.default"; String DEFAULT_TIMEOUT_PROPERTY_NAME = "junit.jupiter.execution.timeout.default"; String DEFAULT_TESTABLE_METHOD_TIMEOUT_PROPERTY_NAME = "junit.jupiter.execution.timeout.testable.method.default"; @@ -71,4 +73,6 @@ public interface JupiterConfiguration { DisplayNameGenerator getDefaultDisplayNameGenerator(); Optional getDefaultTestMethodOrderer(); + + Optional getTestClassOrderer(); } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java new file mode 100644 index 000000000000..13917501dcf9 --- /dev/null +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java @@ -0,0 +1,58 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.discovery; + +import java.lang.annotation.Annotation; +import java.lang.reflect.AnnotatedElement; +import java.util.List; +import java.util.Optional; + +import org.junit.platform.commons.util.AnnotationUtils; +import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.engine.TestDescriptor; + +abstract class AbstractAnnotatedElementDescriptor { + + private final TestDescriptor testDescriptor; + private final E annotatedElement; + + AbstractAnnotatedElementDescriptor(TestDescriptor testDescriptor, E annotatedElement) { + this.testDescriptor = testDescriptor; + this.annotatedElement = annotatedElement; + } + + protected E getAnnotatedElement() { + return annotatedElement; + } + + TestDescriptor getTestDescriptor() { + return testDescriptor; + } + + public final String getDisplayName() { + return this.testDescriptor.getDisplayName(); + } + + public boolean isAnnotated(Class annotationType) { + Preconditions.notNull(annotationType, "annotationType must not be null"); + return AnnotationUtils.isAnnotated(getAnnotatedElement(), annotationType); + } + + public Optional findAnnotation(Class annotationType) { + Preconditions.notNull(annotationType, "annotationType must not be null"); + return AnnotationUtils.findAnnotation(getAnnotatedElement(), annotationType); + } + + public List findRepeatableAnnotations(Class annotationType) { + Preconditions.notNull(annotationType, "annotationType must not be null"); + return AnnotationUtils.findRepeatableAnnotations(getAnnotatedElement(), annotationType); + } +} diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java new file mode 100644 index 000000000000..4739399f63ae --- /dev/null +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java @@ -0,0 +1,90 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.discovery; + +import static java.util.stream.Collectors.toCollection; + +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.IntFunction; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; +import org.junit.platform.commons.util.UnrecoverableExceptions; +import org.junit.platform.engine.TestDescriptor; + +class AbstractOrderingVisitor { + + private static final Logger logger = LoggerFactory.getLogger(AbstractOrderingVisitor.class); + + @SuppressWarnings({ "unchecked" }) + protected void doWithMatchingDescriptor(Class descriptorSubType, + TestDescriptor testDescriptor, Consumer action, Function errorMessageBuilder) { + if (descriptorSubType.isAssignableFrom(testDescriptor.getClass())) { + T specificTestDescriptor = (T) testDescriptor; + try { + action.accept(specificTestDescriptor); + } + catch (Throwable t) { + UnrecoverableExceptions.rethrowIfUnrecoverable(t); + logger.error(t, () -> errorMessageBuilder.apply(specificTestDescriptor)); + } + } + } + + protected > void orderChildrenTestDescriptors( + TestDescriptor parentTestDescriptor, Class matchingChildrenType, Function descriptorWrapperBuilder, + Consumer> orderingAction, IntFunction descriptorAdditionLogger, + IntFunction descriptorDeletionLogger) { + Set children = parentTestDescriptor.getChildren(); + + List nonMatchingTestDescriptors = children.stream()// + .filter(childTestDescriptor -> !(matchingChildrenType.isAssignableFrom(childTestDescriptor.getClass())))// + .collect(Collectors.toList()); + + List matchingDescriptorWrappers = children.stream()// + .filter(matchingChildrenType::isInstance)// + .map(matchingChildrenType::cast)// + .map(descriptorWrapperBuilder)// + .collect(toCollection(ArrayList::new)); + + // Make a local copy for later validation + Set originalDescriptors = new LinkedHashSet<>(matchingDescriptorWrappers); + + orderingAction.accept(matchingDescriptorWrappers); + + int difference = matchingDescriptorWrappers.size() - originalDescriptors.size(); + + if (difference > 0) { + logger.warn(() -> descriptorAdditionLogger.apply(difference)); + } + else if (difference < 0) { + logger.warn(() -> descriptorDeletionLogger.apply(difference)); + } + + Set sortedTestDescriptors = matchingDescriptorWrappers.stream()// + .filter(originalDescriptors::contains)// + .map(AbstractAnnotatedElementDescriptor::getTestDescriptor)// + .collect(toCollection(LinkedHashSet::new)); + + // Currently no way to removeAll or addAll children at once. + Stream.concat(sortedTestDescriptors.stream(), nonMatchingTestDescriptors.stream())// + .forEach(parentTestDescriptor::removeChild); + Stream.concat(sortedTestDescriptors.stream(), nonMatchingTestDescriptors.stream())// + .forEach(parentTestDescriptor::addChild); + } +} diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java new file mode 100644 index 000000000000..634a3a930dfd --- /dev/null +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java @@ -0,0 +1,54 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.discovery; + +import java.util.Optional; + +import org.junit.jupiter.api.ClassOrderer; +import org.junit.jupiter.engine.config.JupiterConfiguration; +import org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor; +import org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor; +import org.junit.platform.engine.TestDescriptor; + +/** + * @since 5.8 + */ +class ClassOrderingVisitor extends AbstractOrderingVisitor implements TestDescriptor.Visitor { + + private final JupiterConfiguration configuration; + + public ClassOrderingVisitor(JupiterConfiguration configuration) { + this.configuration = configuration; + } + + @Override + public void visit(TestDescriptor testDescriptor) { + Optional testClassOrderer = configuration.getTestClassOrderer(); + if (!testClassOrderer.isPresent()) { + return; + } + doWithMatchingDescriptor(JupiterEngineDescriptor.class, testDescriptor, + descriptor -> orderContainedClasses(descriptor, testClassOrderer.get()), + descriptor -> "Failed to order classes"); + } + + private void orderContainedClasses(JupiterEngineDescriptor jupiterEngineDescriptor, ClassOrderer classOrderer) { + orderChildrenTestDescriptors(jupiterEngineDescriptor, ClassBasedTestDescriptor.class, + DefaultClassDescriptor::new, + descriptorWrappers -> classOrderer.orderClasses( + new DefaultClassOrdererContext(descriptorWrappers, this.configuration)), + difference -> String.format("ClassOrderer [%s] added %s ClassDescriptor(s) which will be ignored.", + classOrderer.getClass().getName(), difference), + difference -> String.format( + "ClassOrderer [%s] removed %s ClassDescriptor(s) which will be retained with arbitrary ordering.", + classOrderer.getClass().getName(), -difference)); + } +} diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java new file mode 100644 index 000000000000..30ad21c4634d --- /dev/null +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java @@ -0,0 +1,38 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.discovery; + +import org.junit.jupiter.api.ClassDescriptor; +import org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor; +import org.junit.platform.commons.util.ToStringBuilder; + +/** + * Default implementation of {@link ClassDescriptor}, backed by + * a {@link ClassBasedTestDescriptor}. + * + * @since 5.8 + */ +class DefaultClassDescriptor extends AbstractAnnotatedElementDescriptor> implements ClassDescriptor { + + DefaultClassDescriptor(ClassBasedTestDescriptor testDescriptor) { + super(testDescriptor, testDescriptor.getTestClass()); + } + + @Override + public final Class getTestClass() { + return getAnnotatedElement(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("class", getTestClass().toGenericString()).toString(); + } +} diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java new file mode 100644 index 000000000000..94fb4f7c9c90 --- /dev/null +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java @@ -0,0 +1,44 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.discovery; + +import java.util.List; +import java.util.Optional; + +import org.junit.jupiter.api.ClassDescriptor; +import org.junit.jupiter.api.ClassOrdererContext; +import org.junit.jupiter.engine.config.JupiterConfiguration; + +/** + * Default implementation of {@link ClassOrdererContext}. + * + * @since 5.8 + */ +class DefaultClassOrdererContext implements ClassOrdererContext { + + private final List classDescriptors; + private final JupiterConfiguration configuration; + + DefaultClassOrdererContext(List classDescriptors, JupiterConfiguration configuration) { + this.classDescriptors = classDescriptors; + this.configuration = configuration; + } + + @Override + public List getClassDescriptors() { + return classDescriptors; + } + + @Override + public Optional getConfigurationParameter(String key) { + return this.configuration.getRawConfigurationParameter(key); + } +} diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java index d46e0467487e..26fa7ee2fc54 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java @@ -10,15 +10,10 @@ package org.junit.jupiter.engine.discovery; -import java.lang.annotation.Annotation; import java.lang.reflect.Method; -import java.util.List; -import java.util.Optional; import org.junit.jupiter.api.MethodDescriptor; import org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor; -import org.junit.platform.commons.util.AnnotationUtils; -import org.junit.platform.commons.util.Preconditions; import org.junit.platform.commons.util.ToStringBuilder; /** @@ -27,49 +22,19 @@ * * @since 5.4 */ -class DefaultMethodDescriptor implements MethodDescriptor { - - private final MethodBasedTestDescriptor testDescriptor; +class DefaultMethodDescriptor extends AbstractAnnotatedElementDescriptor implements MethodDescriptor { DefaultMethodDescriptor(MethodBasedTestDescriptor testDescriptor) { - this.testDescriptor = testDescriptor; - } - - MethodBasedTestDescriptor getTestDescriptor() { - return testDescriptor; + super(testDescriptor, testDescriptor.getTestMethod()); } @Override public final Method getMethod() { - return this.testDescriptor.getTestMethod(); - } - - @Override - public final String getDisplayName() { - return this.testDescriptor.getDisplayName(); - } - - @Override - public boolean isAnnotated(Class annotationType) { - Preconditions.notNull(annotationType, "annotationType must not be null"); - return AnnotationUtils.isAnnotated(getMethod(), annotationType); - } - - @Override - public Optional findAnnotation(Class annotationType) { - Preconditions.notNull(annotationType, "annotationType must not be null"); - return AnnotationUtils.findAnnotation(getMethod(), annotationType); - } - - @Override - public List findRepeatableAnnotations(Class annotationType) { - Preconditions.notNull(annotationType, "annotationType must not be null"); - return AnnotationUtils.findRepeatableAnnotations(getMethod(), annotationType); + return getAnnotatedElement(); } @Override public String toString() { return new ToStringBuilder(this).append("method", getMethod().toGenericString()).toString(); } - } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java index 2061f58fe15e..541be65df359 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DiscoverySelectorResolver.java @@ -36,6 +36,7 @@ public class DiscoverySelectorResolver { .addClassContainerSelectorResolver(new IsTestClassWithTests()) .addSelectorResolver(context -> new ClassSelectorResolver(context.getClassNameFilter(), context.getEngineDescriptor().getConfiguration())) .addSelectorResolver(context -> new MethodSelectorResolver(context.getEngineDescriptor().getConfiguration())) + .addTestDescriptorVisitor(context -> new ClassOrderingVisitor(context.getEngineDescriptor().getConfiguration())) .addTestDescriptorVisitor(context -> new MethodOrderingVisitor(context.getEngineDescriptor().getConfiguration())) .addTestDescriptorVisitor(context -> TestDescriptor::prune) .build(); diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java index 3f9b0c39ebeb..056114630ef2 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/MethodOrderingVisitor.java @@ -10,16 +10,9 @@ package org.junit.jupiter.engine.discovery; -import static java.util.stream.Collectors.toCollection; import static org.junit.platform.commons.support.AnnotationSupport.findAnnotation; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.TestMethodOrder; @@ -27,18 +20,13 @@ import org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor; import org.junit.jupiter.engine.descriptor.JupiterTestDescriptor; import org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor; -import org.junit.platform.commons.logging.Logger; -import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.commons.util.ReflectionUtils; -import org.junit.platform.commons.util.UnrecoverableExceptions; import org.junit.platform.engine.TestDescriptor; /** * @since 5.5 */ -class MethodOrderingVisitor implements TestDescriptor.Visitor { - - private static final Logger logger = LoggerFactory.getLogger(MethodOrderingVisitor.class); +class MethodOrderingVisitor extends AbstractOrderingVisitor implements TestDescriptor.Visitor { private final JupiterConfiguration configuration; @@ -48,16 +36,9 @@ class MethodOrderingVisitor implements TestDescriptor.Visitor { @Override public void visit(TestDescriptor testDescriptor) { - if (testDescriptor instanceof ClassBasedTestDescriptor) { - ClassBasedTestDescriptor classBasedTestDescriptor = (ClassBasedTestDescriptor) testDescriptor; - try { - orderContainedMethods(classBasedTestDescriptor, classBasedTestDescriptor.getTestClass()); - } - catch (Throwable t) { - UnrecoverableExceptions.rethrowIfUnrecoverable(t); - logger.error(t, () -> "Failed to order methods for " + classBasedTestDescriptor.getTestClass()); - } - } + doWithMatchingDescriptor(ClassBasedTestDescriptor.class, testDescriptor, + descriptor -> orderContainedMethods(descriptor, descriptor.getTestClass()), + descriptor -> "Failed to order methods for " + descriptor.getTestClass()); } /** @@ -70,48 +51,16 @@ private void orderContainedMethods(ClassBasedTestDescriptor classBasedTestDescri .map(Optional::of)// .orElseGet(configuration::getDefaultTestMethodOrderer)// .ifPresent(methodOrderer -> { - - Set children = classBasedTestDescriptor.getChildren(); - - List nonMethodTestDescriptors = children.stream()// - .filter(testDescriptor -> !(testDescriptor instanceof MethodBasedTestDescriptor))// - .collect(Collectors.toList()); - - List methodDescriptors = children.stream()// - .filter(MethodBasedTestDescriptor.class::isInstance)// - .map(MethodBasedTestDescriptor.class::cast)// - .map(DefaultMethodDescriptor::new)// - .collect(toCollection(ArrayList::new)); - - // Make a local copy for later validation - Set originalMethodDescriptors = new LinkedHashSet<>(methodDescriptors); - - methodOrderer.orderMethods( - new DefaultMethodOrdererContext(methodDescriptors, testClass, this.configuration)); - - int difference = methodDescriptors.size() - originalMethodDescriptors.size(); - - if (difference > 0) { - logger.warn(() -> String.format( + orderChildrenTestDescriptors(classBasedTestDescriptor, MethodBasedTestDescriptor.class, + DefaultMethodDescriptor::new, + descriptorWrappers -> methodOrderer.orderMethods( + new DefaultMethodOrdererContext(descriptorWrappers, testClass, this.configuration)), + difference -> String.format( "MethodOrderer [%s] added %s MethodDescriptor(s) for test class [%s] which will be ignored.", - methodOrderer.getClass().getName(), difference, testClass.getName())); - } - else if (difference < 0) { - logger.warn(() -> String.format( + methodOrderer.getClass().getName(), difference, testClass.getName()), + difference -> String.format( "MethodOrderer [%s] removed %s MethodDescriptor(s) for test class [%s] which will be retained with arbitrary ordering.", methodOrderer.getClass().getName(), -difference, testClass.getName())); - } - - Set sortedMethodTestDescriptors = methodDescriptors.stream()// - .filter(originalMethodDescriptors::contains)// - .map(DefaultMethodDescriptor::getTestDescriptor)// - .collect(toCollection(LinkedHashSet::new)); - - // Currently no way to removeAll or addAll children at once. - Stream.concat(sortedMethodTestDescriptors.stream(), nonMethodTestDescriptors.stream())// - .forEach(classBasedTestDescriptor::removeChild); - Stream.concat(sortedMethodTestDescriptors.stream(), nonMethodTestDescriptors.stream())// - .forEach(classBasedTestDescriptor::addChild); // Note: MethodOrderer#getDefaultExecutionMode() is guaranteed // to be invoked after MethodOrderer#orderMethods(). diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java new file mode 100644 index 000000000000..30f031f91840 --- /dev/null +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java @@ -0,0 +1,113 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.extension; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.engine.Constants.DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME; +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; + +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.ClassOrderer; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.platform.testkit.engine.EngineTestKit; +import org.junit.platform.testkit.engine.Events; + +class OrderedClassTests { + + private static final Set callSequence = Collections.synchronizedSet(new LinkedHashSet<>()); + + @BeforeEach + void clearCallSequence() { + callSequence.clear(); + } + + @Test + void className() { + var tests = executeTests(ClassOrderer.ClassName.class); + + tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); + + assertThat(callSequence)// + .containsExactly("A_TestCase", "B_TestCase", "C_TestCase"); + } + + @Test + void displayName() { + var tests = executeTests(ClassOrderer.DisplayName.class); + + tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); + + assertThat(callSequence)// + .containsExactly("C_TestCase", "B_TestCase", "A_TestCase"); + } + + @Test + void orderAnnotation() { + var tests = executeTests(ClassOrderer.OrderAnnotation.class); + + tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); + + assertThat(callSequence)// + .containsExactly("A_TestCase", "C_TestCase", "B_TestCase"); + } + + @Test + void random() { + var tests = executeTests(ClassOrderer.Random.class); + + tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); + } + + private Events executeTests(Class classOrderer) { + // @formatter:off + return EngineTestKit + .engine("junit-jupiter") + .configurationParameter(DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME, classOrderer.getName()) + .selectors(selectClass(A_TestCase.class), selectClass(B_TestCase.class), selectClass(C_TestCase.class)) + .execute() + .testEvents(); + // @formatter:on + } + + abstract static class BaseTestCase { + + @BeforeEach + void trackInvocations(TestInfo testInfo) { + var testClass = testInfo.getTestClass().get(); + + callSequence.add(testClass.getSimpleName()); + } + + @Test + void a() { + } + } + + @Order(2) + @DisplayName("Z") + static class A_TestCase extends BaseTestCase { + } + + static class B_TestCase extends BaseTestCase { + } + + @Order(10) + @DisplayName("A") + static class C_TestCase extends BaseTestCase { + } +} diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java new file mode 100644 index 000000000000..a3d9fb938cba --- /dev/null +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java @@ -0,0 +1,91 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine.extension; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.engine.Constants.DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME; +import static org.junit.jupiter.engine.Constants.DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME; +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; + +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.stream.IntStream; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.ClassOrderer; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.platform.testkit.engine.EngineTestKit; +import org.junit.platform.testkit.engine.Events; + +class RandomlyOrderedTests { + + private static final Set callSequence = Collections.synchronizedSet(new LinkedHashSet<>()); + + @Test + void randomSeedForClassAndMethodOrderingIsDeterministic() { + IntStream.range(0, 20).forEach(i -> { + callSequence.clear(); + var tests = executeTests(1618034L); + + tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); + assertThat(callSequence).containsExactlyInAnyOrder("B_TestCase#b", "B_TestCase#c", "B_TestCase#a", + "C_TestCase#b", "C_TestCase#c", "C_TestCase#a", "A_TestCase#b", "A_TestCase#c", "A_TestCase#a"); + }); + } + + private Events executeTests(long randomSeed) { + // @formatter:off + return EngineTestKit + .engine("junit-jupiter") + .configurationParameter(DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME, ClassOrderer.Random.class.getName()) + .configurationParameter(DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME, MethodOrderer.Random.class.getName()) + .configurationParameter(MethodOrderer.Random.RANDOM_SEED_PROPERTY_NAME, String.valueOf(randomSeed)) + .selectors(selectClass(A_TestCase.class), selectClass(B_TestCase.class), selectClass(C_TestCase.class)) + .execute() + .testEvents(); + // @formatter:on + } + + abstract static class BaseTestCase { + + @BeforeEach + void trackInvocations(TestInfo testInfo) { + var testClass = testInfo.getTestClass().get(); + var testMethod = testInfo.getTestMethod().get(); + + callSequence.add(testClass.getSimpleName() + "#" + testMethod.getName()); + } + + @Test + void a() { + } + + @Test + void b() { + } + + @Test + void c() { + } + } + + static class A_TestCase extends BaseTestCase { + } + + static class B_TestCase extends BaseTestCase { + } + + static class C_TestCase extends BaseTestCase { + } +} From 49565e9cb35c722871c17d0549f505ea70cc2e3d Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 28 Jan 2021 18:10:20 +0100 Subject: [PATCH 0183/1433] Polish contribution See #2488 --- .../release-notes/release-notes-5.8.0-M1.adoc | 4 +- .../asciidoc/user-guide/writing-tests.adoc | 43 +++++++++-------- .../junit/jupiter/api/ClassDescriptor.java | 3 +- .../org/junit/jupiter/api/ClassOrderer.java | 48 +++++++++---------- .../jupiter/api/ClassOrdererContext.java | 1 + .../org/junit/jupiter/api/MethodOrderer.java | 26 +++++----- .../java/org/junit/jupiter/api/Order.java | 15 +++--- .../org/junit/jupiter/engine/Constants.java | 2 +- .../config/CachingJupiterConfiguration.java | 5 +- .../config/DefaultJupiterConfiguration.java | 3 +- .../engine/config/JupiterConfiguration.java | 3 +- .../AbstractAnnotatedElementDescriptor.java | 14 ++++-- .../discovery/AbstractOrderingVisitor.java | 11 +++-- .../discovery/ClassOrderingVisitor.java | 15 +++--- .../discovery/DefaultClassDescriptor.java | 1 + .../discovery/DefaultClassOrdererContext.java | 3 +- .../discovery/DefaultMethodDescriptor.java | 1 + .../src/test/java/example/B_TestCase.java | 37 ++++++++++++++ .../engine/extension/OrderedClassTests.java | 44 +++++++++++++---- .../extension/RandomlyOrderedTests.java | 4 ++ 20 files changed, 180 insertions(+), 103 deletions(-) create mode 100644 junit-jupiter-engine/src/test/java/example/B_TestCase.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index bc2bd62343ab..db3eda92ff5e 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -76,8 +76,8 @@ on GitHub. * New `ignoreLeadingAndTrailingWhitespace` attribute to control whether or not to trim whitespaces in `@CsvSource` and `@CsvFileSource` (set to `true` by default). * Top-level test classes can now be ordered by passing the fully-qualified name of a - class implementing `ClassOrderer` as value of the new - `junit.jupiter.testclass.order.default` configuration property. + class implementing `ClassOrderer` as the value of the new + `junit.jupiter.testclass.order.default` configuration parameter. [[release-notes-5.8.0-M1-junit-vintage]] diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 8759e0e4bdc9..a8fd911b1503 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -512,9 +512,9 @@ custom annotations for tags. === Test Execution Order By default, test classes and methods will be ordered using an algorithm that is -deterministic but intentionally nonobvious. This ensures that subsequent runs of several -test suites execute test methods in the same order, thereby allowing for repeatable -builds. +deterministic but intentionally nonobvious. This ensures that subsequent runs of a test +suite execute test classes and test methods in the same order, thereby allowing for +repeatable builds. NOTE: See <> for a definition of _test method_ and _test class_. @@ -535,14 +535,14 @@ following built-in `MethodOrderer` implementations. * `{DisplayName}`: sorts test methods _alphanumerically_ based on their display names (see <>) -* `{MethodName}`: sorts test methods _alphanumerically_ based on their method name and formal - parameter lists. +* `{MethodName}`: sorts test methods _alphanumerically_ based on their names and formal + parameter lists * `{OrderAnnotation}`: sorts test methods _numerically_ based on values specified via the - `{Order}` annotation. + `{Order}` annotation * `{Random}`: orders test methods _pseudo-randomly_ and supports configuration of a custom - _seed_. + _seed_ * `{Alphanumeric}`: sorts test methods _alphanumerically_ based on their names and formal - parameter lists. **Deprecated in favor of `{MethodName}`. Will be removed in 6.0** + parameter lists; **Deprecated in favor of `{MethodName}`, to be removed in 6.0** NOTE: See also: <> @@ -581,30 +581,33 @@ Similarly, you can specify the fully qualified name of any custom class that imp For build optimization purposes, it can be helpful to run _test classes_ in a specific order. + For example: + * previously failed tests and faster tests first: fail fast * with parallelism enabled, longer tests first: shortest test execution duration * etc. -You can use the `junit.jupiter.testclass.order.default` -<> to specify the fully qualified -class name of the `{ClassOrderer}` you would like to use. The supplied class has to -implement the `ClassOrderer` interface. +You can use the `junit.jupiter.testclass.order.default` <> to specify the fully qualified class name of the +`{ClassOrderer}` you would like to use. The supplied class must implement the +`ClassOrderer` interface. -You can implement your own custom `ClassOrderer` or use one of the -following built-in `ClassOrderer` implementations. +You can implement your own custom `ClassOrderer` or use one of the following built-in +`ClassOrderer` implementations. * `{DisplayName}`: sorts test classes _alphanumerically_ based on their display names (see <>). -* `{ClassName}`: sorts test classes _alphanumerically_ based on their class name. + precedence rules>>) +* `{ClassName}`: sorts test classes _alphanumerically_ based on their fully qualified + class names * `{OrderAnnotation}`: sorts test classes _numerically_ based on values specified via the - `{Order}` annotation. + `{Order}` annotation * `{Random}`: orders test classes _pseudo-randomly_ and supports configuration of a - custom _seed_. + custom _seed_ -For example for the `@Order` annotation to be honored on _test classes_, you should set -the `{OrderAnnotation}` class orderer, using the configuration parameter with the +For example, for the `@Order` annotation to be honored on _test classes_, you should +configure the `{OrderAnnotation}` class orderer using the configuration parameter with the corresponding fully qualified class name (e.g., in `src/test/resources/junit-platform.properties`): diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java index 5eac4e76e402..db6dafcc42c3 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java @@ -35,7 +35,7 @@ public interface ClassDescriptor { Class getTestClass(); /** - * Get the display name for this descriptor's {@link #getClass()} () class}. + * Get the display name for this descriptor's {@link #getClass() class}. * * @return the display name for this descriptor's class; never {@code null} * or blank @@ -83,4 +83,5 @@ public interface ClassDescriptor { * @see java.lang.annotation.Repeatable */ List findRepeatableAnnotations(Class annotationType); + } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java index 33453d5de1e2..0f2f029aa0ae 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java @@ -22,12 +22,13 @@ import org.junit.platform.commons.logging.LoggerFactory; /** - * {@code ClassOrderer} defines the API for ordering the top-level test classes, - * without considering nested test classes. + * {@code ClassOrderer} defines the API for ordering the top-level test + * classes, without considering nested test classes. * - *

    In this context, the term "test class" refers to any class containing methods annotated with - * {@code @Test}, {@code @RepeatedTest}, {@code @ParameterizedTest}, - * {@code @TestFactory}, or {@code @TestTemplate} and not being annotated with {@code @Nested}. + *

    In this context, the term "test class" refers to any class containing methods + * annotated with {@code @Test}, {@code @RepeatedTest}, {@code @ParameterizedTest}, + * {@code @TestFactory}, or {@code @TestTemplate}. {@link Nested @Nested} test + * classes cannot be ordered by a {@code ClassOrderer}. * *

    Built-in Implementations

    * @@ -41,9 +42,9 @@ *
  • {@link ClassOrderer.Random}
  • * * + * @since 5.8 * @see ClassOrdererContext * @see #orderClasses(ClassOrdererContext) - * @since 5.8 */ @API(status = EXPERIMENTAL, since = "5.8") public interface ClassOrderer { @@ -52,7 +53,7 @@ public interface ClassOrderer { * Order the classes encapsulated in the supplied {@link ClassOrdererContext}. * *

    The classes to order or sort are made indirectly available via - * {@link ClassOrdererContext#getClassDescriptors()} ()}. Since this method + * {@link ClassOrdererContext#getClassDescriptors()}. Since this method * has a {@code void} return type, the list of class descriptors must be * modified directly. * @@ -66,39 +67,34 @@ public interface ClassOrderer { * * * @param context the {@code ClassOrdererContext} containing the - * {@link ClassDescriptor class descriptors} to order; never {@code null} + * {@linkplain ClassDescriptor class descriptors} to order; never {@code null} */ void orderClasses(ClassOrdererContext context); /** * {@code ClassOrderer} that sorts classes alphanumerically based on their - * qualified names using {@link String#compareTo(String)}. - * - * @since 5.8 + * fully qualified names using {@link String#compareTo(String)}. */ - @API(status = EXPERIMENTAL, since = "5.8") class ClassName implements ClassOrderer { /** * Sort the classes encapsulated in the supplied - * {@link ClassOrdererContext} alphanumerically based on their qualified names. + * {@link ClassOrdererContext} alphanumerically based on their fully + * qualified names. */ @Override public void orderClasses(ClassOrdererContext context) { context.getClassDescriptors().sort(comparator); } - private static final Comparator comparator = Comparator. // - comparing(descriptor -> descriptor.getTestClass().getName()); + private static final Comparator comparator = Comparator.comparing( + descriptor -> descriptor.getTestClass().getName()); } /** * {@code ClassOrderer} that sorts classes alphanumerically based on their * display names using {@link String#compareTo(String)} - * - * @since 5.8 */ - @API(status = EXPERIMENTAL, since = "5.8") class DisplayName implements ClassOrderer { /** @@ -123,12 +119,11 @@ public void orderClasses(ClassOrdererContext context) { * arbitrarily adjacent to each other. * *

    Any classes not annotated with {@code @Order} will be assigned the - * {@link org.junit.jupiter.api.Order#DEFAULT default order} value which will - * effectively cause them to appear at the end of the sorted list, unless - * certain classes are assigned an explicit order value greater than the default - * order value. Any classes assigned an explicit order value greater than the - * default order value will appear after non-annotated classes in the sorted - * list. + * {@link Order#DEFAULT default order} value which will effectively cause them + * to appear at the end of the sorted list, unless certain classes are assigned + * an explicit order value greater than the default order value. Any classes + * assigned an explicit order value greater than the default order value will + * appear after non-annotated classes in the sorted list. */ class OrderAnnotation implements ClassOrderer { @@ -186,8 +181,8 @@ class Random implements ClassOrderer { * Property name used to set the random seed used by this * {@code ClassOrderer}: {@value} * - * The same property is used by {@link MethodOrderer.Random} for consistency - * between the two random orderers. + *

    The same property is used by {@link MethodOrderer.Random} for + * consistency between the two random orderers. * *

    Supported Values

    * @@ -232,4 +227,5 @@ private Optional getCustomSeed(ClassOrdererContext context) { }); } } + } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java index 3857ef73097c..8942a327e206 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrdererContext.java @@ -52,4 +52,5 @@ public interface ClassOrdererContext { * @see org.junit.platform.engine.ConfigurationParameters */ Optional getConfigurationParameter(String key); + } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java index 7cc5b22ec854..35876db10e3d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/MethodOrderer.java @@ -71,7 +71,7 @@ public interface MethodOrderer { * * * @param context the {@code MethodOrdererContext} containing the - * {@link MethodDescriptor method descriptors} to order; never {@code null} + * {@linkplain MethodDescriptor method descriptors} to order; never {@code null} * @see #getDefaultExecutionMode() */ void orderMethods(MethodOrdererContext context); @@ -112,12 +112,11 @@ default Optional getDefaultExecutionMode() { * *

    If two methods have the same name, {@code String} representations of * their formal parameter lists will be used as a fallback for comparing the - * methods.

    - *

    This class has been deprecated in favor of - * {@link MethodOrderer.MethodName} and will be removed in 6.0

    + * methods. * * @since 5.4 - * @deprecated Please use {@link MethodOrderer.MethodName} instead. + * @deprecated as of JUnit Jupiter 5.7 in favor of {@link MethodOrderer.MethodName}; + * to be removed in 6.0 */ @API(status = DEPRECATED, since = "5.7") @Deprecated @@ -126,6 +125,7 @@ class Alphanumeric extends MethodName { public Alphanumeric() { } } + /** * {@code MethodOrderer} that sorts methods alphanumerically based on their * names using {@link String#compareTo(String)}. @@ -133,6 +133,7 @@ public Alphanumeric() { *

    If two methods have the same name, {@code String} representations of * their formal parameter lists will be used as a fallback for comparing the * methods. + * * @since 5.7 */ @API(status = EXPERIMENTAL, since = "5.7") @@ -194,12 +195,11 @@ public void orderMethods(MethodOrdererContext context) { * arbitrarily adjacent to each other. * *

    Any methods not annotated with {@code @Order} will be assigned the - * {@link org.junit.jupiter.api.Order#DEFAULT default order} value which will - * effectively cause them to appear at the end of the sorted list, unless - * certain methods are assigned an explicit order value greater than the default - * order value. Any methods assigned an explicit order value greater than the - * default order value will appear after non-annotated methods in the sorted - * list. + * {@link Order#DEFAULT default order} value which will effectively cause them + * to appear at the end of the sorted list, unless certain methods are assigned + * an explicit order value greater than the default order value. Any methods + * assigned an explicit order value greater than the default order value will + * appear after non-annotated methods in the sorted list. */ class OrderAnnotation implements MethodOrderer { @@ -260,8 +260,8 @@ class Random implements MethodOrderer { * Property name used to set the random seed used by this * {@code MethodOrderer}: {@value} * - * The same property is used by {@link ClassOrderer.Random} for consistency - * between the two random orderers. + *

    The same property is used by {@link ClassOrderer.Random} for + * consistency between the two random orderers. * *

    Supported Values

    * diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java index ee3c94f6873a..6971f5a39d8c 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Order.java @@ -19,26 +19,23 @@ import java.lang.annotation.Target; import org.apiguardian.api.API; -import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; /** * {@code @Order} is an annotation that is used to configure the * {@linkplain #value order} in which the annotated element (i.e., field, - * method or class) should be evaluated or executed relative to other elements + * method, or class) should be evaluated or executed relative to other elements * of the same category. * *

    When used with * {@link org.junit.jupiter.api.extension.RegisterExtension @RegisterExtension}, - * the category applies to extension fields. When used with the - * {@link OrderAnnotation} {@link MethodOrderer}, the category applies to - * test methods. + * the category applies to extension fields. When used with + * {@link MethodOrderer.OrderAnnotation}, the category applies to test methods. + * When used with {@link ClassOrderer.OrderAnnotation}, the category applies to + * top-level test classes. * *

    If {@code @Order} is not explicitly declared on an element, the * {@link #DEFAULT} order value will be assigned to the element. * - *

    If {@code @Order} is used on classes, ordering is performed only if - * the matching {@link ClassOrderer.OrderAnnotation} is configured. - * * @since 5.4 * @see MethodOrderer.OrderAnnotation * @see ClassOrderer.OrderAnnotation @@ -61,7 +58,7 @@ int DEFAULT = Integer.MAX_VALUE / 2; /** - * The order value for the annotated element (i.e., field or method). + * The order value for the annotated element (i.e., field, method, or class). * *

    Elements are ordered based on priority where a lower value has greater * priority than a higher value. For example, {@link Integer#MAX_VALUE} has diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java index 3cb58fc2f7e2..9c2c92bd1b78 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/Constants.java @@ -464,7 +464,7 @@ public final class Constants { public static final String DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME = JupiterConfiguration.DEFAULT_TEST_METHOD_ORDER_PROPERTY_NAME; /** - * Property name used to set the class orderer class name: {@value} + * Property name used to set the default class orderer class name: {@value} * *

    Supported Values

    * diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java index d49ae5ee386c..c77626266284 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/CachingJupiterConfiguration.java @@ -102,8 +102,9 @@ public Optional getDefaultTestMethodOrderer() { @SuppressWarnings("unchecked") @Override - public Optional getTestClassOrderer() { + public Optional getDefaultTestClassOrderer() { return (Optional) cache.computeIfAbsent(DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME, - key -> delegate.getTestClassOrderer()); + key -> delegate.getDefaultTestClassOrderer()); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java index fffeb14c168e..f8823892a5d7 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/DefaultJupiterConfiguration.java @@ -113,7 +113,8 @@ public Optional getDefaultTestMethodOrderer() { } @Override - public Optional getTestClassOrderer() { + public Optional getDefaultTestClassOrderer() { return classOrdererConverter.get(configurationParameters, DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java index a4301d881e51..2259d96739b1 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/config/JupiterConfiguration.java @@ -74,5 +74,6 @@ public interface JupiterConfiguration { Optional getDefaultTestMethodOrderer(); - Optional getTestClassOrderer(); + Optional getDefaultTestClassOrderer(); + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java index 13917501dcf9..3ec0e6a7c57a 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractAnnotatedElementDescriptor.java @@ -19,6 +19,9 @@ import org.junit.platform.commons.util.Preconditions; import org.junit.platform.engine.TestDescriptor; +/** + * @since 5.8 + */ abstract class AbstractAnnotatedElementDescriptor { private final TestDescriptor testDescriptor; @@ -30,29 +33,30 @@ abstract class AbstractAnnotatedElementDescriptor { } protected E getAnnotatedElement() { - return annotatedElement; + return this.annotatedElement; } TestDescriptor getTestDescriptor() { - return testDescriptor; + return this.testDescriptor; } public final String getDisplayName() { return this.testDescriptor.getDisplayName(); } - public boolean isAnnotated(Class annotationType) { + public final boolean isAnnotated(Class annotationType) { Preconditions.notNull(annotationType, "annotationType must not be null"); return AnnotationUtils.isAnnotated(getAnnotatedElement(), annotationType); } - public
    Optional findAnnotation(Class annotationType) { + public final Optional findAnnotation(Class annotationType) { Preconditions.notNull(annotationType, "annotationType must not be null"); return AnnotationUtils.findAnnotation(getAnnotatedElement(), annotationType); } - public List findRepeatableAnnotations(Class annotationType) { + public final List findRepeatableAnnotations(Class annotationType) { Preconditions.notNull(annotationType, "annotationType must not be null"); return AnnotationUtils.findRepeatableAnnotations(getAnnotatedElement(), annotationType); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java index 4739399f63ae..02e553450ab6 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/AbstractOrderingVisitor.java @@ -34,6 +34,7 @@ class AbstractOrderingVisitor { @SuppressWarnings({ "unchecked" }) protected void doWithMatchingDescriptor(Class descriptorSubType, TestDescriptor testDescriptor, Consumer action, Function errorMessageBuilder) { + if (descriptorSubType.isAssignableFrom(testDescriptor.getClass())) { T specificTestDescriptor = (T) testDescriptor; try { @@ -48,8 +49,9 @@ protected void doWithMatchingDescriptor(Class desc protected > void orderChildrenTestDescriptors( TestDescriptor parentTestDescriptor, Class matchingChildrenType, Function descriptorWrapperBuilder, - Consumer> orderingAction, IntFunction descriptorAdditionLogger, - IntFunction descriptorDeletionLogger) { + Consumer> orderingAction, IntFunction descriptorsAddedLogger, + IntFunction descriptorsRemovedLogger) { + Set children = parentTestDescriptor.getChildren(); List nonMatchingTestDescriptors = children.stream()// @@ -70,10 +72,10 @@ protected 0) { - logger.warn(() -> descriptorAdditionLogger.apply(difference)); + logger.warn(() -> descriptorsAddedLogger.apply(difference)); } else if (difference < 0) { - logger.warn(() -> descriptorDeletionLogger.apply(difference)); + logger.warn(() -> descriptorsRemovedLogger.apply(difference)); } Set sortedTestDescriptors = matchingDescriptorWrappers.stream()// @@ -87,4 +89,5 @@ else if (difference < 0) { Stream.concat(sortedTestDescriptors.stream(), nonMatchingTestDescriptors.stream())// .forEach(parentTestDescriptor::addChild); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java index 634a3a930dfd..8114ea544ad6 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/ClassOrderingVisitor.java @@ -10,8 +10,6 @@ package org.junit.jupiter.engine.discovery; -import java.util.Optional; - import org.junit.jupiter.api.ClassOrderer; import org.junit.jupiter.engine.config.JupiterConfiguration; import org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor; @@ -31,13 +29,11 @@ public ClassOrderingVisitor(JupiterConfiguration configuration) { @Override public void visit(TestDescriptor testDescriptor) { - Optional testClassOrderer = configuration.getTestClassOrderer(); - if (!testClassOrderer.isPresent()) { - return; - } - doWithMatchingDescriptor(JupiterEngineDescriptor.class, testDescriptor, - descriptor -> orderContainedClasses(descriptor, testClassOrderer.get()), - descriptor -> "Failed to order classes"); + this.configuration.getDefaultTestClassOrderer().ifPresent(testClassOrderer -> { + doWithMatchingDescriptor(JupiterEngineDescriptor.class, testDescriptor, + descriptor -> orderContainedClasses(descriptor, testClassOrderer), + descriptor -> "Failed to order classes"); + }); } private void orderContainedClasses(JupiterEngineDescriptor jupiterEngineDescriptor, ClassOrderer classOrderer) { @@ -51,4 +47,5 @@ private void orderContainedClasses(JupiterEngineDescriptor jupiterEngineDescript "ClassOrderer [%s] removed %s ClassDescriptor(s) which will be retained with arbitrary ordering.", classOrderer.getClass().getName(), -difference)); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java index 30ad21c4634d..dd3baa5b1cb5 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassDescriptor.java @@ -35,4 +35,5 @@ public final Class getTestClass() { public String toString() { return new ToStringBuilder(this).append("class", getTestClass().toGenericString()).toString(); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java index 94fb4f7c9c90..66467eb0abf8 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultClassOrdererContext.java @@ -34,11 +34,12 @@ class DefaultClassOrdererContext implements ClassOrdererContext { @Override public List getClassDescriptors() { - return classDescriptors; + return this.classDescriptors; } @Override public Optional getConfigurationParameter(String key) { return this.configuration.getRawConfigurationParameter(key); } + } diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java index 26fa7ee2fc54..13aeed85efb8 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/discovery/DefaultMethodDescriptor.java @@ -37,4 +37,5 @@ public final Method getMethod() { public String toString() { return new ToStringBuilder(this).append("method", getMethod().toGenericString()).toString(); } + } diff --git a/junit-jupiter-engine/src/test/java/example/B_TestCase.java b/junit-jupiter-engine/src/test/java/example/B_TestCase.java new file mode 100644 index 000000000000..7112e67930ea --- /dev/null +++ b/junit-jupiter-engine/src/test/java/example/B_TestCase.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package example; + +import java.util.Set; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; + +/** + * @since 5.8 + */ +public class B_TestCase { + + public static Set callSequence; + + @BeforeEach + void trackInvocations(TestInfo testInfo) { + if (callSequence != null) { + callSequence.add(testInfo.getTestClass().get().getName()); + } + } + + @Test + void a() { + } + +} diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java index 30f031f91840..d207291cceba 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/OrderedClassTests.java @@ -27,6 +27,9 @@ import org.junit.platform.testkit.engine.EngineTestKit; import org.junit.platform.testkit.engine.Events; +/** + * @since 5.8 + */ class OrderedClassTests { private static final Set callSequence = Collections.synchronizedSet(new LinkedHashSet<>()); @@ -46,6 +49,30 @@ void className() { .containsExactly("A_TestCase", "B_TestCase", "C_TestCase"); } + @Test + void classNameAcrossPackages() { + try { + example.B_TestCase.callSequence = callSequence; + + // @formatter:off + var tests = EngineTestKit + .engine("junit-jupiter") + .configurationParameter(DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME, ClassOrderer.ClassName.class.getName()) + .selectors(selectClass(B_TestCase.class), selectClass(example.B_TestCase.class)) + .execute() + .testEvents(); + // @formatter:on + + tests.assertStatistics(stats -> stats.succeeded(callSequence.size())); + + assertThat(callSequence)// + .containsExactly("example.B_TestCase", "B_TestCase"); + } + finally { + example.B_TestCase.callSequence = null; + } + } + @Test void displayName() { var tests = executeTests(ClassOrderer.DisplayName.class); @@ -75,16 +102,16 @@ void random() { private Events executeTests(Class classOrderer) { // @formatter:off - return EngineTestKit - .engine("junit-jupiter") - .configurationParameter(DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME, classOrderer.getName()) - .selectors(selectClass(A_TestCase.class), selectClass(B_TestCase.class), selectClass(C_TestCase.class)) - .execute() - .testEvents(); - // @formatter:on + return EngineTestKit + .engine("junit-jupiter") + .configurationParameter(DEFAULT_TEST_CLASS_ORDER_PROPERTY_NAME, classOrderer.getName()) + .selectors(selectClass(A_TestCase.class), selectClass(B_TestCase.class), selectClass(C_TestCase.class)) + .execute() + .testEvents(); + // @formatter:on } - abstract static class BaseTestCase { + static abstract class BaseTestCase { @BeforeEach void trackInvocations(TestInfo testInfo) { @@ -110,4 +137,5 @@ static class B_TestCase extends BaseTestCase { @DisplayName("A") static class C_TestCase extends BaseTestCase { } + } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java index a3d9fb938cba..23fe300f005c 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/RandomlyOrderedTests.java @@ -28,6 +28,9 @@ import org.junit.platform.testkit.engine.EngineTestKit; import org.junit.platform.testkit.engine.Events; +/** + * @since 5.8 + */ class RandomlyOrderedTests { private static final Set callSequence = Collections.synchronizedSet(new LinkedHashSet<>()); @@ -88,4 +91,5 @@ static class B_TestCase extends BaseTestCase { static class C_TestCase extends BaseTestCase { } + } From 76d4ca39bd7c8d70dfcc1fc9c2016f159587d657 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 28 Jan 2021 18:38:10 +0100 Subject: [PATCH 0184/1433] Fix broken links to ClassOrderer implementations in User Guide See #2488 --- .../src/docs/asciidoc/link-attributes.adoc | 15 ++++-- .../asciidoc/user-guide/writing-tests.adoc | 51 ++++++++++--------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/documentation/src/docs/asciidoc/link-attributes.adoc b/documentation/src/docs/asciidoc/link-attributes.adoc index 0c0efa94d34c..c584ea825317 100644 --- a/documentation/src/docs/asciidoc/link-attributes.adoc +++ b/documentation/src/docs/asciidoc/link-attributes.adoc @@ -60,16 +60,21 @@ endif::[] :TestExecutionResultConditions: {javadoc-root}/org.junit.platform.testkit/org/junit/platform/testkit/engine/TestExecutionResultConditions.html[TestExecutionResultConditions] // Jupiter Core API :api-package: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/package-summary.html[org.junit.jupiter.api] -:Alphanumeric: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.Alphanumeric.html[Alphanumeric] -:MethodName: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.MethodName.html[MethodName] :Assertions: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/Assertions.html[org.junit.jupiter.api.Assertions] :Assumptions: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/Assumptions.html[org.junit.jupiter.api.Assumptions] +:ClassOrderer_ClassName: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/ClassOrderer.ClassName.html[ClassOrderer.ClassName] +:ClassOrderer_DisplayName: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/ClassOrderer.DisplayName.html[ClassOrderer.DisplayName] +:ClassOrderer_OrderAnnotation: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/ClassOrderer.OrderAnnotation.html[ClassOrderer.OrderAnnotation] +:ClassOrderer_Random: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/ClassOrderer.Random.html[ClassOrderer.Random] +:ClassOrderer: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/ClassOrderer.html[ClassOrderer] :Disabled: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/Disabled.html[@Disabled] -:DisplayName: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.DisplayName.html[DisplayName] +:MethodOrderer_Alphanumeric: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.Alphanumeric.html[MethodOrderer.Alphanumeric] +:MethodOrderer_DisplayName: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.DisplayName.html[MethodOrderer.DisplayName] +:MethodOrderer_MethodName: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.MethodName.html[MethodOrderer.MethodName] +:MethodOrderer_OrderAnnotation: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.OrderAnnotation.html[MethodOrderer.OrderAnnotation] +:MethodOrderer_Random: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.Random.html[MethodOrderer.Random] :MethodOrderer: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.html[MethodOrderer] :Order: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/Order.html[@Order] -:OrderAnnotation: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.OrderAnnotation.html[OrderAnnotation] -:Random: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/MethodOrderer.Random.html[Random] :RepetitionInfo: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/RepetitionInfo.html[RepetitionInfo] :TestInfo: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/TestInfo.html[TestInfo] :TestMethodOrder: {javadoc-root}/org.junit.jupiter.api/org/junit/jupiter/api/TestMethodOrder.html[@TestMethodOrder] diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index a8fd911b1503..221ae27805dc 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -532,17 +532,18 @@ interface with `{TestMethodOrder}` and specify the desired `{MethodOrderer}` implementation. You can implement your own custom `MethodOrderer` or use one of the following built-in `MethodOrderer` implementations. -* `{DisplayName}`: sorts test methods _alphanumerically_ based on their display names (see - <>) -* `{MethodName}`: sorts test methods _alphanumerically_ based on their names and formal - parameter lists -* `{OrderAnnotation}`: sorts test methods _numerically_ based on values specified via the - `{Order}` annotation -* `{Random}`: orders test methods _pseudo-randomly_ and supports configuration of a custom - _seed_ -* `{Alphanumeric}`: sorts test methods _alphanumerically_ based on their names and formal - parameter lists; **Deprecated in favor of `{MethodName}`, to be removed in 6.0** +* `{MethodOrderer_DisplayName}`: sorts test methods _alphanumerically_ based on their + display names (see <>) +* `{MethodOrderer_MethodName}`: sorts test methods _alphanumerically_ based on their names + and formal parameter lists +* `{MethodOrderer_OrderAnnotation}`: sorts test methods _numerically_ based on values + specified via the `{Order}` annotation +* `{MethodOrderer_Random}`: orders test methods _pseudo-randomly_ and supports + configuration of a custom _seed_ +* `{MethodOrderer_Alphanumeric}`: sorts test methods _alphanumerically_ based on their + names and formal parameter lists; **deprecated in favor of `{MethodOrderer_MethodName}`, + to be removed in 6.0** NOTE: See also: <> @@ -564,9 +565,9 @@ via the `{TestMethodOrder}` annotation, the supplied class has to implement the `MethodOrderer` interface. The default orderer will be used for all tests unless the `@TestMethodOrder` annotation is present on an enclosing test class or test interface. -For example, to use the `{OrderAnnotation}` method orderer by default, you should set the -configuration parameter to the corresponding fully qualified class name (e.g., in -`src/test/resources/junit-platform.properties`): +For example, to use the `{MethodOrderer_OrderAnnotation}` method orderer by default, you +should set the configuration parameter to the corresponding fully qualified class name +(e.g., in `src/test/resources/junit-platform.properties`): [source,properties,indent=0] ---- @@ -596,19 +597,19 @@ configuration parameter>> to specify the fully qualified class name of the You can implement your own custom `ClassOrderer` or use one of the following built-in `ClassOrderer` implementations. -* `{DisplayName}`: sorts test classes _alphanumerically_ based on their display names - (see <>) -* `{ClassName}`: sorts test classes _alphanumerically_ based on their fully qualified - class names -* `{OrderAnnotation}`: sorts test classes _numerically_ based on values specified via the - `{Order}` annotation -* `{Random}`: orders test classes _pseudo-randomly_ and supports configuration of a - custom _seed_ +* `{ClassOrderer_DisplayName}`: sorts test classes _alphanumerically_ based on their + display names (see <>) +* `{ClassOrderer_ClassName}`: sorts test classes _alphanumerically_ based on their fully + qualified class names +* `{ClassOrderer_OrderAnnotation}`: sorts test classes _numerically_ based on values + specified via the `{Order}` annotation +* `{ClassOrderer_Random}`: orders test classes _pseudo-randomly_ and supports + configuration of a custom _seed_ For example, for the `@Order` annotation to be honored on _test classes_, you should -configure the `{OrderAnnotation}` class orderer using the configuration parameter with the -corresponding fully qualified class name (e.g., in +configure the `{ClassOrderer_OrderAnnotation}` class orderer using the configuration +parameter with the corresponding fully qualified class name (e.g., in `src/test/resources/junit-platform.properties`): [source,properties,indent=0] From 2e042d549f5e55c8ddf9c1f4b6f5047b397f1050 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 29 Jan 2021 12:26:30 +0100 Subject: [PATCH 0185/1433] Polish assertInstanceOf support --- .../java/org/junit/jupiter/api/AssertInstanceOf.java | 11 +++++------ .../main/java/org/junit/jupiter/api/Assertions.java | 3 +++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java index ef1cf28f1ab6..f6fbff1420c5 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertInstanceOf.java @@ -20,8 +20,8 @@ /** * {@code AssertInstanceOf} is a collection of utility methods that support - * asserting that a value is of a expected instance type - - * in other words, if it can be assigned to the expected type. + * asserting that an object is of an expected type — in other words, if it + * can be assigned to the expected type. * * @since 5.8 */ @@ -45,13 +45,12 @@ static T assertInstanceOf(Class expectedType, Object actualValue, Supplie private static T assertInstanceOf(Class expectedType, Object actualValue, Object messageOrSupplier) { if (!expectedType.isInstance(actualValue)) { - String template = "Unexpected type"; - if (actualValue == null) - template = "Unexpected null value"; + String reason = (actualValue == null ? "Unexpected null value" : "Unexpected type"); String message = buildPrefix(nullSafeGet(messageOrSupplier)) - + format(expectedType, actualValue == null ? null : actualValue.getClass(), template); + + format(expectedType, actualValue == null ? null : actualValue.getClass(), reason); throw new AssertionFailedError(message); } return expectedType.cast(actualValue); } + } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java index fca32402ac12..e60dec142872 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assertions.java @@ -3449,6 +3449,8 @@ public static T assertTimeoutPreemptively(Duration timeout, ThrowingSupplier return AssertTimeout.assertTimeoutPreemptively(timeout, supplier, messageSupplier); } + // --- assertInstanceOf ---------------------------------------------------- + /** * Assert that the supplied {@code actualValue} is an instance of the * {@code expectedType}. @@ -3495,4 +3497,5 @@ public static T assertInstanceOf(Class expectedType, Object actualValue, public static T assertInstanceOf(Class expectedType, Object actualValue, Supplier messageSupplier) { return AssertInstanceOf.assertInstanceOf(expectedType, actualValue, messageSupplier); } + } From 5e0569a3babc1c8ce1e5d49dd6e7f0b4fc830a1e Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 29 Jan 2021 12:55:05 +0100 Subject: [PATCH 0186/1433] Improve failure message for assertNull() Prior to this commit, if the `toString()` implementation for the `actual` object passed to assertNull() returned `null` or `"null"`, the following assertion failure message was generated, which is very confusing and difficult to debug. expected but was This commit improves the assertion failure message in such cases by including the actual object's type and identity hash in addition to the result of invoking `toString()` (i.e., "null"). For example, invoking `assertNull("null")` will now result in an assertion failure message similar to the following. expected: null but was: java.lang.String@264b3504 Closes #2523 --- .../release-notes/release-notes-5.8.0-M1.adoc | 3 + .../org/junit/jupiter/api/AssertNull.java | 10 ++- .../api/AssertNullAssertionsTests.java | 73 +++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index db3eda92ff5e..64e910bebe75 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -64,6 +64,9 @@ on GitHub. ==== New Features and Improvements +* `assertNull()` failure messages now include the actual object's type if the `toString()` + implementation for the actual object returns `null` or `"null"`. This avoids the + generation of confusing failure messages such as `expected but was `. * Numeric literals used with `@CsvSource` or `CsvFileSource` can now be expressed using underscores as in some JVM languages, to improve readability of long numbers like `700_000_000`. diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java index c0b9185a1e14..f843202d4a20 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertNull.java @@ -12,6 +12,7 @@ import static org.junit.jupiter.api.AssertionUtils.buildPrefix; import static org.junit.jupiter.api.AssertionUtils.fail; +import static org.junit.jupiter.api.AssertionUtils.format; import static org.junit.jupiter.api.AssertionUtils.nullSafeGet; import java.util.function.Supplier; @@ -45,6 +46,13 @@ static void assertNull(Object actual, Supplier messageSupplier) { } private static void failNotNull(Object actual, String message) { - fail(buildPrefix(message) + "expected: but was: <" + actual + ">", null, actual); + String stringRepresentation = actual.toString(); + if (stringRepresentation == null || stringRepresentation.equals("null")) { + fail(format(null, actual, message), null, actual); + } + else { + fail(buildPrefix(message) + "expected: but was: <" + actual + ">", null, actual); + } } + } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java index 13e4063e7e11..a47ca27207d6 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java @@ -16,6 +16,8 @@ import static org.junit.jupiter.api.AssertionTestUtils.expectAssertionFailedError; import static org.junit.jupiter.api.Assertions.assertNull; +import java.util.function.Supplier; + import org.opentest4j.AssertionFailedError; /** @@ -49,6 +51,69 @@ void assertNullWithNonNullObject() { } } + @Test + void assertNullWithNonNullObjectWithNullStringReturnedFromToString() { + assertNullWithNonNullObjectWithNullStringReturnedFromToString(null); + } + + @Test + void assertNullWithNonNullObjectWithNullStringReturnedFromToStringAndMessageSupplier() { + assertNullWithNonNullObjectWithNullStringReturnedFromToString(() -> "boom"); + } + + private void assertNullWithNonNullObjectWithNullStringReturnedFromToString(Supplier messageSupplier) { + String actual = "null"; + try { + if (messageSupplier == null) { + assertNull(actual); + } + else { + assertNull(actual, messageSupplier); + } + expectAssertionFailedError(); + } + catch (AssertionFailedError ex) { + // Should look something like: + // expected: null but was: java.lang.String@264b3504 + String prefix = (messageSupplier != null ? messageSupplier.get() + " ==> " : ""); + assertMessageStartsWith(ex, prefix + "expected: null but was: java.lang.String@"); + assertMessageEndsWith(ex, ""); + assertExpectedAndActualValues(ex, null, actual); + } + } + + @Test + void assertNullWithNonNullObjectWithNullReferenceReturnedFromToString() { + assertNullWithNonNullObjectWithNullReferenceReturnedFromToString(null); + } + + @Test + void assertNullWithNonNullObjectWithNullReferenceReturnedFromToStringAndMessageSupplier() { + assertNullWithNonNullObjectWithNullReferenceReturnedFromToString(() -> "boom"); + } + + private void assertNullWithNonNullObjectWithNullReferenceReturnedFromToString(Supplier messageSupplier) { + Object actual = new NullToString(); + try { + if (messageSupplier == null) { + assertNull(actual); + } + else { + assertNull(actual, messageSupplier); + } + expectAssertionFailedError(); + } + catch (AssertionFailedError ex) { + // Should look something like: + // expected: null but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@4e7912d8 + String prefix = (messageSupplier != null ? messageSupplier.get() + " ==> " : ""); + assertMessageStartsWith(ex, + prefix + "expected: null but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@"); + assertMessageEndsWith(ex, ""); + assertExpectedAndActualValues(ex, null, actual); + } + } + @Test void assertNullWithNonNullObjectAndMessage() { try { @@ -75,4 +140,12 @@ void assertNullWithNonNullObjectAndMessageSupplier() { } } + private static class NullToString { + + @Override + public String toString() { + return null; + } + } + } From 2ea0998c2d1eb803c0608b6c657abe54a23145c1 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 29 Jan 2021 13:15:44 +0100 Subject: [PATCH 0187/1433] Polish 5.8 M1 release notes --- .../release-notes/release-notes-5.8.0-M1.adoc | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 64e910bebe75..35a7c72cf1ae 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -30,21 +30,22 @@ on GitHub. nested container events when using the `EngineTestKit`. For example, `test(displayName("my test"))` can be used to match against a test whose display name is `my test`. -* The `junit-platform-jfr` module now also reports execution events for containers, e.g. - test classes. -* The `junit-platform-jfr` module now also reports test discovery events for the launcher - and registered test engines. +* The `junit-platform-jfr` module now reports execution events for containers -- for + example, test classes. +* The `junit-platform-jfr` module now reports test discovery events for the launcher and + registered test engines. * Custom `LauncherDiscoveryListener` implementations can now be registered via Java’s `{ServiceLoader}` mechanism. * Documented constant value of `ExclusiveResource.GLOBAL_KEY`. * Instances of `TestIdentifier` and `UniqueId` now retain less memory because they no longer store `String` representations of unique IDs. -* Improvement of `ExclusiveResource` handling, if a `Node` has only read locks and no read-write locks, - then descendants are not forced into `SAME_THREAD` execution, and can run concurrently. +* Improved of `ExclusiveResource` handling: if a `Node` has only read locks and no + read-write locks, then descendants are not forced into `SAME_THREAD` execution and can + run concurrently. * Tools that make multiple calls to the `Launcher` API should now create a - `LauncherSession` instead in order to allow for executing global setup and teardown code - exactly once via the new `LauncherSessionListener` interface that can be registered via - Java’s `{ServiceLoader}` mechanism. + `LauncherSession` in order to allow for executing global setup and teardown code exactly + once via the new `LauncherSessionListener` interface that can be registered via Java’s + `{ServiceLoader}` mechanism. [[release-notes-5.8.0-M1-junit-jupiter]] @@ -56,31 +57,33 @@ on GitHub. ==== Deprecations and Breaking Changes -* `InvocationInterceptor.interceptDynamicTest(Invocation , ExtensionContext)` has +* `InvocationInterceptor.interceptDynamicTest(Invocation, ExtensionContext)` has been deprecated in favor of - `InvocationInterceptor.interceptDynamicTest(Invocation , DynamicTestInvocationContext, ExtensionContext)` - that allows to access the dynamic test executable via + `InvocationInterceptor.interceptDynamicTest(Invocation, DynamicTestInvocationContext, ExtensionContext)` + that provides access to the dynamic test executable via `DynamicTestInvocationContext.getExecutable()`. ==== New Features and Improvements +* Top-level test classes can now be ordered by passing the fully-qualified name of a + class implementing `ClassOrderer` as the value of the new + `junit.jupiter.testclass.order.default` configuration parameter. +* New `assertInstanceOf()` methods which produce better error messages comparable to those + produced by `assertThrows`. These new methods serve as a replacement for + `assertTrue(obj instanceof X)`. * `assertNull()` failure messages now include the actual object's type if the `toString()` implementation for the actual object returns `null` or `"null"`. This avoids the generation of confusing failure messages such as `expected but was `. + * Numeric literals used with `@CsvSource` or `CsvFileSource` can now be expressed using underscores as in some JVM languages, to improve readability of long numbers like `700_000_000`. -* Documented constant values in `Resources`. -* New `assertInstanceOf` methods as a replacement for `assertTrue(obj instanceof X)` which - provide better error messages comparable to those of `assertThrows`. +* CSV rows provided via `@CsvSource` may now start with a number sign (`#`). +* New `ignoreLeadingAndTrailingWhitespace` attributes in `@CsvSource` and `@CsvFileSource` + (set to `true` by default) to control whether or not to trim whitespace. * Dynamic tests now require less memory thanks to a number of improvements to internal data structures. -* Allow rows in `@CsvSource` to start with a number sign (#) -* New `ignoreLeadingAndTrailingWhitespace` attribute to control whether or not to trim - whitespaces in `@CsvSource` and `@CsvFileSource` (set to `true` by default). -* Top-level test classes can now be ordered by passing the fully-qualified name of a - class implementing `ClassOrderer` as the value of the new - `junit.jupiter.testclass.order.default` configuration parameter. +* Documented constant values in `org.junit.jupiter.api.parallel.Resources`. [[release-notes-5.8.0-M1-junit-vintage]] From 12874e9f98911689557d97ddec92bad3b7896570 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 29 Jan 2021 20:27:56 +0100 Subject: [PATCH 0188/1433] Move entry to 5.7.1 release notes --- .../src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc | 2 ++ .../docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index 4b776d75d361..34aec9be9e00 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -25,6 +25,8 @@ GitHub. * `StringUtils.nullSafeToString()` now returns `"null"` if the invocation of `toString()` on the supplied object returns `null`. Although this is an internal utility, the effect of this change may be witnessed by end users and test engine or extension authors. +* Method `scanForClassesInPackage(String)` in `ClasspathScanner` now returns a valid list + of class names when the package name is equal to the name of a module on the module path. ==== Deprecations and Breaking Changes diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 35a7c72cf1ae..d13b4fb712bb 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -15,8 +15,7 @@ on GitHub. ==== Bug Fixes -* Method `scanForClassesInPackage(String)` in `ClasspathScanner` now returns a valid list - of class names when the package name is equal to the name of a module on the module path. +* ❓ ==== Deprecations and Breaking Changes From 31aaac8d30230eba1ff3c626cdc0b7e6b9a1f6f1 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 30 Jan 2021 17:44:09 +0100 Subject: [PATCH 0189/1433] Track inputs of compileModule tasks correctly --- .../kotlin/java-library-conventions.gradle.kts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 137355d7b451..1d52ba465358 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -1,3 +1,5 @@ +import org.gradle.api.tasks.PathSensitivity.RELATIVE + plugins { `java-library` eclipse @@ -219,18 +221,19 @@ tasks.compileTestJava { )) } -inner class ModulePathArgumentProvider : CommandLineArgumentProvider { - @get:Input val modulePath: Provider = configurations.compileClasspath - override fun asArguments(): List = listOf("--module-path", modulePath.get().asPath) +inner class ModulePathArgumentProvider : CommandLineArgumentProvider, Named { + @get:CompileClasspath val modulePath: Provider = configurations.compileClasspath + override fun asArguments() = listOf("--module-path", modulePath.get().asPath) + override fun getName() = "module-path" } -inner class PatchModuleArgumentProvider(it: Project) : CommandLineArgumentProvider { +inner class PatchModuleArgumentProvider(it: Project) : CommandLineArgumentProvider, Named { @get:Input val module: String = it.javaModuleName - @get:Input val patch: Provider = provider { + @get:InputFiles @get:PathSensitive(RELATIVE) val patch: Provider = provider { if (it == project) - files(sourceSets.matching { it.name.startsWith("main") }.map { it.output }) + configurations.compileClasspath.get() + files(sourceSets.matching { it.name.startsWith("main") }.map { it.output }) else files(it.sourceSets["main"].java.srcDirs) } @@ -242,6 +245,8 @@ inner class PatchModuleArgumentProvider(it: Project) : CommandLineArgumentProvid } return listOf("--patch-module", "$module=$path") } + + override fun getName() = "patch-module($module)" } afterEvaluate { From dc7cab302e0682ccd015d03c07548e9099ee4d3b Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sat, 30 Jan 2021 16:01:21 +0100 Subject: [PATCH 0190/1433] Fix warnings on JDK 17 --- .../java/org/junit/jupiter/api/ClassOrderer.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java index 0f2f029aa0ae..2eb44412265e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassOrderer.java @@ -77,6 +77,9 @@ public interface ClassOrderer { */ class ClassName implements ClassOrderer { + public ClassName() { + } + /** * Sort the classes encapsulated in the supplied * {@link ClassOrdererContext} alphanumerically based on their fully @@ -97,6 +100,9 @@ public void orderClasses(ClassOrdererContext context) { */ class DisplayName implements ClassOrderer { + public DisplayName() { + } + /** * Sort the classes encapsulated in the supplied * {@link ClassOrdererContext} alphanumerically based on their display @@ -127,6 +133,9 @@ public void orderClasses(ClassOrdererContext context) { */ class OrderAnnotation implements ClassOrderer { + public OrderAnnotation() { + } + /** * Sort the classes encapsulated in the supplied * {@link ClassOrdererContext} based on the {@link Order @Order} @@ -197,6 +206,9 @@ class Random implements ClassOrderer { */ public static final String RANDOM_SEED_PROPERTY_NAME = MethodOrderer.Random.RANDOM_SEED_PROPERTY_NAME; + public Random() { + } + /** * Order the classes encapsulated in the supplied * {@link ClassOrdererContext} pseudo-randomly. From eab64902fa14528376b25884eaf4ecab87dc3af6 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 30 Jan 2021 21:32:29 +0100 Subject: [PATCH 0191/1433] Use jOOX to test XML reports Instead of asserting string subsequences, we select elements and attributes in the DOM via jOOX which allows for much more expressive assertions. --- dependencies/dependencies.gradle.kts | 1 + gradle.properties | 1 + platform-tests/platform-tests.gradle.kts | 1 + ...egacyXmlReportGeneratingListenerTests.java | 312 ++++++++---------- .../legacy/xml/XmlReportAssertions.java | 11 +- .../legacy/xml/XmlReportWriterTests.java | 159 ++++----- 6 files changed, 207 insertions(+), 278 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 7921c47f032a..10470cb05888 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -38,5 +38,6 @@ dependencies { api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") api("org.spockframework:spock-core:${versions["spock"]}") api("com.github.gunnarmorling:jfrunit:${versions["jfrunit"]}") + api("org.jooq:joox:${versions["joox"]}") } } diff --git a/gradle.properties b/gradle.properties index 9a5a6cbdbb70..76bd93b5a7bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -38,6 +38,7 @@ mockito.version=3.7.7 slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 jfrunit.version=main-SNAPSHOT +joox.version=1.6.2 # Tools checkstyle.version=8.36.2 diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 592e0488562d..c8d92f145b1f 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -23,6 +23,7 @@ dependencies { testImplementation(project(":junit-jupiter-engine")) testImplementation("org.apiguardian:apiguardian-api") testImplementation("com.github.gunnarmorling:jfrunit") + testImplementation("org.jooq:joox") // --- Test run-time dependencies --------------------------------------------- testRuntimeOnly(project(":junit-vintage-engine")) diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java index ae6e42870f38..e0c73d2039f2 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java @@ -11,6 +11,7 @@ package org.junit.platform.reporting.legacy.xml; import static org.assertj.core.api.Assertions.assertThat; +import static org.joox.JOOX.$; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeFalse; @@ -37,8 +38,8 @@ import java.util.Map; import java.util.Set; +import org.joox.Match; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestReporter; import org.junit.jupiter.api.io.TempDir; import org.junit.platform.engine.TestEngine; import org.junit.platform.engine.UniqueId; @@ -65,29 +66,26 @@ void writesFileForSingleSucceedingTest(@TempDir Path tempDirectory) throws Excep executeTests(engine, tempDirectory); - var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); - - // @formatter:off - assertThat(content) - .containsSubsequence( - "", - "unique-id: [engine:dummy]/[test:succeedingTest]", - "display-name: display<-->Name 😎", - "", - "", - - "", - "unique-id: [engine:dummy]", - "display-name: dummy", - "", - "") - .doesNotContain("Name 😎"); + assertThat(testcase.attr("classname")).isEqualTo("dummy"); + assertThat(testcase.child("system-out").text()) // + .containsSubsequence("unique-id: [engine:dummy]/[test:succeedingTest]", + "display-name: display<-->Name 😎"); + + assertThat(testsuite.find("skipped")).isEmpty(); + assertThat(testsuite.find("failure")).isEmpty(); + assertThat(testsuite.find("error")).isEmpty(); } @Test @@ -97,22 +95,23 @@ void writesFileForSingleFailingTest(@TempDir Path tempDirectory) throws Exceptio executeTests(engine, tempDirectory); - var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); - - // @formatter:off - assertThat(content) - .containsSubsequence( - "", - "AssertionFailedError: expected to fail", - "\tat", - "", - "", - "") - .doesNotContain("fail"); + assertThat(failure.attr("type")).isEqualTo(AssertionFailedError.class.getName()); + assertThat(failure.text()).containsSubsequence("AssertionFailedError: expected to fail", "\tat"); + + assertThat(testsuite.find("skipped")).isEmpty(); + assertThat(testsuite.find("error")).isEmpty(); } @Test @@ -124,22 +123,23 @@ void writesFileForSingleErroneousTest(@TempDir Path tempDirectory) throws Except executeTests(engine, tempDirectory); - var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); - - // @formatter:off - assertThat(content) - .containsSubsequence( - "", - "RuntimeException: error occurred", - "\tat ", - "", - "", - "") - .doesNotContain("", - "should be skipped", - "", - "", - "") - .doesNotContain("", - "TestAbortedException: ", - "deliberately aborted", - "at ", - "", - "", - "") - .doesNotContain("", - "parent was skipped: should be skipped", - "", - "", - ""); - // @formatter:on + var testsuite = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + + assertThat(testsuite.attr("tests", int.class)).isEqualTo(1); + assertThat(testsuite.attr("skipped", int.class)).isEqualTo(1); + + var testcase = testsuite.child("testcase"); + assertThat(testcase.attr("name")).isEqualTo("test"); + assertThat(testcase.child("skipped").text()).isEqualTo("parent was skipped: should be skipped"); } @Test @@ -268,20 +254,18 @@ void writesFileForFailingContainer(@TempDir Path tempDirectory) throws Exception executeTests(engine, tempDirectory); - var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); - - // @formatter:off - assertThat(content) - .containsSubsequence( - "", - "AssertionFailedError: failure before all tests", - "\tat", - "", - "", - ""); - // @formatter:on + var testsuite = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + + assertThat(testsuite.attr("tests", int.class)).isEqualTo(1); + assertThat(testsuite.attr("failures", int.class)).isEqualTo(1); + + var testcase = testsuite.child("testcase"); + assertThat(testcase.attr("name")).isEqualTo("test"); + + var failure = testcase.child("failure"); + assertThat(failure.attr("message")).isEqualTo("failure before all tests"); + assertThat(failure.attr("type")).isEqualTo(AssertionFailedError.class.getName()); + assertThat(failure.text()).containsSubsequence("AssertionFailedError: failure before all tests", "\tat"); } @Test @@ -292,19 +276,10 @@ void writesSystemProperties(@TempDir Path tempDirectory) throws Exception { executeTests(engine, tempDirectory); - var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); - - // @formatter:off - assertThat(content) - .containsSubsequence( - "", - "", - "", - "", - ""); - // @formatter:on + var testsuite = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + var properties = testsuite.child("properties").children("property"); + assertThat(properties.matchAttr("name", "file\\.separator").attr("value")).isEqualTo(File.separator); + assertThat(properties.matchAttr("name", "path\\.separator").attr("value")).isEqualTo(File.pathSeparator); } @Test @@ -318,17 +293,9 @@ void writesHostNameAndTimestamp(@TempDir Path tempDirectory) throws Exception { executeTests(engine, tempDirectory, Clock.fixed(ZonedDateTime.of(now, zone).toInstant(), zone)); - var content = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); - - // @formatter:off - assertThat(content) - .containsSubsequence( - ""); - // @formatter:on + var testsuite = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + assertThat(testsuite.attr("hostname")).isEqualTo(InetAddress.getLocalHost().getHostName()); + assertThat(testsuite.attr("timestamp")).isEqualTo("2016-01-28T14:02:59"); } @Test @@ -362,8 +329,7 @@ void printsExceptionWhenReportCouldNotBeWritten(@TempDir Path tempDirectory) thr } @Test - void writesReportEntriesToSystemOutElement(@TempDir Path tempDirectory, TestReporter testReporter) - throws Exception { + void writesReportEntriesToSystemOutElement(@TempDir Path tempDirectory) throws Exception { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); var testPlan = TestPlan.from(Set.of(engineDescriptor)); @@ -382,24 +348,12 @@ void writesReportEntriesToSystemOutElement(@TempDir Path tempDirectory, TestRepo listener.executionFinished(testIdentifier, successful()); listener.executionFinished(testPlan.getTestIdentifier("[engine:engine]"), successful()); - var content = readValidXmlFile(tempDirectory.resolve("TEST-engine.xml")); - //testReporter.publishEntry("xml", content); - - // @formatter:off - assertThat(content) - .containsSubsequence( - "", - "Report Entry #1 (timestamp: " + Year.now(), - "- foo: bar\n", - "Report Entry #2 (timestamp: " + Year.now(), - "- bar: baz\n", - "- qux: foo\n", - "", - "", - ""); - // @formatter:on + var testsuite = readValidXmlFile(tempDirectory.resolve("TEST-engine.xml")); + + assertThat(String.join("\n", testsuite.child("testcase").children("system-out").texts())) // + .containsSubsequence( // + "Report Entry #1 (timestamp: " + Year.now(), "- foo: bar\n", + "Report Entry #2 (timestamp: " + Year.now(), "- bar: baz\n", "- qux: foo\n"); } private void executeTests(TestEngine engine, Path tempDirectory) { @@ -414,11 +368,13 @@ private void executeTests(TestEngine engine, Path tempDirectory, Clock clock) { launcher.execute(request().selectors(selectUniqueId(UniqueId.forEngine(engine.getId()))).build()); } - private String readValidXmlFile(Path xmlFile) throws Exception { + private Match readValidXmlFile(Path xmlFile) throws Exception { assertTrue(Files.exists(xmlFile), () -> "File does not exist: " + xmlFile); - var content = Files.readString(xmlFile); - assertValidAccordingToJenkinsSchema(content); - return content; + try (var reader = Files.newBufferedReader(xmlFile)) { + var xml = $(reader); + assertValidAccordingToJenkinsSchema(xml.document()); + return xml; + } } } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java index a64c5d758ce0..b3d1037db4ac 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportAssertions.java @@ -12,14 +12,13 @@ import static org.junit.jupiter.api.Assertions.fail; -import java.io.StringReader; - import javax.xml.XMLConstants; -import javax.xml.transform.stream.StreamSource; +import javax.xml.transform.dom.DOMSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import javax.xml.validation.Validator; +import org.w3c.dom.Document; import org.xml.sax.SAXException; /** @@ -27,14 +26,14 @@ */ class XmlReportAssertions { - static void assertValidAccordingToJenkinsSchema(String content) throws Exception { + static void assertValidAccordingToJenkinsSchema(Document document) throws Exception { try { // Schema is thread-safe, Validator is not var validator = CachedSchema.JENKINS.newValidator(); - validator.validate(new StreamSource(new StringReader(content))); + validator.validate(new DOMSource(document)); } catch (SAXException e) { - fail("Invalid XML document: " + content, e); + fail("Invalid XML document: " + document, e); } } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java index 923413491208..2b6cdf1dceeb 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportWriterTests.java @@ -11,6 +11,7 @@ package org.junit.platform.reporting.legacy.xml; import static org.assertj.core.api.Assertions.assertThat; +import static org.joox.JOOX.$; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.junit.platform.commons.util.CollectionUtils.getOnlyElement; @@ -20,6 +21,7 @@ import static org.junit.platform.launcher.LauncherConstants.STDOUT_REPORT_ENTRY_KEY; import static org.junit.platform.reporting.legacy.xml.XmlReportAssertions.assertValidAccordingToJenkinsSchema; +import java.io.StringReader; import java.io.StringWriter; import java.io.Writer; import java.time.Clock; @@ -27,8 +29,8 @@ import java.util.Set; import java.util.stream.Stream; +import org.joox.Match; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -52,16 +54,13 @@ void writesTestsuiteElementsWithoutTestcaseElementsWithoutAnyTests() throws Exce var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - var content = writeXmlReport(testPlan, reportData); + var testsuite = writeXmlReport(testPlan, reportData); - assertValidAccordingToJenkinsSchema(content); - //@formatter:off - assertThat(content) - .containsSubsequence( - "") - .doesNotContain("", - "Report Entry #1 (timestamp: ", - "- myKey: myValue", - ""); - //@formatter:on + var testsuite = writeXmlReport(testPlan, reportData); + + assertValidAccordingToJenkinsSchema(testsuite.document()); + assertThat(String.join("\n", testsuite.find("system-out").texts())) // + .containsSubsequence("Report Entry #1 (timestamp: ", "- myKey: myValue"); } @Test @@ -104,30 +97,18 @@ void writesCapturedOutput() throws Exception { reportData.addReportEntry(TestIdentifier.from(testDescriptor), ReportEntry.from(Map.of("baz", "qux"))); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), successful()); - var content = writeXmlReport(testPlan, reportData); - - assertValidAccordingToJenkinsSchema(content); - //@formatter:off - assertThat(content) - .containsSubsequence( - "", - "unique-id: ", "test:test", - "display-name: successfulTest", - "", - "", - "Report Entry #1 (timestamp: ", - "- foo: bar", - "Report Entry #2 (timestamp: ", - "- baz: qux", - "", - "", - "normal output", - "", - "", - "error output", - "") - .doesNotContain(STDOUT_REPORT_ENTRY_KEY, STDERR_REPORT_ENTRY_KEY); - //@formatter:on + var testsuite = writeXmlReport(testPlan, reportData); + + assertValidAccordingToJenkinsSchema(testsuite.document()); + assertThat(testsuite.find("system-out").text(0)) // + .containsSubsequence("unique-id: ", "test:test", "display-name: successfulTest"); + assertThat(testsuite.find("system-out").text(1)) // + .containsSubsequence("Report Entry #1 (timestamp: ", "- foo: bar", "Report Entry #2 (timestamp: ", + "- baz: qux"); + assertThat(testsuite.find("system-out").text(2).trim()) // + .isEqualTo("normal output"); + assertThat(testsuite.find("system-err").text().trim()) // + .isEqualTo("error output"); } @Test @@ -139,16 +120,14 @@ void writesEmptySkippedElementForSkippedTestWithoutReason() throws Exception { var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markSkipped(testPlan.getTestIdentifier(uniqueId.toString()), null); - var content = writeXmlReport(testPlan, reportData); + var testsuite = writeXmlReport(testPlan, reportData); - assertValidAccordingToJenkinsSchema(content); - //@formatter:off - assertThat(content) - .containsSubsequence( - "", - ""); - //@formatter:on + assertValidAccordingToJenkinsSchema(testsuite.document()); + var testcase = testsuite.child("testcase"); + assertThat(testcase.attr("name")).isEqualTo("skippedTest"); + var skipped = testcase.child("skipped"); + assertThat(skipped.size()).isEqualTo(1); + assertThat(skipped.children()).isEmpty(); } @Test @@ -171,16 +150,15 @@ public String getLegacyReportingName() { var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(null)); - var content = writeXmlReport(testPlan, reportData); + var testsuite = writeXmlReport(testPlan, reportData); - assertValidAccordingToJenkinsSchema(content); - //@formatter:off - assertThat(content) - .containsSubsequence( - "", - ""); - //@formatter:on + assertValidAccordingToJenkinsSchema(testsuite.document()); + var testcase = testsuite.child("testcase"); + assertThat(testcase.attr("name")).isEqualTo("failedTest"); + assertThat(testcase.attr("classname")).isEqualTo("myEngine"); + var error = testcase.child("error"); + assertThat(error.size()).isEqualTo(1); + assertThat(error.children()).isEmpty(); } @Test @@ -192,16 +170,12 @@ void omitsMessageAttributeForFailedTestWithThrowableWithoutMessage() throws Exce var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(new NullPointerException())); - var content = writeXmlReport(testPlan, reportData); + var testsuite = writeXmlReport(testPlan, reportData); - assertValidAccordingToJenkinsSchema(content); - //@formatter:off - assertThat(content) - .containsSubsequence( - "", - ""); - //@formatter:on + assertValidAccordingToJenkinsSchema(testsuite.document()); + var error = testsuite.find("error"); + assertThat(error.attr("type")).isEqualTo("java.lang.NullPointerException"); + assertThat(error.attr("message")).isNull(); } @Test @@ -214,21 +188,14 @@ void writesValidXmlEvenIfExceptionMessageContainsCData() throws Exception { var assertionError = new AssertionError(""); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); - var content = writeXmlReport(testPlan, reportData); - - assertValidAccordingToJenkinsSchema(content); - //@formatter:off - assertThat(content) - .containsSubsequence( - "", - "]]>") - .doesNotContain(assertionError.getMessage()); - //@formatter:on + var testsuite = writeXmlReport(testPlan, reportData); + + assertValidAccordingToJenkinsSchema(testsuite.document()); + assertThat(testsuite.find("failure").attr("message")).isEqualTo(""); } @Test - void escapesInvalidCharactersInSystemPropertiesAndExceptionMessages(TestInfo testInfo) throws Exception { + void escapesInvalidCharactersInSystemPropertiesAndExceptionMessages() throws Exception { var uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); var testPlan = TestPlan.from(Set.of(engineDescriptor)); @@ -238,18 +205,21 @@ void escapesInvalidCharactersInSystemPropertiesAndExceptionMessages(TestInfo tes reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); System.setProperty("foo.bar", "\1"); - String content; + Match testsuite; try { - content = writeXmlReport(testPlan, reportData); + testsuite = writeXmlReport(testPlan, reportData); } finally { System.getProperties().remove("foo.bar"); } - assertValidAccordingToJenkinsSchema(content); - assertThat(content) // - .contains("") // - .contains("failure message=\"expected: <A> but was: <B&#0;>\"") // + assertValidAccordingToJenkinsSchema(testsuite.document()); + assertThat(testsuite.find("property").matchAttr("name", "foo\\.bar").attr("value")) // + .isEqualTo(""); + var failure = testsuite.find("failure"); + assertThat(failure.attr("message")) // + .isEqualTo("expected: but was: "); + assertThat(failure.text()) // .contains("AssertionError: expected: but was: "); } @@ -264,9 +234,10 @@ void doesNotReopenCDataWithinCDataContent() throws Exception { reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); Writer assertingWriter = new StringWriter() { + @SuppressWarnings("NullableProblems") @Override - public void write(char[] cbuf, int off, int len) { - assertThat(new String(cbuf, off, len)).doesNotContain("]]> stringPairs() { ); } - private String writeXmlReport(TestPlan testPlan, XmlReportData reportData) throws Exception { + private Match writeXmlReport(TestPlan testPlan, XmlReportData reportData) throws Exception { var out = new StringWriter(); writeXmlReport(testPlan, reportData, out); - return out.toString(); + return $(new StringReader(out.toString())); } private void writeXmlReport(TestPlan testPlan, XmlReportData reportData, Writer out) throws Exception { From 68bcfdde3889ffe263869005453d531f2ceb3a12 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 31 Jan 2021 14:55:51 +0100 Subject: [PATCH 0192/1433] Improve failure message for null vs. null comparisons Prior to this commit, if the expected and actual values for a failed assertion both had "null" string representations and if either the expected or actual value was the null reference, the generated failure message looked something like the following. expected: null but was: java.lang.String@264b3504 This commit improves the assertion failure message in such cases by representing the null reference as "" instead of "null", leading to generated failure messages similar to the following. expected: but was: java.lang.String@264b3504 This improvement applies to assertEquals(), assertNull, and any other assertion that internally delegates to format(Object, Object, String) or formatValues(Object, Object) in AssertionUtils. See #2523 --- .../org/junit/jupiter/api/AssertionUtils.java | 4 +++ .../api/AssertEqualsAssertionsTests.java | 26 +++++++++++++++++++ .../api/AssertNullAssertionsTests.java | 8 +++--- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java index a091cf0947e6..faeeb6ab6808 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertionUtils.java @@ -123,6 +123,10 @@ static String formatValues(Object expected, Object actual) { } private static String formatClassAndValue(Object value, String valueString) { + // If the value is null, return instead of null. + if (value == null) { + return ""; + } String classAndHash = getClassName(value) + toHash(value); // if it's a class, there's no need to repeat the class name contained in the valueString. return (value instanceof Class ? "<" + classAndHash + ">" : classAndHash + "<" + valueString + ">"); diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java index e8629ae6ec9f..288cb8a51875 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertEqualsAssertionsTests.java @@ -550,6 +550,32 @@ void assertEqualsWithObjectVsNull() { } } + @Test + void assertEqualsWithObjectWithNullStringReturnedFromToStringVsNull() { + try { + assertEquals("null", null); + expectAssertionFailedError(); + } + catch (AssertionFailedError ex) { + assertMessageStartsWith(ex, "expected: java.lang.String@"); + assertMessageEndsWith(ex, " but was: "); + assertExpectedAndActualValues(ex, "null", null); + } + } + + @Test + void assertEqualsWithNullVsObjectWithNullStringReturnedFromToString() { + try { + assertEquals(null, "null"); + expectAssertionFailedError(); + } + catch (AssertionFailedError ex) { + assertMessageStartsWith(ex, "expected: but was: java.lang.String@"); + assertMessageEndsWith(ex, ""); + assertExpectedAndActualValues(ex, null, "null"); + } + } + @Test void assertEqualsWithNullVsObjectAndMessageSupplier() { try { diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java index a47ca27207d6..e219e3342189 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java @@ -74,9 +74,9 @@ private void assertNullWithNonNullObjectWithNullStringReturnedFromToString(Suppl } catch (AssertionFailedError ex) { // Should look something like: - // expected: null but was: java.lang.String@264b3504 + // expected: but was: java.lang.String@264b3504 String prefix = (messageSupplier != null ? messageSupplier.get() + " ==> " : ""); - assertMessageStartsWith(ex, prefix + "expected: null but was: java.lang.String@"); + assertMessageStartsWith(ex, prefix + "expected: but was: java.lang.String@"); assertMessageEndsWith(ex, ""); assertExpectedAndActualValues(ex, null, actual); } @@ -105,10 +105,10 @@ private void assertNullWithNonNullObjectWithNullReferenceReturnedFromToString(Su } catch (AssertionFailedError ex) { // Should look something like: - // expected: null but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@4e7912d8 + // expected: but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@4e7912d8 String prefix = (messageSupplier != null ? messageSupplier.get() + " ==> " : ""); assertMessageStartsWith(ex, - prefix + "expected: null but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@"); + prefix + "expected: but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@"); assertMessageEndsWith(ex, ""); assertExpectedAndActualValues(ex, null, actual); } From ebe74080110975b0c1b013c8d4e635ba1e98edc8 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 31 Jan 2021 17:28:24 +0100 Subject: [PATCH 0193/1433] Introduce AssertionTestUtils.assertMessageMatches assertMessageMatches() is a convenience method for using a RegEx instead of assertMessageStartsWith()/assertMessageEndsWith() combos. This commit makes use of the new method in AssertNullAssertionsTests but leaves all other existing tests unchanged. assertMessageMatches() can be used for new tests, or we can slowly migrate to it where it makes sense as we modify existing tests for some other reason. --- .../api/AssertNullAssertionsTests.java | 20 ++++++++----------- .../junit/jupiter/api/AssertionTestUtils.java | 7 +++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java index e219e3342189..54849ad6d3be 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertNullAssertionsTests.java @@ -11,8 +11,8 @@ package org.junit.jupiter.api; import static org.junit.jupiter.api.AssertionTestUtils.assertExpectedAndActualValues; -import static org.junit.jupiter.api.AssertionTestUtils.assertMessageEndsWith; -import static org.junit.jupiter.api.AssertionTestUtils.assertMessageStartsWith; +import static org.junit.jupiter.api.AssertionTestUtils.assertMessageEquals; +import static org.junit.jupiter.api.AssertionTestUtils.assertMessageMatches; import static org.junit.jupiter.api.AssertionTestUtils.expectAssertionFailedError; import static org.junit.jupiter.api.Assertions.assertNull; @@ -46,7 +46,7 @@ void assertNullWithNonNullObject() { expectAssertionFailedError(); } catch (AssertionFailedError ex) { - assertMessageEndsWith(ex, "expected: but was: "); + assertMessageEquals(ex, "expected: but was: "); assertExpectedAndActualValues(ex, null, "foo"); } } @@ -76,8 +76,7 @@ private void assertNullWithNonNullObjectWithNullStringReturnedFromToString(Suppl // Should look something like: // expected: but was: java.lang.String@264b3504 String prefix = (messageSupplier != null ? messageSupplier.get() + " ==> " : ""); - assertMessageStartsWith(ex, prefix + "expected: but was: java.lang.String@"); - assertMessageEndsWith(ex, ""); + assertMessageMatches(ex, prefix + "expected: but was: java\\.lang\\.String@.+"); assertExpectedAndActualValues(ex, null, actual); } } @@ -107,9 +106,8 @@ private void assertNullWithNonNullObjectWithNullReferenceReturnedFromToString(Su // Should look something like: // expected: but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@4e7912d8 String prefix = (messageSupplier != null ? messageSupplier.get() + " ==> " : ""); - assertMessageStartsWith(ex, - prefix + "expected: but was: org.junit.jupiter.api.AssertNullAssertionsTests$NullToString@"); - assertMessageEndsWith(ex, ""); + assertMessageMatches(ex, prefix + + "expected: but was: org\\.junit\\.jupiter\\.api\\.AssertNullAssertionsTests\\$NullToString@.+"); assertExpectedAndActualValues(ex, null, actual); } } @@ -121,8 +119,7 @@ void assertNullWithNonNullObjectAndMessage() { expectAssertionFailedError(); } catch (AssertionFailedError ex) { - assertMessageStartsWith(ex, "a message"); - assertMessageEndsWith(ex, "expected: but was: "); + assertMessageEquals(ex, "a message ==> expected: but was: "); assertExpectedAndActualValues(ex, null, "foo"); } } @@ -134,8 +131,7 @@ void assertNullWithNonNullObjectAndMessageSupplier() { expectAssertionFailedError(); } catch (AssertionFailedError ex) { - assertMessageStartsWith(ex, "test"); - assertMessageEndsWith(ex, "expected: but was: "); + assertMessageEquals(ex, "test ==> expected: but was: "); assertExpectedAndActualValues(ex, null, "foo"); } } diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java index a95c27212ab1..a2cd16f66290 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/AssertionTestUtils.java @@ -38,6 +38,13 @@ static void assertMessageEquals(Throwable ex, String msg) throws AssertionError } } + static void assertMessageMatches(Throwable ex, String regex) throws AssertionError { + if (!ex.getMessage().matches(regex)) { + throw new AssertionError("Exception message should match regular expression [" + regex + "], but was [" + + ex.getMessage() + "]."); + } + } + static void assertMessageStartsWith(Throwable ex, String msg) throws AssertionError { if (!ex.getMessage().startsWith(msg)) { throw new AssertionError( From 3583c879a4d9b3e8b4df573a788157d97667c8e7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 1 Feb 2021 19:30:32 +0100 Subject: [PATCH 0194/1433] Fix container failure XML reporting (#2542) Prior to this commit, failing containers were only reported in case they contained at least one test. However, for example for a parameterized Jupiter tests and an exception in a `@BeforeAll` method, that led to failures being silently swallowed. Now, in addition to tests, leaf nodes of the test tree are always included in the XML report, even if they are containers, not tests. Moreover, failures on the container level that occurred after their children had been executed were not reported, e.g. when an exception was thrown from a Jupiter `@AfterAll` method. Now such failures cause the contained tests to be reported as failed. Fixes #2537. --- .../release-notes/release-notes-5.7.1.adoc | 2 + .../DemoEngineExecutionContext.java | 2 +- .../DemoHierarchicalTestDescriptor.java | 2 +- .../DemoHierarchicalTestEngine.java | 23 ++- .../reporting/legacy/xml/XmlReportData.java | 38 ++-- .../reporting/legacy/xml/XmlReportWriter.java | 172 ++++++++++-------- ...egacyXmlReportGeneratingListenerTests.java | 90 +++++++-- .../legacy/xml/XmlReportDataTests.java | 18 +- 8 files changed, 221 insertions(+), 126 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index 34aec9be9e00..535dd7bd657f 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -27,6 +27,8 @@ GitHub. of this change may be witnessed by end users and test engine or extension authors. * Method `scanForClassesInPackage(String)` in `ClasspathScanner` now returns a valid list of class names when the package name is equal to the name of a module on the module path. +* The legacy XML report now always includes container-level failures (e.g. from + `@BeforeAll` Jupiter lifecycle methods). ==== Deprecations and Breaking Changes diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java index 174d51196bcf..8baf48abf067 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoEngineExecutionContext.java @@ -13,5 +13,5 @@ /** * @since 1.0 */ -class DemoEngineExecutionContext implements EngineExecutionContext { +public class DemoEngineExecutionContext implements EngineExecutionContext { } diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java index 57058e827a75..320e712a7d28 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestDescriptor.java @@ -26,7 +26,7 @@ public class DemoHierarchicalTestDescriptor extends AbstractTestDescriptor imple private String skippedReason; private boolean skipped; - DemoHierarchicalTestDescriptor(UniqueId uniqueId, String displayName, Runnable executeBlock) { + public DemoHierarchicalTestDescriptor(UniqueId uniqueId, String displayName, Runnable executeBlock) { this(uniqueId, displayName, null, executeBlock); } diff --git a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java index f389c7682690..f4e6c3fd300c 100644 --- a/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java +++ b/junit-platform-engine/src/testFixtures/java/org/junit/platform/engine/support/hierarchical/DemoHierarchicalTestEngine.java @@ -10,6 +10,8 @@ package org.junit.platform.engine.support.hierarchical; +import java.util.function.Function; + import org.junit.platform.engine.EngineDiscoveryRequest; import org.junit.platform.engine.ExecutionRequest; import org.junit.platform.engine.TestDescriptor; @@ -47,10 +49,8 @@ public DemoHierarchicalTestDescriptor addTest(String uniqueName, Runnable execut } public DemoHierarchicalTestDescriptor addTest(String uniqueName, String displayName, Runnable executeBlock) { - var uniqueId = engineDescriptor.getUniqueId().append("test", uniqueName); - var child = new DemoHierarchicalTestDescriptor(uniqueId, displayName, executeBlock); - engineDescriptor.addChild(child); - return child; + return addChild(uniqueName, uniqueId -> new DemoHierarchicalTestDescriptor(uniqueId, displayName, executeBlock), + "test"); } public DemoHierarchicalContainerDescriptor addContainer(String uniqueName, String displayName, TestSource source) { @@ -64,10 +64,17 @@ public DemoHierarchicalContainerDescriptor addContainer(String uniqueName, Runna public DemoHierarchicalContainerDescriptor addContainer(String uniqueName, String displayName, TestSource source, Runnable beforeBlock) { - var uniqueId = engineDescriptor.getUniqueId().append("container", uniqueName); - var container = new DemoHierarchicalContainerDescriptor(uniqueId, displayName, source, beforeBlock); - engineDescriptor.addChild(container); - return container; + return addChild(uniqueName, + uniqueId -> new DemoHierarchicalContainerDescriptor(uniqueId, displayName, source, beforeBlock), + "container"); + } + + public > T addChild(String uniqueName, + Function creator, String segmentType) { + var uniqueId = engineDescriptor.getUniqueId().append(segmentType, uniqueName); + var child = creator.apply(uniqueId); + engineDescriptor.addChild(child); + return child; } @Override diff --git a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java index 000fbd7015c7..18437a60b6b5 100644 --- a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java +++ b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportData.java @@ -11,8 +11,8 @@ package org.junit.platform.reporting.legacy.xml; import static java.util.Collections.emptyList; +import static java.util.stream.Collectors.toList; import static org.junit.platform.engine.TestExecutionResult.Status.ABORTED; -import static org.junit.platform.engine.TestExecutionResult.Status.SUCCESSFUL; import java.time.Clock; import java.time.Duration; @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; @@ -103,19 +104,11 @@ String getSkipReason(TestIdentifier testIdentifier) { }).orElse(null); } - Optional getResult(TestIdentifier testIdentifier) { - if (this.finishedTests.containsKey(testIdentifier)) { - return Optional.of(this.finishedTests.get(testIdentifier)); - } - Optional parent = this.testPlan.getParent(testIdentifier); - Optional ancestor = findAncestor(parent, this.finishedTests::containsKey); - if (ancestor.isPresent()) { - TestExecutionResult result = this.finishedTests.get(ancestor.get()); - if (result.getStatus() != SUCCESSFUL) { - return Optional.of(result); - } - } - return Optional.empty(); + List getResults(TestIdentifier testIdentifier) { + return getAncestors(testIdentifier).stream() // + .map(this.finishedTests::get) // + .filter(Objects::nonNull) // + .collect(toList()); } List getReportEntries(TestIdentifier testIdentifier) { @@ -123,12 +116,11 @@ List getReportEntries(TestIdentifier testIdentifier) { } private Optional findSkippedAncestor(TestIdentifier testIdentifier) { - return findAncestor(Optional.of(testIdentifier), this.skippedTests::containsKey); + return findAncestor(testIdentifier, this.skippedTests::containsKey); } - private Optional findAncestor(Optional testIdentifier, - Predicate predicate) { - Optional current = testIdentifier; + private Optional findAncestor(TestIdentifier testIdentifier, Predicate predicate) { + Optional current = Optional.of(testIdentifier); while (current.isPresent()) { if (predicate.test(current.get())) { return current; @@ -138,4 +130,14 @@ private Optional findAncestor(Optional testIdent return Optional.empty(); } + private List getAncestors(TestIdentifier testIdentifier) { + TestIdentifier current = testIdentifier; + List ancestors = new ArrayList<>(); + while (current != null) { + ancestors.add(current); + current = this.testPlan.getParent(current).orElse(null); + } + return ancestors; + } + } diff --git a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java index 4724a36948e6..015cfe0fa2d2 100644 --- a/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java +++ b/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java @@ -12,12 +12,23 @@ import static java.text.MessageFormat.format; import static java.time.format.DateTimeFormatter.ISO_LOCAL_DATE_TIME; +import static java.util.Collections.emptyList; +import static java.util.Comparator.naturalOrder; +import static java.util.function.Function.identity; +import static java.util.stream.Collectors.counting; +import static java.util.stream.Collectors.groupingBy; +import static java.util.stream.Collectors.mapping; import static java.util.stream.Collectors.toList; +import static java.util.stream.Collectors.toMap; import static org.junit.platform.commons.util.ExceptionUtils.readStackTrace; import static org.junit.platform.commons.util.StringUtils.isNotBlank; import static org.junit.platform.engine.TestExecutionResult.Status.FAILED; import static org.junit.platform.launcher.LauncherConstants.STDERR_REPORT_ENTRY_KEY; import static org.junit.platform.launcher.LauncherConstants.STDOUT_REPORT_ENTRY_KEY; +import static org.junit.platform.reporting.legacy.xml.XmlReportWriter.AggregatedTestResult.Type.ERROR; +import static org.junit.platform.reporting.legacy.xml.XmlReportWriter.AggregatedTestResult.Type.FAILURE; +import static org.junit.platform.reporting.legacy.xml.XmlReportWriter.AggregatedTestResult.Type.SKIPPED; +import static org.junit.platform.reporting.legacy.xml.XmlReportWriter.AggregatedTestResult.Type.SUCCESS; import java.io.Writer; import java.net.InetAddress; @@ -25,10 +36,13 @@ import java.text.NumberFormat; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Map.Entry; import java.util.Optional; import java.util.Properties; import java.util.TreeSet; @@ -41,7 +55,9 @@ import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.reporting.ReportEntry; import org.junit.platform.launcher.TestIdentifier; +import org.junit.platform.launcher.TestPlan; import org.junit.platform.reporting.legacy.LegacyReportingUtils; +import org.junit.platform.reporting.legacy.xml.XmlReportWriter.AggregatedTestResult.Type; /** * {@code XmlReportWriter} writes an XML report whose format is compatible @@ -62,18 +78,28 @@ class XmlReportWriter { this.reportData = reportData; } - void writeXmlReport(TestIdentifier testIdentifier, Writer out) throws XMLStreamException { - // @formatter:off - List tests = this.reportData.getTestPlan().getDescendants(testIdentifier) - .stream() - .filter(TestIdentifier::isTest) - .collect(toList()); - // @formatter:on - writeXmlReport(testIdentifier, tests, out); + void writeXmlReport(TestIdentifier rootDescriptor, Writer out) throws XMLStreamException { + TestPlan testPlan = this.reportData.getTestPlan(); + Map tests = testPlan.getDescendants(rootDescriptor) // + .stream() // + .filter(testIdentifier -> shouldInclude(testPlan, testIdentifier)) // + .collect(toMap(identity(), this::toAggregatedResult)); // + writeXmlReport(rootDescriptor, tests, out); } - private void writeXmlReport(TestIdentifier testIdentifier, List tests, Writer out) - throws XMLStreamException { + private AggregatedTestResult toAggregatedResult(TestIdentifier testIdentifier) { + if (this.reportData.wasSkipped(testIdentifier)) { + return AggregatedTestResult.skipped(); + } + return AggregatedTestResult.nonSkipped(this.reportData.getResults(testIdentifier)); + } + + private boolean shouldInclude(TestPlan testPlan, TestIdentifier testIdentifier) { + return testIdentifier.isTest() || testPlan.getChildren(testIdentifier).isEmpty(); + } + + private void writeXmlReport(TestIdentifier testIdentifier, Map tests, + Writer out) throws XMLStreamException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLStreamWriter xmlWriter = factory.createXMLStreamWriter(out); @@ -85,8 +111,8 @@ private void writeXmlReport(TestIdentifier testIdentifier, List xmlWriter.close(); } - private void writeTestsuite(TestIdentifier testIdentifier, List tests, XMLStreamWriter writer) - throws XMLStreamException { + private void writeTestsuite(TestIdentifier testIdentifier, Map tests, + XMLStreamWriter writer) throws XMLStreamException { // NumberFormat is not thread-safe. Thus, we instantiate it here and pass it to // writeTestcase instead of using a constant @@ -94,13 +120,13 @@ private void writeTestsuite(TestIdentifier testIdentifier, List writer.writeStartElement("testsuite"); - writeSuiteAttributes(testIdentifier, tests, numberFormat, writer); + writeSuiteAttributes(testIdentifier, tests.values(), numberFormat, writer); newLine(writer); writeSystemProperties(writer); - for (TestIdentifier test : tests) { - writeTestcase(test, numberFormat, writer); + for (Entry entry : tests.entrySet()) { + writeTestcase(entry.getKey(), entry.getValue(), numberFormat, writer); } writeOutputElement("system-out", formatNonStandardAttributesAsString(testIdentifier), writer); @@ -109,22 +135,24 @@ private void writeTestsuite(TestIdentifier testIdentifier, List newLine(writer); } - private void writeSuiteAttributes(TestIdentifier testIdentifier, List tests, + private void writeSuiteAttributes(TestIdentifier testIdentifier, Collection testResults, NumberFormat numberFormat, XMLStreamWriter writer) throws XMLStreamException { writeAttributeSafely(writer, "name", testIdentifier.getDisplayName()); - writeTestCounts(tests, writer); + writeTestCounts(testResults, writer); writeAttributeSafely(writer, "time", getTime(testIdentifier, numberFormat)); writeAttributeSafely(writer, "hostname", getHostname().orElse("")); writeAttributeSafely(writer, "timestamp", ISO_LOCAL_DATE_TIME.format(getCurrentDateTime())); } - private void writeTestCounts(List tests, XMLStreamWriter writer) throws XMLStreamException { - TestCounts testCounts = TestCounts.from(this.reportData, tests); - writeAttributeSafely(writer, "tests", String.valueOf(testCounts.getTotal())); - writeAttributeSafely(writer, "skipped", String.valueOf(testCounts.getSkipped())); - writeAttributeSafely(writer, "failures", String.valueOf(testCounts.getFailures())); - writeAttributeSafely(writer, "errors", String.valueOf(testCounts.getErrors())); + private void writeTestCounts(Collection testResults, XMLStreamWriter writer) + throws XMLStreamException { + Map counts = testResults.stream().map(it -> it.type).collect(groupingBy(identity(), counting())); + long total = counts.values().stream().mapToLong(Long::longValue).sum(); + writeAttributeSafely(writer, "tests", String.valueOf(total)); + writeAttributeSafely(writer, "skipped", counts.getOrDefault(SKIPPED, 0L).toString()); + writeAttributeSafely(writer, "failures", counts.getOrDefault(FAILURE, 0L).toString()); + writeAttributeSafely(writer, "errors", counts.getOrDefault(ERROR, 0L).toString()); } private void writeSystemProperties(XMLStreamWriter writer) throws XMLStreamException { @@ -141,8 +169,8 @@ private void writeSystemProperties(XMLStreamWriter writer) throws XMLStreamExcep newLine(writer); } - private void writeTestcase(TestIdentifier testIdentifier, NumberFormat numberFormat, XMLStreamWriter writer) - throws XMLStreamException { + private void writeTestcase(TestIdentifier testIdentifier, AggregatedTestResult testResult, + NumberFormat numberFormat, XMLStreamWriter writer) throws XMLStreamException { writer.writeStartElement("testcase"); @@ -151,7 +179,7 @@ private void writeTestcase(TestIdentifier testIdentifier, NumberFormat numberFor writeAttributeSafely(writer, "time", getTime(testIdentifier, numberFormat)); newLine(writer); - writeSkippedOrErrorOrFailureElement(testIdentifier, writer); + writeSkippedOrErrorOrFailureElement(testIdentifier, testResult, writer); List systemOutElements = new ArrayList<>(); List systemErrElements = new ArrayList<>(); @@ -172,16 +200,18 @@ private String getClassName(TestIdentifier testIdentifier) { return LegacyReportingUtils.getClassName(this.reportData.getTestPlan(), testIdentifier); } - private void writeSkippedOrErrorOrFailureElement(TestIdentifier testIdentifier, XMLStreamWriter writer) - throws XMLStreamException { + private void writeSkippedOrErrorOrFailureElement(TestIdentifier testIdentifier, AggregatedTestResult testResult, + XMLStreamWriter writer) throws XMLStreamException { - if (this.reportData.wasSkipped(testIdentifier)) { + if (testResult.type == SKIPPED) { writeSkippedElement(this.reportData.getSkipReason(testIdentifier), writer); } else { - Optional result = this.reportData.getResult(testIdentifier); - if (result.isPresent() && result.get().getStatus() == FAILED) { - writeErrorOrFailureElement(result.get(), writer); + Map>> throwablesByType = testResult.getThrowablesByType(); + for (Type type : EnumSet.of(FAILURE, ERROR)) { + for (Optional throwable : throwablesByType.getOrDefault(type, emptyList())) { + writeErrorOrFailureElement(type, throwable.orElse(null), writer); + } } } } @@ -198,17 +228,17 @@ private void writeSkippedElement(String reason, XMLStreamWriter writer) throws X newLine(writer); } - private void writeErrorOrFailureElement(TestExecutionResult result, XMLStreamWriter writer) + private void writeErrorOrFailureElement(Type type, Throwable throwable, XMLStreamWriter writer) throws XMLStreamException { - Optional throwable = result.getThrowable(); - if (throwable.isPresent()) { - writer.writeStartElement(isFailure(result) ? "failure" : "error"); - writeFailureAttributesAndContent(throwable.get(), writer); + String elementName = type == FAILURE ? "failure" : "error"; + if (throwable != null) { + writer.writeStartElement(elementName); + writeFailureAttributesAndContent(throwable, writer); writer.writeEndElement(); } else { - writer.writeEmptyElement("error"); + writer.writeEmptyElement(elementName); } newLine(writer); } @@ -342,54 +372,46 @@ private static boolean isFailure(TestExecutionResult result) { return throwable.isPresent() && throwable.get() instanceof AssertionError; } - private static class TestCounts { - - static TestCounts from(XmlReportData reportData, List tests) { - TestCounts counts = new TestCounts(tests.size()); - for (TestIdentifier test : tests) { - if (reportData.wasSkipped(test)) { - counts.skipped++; - } - else { - Optional result = reportData.getResult(test); - if (result.isPresent() && result.get().getStatus() == FAILED) { - if (isFailure(result.get())) { - counts.failures++; - } - else { - counts.errors++; - } - } - } - } - return counts; - } + static class AggregatedTestResult { - private final long total; - private long skipped; - private long failures; - private long errors; + private static final AggregatedTestResult SKIPPED_RESULT = new AggregatedTestResult(SKIPPED, emptyList()); - TestCounts(long total) { - this.total = total; + public static AggregatedTestResult skipped() { + return SKIPPED_RESULT; } - public long getTotal() { - return total; + public static AggregatedTestResult nonSkipped(List executionResults) { + Type type = executionResults.stream() // + .map(Type::from) // + .max(naturalOrder()) // + .orElse(SUCCESS); + return new AggregatedTestResult(type, executionResults); } - public long getSkipped() { - return skipped; - } + private final Type type; + private final List executionResults; - public long getFailures() { - return failures; + private AggregatedTestResult(Type type, List executionResults) { + this.type = type; + this.executionResults = executionResults; } - public long getErrors() { - return errors; + public Map>> getThrowablesByType() { + return executionResults.stream() // + .collect(groupingBy(Type::from, mapping(TestExecutionResult::getThrowable, toList()))); } + enum Type { + + SUCCESS, SKIPPED, FAILURE, ERROR; + + private static Type from(TestExecutionResult executionResult) { + if (executionResult.getStatus() == FAILED) { + return isFailure(executionResult) ? FAILURE : ERROR; + } + return SUCCESS; + } + } } } diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java index e0c73d2039f2..546cb1331c1f 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListenerTests.java @@ -45,6 +45,9 @@ import org.junit.platform.engine.UniqueId; import org.junit.platform.engine.reporting.ReportEntry; import org.junit.platform.engine.support.descriptor.EngineDescriptor; +import org.junit.platform.engine.support.hierarchical.DemoEngineExecutionContext; +import org.junit.platform.engine.support.hierarchical.DemoHierarchicalContainerDescriptor; +import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestDescriptor; import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine; import org.junit.platform.fakes.TestDescriptorStub; import org.junit.platform.launcher.TestIdentifier; @@ -58,8 +61,11 @@ */ class LegacyXmlReportGeneratingListenerTests { + @TempDir + Path tempDirectory; + @Test - void writesFileForSingleSucceedingTest(@TempDir Path tempDirectory) throws Exception { + void writesFileForSingleSucceedingTest() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("succeedingTest", "display<-->Name 😎", () -> { }); @@ -89,7 +95,7 @@ void writesFileForSingleSucceedingTest(@TempDir Path tempDirectory) throws Excep } @Test - void writesFileForSingleFailingTest(@TempDir Path tempDirectory) throws Exception { + void writesFileForSingleFailingTest() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("failingTest", () -> fail("expected to fail")); @@ -115,7 +121,7 @@ void writesFileForSingleFailingTest(@TempDir Path tempDirectory) throws Exceptio } @Test - void writesFileForSingleErroneousTest(@TempDir Path tempDirectory) throws Exception { + void writesFileForSingleErroneousTest() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("failingTest", () -> { throw new RuntimeException("error occurred"); @@ -143,7 +149,7 @@ void writesFileForSingleErroneousTest(@TempDir Path tempDirectory) throws Except } @Test - void writesFileForSingleSkippedTest(@TempDir Path tempDirectory) throws Exception { + void writesFileForSingleSkippedTest() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); var testDescriptor = engine.addTest("skippedTest", () -> fail("never called")); testDescriptor.markSkipped("should be skipped"); @@ -167,7 +173,7 @@ void writesFileForSingleSkippedTest(@TempDir Path tempDirectory) throws Exceptio @SuppressWarnings("ConstantConditions") @Test - void writesFileForSingleAbortedTest(@TempDir Path tempDirectory) throws Exception { + void writesFileForSingleAbortedTest() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("abortedTest", () -> assumeFalse(true, "deliberately aborted")); @@ -190,7 +196,7 @@ void writesFileForSingleAbortedTest(@TempDir Path tempDirectory) throws Exceptio } @Test - void measuresTimesInSeconds(@TempDir Path tempDirectory) throws Exception { + void measuresTimesInSeconds() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("firstTest", () -> { }); @@ -216,7 +222,7 @@ void measuresTimesInSeconds(@TempDir Path tempDirectory) throws Exception { } @Test - void testWithImmeasurableTimeIsOutputCorrectly(@TempDir Path tempDirectory) throws Exception { + void testWithImmeasurableTimeIsOutputCorrectly() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> { }); @@ -229,7 +235,7 @@ void testWithImmeasurableTimeIsOutputCorrectly(@TempDir Path tempDirectory) thro } @Test - void writesFileForSkippedContainer(@TempDir Path tempDirectory) throws Exception { + void writesFileForSkippedContainer() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> fail("never called")); engine.getEngineDescriptor().markSkipped("should be skipped"); @@ -247,7 +253,7 @@ void writesFileForSkippedContainer(@TempDir Path tempDirectory) throws Exception } @Test - void writesFileForFailingContainer(@TempDir Path tempDirectory) throws Exception { + void writesFileForFailingContainer() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> fail("never called")); engine.getEngineDescriptor().setBeforeAllBehavior(() -> fail("failure before all tests")); @@ -269,7 +275,63 @@ void writesFileForFailingContainer(@TempDir Path tempDirectory) throws Exception } @Test - void writesSystemProperties(@TempDir Path tempDirectory) throws Exception { + void writesFileForFailingContainerWithoutTest() throws Exception { + var engine = new DemoHierarchicalTestEngine("dummy"); + engine.addContainer("failingContainer", () -> { + throw new RuntimeException("boom"); + }); + + executeTests(engine, tempDirectory); + + var testsuite = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + + assertThat(testsuite.attr("tests", int.class)).isEqualTo(1); + assertThat(testsuite.attr("errors", int.class)).isEqualTo(1); + + var testcase = testsuite.child("testcase"); + assertThat(testcase.attr("name")).isEqualTo("failingContainer"); + assertThat(testcase.attr("classname")).isEqualTo("dummy"); + + var error = testcase.child("error"); + assertThat(error.attr("message")).isEqualTo("boom"); + assertThat(error.attr("type")).isEqualTo(RuntimeException.class.getName()); + assertThat(error.text()).containsSubsequence("RuntimeException: boom", "\tat"); + } + + @Test + void writesFileForContainerFailingAfterTest() throws Exception { + var engine = new DemoHierarchicalTestEngine("dummy"); + + var container = engine.addChild("failingContainer", + uniqueId -> new DemoHierarchicalContainerDescriptor(uniqueId, "failingContainer", null, null) { + @Override + public void after(DemoEngineExecutionContext context) { + throw new RuntimeException("boom"); + } + }, "child"); + container.addChild( + new DemoHierarchicalTestDescriptor(container.getUniqueId().append("test", "someTest"), "someTest", () -> { + })); + + executeTests(engine, tempDirectory); + + var testsuite = readValidXmlFile(tempDirectory.resolve("TEST-dummy.xml")); + + assertThat(testsuite.attr("tests", int.class)).isEqualTo(1); + assertThat(testsuite.attr("errors", int.class)).isEqualTo(1); + + var testcase = testsuite.child("testcase"); + assertThat(testcase.attr("name")).isEqualTo("someTest"); + assertThat(testcase.attr("classname")).isEqualTo("failingContainer"); + + var error = testcase.child("error"); + assertThat(error.attr("message")).isEqualTo("boom"); + assertThat(error.attr("type")).isEqualTo(RuntimeException.class.getName()); + assertThat(error.text()).containsSubsequence("RuntimeException: boom", "\tat"); + } + + @Test + void writesSystemProperties() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> { }); @@ -283,7 +345,7 @@ void writesSystemProperties(@TempDir Path tempDirectory) throws Exception { } @Test - void writesHostNameAndTimestamp(@TempDir Path tempDirectory) throws Exception { + void writesHostNameAndTimestamp() throws Exception { var engine = new DemoHierarchicalTestEngine("dummy"); engine.addTest("test", () -> { }); @@ -299,7 +361,7 @@ void writesHostNameAndTimestamp(@TempDir Path tempDirectory) throws Exception { } @Test - void printsExceptionWhenReportsDirCannotBeCreated(@TempDir Path tempDirectory) throws Exception { + void printsExceptionWhenReportsDirCannotBeCreated() throws Exception { var reportsDir = tempDirectory.resolve("dummy.txt"); Files.write(reportsDir, Set.of("content")); @@ -313,7 +375,7 @@ void printsExceptionWhenReportsDirCannotBeCreated(@TempDir Path tempDirectory) t } @Test - void printsExceptionWhenReportCouldNotBeWritten(@TempDir Path tempDirectory) throws Exception { + void printsExceptionWhenReportCouldNotBeWritten() throws Exception { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); var xmlFile = tempDirectory.resolve("TEST-engine.xml"); @@ -329,7 +391,7 @@ void printsExceptionWhenReportCouldNotBeWritten(@TempDir Path tempDirectory) thr } @Test - void writesReportEntriesToSystemOutElement(@TempDir Path tempDirectory) throws Exception { + void writesReportEntriesToSystemOutElement() throws Exception { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); var testPlan = TestPlan.from(Set.of(engineDescriptor)); diff --git a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java index 7f339554a6ed..0a528f543559 100644 --- a/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java +++ b/platform-tests/src/test/java/org/junit/platform/reporting/legacy/xml/XmlReportDataTests.java @@ -29,19 +29,19 @@ class XmlReportDataTests { @Test - void resultOfTestIdentifierWithoutAnyReportedEventsIsEmpty() { + void resultsOfTestIdentifierWithoutAnyReportedEventsAreEmpty() { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); var testPlan = TestPlan.from(Set.of(engineDescriptor)); var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); - var result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); + var results = reportData.getResults(testPlan.getTestIdentifier("[child:test]")); - assertThat(result).isEmpty(); + assertThat(results).isEmpty(); } @Test - void resultOfTestIdentifierWithoutReportedEventsIsFailureOfAncestor() { + void resultsOfTestIdentifierWithoutReportedEventsContainsOnlyFailureOfAncestor() { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); var testPlan = TestPlan.from(Set.of(engineDescriptor)); @@ -50,13 +50,13 @@ void resultOfTestIdentifierWithoutReportedEventsIsFailureOfAncestor() { var failureOfAncestor = failed(new RuntimeException("failed!")); reportData.markFinished(testPlan.getTestIdentifier("[engine:engine]"), failureOfAncestor); - var result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); + var results = reportData.getResults(testPlan.getTestIdentifier("[child:test]")); - assertThat(result).contains(failureOfAncestor); + assertThat(results).containsExactly(failureOfAncestor); } @Test - void resultOfTestIdentifierWithoutReportedEventsIsEmptyWhenAncestorWasSuccessful() { + void resultsOfTestIdentifierWithoutReportedEventsContainsOnlySuccessOfAncestor() { var engineDescriptor = new EngineDescriptor(UniqueId.forEngine("engine"), "Engine"); engineDescriptor.addChild(new TestDescriptorStub(UniqueId.root("child", "test"), "test")); var testPlan = TestPlan.from(Set.of(engineDescriptor)); @@ -64,8 +64,8 @@ void resultOfTestIdentifierWithoutReportedEventsIsEmptyWhenAncestorWasSuccessful var reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); reportData.markFinished(testPlan.getTestIdentifier("[engine:engine]"), successful()); - var result = reportData.getResult(testPlan.getTestIdentifier("[child:test]")); + var results = reportData.getResults(testPlan.getTestIdentifier("[child:test]")); - assertThat(result).isEmpty(); + assertThat(results).containsExactly(successful()); } } From 5ad2cd621636adca469aa23871ecbe19018566f4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 1 Feb 2021 19:28:41 +0100 Subject: [PATCH 0195/1433] Upgrade ArchUnit to 0.16.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 76bd93b5a7bd..c7a69ac63ad5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ picocli.version=4.6.1 univocity-parsers.version=2.9.0 # Test Dependencies -archunit.version=0.15.0 +archunit.version=0.16.0 bartholdy.version=0.2.3 classgraph.version=4.8.98 commons-io.version=2.8.0 From 24a1b9c0a3f38e1189e785b46671ce45c3b167a8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 4 Feb 2021 20:41:37 +0100 Subject: [PATCH 0196/1433] Finalize release notes for 5.7.1 --- .../release-notes/release-notes-5.7.1.adoc | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc index 535dd7bd657f..6264f0b4234e 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.1.adoc @@ -1,7 +1,7 @@ [[release-notes-5.7.1]] == 5.7.1 -*Date of Release:* ❓ +*Date of Release:* February 4, 2021 *Scope:* Bug fixes since 5.7.0 @@ -30,14 +30,6 @@ GitHub. * The legacy XML report now always includes container-level failures (e.g. from `@BeforeAll` Jupiter lifecycle methods). -==== Deprecations and Breaking Changes - -* ❓ - -==== New Features and Improvements - -* ❓ - [[release-notes-5.7.1-junit-jupiter]] === JUnit Jupiter @@ -51,10 +43,6 @@ GitHub. * Creator functions passed to `ExtensionContext.Store.getOrComputeIfAbsent()` are now only called once even if they throw an exception. -==== Deprecations and Breaking Changes - -* ❓ - ==== New Features and Improvements * The user guide now explains Nested Tests in more detail. @@ -70,11 +58,3 @@ GitHub. * The legacy reporting name of top-level test classes is now always their fully-qualified class name. Previously, a textual description was returned for JUnit 3 suites. - -==== Deprecations and Breaking Changes - -* ❓ - -==== New Features and Improvements - -* ❓ From da2dee2bfb89f480008bffb76cf08e612f642a63 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 4 Feb 2021 20:45:29 +0100 Subject: [PATCH 0197/1433] Release 5.7.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7055b276a18..c6b6e453af25 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository is the home of the next generation of JUnit, _JUnit 5_. ## Latest Releases -- General Availability (GA): [JUnit 5.7.0](https://github.com/junit-team/junit5/releases/tag/r5.7.0) (September 13, 2020) +- General Availability (GA): [JUnit 5.7.1](https://github.com/junit-team/junit5/releases/tag/r5.7.1) (February 4, 2021) - Preview (Milestone/Release Candidate): n/a ## Documentation From e1700117be9b28a0c958cb3a73b738969ca8ce77 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 6 Feb 2021 11:28:40 +0100 Subject: [PATCH 0198/1433] Upgradle to 6.8.2 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f604ed1642c0..299cd1a9e796 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=fd591a34af7385730970399f473afabdb8b28d57fd97d6625c388d090039d6fd -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip +distributionSha256Sum=8de6efc274ab52332a9c820366dd5cf5fc9d35ec7078fd70c8ec6913431ee610 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 9bdc01e71e4ef1ce5aa19ea0f9ab60745059263e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 7 Feb 2021 16:42:19 +0100 Subject: [PATCH 0199/1433] Avoid publishing shadow jar twice Prior to this commit, projects using shadow were publishing their jars twice: once with "all" classifier and once without any classifier. --- buildSrc/src/main/kotlin/shadow-conventions.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts b/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts index 0a5d8db24510..0f1a4bc8d36d 100644 --- a/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts @@ -49,6 +49,7 @@ tasks { shadowJar { configurations = listOf(shadowed) exclude("META-INF/maven/**") + archiveClassifier.set("") } jar { dependsOn(shadowJar) From 189a5a224be2fcc35a3ca2f73be260b19277c45b Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Sun, 7 Feb 2021 17:32:50 +0100 Subject: [PATCH 0200/1433] Expect correct modular JAR file name --- .../jar-describe-module/junit-jupiter-params.expected.txt | 2 +- .../jar-describe-module/junit-platform-console.expected.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt index 079a57db8655..328486500421 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.params@${jupiterVersion} jar:file:.+junit-jupiter-params/build/libs/junit-jupiter-params-${jupiterVersion}-all.jar..module-info.class +org.junit.jupiter.params@${jupiterVersion} jar:file:.+junit-jupiter-params/build/libs/junit-jupiter-params-${jupiterVersion}.jar..module-info.class exports org.junit.jupiter.params exports org.junit.jupiter.params.aggregator exports org.junit.jupiter.params.converter diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt index 51cff827ef0e..54620335d7b3 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.console@${platformVersion} jar:file:.+junit-platform-console/build/libs/junit-platform-console-${platformVersion}-all.jar..module-info.class +org.junit.platform.console@${platformVersion} jar:file:.+junit-platform-console/build/libs/junit-platform-console-${platformVersion}.jar..module-info.class requires java.base mandated requires org.apiguardian.api requires org.junit.platform.commons From d49bc10803450e27fd1258cfaa46daf475800ff3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 7 Feb 2021 19:22:13 +0100 Subject: [PATCH 0201/1433] Simplify Helper --- .../src/main/java/platform/tooling/support/Helper.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java index 00ad77862d79..9bdfe26f6547 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java @@ -91,10 +91,8 @@ public static List loadModuleDirectoryNames() { } public static Path createJarPath(String module) { - var parent = Paths.get("..", module, "build", "libs"); - var jar = parent.resolve(module + '-' + version(module) + ".jar"); - var shadowJar = parent.resolve(module + '-' + version(module) + "-all.jar"); - return Files.exists(jar) ? jar : shadowJar; + return Paths.get("..", module, "build", "libs") // + .resolve(module + '-' + version(module) + ".jar"); } static JarFile createJarFile(String module) { From 9c4da0934db8e33600a4a8622ec2fc03ffe374be Mon Sep 17 00:00:00 2001 From: Juliette de Rancourt Date: Mon, 8 Feb 2021 13:27:07 +0100 Subject: [PATCH 0202/1433] Named arguments in parameterized tests (#2521) This commit introduces a `Named` interface, which is used to wrap test arguments and give them names. Thanks to this, arguments in parameterized tests with `@MethodSource` or `@ArgumentSource` can now have optional names. When the argument is included in the display name of an iteration, this name will be used instead of the value. --- .../release-notes/release-notes-5.8.0-M1.adoc | 4 +- .../asciidoc/user-guide/writing-tests.adoc | 14 ++++++ .../java/example/ParameterizedTestDemo.java | 15 ++++++ .../java/org/junit/jupiter/api/Named.java | 48 +++++++++++++++++++ .../params/ParameterizedTestExtension.java | 6 ++- .../ParameterizedTestNameFormatter.java | 12 ++++- .../ParameterizedTestParameterResolver.java | 15 +++++- .../ParameterizedTestIntegrationTests.java | 20 ++++++++ 8 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index d13b4fb712bb..cbe30705d16a 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -83,7 +83,9 @@ on GitHub. * Dynamic tests now require less memory thanks to a number of improvements to internal data structures. * Documented constant values in `org.junit.jupiter.api.parallel.Resources`. - +* In parameterized tests with `@MethodSource` or `@ArgumentSource`, arguments can now have + optional names. When the argument is included in the display name of an iteration, this + name will be used instead of the value. [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 221ae27805dc..e4cc3b40aae1 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -1634,6 +1634,20 @@ if they exceed the configured maximum length. The limit is configurable via the `junit.jupiter.params.displayname.argument.maxlength` configuration parameter and defaults to 512 characters. +When using `@MethodSource` or `@ArgumentSource`, you can give names to arguments. This +name will be used if the argument is included in the invocation display name, like in +the example below. + +[source,java,indent=0] +---- +include::{testDir}/example/ParameterizedTestDemo.java[tags=named_arguments] +---- + +.... +A parameterized test with named arguments ✔ +├─ 1: An important file ✔ +└─ 2: Another file ✔ +.... [[writing-tests-parameterized-tests-lifecycle-interop]] ==== Lifecycle and Interoperability diff --git a/documentation/src/test/java/example/ParameterizedTestDemo.java b/documentation/src/test/java/example/ParameterizedTestDemo.java index 62ff347d7e9a..8e1f851fc8a3 100644 --- a/documentation/src/test/java/example/ParameterizedTestDemo.java +++ b/documentation/src/test/java/example/ParameterizedTestDemo.java @@ -19,6 +19,7 @@ import static org.junit.jupiter.params.provider.EnumSource.Mode.EXCLUDE; import static org.junit.jupiter.params.provider.EnumSource.Mode.MATCH_ALL; +import java.io.File; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -39,6 +40,7 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Named; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.TestReporter; @@ -441,4 +443,17 @@ void testWithCustomAggregatorAnnotation(@CsvToPerson Person person) { void testWithCustomDisplayNames(String fruit, int rank) { } // end::custom_display_names[] + + // tag::named_arguments[] + @DisplayName("A parameterized test with named arguments") + @ParameterizedTest(name = "{index}: {0}") + @MethodSource("namedArguments") + void testWithNamedArguments(File file) { + } + + static Stream namedArguments() { + return Stream.of(arguments(Named.of("An important file", new File("path1"))), + arguments(Named.of("Another file", new File("path2")))); + } + // end::named_arguments[] } diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java new file mode 100644 index 000000000000..cd2b6cfbccd5 --- /dev/null +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java @@ -0,0 +1,48 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.api; + +import static org.apiguardian.api.API.Status.STABLE; + +import org.apiguardian.api.API; + +/** + * {@code Named} is used to wrap an object and give it a name. + * + * @param the type of the payload + */ +@API(status = STABLE, since = "5.8") +public interface Named { + + static Named of(String name, T payload) { + return new Named() { + @Override + public String getName() { + return name; + } + + @Override + public T getPayload() { + return payload; + } + + @Override + public String toString() { + return name; + } + }; + } + + String getName(); + + T getPayload(); + +} diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java index e50d8bcfc0c7..7d110ce37805 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java @@ -143,8 +143,10 @@ protected static Stream arguments(ArgumentsProvider provide private Object[] consumedArguments(Object[] arguments, ParameterizedTestMethodContext methodContext) { int parameterCount = methodContext.getParameterCount(); - return methodContext.hasAggregator() ? arguments - : (arguments.length > parameterCount ? Arrays.copyOf(arguments, parameterCount) : arguments); + if (methodContext.hasAggregator()) { + return arguments; + } + return arguments.length > parameterCount ? Arrays.copyOf(arguments, parameterCount) : arguments; } } diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java index 49cf34c39320..3f10d21d26c1 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestNameFormatter.java @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.stream.IntStream; +import org.junit.jupiter.api.Named; import org.junit.platform.commons.JUnitException; import org.junit.platform.commons.util.StringUtils; @@ -56,12 +57,19 @@ String format(int invocationIndex, Object... arguments) { } private String formatSafely(int invocationIndex, Object[] arguments) { - String pattern = prepareMessageFormatPattern(invocationIndex, arguments); + Object[] namedArguments = extractNamedArguments(arguments); + String pattern = prepareMessageFormatPattern(invocationIndex, namedArguments); MessageFormat format = new MessageFormat(pattern); - Object[] humanReadableArguments = makeReadable(format, arguments); + Object[] humanReadableArguments = makeReadable(format, namedArguments); return format.format(humanReadableArguments); } + private Object[] extractNamedArguments(Object[] arguments) { + return Arrays.stream(arguments) // + .map(argument -> argument instanceof Named ? ((Named) argument).getName() : argument) // + .toArray(); + } + private String prepareMessageFormatPattern(int invocationIndex, Object[] arguments) { String result = pattern// .replace(DISPLAY_NAME_PLACEHOLDER, this.displayName)// diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java index d47889f8cd15..6185897d9d02 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestParameterResolver.java @@ -12,7 +12,9 @@ import java.lang.reflect.Executable; import java.lang.reflect.Method; +import java.util.Arrays; +import org.junit.jupiter.api.Named; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ParameterContext; import org.junit.jupiter.api.extension.ParameterResolutionException; @@ -60,8 +62,19 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon @Override public Object resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext) throws ParameterResolutionException { + return this.methodContext.resolve(parameterContext, extractPayloads(this.arguments)); + } - return this.methodContext.resolve(parameterContext, this.arguments); + @SuppressWarnings("unchecked") + private Object[] extractPayloads(Object[] arguments) { + return Arrays.stream(arguments) // + .map(argument -> { + if (argument instanceof Named) { + return ((Named) argument).getPayload(); + } + return argument; + }) // + .toArray(); } } diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java index 39332383d443..8423b3c23fb3 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java @@ -46,6 +46,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; +import org.junit.jupiter.api.Named; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -625,6 +626,15 @@ private EngineExecutionResults execute(String methodName, Class... methodPara methodParameterTypes); } + @Test + void namedParameters() { + execute("namedParameters", String.class).allEvents().assertThatEvents() // + .haveAtLeast(1, + event(test(), displayName("cool name"), finishedWithFailure(message("parameter value")))) // + .haveAtLeast(1, + event(test(), displayName("default name"), finishedWithFailure(message("default name")))); + } + } @Nested @@ -1009,6 +1019,12 @@ void streamOfTwoDimensionalObjectArrays(Object[][] array) { fail(Arrays.deepToString(array)); } + @MethodSourceTest + @Order(13) + void namedParameters(String string) { + fail(string); + } + // --------------------------------------------------------------------- static Stream emptyMethodSource() { @@ -1066,6 +1082,10 @@ static Stream streamOfTwoDimensionalObjectArrays() { new Object[][] { { "five", 6 }, { "seven", 8 } }); } + static Stream namedParameters() { + return Stream.of(arguments(Named.of("cool name", "parameter value")), arguments("default name")); + } + // --------------------------------------------------------------------- @MethodSourceTest From b2a98105cc3d5c751e5a2a5709ad463021924613 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Tue, 9 Feb 2021 14:14:57 +0100 Subject: [PATCH 0203/1433] Introduce junit-platform-suite-engine (#2416) 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. --- build.gradle.kts | 5 + documentation/documentation.gradle.kts | 1 + .../src/docs/asciidoc/link-attributes.adoc | 3 +- .../release-notes/release-notes-5.8.0-M1.adoc | 4 +- .../asciidoc/user-guide/advanced-topics.adoc | 2 + .../docs/asciidoc/user-guide/appendix.adoc | 41 +- .../junit-platform-suite-engine.adoc | 45 ++ .../asciidoc/user-guide/launcher-api.adoc | 3 + .../asciidoc/user-guide/running-tests.adoc | 1 + .../src/test/java/example/SuiteDemo.java | 26 ++ .../module-info.java | 3 + .../org/junit/platform/engine/UniqueId.java | 19 + .../engine/discovery/DiscoverySelectors.java | 4 +- .../launcher/core/DefaultLauncher.java | 2 +- .../core/EngineDiscoveryOrchestrator.java | 56 ++- .../core/EngineExecutionOrchestrator.java | 2 +- .../launcher/core/EngineIdValidator.java | 4 + .../core/LauncherDiscoveryResult.java | 4 +- .../core/ServiceLoaderTestEngineRegistry.java | 9 +- .../junit-platform-runner.gradle.kts | 2 + .../junit/platform/runner/JUnitPlatform.java | 217 ++-------- .../module-info.java | 1 + .../junit-platform-suite-api.gradle.kts | 1 + .../suite/api/ConfigurationParameter.java | 53 +++ .../suite/api/ConfigurationParameters.java | 41 ++ .../suite/api/ExcludeClassNamePatterns.java | 18 +- .../platform/suite/api/ExcludeEngines.java | 18 +- .../platform/suite/api/ExcludePackages.java | 19 +- .../junit/platform/suite/api/ExcludeTags.java | 18 +- .../suite/api/IncludeClassNamePatterns.java | 18 +- .../platform/suite/api/IncludeEngines.java | 18 +- .../platform/suite/api/IncludePackages.java | 17 +- .../junit/platform/suite/api/IncludeTags.java | 18 +- .../platform/suite/api/SelectClasses.java | 17 +- .../suite/api/SelectClasspathResource.java | 57 +++ .../suite/api/SelectClasspathResources.java | 46 ++ .../platform/suite/api/SelectDirectories.java | 44 ++ .../junit/platform/suite/api/SelectFile.java | 57 +++ .../junit/platform/suite/api/SelectFiles.java | 46 ++ .../platform/suite/api/SelectModules.java | 45 ++ .../platform/suite/api/SelectPackages.java | 18 +- .../junit/platform/suite/api/SelectUris.java | 44 ++ .../org/junit/platform/suite/api/Suite.java | 65 +++ .../platform/suite/api/SuiteDisplayName.java | 16 +- .../platform/suite/api/UseTechnicalNames.java | 11 - .../platform/suite/api/package-info.java | 8 + .../module-info.java | 1 + .../junit-platform-suite-commons.gradle.kts | 19 + .../commons/AdditionalDiscoverySelectors.java | 113 +++++ .../SuiteLauncherDiscoveryRequestBuilder.java | 185 ++++++++ .../platform/suite/commons/package-info.java | 11 + .../module-info.java | 21 + ...teLauncherDiscoveryRequestBuilderTest.java | 400 ++++++++++++++++++ .../junit-platform-suite-engine.gradle.kts | 24 ++ .../suite/engine/ClassSelectorResolver.java | 93 ++++ .../engine/DiscoverySelectorResolver.java | 40 ++ .../engine/IsPotentialTestContainer.java | 39 ++ .../platform/suite/engine/IsSuiteClass.java | 31 ++ .../suite/engine/SuiteEngineDescriptor.java | 29 ++ .../platform/suite/engine/SuiteLauncher.java | 59 +++ .../suite/engine/SuiteTestDescriptor.java | 129 ++++++ .../suite/engine/SuiteTestEngine.java | 78 ++++ .../platform/suite/engine/package-info.java | 5 + .../org.junit.platform.engine.TestEngine | 1 + .../module-info.java | 21 + .../suite/engine/SuiteEngineTest.java | 276 ++++++++++++ .../suite/engine/SuiteTestDescriptorTest.java | 96 +++++ .../suite/engine/testcases/DynamicTest.java | 30 ++ .../suite/engine/testcases/MultipleTest.java | 26 ++ .../suite/engine/testcases/SimpleTest.java | 21 + .../engine/testsuites/AbstractSuite.java | 21 + .../suite/engine/testsuites/CyclicSuite.java | 22 + .../suite/engine/testsuites/DynamicSuite.java | 20 + .../engine/testsuites/MultipleSuite.java | 21 + .../suite/engine/testsuites/NestedSuite.java | 32 ++ .../engine/testsuites/SelectClassesSuite.java | 21 + .../testsuites/SuiteDisplayNameSuite.java | 23 + .../suite/engine/testsuites/SuiteSuite.java | 22 + .../junit-platform-suite.gradle.kts | 13 + .../org.junit.platform.suite/module-info.java | 19 + .../junit/platform/engine/UniqueIdTests.java | 8 + .../runner/JUnitPlatformRunnerTests.java | 4 +- .../junit-platform-commons.expected.txt | 4 +- .../junit-platform-runner.expected.txt | 3 +- .../junit-platform-suite-api.expected.txt | 1 + .../junit-platform-suite-commons.expected.txt | 8 + .../junit-platform-suite-engine.expected.txt | 10 + .../junit-platform-suite.expected.txt | 4 + .../platform/tooling/support/HelperTests.java | 3 + .../support/tests/JavacModulesTests.java | 2 +- settings.gradle.kts | 3 + ...ishDocumentationSnapshotOnlyIfNecessary.sh | 3 + 92 files changed, 2794 insertions(+), 388 deletions(-) create mode 100644 documentation/src/docs/asciidoc/user-guide/junit-platform-suite-engine.adoc create mode 100644 documentation/src/test/java/example/SuiteDemo.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameter.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameters.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResource.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResources.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectDirectories.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFile.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFiles.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectModules.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectUris.java create mode 100644 junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/Suite.java create mode 100644 junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts create mode 100644 junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/AdditionalDiscoverySelectors.java create mode 100644 junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilder.java create mode 100644 junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/package-info.java create mode 100644 junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java create mode 100644 junit-platform-suite-commons/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java create mode 100644 junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/ClassSelectorResolver.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/DiscoverySelectorResolver.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsPotentialTestContainer.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsSuiteClass.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteEngineDescriptor.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteLauncher.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestDescriptor.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestEngine.java create mode 100644 junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/package-info.java create mode 100644 junit-platform-suite-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine create mode 100644 junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java create mode 100644 junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java create mode 100644 junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/DynamicTest.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/MultipleTest.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/SimpleTest.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java create mode 100644 junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java create mode 100644 junit-platform-suite/junit-platform-suite.gradle.kts create mode 100644 junit-platform-suite/src/module/org.junit.platform.suite/module-info.java create mode 100644 platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt create mode 100644 platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt create mode 100644 platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt diff --git a/build.gradle.kts b/build.gradle.kts index 6e6a8fa98792..beec328ed747 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,7 +42,10 @@ val platformProjects by extra(listOf( project(":junit-platform-launcher"), project(":junit-platform-reporting"), project(":junit-platform-runner"), + project(":junit-platform-suite"), project(":junit-platform-suite-api"), + project(":junit-platform-suite-commons"), + project(":junit-platform-suite-engine"), project(":junit-platform-testkit") )) @@ -76,6 +79,8 @@ val jacocoTestProjects = listOf( project(":junit-jupiter-migrationsupport"), project(":junit-jupiter-params"), project(":junit-platform-runner"), + project(":junit-platform-suite-commons"), + project(":junit-platform-suite-engine"), project(":junit-vintage-engine"), project(":platform-tests") ) diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 917a6dd245c0..6ecf26cbb3ef 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -41,6 +41,7 @@ dependencies { testImplementation(project(":junit-jupiter-migrationsupport")) testImplementation(project(":junit-platform-console")) testImplementation(project(":junit-platform-runner")) + testImplementation(project(":junit-platform-suite")) testImplementation(project(":junit-platform-testkit")) testImplementation("org.jetbrains.kotlin:kotlin-stdlib") diff --git a/documentation/src/docs/asciidoc/link-attributes.adoc b/documentation/src/docs/asciidoc/link-attributes.adoc index c584ea825317..987287be3d68 100644 --- a/documentation/src/docs/asciidoc/link-attributes.adoc +++ b/documentation/src/docs/asciidoc/link-attributes.adoc @@ -43,8 +43,9 @@ endif::[] :LegacyXmlReportGeneratingListener: {javadoc-root}/org.junit.platform.reporting/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListener.html[LegacyXmlReportGeneratingListener] // Platform Runner :JUnitPlatform-Runner: {javadoc-root}/org.junit.platform.runnner/org/junit/platform/runner/JUnitPlatform.html[JUnitPlatform] -// Platform Suite API +// Platform Suite :suite-api-package: {javadoc-root}/org.junit.platform.suite.api/org/junit/platform/suite/api/package-summary.html[org.junit.platform.suite.api] +:junit-platform-suite-engine {javadoc-root}/org.junit.platform.suite.engine/org/junit/platform/suite/engine/package-summary.html[junit-platform-suite-engine] // Platform Test Kit :testkit-engine-package: {javadoc-root}/org.junit.platform.testkit/org/junit/platform/testkit/engine/package-summary.html[org.junit.platform.testkit.engine] :EngineExecutionResults: {javadoc-root}/org.junit.platform.testkit/org/junit/platform/testkit/engine/EngineExecutionResults.html[EngineExecutionResults] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index cbe30705d16a..d9be75d3f793 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -45,7 +45,9 @@ on GitHub. `LauncherSession` in order to allow for executing global setup and teardown code exactly once via the new `LauncherSessionListener` interface that can be registered via Java’s `{ServiceLoader}` mechanism. - +* New `junit-platform-suite-engine` to execute declarative test suites using the JUnit + Platform Launcher. +* Added additional selectors to the `junit-platform-suite-api` [[release-notes-5.8.0-M1-junit-jupiter]] === JUnit Jupiter diff --git a/documentation/src/docs/asciidoc/user-guide/advanced-topics.adoc b/documentation/src/docs/asciidoc/user-guide/advanced-topics.adoc index 53164790e5b2..af8e07e8ee03 100644 --- a/documentation/src/docs/asciidoc/user-guide/advanced-topics.adoc +++ b/documentation/src/docs/asciidoc/user-guide/advanced-topics.adoc @@ -3,6 +3,8 @@ include::launcher-api.adoc[] +include::junit-platform-suite-engine.adoc[] + include::testkit.adoc[] //// diff --git a/documentation/src/docs/asciidoc/user-guide/appendix.adoc b/documentation/src/docs/asciidoc/user-guide/appendix.adoc index ab0164d15321..d850ea57c94b 100644 --- a/documentation/src/docs/asciidoc/user-guide/appendix.adoc +++ b/documentation/src/docs/asciidoc/user-guide/appendix.adoc @@ -50,10 +50,17 @@ artifacts are deployed to Sonatype's {snapshot-repo}[snapshots repository] under `junit-platform-runner`:: Runner for executing tests and test suites on the JUnit Platform in a JUnit 4 environment. See <> for details. + `junit-platform-suite`:: + JUnit Platform Suite artifact that transitively pulls in dependencies on + `junit-platform-suite-api`, `junit-platform-suite-engine` for simplified + dependency management in build tools such as Gradle and Maven. `junit-platform-suite-api`:: Annotations for configuring test suites on the JUnit Platform. Supported by the - <> and possibly by - third-party `TestEngine` implementations. + <> and + <>. + `junit-platform-suite-engine`:: + Engine to execute suites on the JUnit Platform. See + <> for details. `junit-platform-testkit`:: Provides support for executing a test plan for a given `TestEngine` and then accessing the results via a fluent API to verify the expected results. @@ -148,7 +155,10 @@ package org.junit.platform { [junit-platform-launcher] as launcher [junit-platform-reporting] as reporting [junit-platform-runner] as runner + [junit-platform-suite] as suite [junit-platform-suite-api] as suite_api + [junit-platform-suite-commons] as suite_commons + [junit-platform-suite-engine] as suite_engine [junit-platform-testkit] as testkit } @@ -173,15 +183,15 @@ jupiter ..> jupiter_api jupiter ..> jupiter_params jupiter ..> jupiter_engine -jupiter_api ..> opentest4j -jupiter_api ..> commons +jupiter_api ....> opentest4j +jupiter_api ...> commons -jupiter_engine ..> engine +jupiter_engine ...> engine jupiter_engine ..> jupiter_api jupiter_params ..> jupiter_api jupiter_migration_support ..> jupiter_api -jupiter_migration_support ..> junit4 +jupiter_migration_support ...> junit4 console ..> launcher console ..> reporting @@ -190,18 +200,25 @@ launcher ..> engine jfr ..> launcher -engine ..> opentest4j +engine ....> opentest4j engine ..> commons reporting ..> launcher -runner ..> launcher -runner ..> suite_api -runner ..> junit4 +runner ..> suite_commons +runner ...> junit4 -testkit ..> opentest4j +suite ..> suite_api +suite ..> suite_engine + +suite_engine ..> suite_commons + +suite_commons ..> launcher +suite_commons ..> suite_api + +testkit ....> opentest4j testkit ..> launcher -vintage_engine ..> engine +vintage_engine ...> engine vintage_engine ..> junit4 ---- diff --git a/documentation/src/docs/asciidoc/user-guide/junit-platform-suite-engine.adoc b/documentation/src/docs/asciidoc/user-guide/junit-platform-suite-engine.adoc new file mode 100644 index 000000000000..f22c96a40031 --- /dev/null +++ b/documentation/src/docs/asciidoc/user-guide/junit-platform-suite-engine.adoc @@ -0,0 +1,45 @@ +[[junit-platform-suite-engine]] +=== JUnit Platform Suite Engine + +The JUnit Platform supports declarative definition and execution of suites of tests from +_any_ test engine using the Junit Platform. + +==== Setup + +In addition to _at least one_ other test engine, you need the following artifacts and +their dependencies on the classpath. See <> for details regarding +group IDs, artifact IDs, and versions. + +===== Explicit Dependencies + +* `junit-platform-suite-api` in _test_ scope +* `junit-platform-suite-engine` in _test runtime_ scope: implementation of the + `TestEngine` API for the declarative Junit Platform + Suites + +NOTE: Both dependencies are aggregated in `junit-platform-suite` which can be used in +_test_ scope. + +===== Transitive Dependencies + +* `junit-platform-suite-commons` in _test_ scope +* `junit-platform-launcher` in _test_ scope +* `junit-platform-engine` in _test_ scope +* `junit-platform-commons` in _test_ scope +* `opentest4j` in _test_ scope + +==== Test Suite + +By annotating a class with `@Suite` it is marked as a test suite on the JUnit Platform. +As seen in the following example, selector and filter annotations can then be used to +control the contents of the suite. + +[source,java,indent=0] +---- +include::{testDir}/example/SuiteDemo.java[tags=user_guide] +---- + +.Additional Configuration Options +NOTE: There are more configuration options for discovering and filtering tests than just +`@SelectPackages`. Please consult the Javadoc of the `{suite-api-package}` package for +further details. diff --git a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc index 441f8f7b8376..04a1566bd12b 100644 --- a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc +++ b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc @@ -77,6 +77,9 @@ JUnit currently provides two `{TestEngine}` implementations. * `{junit-jupiter-engine}`: The core of JUnit Jupiter. * `{junit-vintage-engine}`: A thin layer on top of JUnit 4 to allow running _vintage_ tests with the launcher infrastructure. +* `{junit-platform-suite-engine}`: To execute declarative suites of tests with the + launcher infrastructure. + Third parties may also contribute their own `TestEngine` by implementing the interfaces in the {junit-platform-engine} module and _registering_ their engine. By default, engine diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index 9e66659de68f..a6c1d3e34c39 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -630,6 +630,7 @@ You need the following artifacts and their dependencies on the classpath. See ===== Transitive Dependencies * `junit-platform-suite-api` in _test_ scope +* `junit-platform-suite-commons` in _test_ scope * `junit-platform-launcher` in _test_ scope * `junit-platform-engine` in _test_ scope * `junit-platform-commons` in _test_ scope diff --git a/documentation/src/test/java/example/SuiteDemo.java b/documentation/src/test/java/example/SuiteDemo.java new file mode 100644 index 000000000000..278b662715b8 --- /dev/null +++ b/documentation/src/test/java/example/SuiteDemo.java @@ -0,0 +1,26 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package example; + +//tag::user_guide[] +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.api.SuiteDisplayName; + +@Suite +@SuiteDisplayName("JUnit Platform Suite Demo") +@SelectPackages("example") +//end::user_guide[] +@org.junit.platform.suite.api.ExcludeTags("exclude") +//tag::user_guide[] +public class SuiteDemo { +} +//end::user_guide[] diff --git a/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java b/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java index b4e0774b29c8..c1bcc1b22550 100644 --- a/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java +++ b/junit-platform-commons/src/module/org.junit.platform.commons/module-info.java @@ -32,6 +32,7 @@ org.junit.platform.reporting, org.junit.platform.runner, org.junit.platform.suite.api, + org.junit.platform.suite.engine, org.junit.platform.testkit, org.junit.vintage.engine; exports org.junit.platform.commons.support; @@ -46,6 +47,8 @@ org.junit.platform.reporting, org.junit.platform.runner, org.junit.platform.suite.api, + org.junit.platform.suite.commons, + org.junit.platform.suite.engine, org.junit.platform.testkit, org.junit.vintage.engine; } diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java index ef6e552f90ca..8e601904a0da 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/UniqueId.java @@ -12,6 +12,7 @@ import static java.util.Collections.singletonList; import static java.util.Collections.unmodifiableList; +import static org.apiguardian.api.API.Status.EXPERIMENTAL; import static org.apiguardian.api.API.Status.STABLE; import java.io.Serializable; @@ -162,6 +163,24 @@ public final UniqueId append(Segment segment) { return new UniqueId(this.uniqueIdFormat, baseSegments); } + /** + * Construct a new {@code UniqueId} by appending a new {@link Segment}, based + * on the supplied {@code engineId}, to the end of this {@code UniqueId}. + * + *

    This {@code UniqueId} will not be modified. + * + *

    The engine ID will be stored in a {@link Segment} with + * {@link Segment#getType type} {@value ENGINE_SEGMENT_TYPE}. + * + * @param engineId the engine ID; never {@code null} or blank + * + * @since 1.8 + */ + @API(status = EXPERIMENTAL, since = "1.8") + public UniqueId appendEngine(String engineId) { + return append(new Segment(ENGINE_SEGMENT_TYPE, engineId)); + } + /** * Determine if the supplied {@code UniqueId} is a prefix for this * {@code UniqueId}. diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java index 156e07b628c0..e2f892efdc76 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/discovery/DiscoverySelectors.java @@ -343,8 +343,8 @@ public static ModuleSelector selectModule(String moduleName) { */ @API(status = EXPERIMENTAL, since = "1.1") public static List selectModules(Set moduleNames) { - Preconditions.notNull(moduleNames, "moduleNames must not be null"); - Preconditions.containsNoNullElements(moduleNames, "individual module name must not be null"); + Preconditions.notNull(moduleNames, "Module names must not be null"); + Preconditions.containsNoNullElements(moduleNames, "Individual module name must not be null"); // @formatter:off return moduleNames.stream() diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java index 5b8af43c137a..15b7bef4e8b9 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/DefaultLauncher.java @@ -58,7 +58,7 @@ class DefaultLauncher implements InternalLauncher { Preconditions.notNull(postDiscoveryFilters, "PostDiscoveryFilter array must not be null"); Preconditions.containsNoNullElements(postDiscoveryFilters, "PostDiscoveryFilter array must not contain null elements"); - this.discoveryOrchestrator = new EngineDiscoveryOrchestrator(EngineIdValidator.validate(testEngines), + this.discoveryOrchestrator = new EngineDiscoveryOrchestrator(testEngines, unmodifiableCollection(postDiscoveryFilters), launcherDiscoveryListenerRegistry); } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java index b1752e0219a9..a2571030be64 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineDiscoveryOrchestrator.java @@ -11,6 +11,7 @@ package org.junit.platform.launcher.core; import static java.util.stream.Collectors.joining; +import static java.util.stream.Collectors.toMap; import static org.apiguardian.api.API.Status.INTERNAL; import static org.junit.platform.engine.Filter.composeFilters; @@ -20,13 +21,16 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Map.Entry; import java.util.Optional; +import java.util.function.Function; import org.apiguardian.api.API; import org.junit.platform.commons.JUnitException; import org.junit.platform.commons.logging.Logger; import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.commons.util.UnrecoverableExceptions; +import org.junit.platform.engine.EngineExecutionListener; import org.junit.platform.engine.Filter; import org.junit.platform.engine.FilterResult; import org.junit.platform.engine.TestDescriptor; @@ -42,7 +46,7 @@ * * @since 1.7 */ -@API(status = INTERNAL, since = "1.7", consumers = "testkit") +@API(status = INTERNAL, since = "1.7", consumers = { "org.junit.platform.testkit", "org.junit.platform.suite.engine" }) public class EngineDiscoveryOrchestrator { private static final Logger logger = LoggerFactory.getLogger(EngineDiscoveryOrchestrator.class); @@ -59,7 +63,7 @@ public EngineDiscoveryOrchestrator(Iterable testEngines, EngineDiscoveryOrchestrator(Iterable testEngines, Collection postDiscoveryFilters, ListenerRegistry launcherDiscoveryListenerRegistry) { - this.testEngines = testEngines; + this.testEngines = EngineIdValidator.validate(testEngines); this.postDiscoveryFilters = postDiscoveryFilters; this.launcherDiscoveryListenerRegistry = launcherDiscoveryListenerRegistry; } @@ -73,18 +77,43 @@ public EngineDiscoveryOrchestrator(Iterable testEngines, * {@linkplain TestDescriptor#prune() prunes} the resulting test tree. */ public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, Phase phase) { + Map result = discover(request, phase, UniqueId::forEngine); + return new LauncherDiscoveryResult(result, request.getConfigurationParameters()); + } + + /** + * Discovers tests for the supplied request in the supplied phase using the + * configured test engines to be used by the suite engine. + * + *

    Applies {@linkplain org.junit.platform.launcher.EngineFilter engine + * filters} and {@linkplain PostDiscoveryFilter post-discovery filters} and + * {@linkplain TestDescriptor#prune() prunes} the resulting test tree. + * + * Note: The test descriptors in the discovery result can safely be used as + * non-root descriptors. Engine-test descriptor entries are pruned from + * the returned result. As such execution by + * {@link EngineExecutionOrchestrator#execute(LauncherDiscoveryResult, EngineExecutionListener)} + * will not emit start or emit events for engines without tests. + */ + public LauncherDiscoveryResult discover(LauncherDiscoveryRequest request, Phase phase, UniqueId parentId) { + Map result = discover(request, phase, parentId::appendEngine); + return new LauncherDiscoveryResult(pruneEngines(result), request.getConfigurationParameters()); + } + + private Map discover(LauncherDiscoveryRequest request, Phase phase, + Function uniqueIdCreator) { LauncherDiscoveryListener listener = getLauncherDiscoveryListener(request); listener.launcherDiscoveryStarted(request); try { - return discoverSafely(request, phase, listener); + return discoverSafely(request, phase, listener, uniqueIdCreator); } finally { listener.launcherDiscoveryFinished(request); } } - private LauncherDiscoveryResult discoverSafely(LauncherDiscoveryRequest request, Phase phase, - LauncherDiscoveryListener listener) { + private Map discoverSafely(LauncherDiscoveryRequest request, Phase phase, + LauncherDiscoveryListener listener, Function uniqueIdCreator) { Map testEngineDescriptors = new LinkedHashMap<>(); for (TestEngine testEngine : this.testEngines) { @@ -102,7 +131,7 @@ private LauncherDiscoveryResult discoverSafely(LauncherDiscoveryRequest request, logger.debug(() -> String.format("Discovering tests during Launcher %s phase in engine '%s'.", phase, testEngine.getId())); - TestDescriptor rootDescriptor = discoverEngineRoot(testEngine, request, listener); + TestDescriptor rootDescriptor = discoverEngineRoot(testEngine, request, listener, uniqueIdCreator); testEngineDescriptors.put(testEngine, rootDescriptor); } @@ -112,12 +141,12 @@ private LauncherDiscoveryResult discoverSafely(LauncherDiscoveryRequest request, applyPostDiscoveryFilters(testEngineDescriptors, filters); prune(testEngineDescriptors); - return new LauncherDiscoveryResult(testEngineDescriptors, request.getConfigurationParameters()); + return testEngineDescriptors; } private TestDescriptor discoverEngineRoot(TestEngine testEngine, LauncherDiscoveryRequest request, - LauncherDiscoveryListener listener) { - UniqueId uniqueEngineId = UniqueId.forEngine(testEngine.getId()); + LauncherDiscoveryListener listener, Function uniqueIdCreator) { + UniqueId uniqueEngineId = uniqueIdCreator.apply(testEngine.getId()); try { listener.engineDiscoveryStarted(uniqueEngineId); TestDescriptor engineRoot = testEngine.discover(request, uniqueEngineId); @@ -173,6 +202,15 @@ private void logTestDescriptorExclusionReasons(Map> }); } + private Map pruneEngines(Map result) { + // @formatter:off + return result.entrySet() + .stream() + .filter(entry -> TestDescriptor.containsTests(entry.getValue())) + .collect(toMap(Entry::getKey, Entry::getValue)); + // @formatter:on + } + /** * Prune all branches in the tree of {@link TestDescriptor TestDescriptors} * that do not have executable tests. diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java index 788303775a3c..eaf2c71bff5c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineExecutionOrchestrator.java @@ -31,7 +31,7 @@ * * @since 1.7 */ -@API(status = INTERNAL, since = "1.7", consumers = "testkit") +@API(status = INTERNAL, since = "1.7", consumers = { "org.junit.platform.testkit", "org.junit.platform.suite.engine" }) public class EngineExecutionOrchestrator { private final ListenerRegistry listenerRegistry; diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java index f50a2f35e63e..de0a8186ba92 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineIdValidator.java @@ -61,6 +61,10 @@ private static boolean validateReservedIds(TestEngine testEngine) { validateWellKnownClassName(testEngine, "org.junit.vintage.engine.VintageTestEngine"); return true; } + if (engineId.equals("junit-platform-suite")) { + validateWellKnownClassName(testEngine, "org.junit.platform.suite.engine.SuiteTestEngine"); + return true; + } return false; } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java index fb1bd04de26b..d96ad1dee15a 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/LauncherDiscoveryResult.java @@ -28,7 +28,7 @@ * * @since 1.7 */ -@API(status = INTERNAL, since = "1.7", consumers = "testkit") +@API(status = INTERNAL, since = "1.7", consumers = { "org.junit.platform.testkit", "org.junit.platform.suite.engine" }) public class LauncherDiscoveryResult { private final Map testEngineDescriptors; @@ -48,7 +48,7 @@ ConfigurationParameters getConfigurationParameters() { return configurationParameters; } - Collection getTestEngines() { + public Collection getTestEngines() { return this.testEngineDescriptors.keySet(); } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java index 98671f73a003..29e8ae95d3d0 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java @@ -12,12 +12,14 @@ import static java.lang.String.join; import static java.util.stream.Collectors.toList; +import static org.apiguardian.api.API.Status.INTERNAL; import java.util.ArrayList; import java.util.List; import java.util.ServiceLoader; import java.util.stream.Stream; +import org.apiguardian.api.API; import org.junit.platform.commons.logging.Logger; import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.commons.util.ClassLoaderUtils; @@ -27,7 +29,12 @@ /** * @since 1.0 */ -class ServiceLoaderTestEngineRegistry { +@API(status = INTERNAL, since = "1.0", consumers = "org.junit.platform.suite.engine") +public final class ServiceLoaderTestEngineRegistry { + + public ServiceLoaderTestEngineRegistry() { + + } private static final Logger logger = LoggerFactory.getLogger(ServiceLoaderTestEngineRegistry.class); diff --git a/junit-platform-runner/junit-platform-runner.gradle.kts b/junit-platform-runner/junit-platform-runner.gradle.kts index 126265fbfcb3..a6aab3ce037c 100644 --- a/junit-platform-runner/junit-platform-runner.gradle.kts +++ b/junit-platform-runner/junit-platform-runner.gradle.kts @@ -16,6 +16,8 @@ dependencies { api(project(":junit-platform-launcher")) api(project(":junit-platform-suite-api")) + implementation(project(":junit-platform-suite-commons")) + testImplementation(testFixtures(project(":junit-platform-engine"))) testImplementation(testFixtures(project(":junit-platform-launcher"))) } diff --git a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java index 4e232ff135bc..a750594af635 100644 --- a/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java +++ b/junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java @@ -10,38 +10,26 @@ package org.junit.platform.runner; -import static java.util.Arrays.stream; import static java.util.stream.Collectors.toList; import static org.apiguardian.api.API.Status.STABLE; -import static org.junit.platform.engine.discovery.ClassNameFilter.STANDARD_INCLUDE_PATTERN; -import static org.junit.platform.engine.discovery.ClassNameFilter.excludeClassNamePatterns; -import static org.junit.platform.engine.discovery.ClassNameFilter.includeClassNamePatterns; +import static org.junit.platform.commons.support.AnnotationSupport.isAnnotated; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; -import static org.junit.platform.engine.discovery.PackageNameFilter.excludePackageNames; -import static org.junit.platform.engine.discovery.PackageNameFilter.includePackageNames; -import static org.junit.platform.launcher.EngineFilter.excludeEngines; -import static org.junit.platform.launcher.EngineFilter.includeEngines; -import static org.junit.platform.launcher.TagFilter.excludeTags; -import static org.junit.platform.launcher.TagFilter.includeTags; -import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; +import static org.junit.platform.suite.commons.SuiteLauncherDiscoveryRequestBuilder.request; import java.lang.annotation.Annotation; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Set; -import java.util.function.Function; import org.apiguardian.api.API; -import org.junit.platform.commons.util.StringUtils; import org.junit.platform.engine.DiscoverySelector; import org.junit.platform.engine.discovery.DiscoverySelectors; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.LauncherDiscoveryRequest; import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; -import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; +import org.junit.platform.suite.api.ConfigurationParameter; import org.junit.platform.suite.api.ExcludeClassNamePatterns; import org.junit.platform.suite.api.ExcludeEngines; import org.junit.platform.suite.api.ExcludePackages; @@ -51,9 +39,15 @@ import org.junit.platform.suite.api.IncludePackages; import org.junit.platform.suite.api.IncludeTags; import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectClasspathResource; +import org.junit.platform.suite.api.SelectDirectories; +import org.junit.platform.suite.api.SelectFile; +import org.junit.platform.suite.api.SelectModules; import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.SelectUris; import org.junit.platform.suite.api.SuiteDisplayName; import org.junit.platform.suite.api.UseTechnicalNames; +import org.junit.platform.suite.commons.SuiteLauncherDiscoveryRequestBuilder; import org.junit.runner.Description; import org.junit.runner.Runner; import org.junit.runner.manipulation.Filter; @@ -93,25 +87,40 @@ * ClassNameFilter#STANDARD_INCLUDE_PATTERN}). * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages * @see SelectClasses + * @see SelectClasspathResource + * @see SelectDirectories + * @see SelectFile + * @see SelectModules + * @see SelectPackages + * @see SelectUris * @see IncludeClassNamePatterns * @see ExcludeClassNamePatterns + * @see IncludeEngines + * @see ExcludeEngines * @see IncludePackages * @see ExcludePackages * @see IncludeTags * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines + * @see SuiteDisplayName + * @see UseTechnicalNames + * @see ConfigurationParameter */ @API(status = STABLE, since = "1.0") public class JUnitPlatform extends Runner implements Filterable { - private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; - private static final String[] EMPTY_STRING_ARRAY = new String[0]; - private static final String[] STANDARD_INCLUDE_PATTERN_ARRAY = new String[] { STANDARD_INCLUDE_PATTERN }; + // @formatter:off + private static final List> IMPLICIT_SUITE_ANNOTATIONS = Arrays.asList( + SelectClasses.class, + SelectClasspathResource.class, + SelectDirectories.class, + SelectFile.class, + SelectFile.class, + SelectModules.class, + SelectPackages.class, + SelectUris.class + ); + // @formatter:on private final Class testClass; private final Launcher launcher; @@ -145,160 +154,26 @@ private JUnitPlatformTestTree generateTestTree(LauncherDiscoveryRequest discover } private LauncherDiscoveryRequest createDiscoveryRequest() { - List selectors = getSelectorsFromAnnotations(); - + SuiteLauncherDiscoveryRequestBuilder requestBuilder = request(); // Allows @RunWith(JUnitPlatform.class) to be added to any test case - boolean isSuite = !selectors.isEmpty(); + boolean isSuite = isSuite(); if (!isSuite) { - selectors.add(selectClass(this.testClass)); - } - - LauncherDiscoveryRequestBuilder requestBuilder = request().selectors(selectors); - addFiltersFromAnnotations(requestBuilder, isSuite); - return requestBuilder.build(); - } - - private void addFiltersFromAnnotations(LauncherDiscoveryRequestBuilder requestBuilder, boolean isSuite) { - addIncludeClassNamePatternFilter(requestBuilder, isSuite); - addExcludeClassNamePatternFilter(requestBuilder); - - addIncludePackagesFilter(requestBuilder); - addExcludePackagesFilter(requestBuilder); - - addIncludedTagsFilter(requestBuilder); - addExcludedTagsFilter(requestBuilder); - - addIncludedEnginesFilter(requestBuilder); - addExcludedEnginesFilter(requestBuilder); - } - - private List getSelectorsFromAnnotations() { - List selectors = new ArrayList<>(); - - selectors.addAll(transform(getSelectedClasses(), DiscoverySelectors::selectClass)); - selectors.addAll(transform(getSelectedPackageNames(), DiscoverySelectors::selectPackage)); - - return selectors; - } - - private List transform(T[] sourceElements, Function transformer) { - return stream(sourceElements).map(transformer).collect(toList()); - } - - private void addIncludeClassNamePatternFilter(LauncherDiscoveryRequestBuilder requestBuilder, boolean isSuite) { - String[] patterns = getIncludeClassNamePatterns(isSuite); - if (patterns.length > 0) { - requestBuilder.filters(includeClassNamePatterns(patterns)); + requestBuilder.selectors(selectClass(this.testClass)); } - } - private void addExcludeClassNamePatternFilter(LauncherDiscoveryRequestBuilder requestBuilder) { - String[] patterns = getExcludeClassNamePatterns(); - if (patterns.length > 0) { - requestBuilder.filters(excludeClassNamePatterns(patterns)); - } - } - - private void addIncludePackagesFilter(LauncherDiscoveryRequestBuilder requestBuilder) { - String[] includedPackages = getIncludedPackages(); - if (includedPackages.length > 0) { - requestBuilder.filters(includePackageNames(includedPackages)); - } - } - - private void addExcludePackagesFilter(LauncherDiscoveryRequestBuilder requestBuilder) { - String[] excludedPackages = getExcludedPackages(); - if (excludedPackages.length > 0) { - requestBuilder.filters(excludePackageNames(excludedPackages)); - } - } - - private void addIncludedTagsFilter(LauncherDiscoveryRequestBuilder requestBuilder) { - String[] includedTags = getIncludedTags(); - if (includedTags.length > 0) { - requestBuilder.filters(includeTags(includedTags)); - } - } - - private void addExcludedTagsFilter(LauncherDiscoveryRequestBuilder requestBuilder) { - String[] excludedTags = getExcludedTags(); - if (excludedTags.length > 0) { - requestBuilder.filters(excludeTags(excludedTags)); - } - } - - private void addIncludedEnginesFilter(LauncherDiscoveryRequestBuilder requestBuilder) { - String[] engineIds = getIncludedEngineIds(); - if (engineIds.length > 0) { - requestBuilder.filters(includeEngines(engineIds)); - } - } - - private void addExcludedEnginesFilter(LauncherDiscoveryRequestBuilder requestBuilder) { - String[] engineIds = getExcludedEngineIds(); - if (engineIds.length > 0) { - requestBuilder.filters(excludeEngines(engineIds)); - } - } - - private Class[] getSelectedClasses() { - return getValueFromAnnotation(SelectClasses.class, SelectClasses::value, EMPTY_CLASS_ARRAY); - } - - private String[] getSelectedPackageNames() { - return getValueFromAnnotation(SelectPackages.class, SelectPackages::value, EMPTY_STRING_ARRAY); - } - - private String[] getIncludedPackages() { - return getValueFromAnnotation(IncludePackages.class, IncludePackages::value, EMPTY_STRING_ARRAY); - } - - private String[] getExcludedPackages() { - return getValueFromAnnotation(ExcludePackages.class, ExcludePackages::value, EMPTY_STRING_ARRAY); - } - - private String[] getIncludedTags() { - return getValueFromAnnotation(IncludeTags.class, IncludeTags::value, EMPTY_STRING_ARRAY); - } - - private String[] getExcludedTags() { - return getValueFromAnnotation(ExcludeTags.class, ExcludeTags::value, EMPTY_STRING_ARRAY); - } - - private String[] getIncludedEngineIds() { - return getValueFromAnnotation(IncludeEngines.class, IncludeEngines::value, EMPTY_STRING_ARRAY); - } - - private String[] getExcludedEngineIds() { - return getValueFromAnnotation(ExcludeEngines.class, ExcludeEngines::value, EMPTY_STRING_ARRAY); - } - - private String[] getIncludeClassNamePatterns(boolean isSuite) { - String[] patterns = trimmed(getValueFromAnnotation(IncludeClassNamePatterns.class, - IncludeClassNamePatterns::value, EMPTY_STRING_ARRAY)); - if (patterns.length == 0 && isSuite) { - return STANDARD_INCLUDE_PATTERN_ARRAY; - } - return patterns; - } - - private String[] getExcludeClassNamePatterns() { - return trimmed(getValueFromAnnotation(ExcludeClassNamePatterns.class, ExcludeClassNamePatterns::value, - EMPTY_STRING_ARRAY)); - } - - private String[] trimmed(String[] patterns) { - if (patterns.length == 0) { - return patterns; - } - return Arrays.stream(patterns).filter(StringUtils::isNotBlank).map(String::trim).toArray(String[]::new); + // @formatter:off + return requestBuilder + .filterStandardClassNamePatterns(isSuite) + .suite(this.testClass) + .build(); + // @formatter:on } - private V getValueFromAnnotation(Class annotationClass, Function extractor, - V defaultValue) { - - A annotation = this.testClass.getAnnotation(annotationClass); - return (annotation != null ? extractor.apply(annotation) : defaultValue); + private boolean isSuite() { + // @formatter:off + return IMPLICIT_SUITE_ANNOTATIONS.stream() + .anyMatch(annotation -> isAnnotated(testClass, annotation)); + // @formatter:on } @Override diff --git a/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java b/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java index 108bd2188189..fcbf296ecc9b 100644 --- a/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java +++ b/junit-platform-runner/src/module/org.junit.platform.runner/module-info.java @@ -19,6 +19,7 @@ requires transitive org.apiguardian.api; requires transitive org.junit.platform.launcher; requires transitive org.junit.platform.suite.api; + requires org.junit.platform.suite.commons; exports org.junit.platform.runner; } diff --git a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts index 9013d8c82b5d..434370974777 100644 --- a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts +++ b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts @@ -9,6 +9,7 @@ dependencies { api(platform(project(":junit-bom"))) api("org.apiguardian:apiguardian-api") + api(project(":junit-platform-commons")) osgiVerification(project(":junit-platform-commons")) } diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameter.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameter.java new file mode 100644 index 000000000000..6e8c44d8c7b9 --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameter.java @@ -0,0 +1,53 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @Configuration} specifies the configuration {@linkplain #key key} and + * {@linkplain #value value} pairs to be added to the discovery request when running + * a test suite on the JUnit Platform. + * + * @since 1.8 + * @see Suite + * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder#configurationParameter(String, String) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +@Repeatable(ConfigurationParameters.class) +public @interface ConfigurationParameter { + + /** + * The configuration parameter key under which to add the + * value to the discovery request; never {@code null} or blank. + */ + String key(); + + /** + * The value to add to the discovery request. + */ + String value(); + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameters.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameters.java new file mode 100644 index 000000000000..3637674b3637 --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ConfigurationParameters.java @@ -0,0 +1,41 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @Configurations} is a container for one or more + * {@link ConfigurationParameter @Configuration} declarations. + * + * @since 1.8 + * @see ConfigurationParameter + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +public @interface ConfigurationParameters { + + /** + * An array of one or more {@link ConfigurationParameter Configurations}. + */ + ConfigurationParameter[] value(); +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java index 4c7bf6194aae..a96042077026 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeClassNamePatterns.java @@ -30,24 +30,10 @@ * of a class matches against at least one of the patterns, the class will be * excluded from the test plan. * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines - * @see org.junit.platform.engine.discovery.ClassNameFilter#excludeClassNamePatterns + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.ClassNameFilter#excludeClassNamePatterns */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java index d5b87bf74769..7551584683b6 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeEngines.java @@ -26,24 +26,10 @@ * {@link org.junit.platform.engine.TestEngine TestEngines} to be excluded * when running a test suite on the JUnit Platform. * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see org.junit.platform.launcher.EngineFilter#excludeEngines + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.launcher.EngineFilter#excludeEngines */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java index 11d8113df66e..addffb419282 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludePackages.java @@ -24,24 +24,11 @@ /** * {@code @ExcludePackages} specifies the {@linkplain #value packages} to be * excluded when running a test suite on the JUnit Platform. - * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * + * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.PackageNameFilter#excludePackageNames(String...) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java index 75427acad23e..e08c7c7c9d6a 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/ExcludeTags.java @@ -53,24 +53,10 @@ *

  • {@code "!"}
  • * * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see IncludeEngines - * @see ExcludeEngines - * @see org.junit.platform.launcher.TagFilter#excludeTags + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.launcher.TagFilter#excludeTags */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java index c4c4d3284477..f4004f82317b 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeClassNamePatterns.java @@ -30,25 +30,11 @@ * of a class matches against at least one of the patterns, the class will be * included in the test plan. * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines + * @see Suite + * @see org.junit.platform.runner.JUnitPlatform * @see org.junit.platform.engine.discovery.ClassNameFilter#STANDARD_INCLUDE_PATTERN * @see org.junit.platform.engine.discovery.ClassNameFilter#includeClassNamePatterns - * @see org.junit.platform.runner.JUnitPlatform */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java index 7047caea1d40..fffed4eed54f 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeEngines.java @@ -26,24 +26,10 @@ * {@link org.junit.platform.engine.TestEngine TestEngines} to be included * when running a test suite on the JUnit Platform. * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see ExcludeEngines - * @see org.junit.platform.launcher.EngineFilter#includeEngines + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.launcher.EngineFilter#includeEngines */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java index bcfe221ff90f..94b720e6e2a0 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludePackages.java @@ -25,23 +25,10 @@ * {@code @IncludePackages} specifies the {@linkplain #value packages} to be * included when running a test suite on the JUnit Platform. * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.PackageNameFilter#includePackageNames(String...) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java index 16d94108345c..32de491b2785 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/IncludeTags.java @@ -53,24 +53,10 @@ *

  • {@code "!"}
  • * * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines - * @see org.junit.platform.launcher.TagFilter#includeTags + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.launcher.TagFilter#includeTags */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java index a4aeb1cf8dea..57b23cf157e0 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasses.java @@ -25,24 +25,9 @@ * {@code @SelectClasses} specifies the classes to select when running * a test suite on the JUnit Platform. * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectPackages - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines - * @see org.junit.platform.engine.discovery.ClassSelector * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.DiscoverySelectors#selectClass(Class) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResource.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResource.java new file mode 100644 index 000000000000..9120204b83e2 --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResource.java @@ -0,0 +1,57 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @SelectClasspathResource} specifies the classpath resource to + * select when running a test suite on the JUnit Platform. + * + * @since 1.8 + * @see Suite + * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.DiscoverySelectors#selectClasspathResource(String, org.junit.platform.engine.discovery.FilePosition) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +@Repeatable(SelectClasspathResources.class) +public @interface SelectClasspathResource { + + /** + * A classpath resource name to select. + */ + String value(); + + /** + * The line number; ignored if not greater than zero. + */ + int line() default 0; + + /** + * The column number; ignored if the line number is ignored; ignored if not + * greater than zero. + */ + int column() default 0; + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResources.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResources.java new file mode 100644 index 000000000000..5ad74c95aabf --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectClasspathResources.java @@ -0,0 +1,46 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @SelectClasspathResources} is a container for one or more + * {@link SelectClasspathResource @SelectClasspathResource} declarations. + * + *

    Note, however, that use of the {@code @SelectClasspathResources} container is + * completely optional since {@code @SelectClasspathResource} is a + * {@linkplain java.lang.annotation.Repeatable repeatable} annotation. + * + * @since 1.8 + * @see SelectClasspathResource + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +public @interface SelectClasspathResources { + + /** + * An array of one or more {@link SelectClasspathResource SelectClasspathResources}. + */ + SelectClasspathResource[] value(); + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectDirectories.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectDirectories.java new file mode 100644 index 000000000000..378f6cc28dce --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectDirectories.java @@ -0,0 +1,44 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @SelectDirectories} specifies the directories to + * select when running a test suite on the JUnit Platform. + * + * @since 1.8 + * @see Suite + * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.DiscoverySelectors#selectDirectory(String) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +public @interface SelectDirectories { + + /** + * One or more directories to select. + */ + String[] value(); + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFile.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFile.java new file mode 100644 index 000000000000..04c475a9430d --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFile.java @@ -0,0 +1,57 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @SelectFiles} specifies the files to + * select when running a test suite on the JUnit Platform. + * + * @see Suite + * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.DiscoverySelectors#selectFile(String, org.junit.platform.engine.discovery.FilePosition) + * @since 1.8 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +@Repeatable(SelectFiles.class) +public @interface SelectFile { + + /** + * A file to select. + */ + String value(); + + /** + * The line number; ignored if not greater than zero. + */ + int line() default 0; + + /** + * The column number; ignored if the line number is ignored; ignored if not + * greater than zero. + */ + int column() default 0; + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFiles.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFiles.java new file mode 100644 index 000000000000..dc95a2d07b64 --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectFiles.java @@ -0,0 +1,46 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @SelectFiles} is a container for one or more + * {@link SelectFile @SelectFile} declarations. + * + *

    Note, however, that use of the {@code @SelectFiles} container is + * completely optional since {@code @SelectFile} is a + * {@linkplain java.lang.annotation.Repeatable repeatable} annotation. + * + * @since 1.8 + * @see SelectFile + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +public @interface SelectFiles { + + /** + * An array of one or more {@link SelectFile SelectFiles}. + */ + SelectFile[] value(); + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectModules.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectModules.java new file mode 100644 index 000000000000..57bea0744fd0 --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectModules.java @@ -0,0 +1,45 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Set; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @SelectModules} specifies the modules to + * select when running a test suite on the JUnit Platform. + * + * @since 1.8 + * @see Suite + * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.DiscoverySelectors#selectModules(Set) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +public @interface SelectModules { + + /** + * One or more modules to select. + */ + String[] value(); + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java index 9592461204cc..4659689c598d 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectPackages.java @@ -25,24 +25,10 @@ * {@code @SelectPackages} specifies the names of packages to select * when running a test suite on the JUnit Platform. * - *

    JUnit 4 Suite Support

    - *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via - * {@code @RunWith(JUnitPlatform.class)}. - * * @since 1.0 - * @see SuiteDisplayName - * @see UseTechnicalNames - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines - * @see org.junit.platform.engine.discovery.PackageSelector + * @see Suite * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.DiscoverySelectors#selectPackage(String) */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectUris.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectUris.java new file mode 100644 index 000000000000..cee5d4e2990b --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SelectUris.java @@ -0,0 +1,44 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; + +/** + * {@code @SelectUris} specifies the uris to + * select when running a test suite on the JUnit Platform. + * + * @since 1.8 + * @see Suite + * @see org.junit.platform.runner.JUnitPlatform + * @see org.junit.platform.engine.discovery.DiscoverySelectors#selectUri(String) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +public @interface SelectUris { + + /** + * One or more uris to select. + */ + String[] value(); + +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/Suite.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/Suite.java new file mode 100644 index 000000000000..8b01fe2cdb97 --- /dev/null +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/Suite.java @@ -0,0 +1,65 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; +import org.junit.platform.commons.annotation.Testable; + +/** + * {@code @Suite} marks class as a test suite on the JUnit Platform. + *

    Selector and filter annotations are used to control the contents of the + * suite. Additionally configuration can be passed to the suite via the + * configuration annotations. + * + *

    When the {@link IncludeClassNamePatterns @IncludeClassNamePatterns} + * annotation is not present, the default include pattern + * {@value org.junit.platform.engine.discovery.ClassNameFilter#STANDARD_INCLUDE_PATTERN} + * will be used in order to avoid loading classes unnecessarily (see {@link + * org.junit.platform.engine.discovery.ClassNameFilter#STANDARD_INCLUDE_PATTERN + * ClassNameFilter#STANDARD_INCLUDE_PATTERN}). + * + * @since 1.8 + * @see SelectClasses + * @see SelectClasspathResource + * @see SelectDirectories + * @see SelectFile + * @see SelectModules + * @see SelectPackages + * @see SelectUris + * @see IncludeClassNamePatterns + * @see ExcludeClassNamePatterns + * @see IncludeEngines + * @see ExcludeEngines + * @see IncludePackages + * @see ExcludePackages + * @see IncludeTags + * @see ExcludeTags + * @see SuiteDisplayName + * @see ConfigurationParameter + * @see org.junit.platform.launcher.LauncherDiscoveryRequest + * @see org.junit.platform.launcher.Launcher + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +@Documented +@API(status = Status.EXPERIMENTAL, since = "1.8") +@Testable +public @interface Suite { +} diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java index 3d8bf880bb5b..f63baa5d1edb 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/SuiteDisplayName.java @@ -32,18 +32,12 @@ *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via * {@code @RunWith(JUnitPlatform.class)}. * + *

    JUnit 5 Suite Support

    + *

    Test suites can be run on the JUnit Platform in a JUnit 5 environment via + * the {@code junit-platform-suite} engine. + * * @since 1.1 - * @see UseTechnicalNames - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines + * @see Suite * @see org.junit.platform.runner.JUnitPlatform */ @Retention(RUNTIME) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java index 596b9137a2dd..32ede2d0aa3a 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java @@ -42,17 +42,6 @@ * {@code @RunWith(JUnitPlatform.class)}. * * @since 1.0 - * @see SuiteDisplayName - * @see SelectPackages - * @see SelectClasses - * @see IncludeClassNamePatterns - * @see ExcludeClassNamePatterns - * @see IncludePackages - * @see ExcludePackages - * @see IncludeTags - * @see ExcludeTags - * @see IncludeEngines - * @see ExcludeEngines * @see org.junit.platform.runner.JUnitPlatform */ @Retention(RetentionPolicy.RUNTIME) diff --git a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/package-info.java b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/package-info.java index ab20a1f6600e..27a247baea60 100644 --- a/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/package-info.java +++ b/junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/package-info.java @@ -1,5 +1,13 @@ /** * Annotations for configuring a test suite on the JUnit Platform. + * + *

    JUnit 4 Suite Support

    + *

    Test suites can be run on the JUnit Platform in a JUnit 4 environment via + * {@code @RunWith(JUnitPlatform.class)} with the {@code junit-platform-runner}. + * + *

    JUnit 5 Suite Support

    + *

    Test suites can be run on the JUnit Platform in a JUnit 5 environment via + * {@link Suite @Suite} with the {@code junit-platform-suite-engine}. */ package org.junit.platform.suite.api; diff --git a/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java b/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java index 6b88fc29025d..c65659ee0833 100644 --- a/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java +++ b/junit-platform-suite-api/src/module/org.junit.platform.suite.api/module-info.java @@ -15,6 +15,7 @@ */ module org.junit.platform.suite.api { requires transitive org.apiguardian.api; + requires transitive org.junit.platform.commons; exports org.junit.platform.suite.api; } diff --git a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts new file mode 100644 index 000000000000..11ffb7fe7a53 --- /dev/null +++ b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts @@ -0,0 +1,19 @@ +plugins { + `java-library-conventions` + `testing-conventions` +} + +description = "JUnit Platform Suite Commons" + +dependencies { + internal(platform(project(":dependencies"))) + + api(platform(project(":junit-bom"))) + api("org.apiguardian:apiguardian-api") + api(project(":junit-platform-launcher")) + + implementation(project(":junit-platform-engine")) + implementation(project(":junit-platform-suite-api")) + + testImplementation(project(":junit-jupiter-engine")) +} diff --git a/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/AdditionalDiscoverySelectors.java b/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/AdditionalDiscoverySelectors.java new file mode 100644 index 000000000000..4efd8f35b5da --- /dev/null +++ b/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/AdditionalDiscoverySelectors.java @@ -0,0 +1,113 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.commons; + +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.engine.discovery.ClassSelector; +import org.junit.platform.engine.discovery.ClasspathResourceSelector; +import org.junit.platform.engine.discovery.DirectorySelector; +import org.junit.platform.engine.discovery.DiscoverySelectors; +import org.junit.platform.engine.discovery.FilePosition; +import org.junit.platform.engine.discovery.FileSelector; +import org.junit.platform.engine.discovery.ModuleSelector; +import org.junit.platform.engine.discovery.PackageSelector; +import org.junit.platform.engine.discovery.UriSelector; + +class AdditionalDiscoverySelectors { + + static List selectUris(String... uris) { + Preconditions.notNull(uris, "Uris must not be null"); + Preconditions.containsNoNullElements(uris, "Individual uris must not be null"); + + // @formatter:off + return uniqueStreamOf(uris) + .filter(s -> !s.isEmpty()) + .map(DiscoverySelectors::selectUri) + .collect(Collectors.toList()); + // @formatter:on + } + + static List selectDirectories(String... paths) { + Preconditions.notNull(paths, "Directory paths must not be null"); + Preconditions.containsNoNullElements(paths, "Individual directory paths must not be null"); + + // @formatter:off + return uniqueStreamOf(paths) + .filter(s -> !s.isEmpty()) + .map(DiscoverySelectors::selectDirectory) + .collect(Collectors.toList()); + // @formatter:on + } + + static List selectPackages(String... packageNames) { + Preconditions.notNull(packageNames, "Package names must not be null"); + Preconditions.containsNoNullElements(packageNames, "Individual package names must not be null"); + + // @formatter:off + return uniqueStreamOf(packageNames) + .map(DiscoverySelectors::selectPackage) + .collect(Collectors.toList()); + // @formatter:on + } + + static List selectClasses(Class... classes) { + Preconditions.notNull(classes, "classes must not be null"); + Preconditions.containsNoNullElements(classes, "individual classes must not be null"); + + // @formatter:off + return uniqueStreamOf(classes) + .map(DiscoverySelectors::selectClass) + .collect(Collectors.toList()); + // @formatter:on + } + + static List selectModules(String... moduleNames) { + Preconditions.notNull(moduleNames, "Module names must not be null"); + Preconditions.containsNoNullElements(moduleNames, "Individual module name must not be null"); + + return DiscoverySelectors.selectModules(uniqueStreamOf(moduleNames).collect(Collectors.toSet())); + } + + static FileSelector selectFile(String path, int line, int column) { + Preconditions.notBlank(path, "File path must not be null or blank"); + + if (line <= 0) { + return DiscoverySelectors.selectFile(path); + } + if (column <= 0) { + return DiscoverySelectors.selectFile(path, FilePosition.from(line)); + } + return DiscoverySelectors.selectFile(path, FilePosition.from(line, column)); + } + + static ClasspathResourceSelector selectClasspathResource(String classpathResourceName, int line, int column) { + Preconditions.notBlank(classpathResourceName, "Classpath resource name must not be null or blank"); + + if (line <= 0) { + return DiscoverySelectors.selectClasspathResource(classpathResourceName); + } + if (column <= 0) { + return DiscoverySelectors.selectClasspathResource(classpathResourceName, FilePosition.from(line)); + } + return DiscoverySelectors.selectClasspathResource(classpathResourceName, FilePosition.from(line, column)); + } + + private static Stream uniqueStreamOf(T[] packageNames) { + return new LinkedHashSet<>(Arrays.asList(packageNames)).stream(); + } + +} diff --git a/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilder.java b/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilder.java new file mode 100644 index 000000000000..d36f90d79feb --- /dev/null +++ b/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilder.java @@ -0,0 +1,185 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.commons; + +import static org.junit.platform.commons.support.AnnotationSupport.findAnnotation; +import static org.junit.platform.commons.support.AnnotationSupport.findRepeatableAnnotations; +import static org.junit.platform.engine.discovery.ClassNameFilter.STANDARD_INCLUDE_PATTERN; +import static org.junit.platform.suite.commons.AdditionalDiscoverySelectors.selectClasspathResource; +import static org.junit.platform.suite.commons.AdditionalDiscoverySelectors.selectFile; + +import java.lang.annotation.Annotation; +import java.lang.reflect.AnnotatedElement; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; + +import org.apiguardian.api.API; +import org.apiguardian.api.API.Status; +import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.commons.util.StringUtils; +import org.junit.platform.engine.DiscoverySelector; +import org.junit.platform.engine.Filter; +import org.junit.platform.engine.discovery.ClassNameFilter; +import org.junit.platform.engine.discovery.PackageNameFilter; +import org.junit.platform.launcher.EngineFilter; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.TagFilter; +import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; +import org.junit.platform.suite.api.ConfigurationParameter; +import org.junit.platform.suite.api.ExcludeClassNamePatterns; +import org.junit.platform.suite.api.ExcludeEngines; +import org.junit.platform.suite.api.ExcludePackages; +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.IncludeEngines; +import org.junit.platform.suite.api.IncludePackages; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectClasspathResource; +import org.junit.platform.suite.api.SelectDirectories; +import org.junit.platform.suite.api.SelectFile; +import org.junit.platform.suite.api.SelectModules; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.SelectUris; + +@API(status = Status.INTERNAL, since = "1.8", consumers = { "org.junit.platform.suite.engine", + "org.junit.platform.runner" }) +public final class SuiteLauncherDiscoveryRequestBuilder { + + private final LauncherDiscoveryRequestBuilder delegate = LauncherDiscoveryRequestBuilder.request(); + private boolean includeClassNamePatternsUsed; + private boolean filterStandardClassNamePatterns = false; + + private SuiteLauncherDiscoveryRequestBuilder() { + + } + + public static SuiteLauncherDiscoveryRequestBuilder request() { + return new SuiteLauncherDiscoveryRequestBuilder(); + } + + public SuiteLauncherDiscoveryRequestBuilder filterStandardClassNamePatterns( + boolean filterStandardClassNamePatterns) { + this.filterStandardClassNamePatterns = filterStandardClassNamePatterns; + return this; + } + + public LauncherDiscoveryRequestBuilder selectors(DiscoverySelector... selectors) { + return delegate.selectors(selectors); + } + + public LauncherDiscoveryRequestBuilder selectors(List selectors) { + return delegate.selectors(selectors); + } + + public LauncherDiscoveryRequestBuilder filters(Filter... filters) { + return delegate.filters(filters); + } + + public LauncherDiscoveryRequestBuilder configurationParameter(String key, String value) { + return delegate.configurationParameter(key, value); + } + + public LauncherDiscoveryRequestBuilder configurationParameters(Map configurationParameters) { + return delegate.configurationParameters(configurationParameters); + } + + public SuiteLauncherDiscoveryRequestBuilder suite(AnnotatedElement suite) { + Preconditions.notNull(suite, "Test class must not be null"); + + // Annotations in alphabetical order + // @formatter:off + findRepeatableAnnotations(suite, ConfigurationParameter.class) + .forEach(configuration -> configurationParameter(configuration.key(), configuration.value())); + findAnnotationValues(suite, ExcludeClassNamePatterns.class, ExcludeClassNamePatterns::value) + .flatMap(SuiteLauncherDiscoveryRequestBuilder::trimmed) + .map(ClassNameFilter::excludeClassNamePatterns) + .ifPresent(this::filters); + findAnnotationValues(suite, ExcludeEngines.class, ExcludeEngines::value) + .map(EngineFilter::excludeEngines) + .ifPresent(this::filters); + findAnnotationValues(suite, ExcludePackages.class, ExcludePackages::value) + .map(PackageNameFilter::excludePackageNames) + .ifPresent(this::filters); + findAnnotationValues(suite, ExcludeTags.class, ExcludeTags::value) + .map(TagFilter::excludeTags) + .ifPresent(this::filters); + findAnnotationValues(suite, IncludeClassNamePatterns.class, IncludeClassNamePatterns::value) + .flatMap(SuiteLauncherDiscoveryRequestBuilder::trimmed) + .map(ClassNameFilter::includeClassNamePatterns) + .ifPresent(filters ->{ + includeClassNamePatternsUsed = true; + this.filters(filters); + }); + findAnnotationValues(suite, IncludeEngines.class, IncludeEngines::value) + .map(EngineFilter::includeEngines) + .ifPresent(this::filters); + findAnnotationValues(suite, IncludePackages.class, IncludePackages::value) + .map(PackageNameFilter::includePackageNames) + .ifPresent(this::filters); + findAnnotationValues(suite, IncludeTags.class, IncludeTags::value) + .map(TagFilter::includeTags) + .ifPresent(this::filters); + findAnnotationValues(suite, SelectClasses.class, SelectClasses::value) + .map(AdditionalDiscoverySelectors::selectClasses) + .ifPresent(this::selectors); + findRepeatableAnnotations(suite, SelectClasspathResource.class) + .stream() + .map(annotation -> selectClasspathResource(annotation.value(), annotation.line(), annotation.column())) + .forEach(this::selectors); + findAnnotationValues(suite, SelectDirectories.class, SelectDirectories::value) + .map(AdditionalDiscoverySelectors::selectDirectories) + .ifPresent(this::selectors); + findRepeatableAnnotations(suite, SelectFile.class) + .stream() + .map(annotation -> selectFile(annotation.value(), annotation.line(), annotation.column())) + .forEach(this::selectors); + findAnnotationValues(suite, SelectModules.class, SelectModules::value) + .map(AdditionalDiscoverySelectors::selectModules) + .ifPresent(this::selectors); + findAnnotationValues(suite, SelectUris.class, SelectUris::value) + .map(AdditionalDiscoverySelectors::selectUris) + .ifPresent(this::selectors); + findAnnotationValues(suite, SelectPackages.class, SelectPackages::value) + .map(AdditionalDiscoverySelectors::selectPackages) + .ifPresent(this::selectors); + // @formatter:on + return this; + } + + public LauncherDiscoveryRequest build() { + if (filterStandardClassNamePatterns && !includeClassNamePatternsUsed) { + delegate.filters(ClassNameFilter.includeClassNamePatterns(STANDARD_INCLUDE_PATTERN)); + } + return delegate.build(); + } + + private static Optional findAnnotationValues(AnnotatedElement element, + Class annotationType, Function valueExtractor) { + return findAnnotation(element, annotationType).map(valueExtractor).filter(values -> values.length > 0); + } + + private static Optional trimmed(String[] patterns) { + if (patterns.length == 0) { + return Optional.empty(); + } + // @formatter:off + return Optional.of(Arrays.stream(patterns) + .filter(StringUtils::isNotBlank) + .map(String::trim) + .toArray(String[]::new)); + // @formatter:on + } + +} diff --git a/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/package-info.java b/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/package-info.java new file mode 100644 index 000000000000..a35d7d91a9a7 --- /dev/null +++ b/junit-platform-suite-commons/src/main/java/org/junit/platform/suite/commons/package-info.java @@ -0,0 +1,11 @@ +/** + * Common APIs and support utilities for the JUnit Platform Suite. + * + *

    DISCLAIMER

    + * + *

    Any API annotated with {@code @API(status = INTERNAL)} is intended solely + * for usage within the JUnit framework itself. Any usage of internal + * APIs by external parties is not supported! + */ + +package org.junit.platform.suite.commons; diff --git a/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java b/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java new file mode 100644 index 000000000000..a65200213874 --- /dev/null +++ b/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +module org.junit.platform.suite.commons { + requires transitive org.apiguardian.api; + requires org.junit.platform.suite.api; + requires org.junit.platform.commons; + requires org.junit.platform.engine; + requires transitive org.junit.platform.launcher; + + exports org.junit.platform.suite.commons to + org.junit.platform.suite.engine, + org.junit.platform.runner; +} diff --git a/junit-platform-suite-commons/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java b/junit-platform-suite-commons/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java new file mode 100644 index 000000000000..8d47e4e8acb7 --- /dev/null +++ b/junit-platform-suite-commons/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java @@ -0,0 +1,400 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.commons; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.net.URI; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.Set; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.engine.JupiterTestEngine; +import org.junit.platform.engine.ConfigurationParameters; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.TestTag; +import org.junit.platform.engine.UniqueId; +import org.junit.platform.engine.discovery.ClassNameFilter; +import org.junit.platform.engine.discovery.ClassSelector; +import org.junit.platform.engine.discovery.ClasspathResourceSelector; +import org.junit.platform.engine.discovery.DirectorySelector; +import org.junit.platform.engine.discovery.FilePosition; +import org.junit.platform.engine.discovery.FileSelector; +import org.junit.platform.engine.discovery.ModuleSelector; +import org.junit.platform.engine.discovery.PackageNameFilter; +import org.junit.platform.engine.discovery.PackageSelector; +import org.junit.platform.engine.discovery.UriSelector; +import org.junit.platform.engine.support.descriptor.AbstractTestDescriptor; +import org.junit.platform.launcher.EngineFilter; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.PostDiscoveryFilter; +import org.junit.platform.suite.api.ConfigurationParameter; +import org.junit.platform.suite.api.ExcludeClassNamePatterns; +import org.junit.platform.suite.api.ExcludeEngines; +import org.junit.platform.suite.api.ExcludePackages; +import org.junit.platform.suite.api.ExcludeTags; +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.IncludeEngines; +import org.junit.platform.suite.api.IncludePackages; +import org.junit.platform.suite.api.IncludeTags; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.SelectClasspathResource; +import org.junit.platform.suite.api.SelectDirectories; +import org.junit.platform.suite.api.SelectFile; +import org.junit.platform.suite.api.SelectModules; +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.SelectUris; + +class SuiteLauncherDiscoveryRequestBuilderTest { + + SuiteLauncherDiscoveryRequestBuilder builder = SuiteLauncherDiscoveryRequestBuilder.request(); + + @Test + void configurationParameter() { + @ConfigurationParameter(key = "com.example", value = "*") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + ConfigurationParameters configuration = request.getConfigurationParameters(); + Optional parameter = configuration.get("com.example"); + assertEquals(Optional.of("*"), parameter); + } + + @Test + void excludeClassNamePatterns() { + class TestCase { + + } + @ExcludeClassNamePatterns("^.*TestCase$") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getFiltersByType(ClassNameFilter.class); + assertTrue(exactlyOne(filters).apply(TestCase.class.getName()).excluded()); + } + + @Test + void excludeEngines() { + @ExcludeEngines("junit-jupiter") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getEngineFilters(); + assertTrue(exactlyOne(filters).apply(new JupiterTestEngine()).excluded()); + } + + @Test + void excludePackages() { + @ExcludePackages("com.example.testcases") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getFiltersByType(PackageNameFilter.class); + assertTrue(exactlyOne(filters).apply("com.example.testcases").excluded()); + } + + @Test + void excludeTags() { + @ExcludeTags("test-tag") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getPostDiscoveryFilters(); + TestDescriptor testDescriptor = new StubAbstractTestDescriptor(); + assertTrue(exactlyOne(filters).apply(testDescriptor).excluded()); + } + + @Test + void includeClassNamePatterns() { + class TestCase { + + } + @IncludeClassNamePatterns("^.*TestCase$") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getFiltersByType(ClassNameFilter.class); + assertTrue(exactlyOne(filters).apply(TestCase.class.getName()).included()); + assertTrue(exactlyOne(filters).apply(Suite.class.getName()).excluded()); + } + + @Test + void filtersOnStandardClassNamePatternsWhenIncludeClassNamePatternsIsOmitted() { + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + assertTrue(request.getFiltersByType(ClassNameFilter.class).isEmpty()); + } + + @Test + void filtersOnStandardClassNamePatternsWhenIncludeClassNamePatternsIsOmittedUnlessDisabled() { + class ExampleTest { + + } + class Suite { + + } + // @formatter:off + LauncherDiscoveryRequest request = builder + .filterStandardClassNamePatterns(true) + .suite(Suite.class) + .build(); + // @formatter:on + List filters = request.getFiltersByType(ClassNameFilter.class); + assertTrue(exactlyOne(filters).apply(ExampleTest.class.getName()).included()); + assertTrue(exactlyOne(filters).apply(Suite.class.getName()).excluded()); + } + + @Test + void includeEngines() { + @IncludeEngines("junit-jupiter") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getEngineFilters(); + assertTrue(exactlyOne(filters).apply(new JupiterTestEngine()).included()); + } + + @Test + void includePackages() { + @IncludePackages("com.example.testcases") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getFiltersByType(PackageNameFilter.class); + assertTrue(exactlyOne(filters).apply("com.example.testcases").included()); + } + + @Test + void includeTags() { + @IncludeTags("test-tag") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List filters = request.getPostDiscoveryFilters(); + TestDescriptor testDescriptor = new StubAbstractTestDescriptor(); + assertTrue(exactlyOne(filters).apply(testDescriptor).included()); + } + + @Test + void selectClasses() { + class TestCase { + + } + @SelectClasses(TestCase.class) + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(ClassSelector.class); + assertFalse(selectors.isEmpty()); + assertEquals(TestCase.class, exactlyOne(selectors).getJavaClass()); + } + + @Test + void selectClasspathResource() { + @SelectClasspathResource("com.example.testcases") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(ClasspathResourceSelector.class); + assertEquals("com.example.testcases", exactlyOne(selectors).getClasspathResourceName()); + } + + @Test + void selectClasspathResourcePosition() { + @SelectClasspathResource(value = "com.example.testcases", line = 42) + @SelectClasspathResource(value = "com.example.testcases", line = 14, column = 15) + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(ClasspathResourceSelector.class); + assertEquals(Optional.of(FilePosition.from(42)), selectors.get(0).getPosition()); + assertEquals(Optional.of(FilePosition.from(14, 15)), selectors.get(1).getPosition()); + } + + @Test + void ignoreClasspathResourcePosition() { + @SelectClasspathResource(value = "com.example.testcases", line = -1) + @SelectClasspathResource(value = "com.example.testcases", column = 12) + @SelectClasspathResource(value = "com.example.testcases", line = 42, column = -12) + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(ClasspathResourceSelector.class); + assertEquals(Optional.empty(), selectors.get(0).getPosition()); + assertEquals(Optional.empty(), selectors.get(1).getPosition()); + assertEquals(Optional.of(FilePosition.from(42)), selectors.get(2).getPosition()); + } + + @Test + void selectDirectories() { + @SelectDirectories("path/to/root") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(DirectorySelector.class); + assertEquals(Paths.get("path/to/root"), exactlyOne(selectors).getPath()); + } + + @Test + void selectDirectoriesFiltersEmptyPaths() { + @SelectDirectories("") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + assertTrue(request.getSelectorsByType(DirectorySelector.class).isEmpty()); + } + + @Test + void selectFile() { + @SelectFile("path/to/root") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(FileSelector.class); + assertEquals(Paths.get("path/to/root"), exactlyOne(selectors).getPath()); + } + + @Test + void selectFilePosition() { + @SelectFile(value = "path/to/root", line = 42) + @SelectFile(value = "path/to/root", line = 14, column = 15) + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(FileSelector.class); + assertEquals(Optional.of(FilePosition.from(42)), selectors.get(0).getPosition()); + assertEquals(Optional.of(FilePosition.from(14, 15)), selectors.get(1).getPosition()); + } + + @Test + void ignoreInvalidFilePosition() { + @SelectFile(value = "path/to/root", line = -1) + @SelectFile(value = "path/to/root", column = 12) + @SelectFile(value = "path/to/root", line = 42, column = -12) + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(FileSelector.class); + assertEquals(Optional.empty(), selectors.get(0).getPosition()); + assertEquals(Optional.empty(), selectors.get(1).getPosition()); + assertEquals(Optional.of(FilePosition.from(42)), selectors.get(2).getPosition()); + } + + @Test + void selectModules() { + @SelectModules("com.example.testcases") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(ModuleSelector.class); + assertEquals("com.example.testcases", exactlyOne(selectors).getModuleName()); + } + + @Test + void selectUris() { + @SelectUris("path/to/root") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(UriSelector.class); + assertEquals(URI.create("path/to/root"), exactlyOne(selectors).getUri()); + } + + @Test + void selectUrisFiltersEmptyUris() { + @SelectUris("") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + assertTrue(request.getSelectorsByType(UriSelector.class).isEmpty()); + } + + @Test + void selectPackages() { + @SelectPackages("com.example.testcases") + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List selectors = request.getSelectorsByType(PackageSelector.class); + assertEquals("com.example.testcases", exactlyOne(selectors).getPackageName()); + } + + @SelectPackages("com.example.testcases") + @Retention(RetentionPolicy.RUNTIME) + @interface Meta { + + } + + @Test + void metaAnnotations() { + @Meta + class Suite { + + } + LauncherDiscoveryRequest request = builder.suite(Suite.class).build(); + List pSelectors = request.getSelectorsByType(PackageSelector.class); + assertEquals("com.example.testcases", exactlyOne(pSelectors).getPackageName()); + } + + private static T exactlyOne(List list) { + assertEquals(1, list.size()); + return list.get(0); + } + + private static class StubAbstractTestDescriptor extends AbstractTestDescriptor { + public StubAbstractTestDescriptor() { + super(UniqueId.forEngine("test"), "stub"); + } + + @Override + public Type getType() { + return Type.CONTAINER; + } + + @Override + public Set getTags() { + return Collections.singleton(TestTag.create("test-tag")); + } + + } + +} diff --git a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts new file mode 100644 index 000000000000..9618efbab32f --- /dev/null +++ b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts @@ -0,0 +1,24 @@ +plugins { + `java-library-conventions` + `testing-conventions` + `java-test-fixtures` +} + +description = "JUnit Platform Suite Engine" + +dependencies { + internal(platform(project(":dependencies"))) + + api(platform(project(":junit-bom"))) + api("org.apiguardian:apiguardian-api") + api(project(":junit-platform-engine")) + api(project(":junit-platform-suite-api")) + + implementation(project(":junit-platform-suite-commons")) + + testFixturesApi(project(":junit-jupiter-api")) + testFixturesApi(project(":junit-platform-suite-api")) + + testImplementation(project(":junit-platform-testkit")) + testImplementation(project(":junit-jupiter-engine")) +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/ClassSelectorResolver.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/ClassSelectorResolver.java new file mode 100644 index 000000000000..58db2bf1f740 --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/ClassSelectorResolver.java @@ -0,0 +1,93 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import static org.junit.platform.engine.support.discovery.SelectorResolver.Resolution.unresolved; + +import java.util.List; +import java.util.Optional; +import java.util.function.Predicate; + +import org.junit.platform.commons.util.ReflectionUtils; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.UniqueId; +import org.junit.platform.engine.UniqueId.Segment; +import org.junit.platform.engine.discovery.ClassSelector; +import org.junit.platform.engine.discovery.UniqueIdSelector; +import org.junit.platform.engine.support.discovery.SelectorResolver; + +final class ClassSelectorResolver implements SelectorResolver { + + private static final IsSuiteClass isSuiteClass = new IsSuiteClass(); + + private final Predicate classNameFilter; + private final SuiteEngineDescriptor suiteEngineDescriptor; + + ClassSelectorResolver(Predicate classNameFilter, SuiteEngineDescriptor suiteEngineDescriptor) { + this.classNameFilter = classNameFilter; + this.suiteEngineDescriptor = suiteEngineDescriptor; + } + + @Override + public Resolution resolve(ClassSelector selector, Context context) { + Class testClass = selector.getJavaClass(); + if (isSuiteClass.test(testClass)) { + if (classNameFilter.test(testClass.getName())) { + // @formatter:off + Optional suiteWithDiscoveryRequest = context + .addToParent(parent -> newSuiteDescriptor(testClass, parent)) + .map(suite -> suite.addDiscoveryRequestFrom(testClass)); + return toResolution(suiteWithDiscoveryRequest); + // @formatter:on + } + } + return unresolved(); + } + + @Override + public Resolution resolve(UniqueIdSelector selector, Context context) { + UniqueId uniqueId = selector.getUniqueId(); + UniqueId engineId = suiteEngineDescriptor.getUniqueId(); + List resolvedSegments = engineId.getSegments(); + // @formatter:off + return uniqueId.getSegments() + .stream() + .skip(resolvedSegments.size()) + .findFirst() + .filter(suiteSegment -> SuiteTestDescriptor.SEGMENT_TYPE.equals(suiteSegment.getType())) + .flatMap(ClassSelectorResolver::tryLoadSuiteClass) + .filter(isSuiteClass) + .map(suiteClass -> context + .addToParent(parent -> newSuiteDescriptor(suiteClass, parent)) + .map(suite -> uniqueId.equals(suite.getUniqueId()) + // The uniqueId selector either targeted a class annotated with @Suite; + ? suite.addDiscoveryRequestFrom(suiteClass) + // or a specific test in that suite + : suite.addDiscoveryRequestFrom(uniqueId))) + .map(ClassSelectorResolver::toResolution) + .orElseGet(Resolution::unresolved); + // @formatter:on + } + + private static Optional> tryLoadSuiteClass(UniqueId.Segment segment) { + return ReflectionUtils.tryToLoadClass(segment.getValue()).toOptional(); + } + + private static Resolution toResolution(Optional suite) { + return suite.map(Match::exact).map(Resolution::match).orElseGet(Resolution::unresolved); + } + + private static Optional newSuiteDescriptor(Class suiteClass, TestDescriptor parent) { + UniqueId id = parent.getUniqueId().append(SuiteTestDescriptor.SEGMENT_TYPE, suiteClass.getName()); + return Optional.of(new SuiteTestDescriptor(id, suiteClass)); + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/DiscoverySelectorResolver.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/DiscoverySelectorResolver.java new file mode 100644 index 000000000000..8f90faad4b3c --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/DiscoverySelectorResolver.java @@ -0,0 +1,40 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import org.junit.platform.engine.EngineDiscoveryRequest; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver; + +final class DiscoverySelectorResolver { + + // @formatter:off + private static final EngineDiscoveryRequestResolver resolver = EngineDiscoveryRequestResolver.builder() + .addClassContainerSelectorResolver(new IsSuiteClass()) + .addSelectorResolver(context -> new ClassSelectorResolver(context.getClassNameFilter(), context.getEngineDescriptor())) + .build(); + // @formatter:on + + private static void discoverSuites(SuiteEngineDescriptor engineDescriptor) { + // @formatter:off + engineDescriptor.getChildren().stream() + .map(SuiteTestDescriptor.class::cast) + .forEach(SuiteTestDescriptor::discover); + // @formatter:on + } + + void resolveSelectors(EngineDiscoveryRequest request, SuiteEngineDescriptor engineDescriptor) { + resolver.resolve(request, engineDescriptor); + discoverSuites(engineDescriptor); + engineDescriptor.accept(TestDescriptor::prune); + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsPotentialTestContainer.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsPotentialTestContainer.java new file mode 100644 index 000000000000..3926ab05a753 --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsPotentialTestContainer.java @@ -0,0 +1,39 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import static org.junit.platform.commons.util.ReflectionUtils.isAbstract; +import static org.junit.platform.commons.util.ReflectionUtils.isInnerClass; +import static org.junit.platform.commons.util.ReflectionUtils.isPrivate; + +import java.util.function.Predicate; + +final class IsPotentialTestContainer implements Predicate> { + + @Override + public boolean test(Class candidate) { + // Please do not collapse the following into a single statement. + if (isPrivate(candidate)) { + return false; + } + if (isAbstract(candidate)) { + return false; + } + if (candidate.isLocalClass()) { + return false; + } + if (candidate.isAnonymousClass()) { + return false; + } + return !isInnerClass(candidate); + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsSuiteClass.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsSuiteClass.java new file mode 100644 index 000000000000..0ba4b4221a07 --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/IsSuiteClass.java @@ -0,0 +1,31 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import java.util.function.Predicate; + +import org.junit.platform.commons.support.AnnotationSupport; +import org.junit.platform.suite.api.Suite; + +final class IsSuiteClass implements Predicate> { + + private static final IsPotentialTestContainer isPotentialTestContainer = new IsPotentialTestContainer(); + + @Override + public boolean test(Class testClass) { + return isPotentialTestContainer.test(testClass) && hasSuiteAnnotation(testClass); + } + + private boolean hasSuiteAnnotation(Class testClass) { + return AnnotationSupport.isAnnotated(testClass, Suite.class); + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteEngineDescriptor.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteEngineDescriptor.java new file mode 100644 index 000000000000..2c77a4185061 --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteEngineDescriptor.java @@ -0,0 +1,29 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import org.junit.platform.engine.UniqueId; +import org.junit.platform.engine.support.descriptor.EngineDescriptor; + +final class SuiteEngineDescriptor extends EngineDescriptor { + + static final String ENGINE_ID = "junit-platform-suite"; + + SuiteEngineDescriptor(UniqueId uniqueId) { + super(uniqueId, "JUnit Platform Suite"); + } + + @Override + public Type getType() { + return Type.CONTAINER; + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteLauncher.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteLauncher.java new file mode 100644 index 000000000000..18a5737a07f0 --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteLauncher.java @@ -0,0 +1,59 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import static java.util.Collections.emptyList; + +import java.util.LinkedHashSet; +import java.util.Set; + +import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.engine.EngineExecutionListener; +import org.junit.platform.engine.TestEngine; +import org.junit.platform.engine.UniqueId; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.core.EngineDiscoveryOrchestrator; +import org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.Phase; +import org.junit.platform.launcher.core.EngineExecutionOrchestrator; +import org.junit.platform.launcher.core.LauncherDiscoveryResult; +import org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry; + +class SuiteLauncher { + + private final EngineExecutionOrchestrator executionOrchestrator = new EngineExecutionOrchestrator(); + private final EngineDiscoveryOrchestrator discoveryOrchestrator; + + static SuiteLauncher create() { + Set engines = new LinkedHashSet<>(); + new ServiceLoaderTestEngineRegistry().loadTestEngines().forEach(engines::add); + return new SuiteLauncher(engines); + } + + private SuiteLauncher(Set testEngines) { + Preconditions.condition(hasTestEngineOtherThanSuiteEngine(testEngines), + () -> "Cannot create SuiteLauncher without at least one other TestEngine; " + + "consider adding an engine implementation JAR to the classpath"); + this.discoveryOrchestrator = new EngineDiscoveryOrchestrator(testEngines, emptyList()); + } + + private boolean hasTestEngineOtherThanSuiteEngine(Set testEngines) { + return testEngines.stream().anyMatch(testEngine -> !SuiteEngineDescriptor.ENGINE_ID.equals(testEngine.getId())); + } + + LauncherDiscoveryResult discover(LauncherDiscoveryRequest discoveryRequest, UniqueId parentId) { + return discoveryOrchestrator.discover(discoveryRequest, Phase.DISCOVERY, parentId); + } + + void execute(LauncherDiscoveryResult discoveryResult, EngineExecutionListener listener) { + executionOrchestrator.execute(discoveryResult, listener); + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestDescriptor.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestDescriptor.java new file mode 100644 index 000000000000..2bed05b2d7bb --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestDescriptor.java @@ -0,0 +1,129 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import static java.util.function.Function.identity; +import static java.util.stream.Collectors.counting; +import static java.util.stream.Collectors.groupingBy; +import static org.junit.platform.suite.commons.SuiteLauncherDiscoveryRequestBuilder.request; + +import java.util.function.Supplier; + +import org.junit.platform.commons.util.AnnotationUtils; +import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.commons.util.StringUtils; +import org.junit.platform.engine.EngineExecutionListener; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.TestExecutionResult; +import org.junit.platform.engine.UniqueId; +import org.junit.platform.engine.UniqueId.Segment; +import org.junit.platform.engine.discovery.DiscoverySelectors; +import org.junit.platform.engine.support.descriptor.AbstractTestDescriptor; +import org.junit.platform.engine.support.descriptor.ClassSource; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.core.LauncherDiscoveryResult; +import org.junit.platform.suite.api.SuiteDisplayName; +import org.junit.platform.suite.commons.SuiteLauncherDiscoveryRequestBuilder; + +/** + * {@link TestDescriptor} for tests based on the JUnit Platform Launcher API. + * + *

    Default Display Names

    + * + *

    The default display name is the simple name of the class. + * + * @since 1.8 + * @see SuiteDisplayName + */ +final class SuiteTestDescriptor extends AbstractTestDescriptor { + + static final String SEGMENT_TYPE = "suite"; + + private final SuiteLauncherDiscoveryRequestBuilder discoveryRequestBuilder = request(); + + private LauncherDiscoveryResult launcherDiscoveryResult; + private SuiteLauncher launcher; + + SuiteTestDescriptor(UniqueId id, Class suiteClass) { + super(requireNoCycles(id), getSuiteDisplayName(suiteClass), ClassSource.from(suiteClass)); + } + + private static UniqueId requireNoCycles(UniqueId id) { + // @formatter:off + boolean containsCycle = id.getSegments().stream() + .filter(segment -> SuiteTestDescriptor.SEGMENT_TYPE.equals(segment.getType())) + .map(Segment::getValue) + .collect(groupingBy(identity(), counting())) + .values() + .stream() + .anyMatch(count -> count > 1); + // @formatter:on + Supplier message = () -> String.format( + "Configuration error: The suite configuration may not contain a cycle [%s]", id); + Preconditions.condition(!containsCycle, message); + return id; + } + + SuiteTestDescriptor addDiscoveryRequestFrom(Class suiteClass) { + Preconditions.condition(launcherDiscoveryResult == null, + "discovery request can not be modified after discovery"); + discoveryRequestBuilder.suite(suiteClass); + return this; + } + + SuiteTestDescriptor addDiscoveryRequestFrom(UniqueId uniqueId) { + Preconditions.condition(launcherDiscoveryResult == null, + "discovery request can not be modified after discovery"); + discoveryRequestBuilder.selectors(DiscoverySelectors.selectUniqueId(uniqueId)); + return this; + } + + void discover() { + if (launcherDiscoveryResult != null) { + return; + } + + // @formatter:off + LauncherDiscoveryRequest request = discoveryRequestBuilder + .filterStandardClassNamePatterns(true) + .build(); + // @formatter:on + this.launcher = SuiteLauncher.create(); + this.launcherDiscoveryResult = launcher.discover(request, getUniqueId()); + // @formatter:off + launcherDiscoveryResult.getTestEngines() + .stream() + .map(testEngine -> launcherDiscoveryResult.getEngineTestDescriptor(testEngine)) + .forEach(this::addChild); + // @formatter:on + } + + @Override + public Type getType() { + return Type.CONTAINER; + } + + private static String getSuiteDisplayName(Class testClass) { + // @formatter:off + return AnnotationUtils.findAnnotation(testClass, SuiteDisplayName.class) + .map(SuiteDisplayName::value) + .filter(StringUtils::isNotBlank) + .orElse(testClass.getSimpleName()); + // @formatter:on + } + + void execute(EngineExecutionListener listener) { + listener.executionStarted(this); + launcher.execute(launcherDiscoveryResult, listener); + listener.executionFinished(this, TestExecutionResult.successful()); + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestEngine.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestEngine.java new file mode 100644 index 000000000000..f608b9737a6c --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/SuiteTestEngine.java @@ -0,0 +1,78 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import static org.apiguardian.api.API.Status.INTERNAL; + +import java.util.Optional; + +import org.apiguardian.api.API; +import org.junit.platform.engine.EngineDiscoveryRequest; +import org.junit.platform.engine.EngineExecutionListener; +import org.junit.platform.engine.ExecutionRequest; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.TestEngine; +import org.junit.platform.engine.TestExecutionResult; +import org.junit.platform.engine.UniqueId; + +/** + * The JUnit Platform Suite {@link org.junit.platform.engine.TestEngine TestEngine}. + * + * @since 5.8 + */ +@API(status = INTERNAL, since = "5.8") +public final class SuiteTestEngine implements TestEngine { + + @Override + public String getId() { + return SuiteEngineDescriptor.ENGINE_ID; + } + + /** + * Returns {@code org.junit.platform} as the group ID. + */ + @Override + public Optional getGroupId() { + return Optional.of("org.junit.platform"); + } + + /** + * Returns {@code junit-platform-suite-engine} as the artifact ID. + */ + @Override + public Optional getArtifactId() { + return Optional.of("junit-platform-suite-engine"); + } + + @Override + public TestDescriptor discover(EngineDiscoveryRequest discoveryRequest, UniqueId uniqueId) { + SuiteEngineDescriptor engineDescriptor = new SuiteEngineDescriptor(uniqueId); + new DiscoverySelectorResolver().resolveSelectors(discoveryRequest, engineDescriptor); + return engineDescriptor; + } + + @Override + public void execute(ExecutionRequest request) { + SuiteEngineDescriptor suiteEngineDescriptor = (SuiteEngineDescriptor) request.getRootTestDescriptor(); + EngineExecutionListener engineExecutionListener = request.getEngineExecutionListener(); + + engineExecutionListener.executionStarted(suiteEngineDescriptor); + + // @formatter:off + suiteEngineDescriptor.getChildren() + .stream() + .map(SuiteTestDescriptor.class::cast) + .forEach(suiteTestDescriptor -> suiteTestDescriptor.execute(engineExecutionListener)); + // @formatter:on + engineExecutionListener.executionFinished(suiteEngineDescriptor, TestExecutionResult.successful()); + } + +} diff --git a/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/package-info.java b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/package-info.java new file mode 100644 index 000000000000..fa4237d3cec4 --- /dev/null +++ b/junit-platform-suite-engine/src/main/java/org/junit/platform/suite/engine/package-info.java @@ -0,0 +1,5 @@ +/** + * Core package for the JUnit Platform Suite test engine. + */ + +package org.junit.platform.suite.engine; diff --git a/junit-platform-suite-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine b/junit-platform-suite-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine new file mode 100644 index 000000000000..5832d4fc4620 --- /dev/null +++ b/junit-platform-suite-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine @@ -0,0 +1 @@ +org.junit.platform.suite.engine.SuiteTestEngine diff --git a/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java b/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java new file mode 100644 index 000000000000..79f6fe1c45e6 --- /dev/null +++ b/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +module org.junit.platform.suite.engine { + requires org.apiguardian.api; + requires org.junit.platform.suite.api; + requires org.junit.platform.suite.commons; + requires org.junit.platform.commons; + requires org.junit.platform.engine; + requires org.junit.platform.launcher; + + provides org.junit.platform.engine.TestEngine + with org.junit.platform.suite.engine.SuiteTestEngine; +} diff --git a/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java b/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java new file mode 100644 index 000000000000..9e0720660c39 --- /dev/null +++ b/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java @@ -0,0 +1,276 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectUniqueId; +import static org.junit.platform.suite.engine.SuiteEngineDescriptor.ENGINE_ID; +import static org.junit.platform.testkit.engine.EventConditions.container; +import static org.junit.platform.testkit.engine.EventConditions.displayName; +import static org.junit.platform.testkit.engine.EventConditions.event; +import static org.junit.platform.testkit.engine.EventConditions.finishedSuccessfully; +import static org.junit.platform.testkit.engine.EventConditions.test; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.engine.descriptor.ClassTestDescriptor; +import org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor; +import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor; +import org.junit.platform.engine.FilterResult; +import org.junit.platform.engine.UniqueId; +import org.junit.platform.engine.support.descriptor.MethodSource; +import org.junit.platform.launcher.PostDiscoveryFilter; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.engine.testcases.DynamicTest; +import org.junit.platform.suite.engine.testcases.MultipleTest; +import org.junit.platform.suite.engine.testcases.SimpleTest; +import org.junit.platform.suite.engine.testsuites.AbstractSuite; +import org.junit.platform.suite.engine.testsuites.DynamicSuite; +import org.junit.platform.suite.engine.testsuites.MultipleSuite; +import org.junit.platform.suite.engine.testsuites.NestedSuite; +import org.junit.platform.suite.engine.testsuites.SelectClassesSuite; +import org.junit.platform.suite.engine.testsuites.SuiteDisplayNameSuite; +import org.junit.platform.suite.engine.testsuites.SuiteSuite; +import org.junit.platform.testkit.engine.EngineTestKit; + +class SuiteEngineTest { + + @Test + void selectClasses() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(SelectClassesSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(1, event(test(SelectClassesSuite.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(SimpleTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void suiteDisplayName() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(SuiteDisplayNameSuite.class)) + .execute() + .allEvents() + .assertThatEvents() + .haveExactly(1, event(container(displayName("Suite Display Name")), finishedSuccessfully())); + // @formatter:on + } + + @Test + void abstractSuiteIsNotExecuted() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(AbstractSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .isEmpty(); + // @formatter:on + } + + @Test + void privateSuiteIsNotExecuted() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(PrivateSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .isEmpty(); + // @formatter:on + } + + @Suite + @SelectClasses(SimpleTest.class) + private static class PrivateSuite { + + } + + @Test + void innerSuiteIsNotExecuted() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(InnerSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .isEmpty(); + // @formatter:on + } + + @SuppressWarnings("InnerClassMayBeStatic") + @Suite + @SelectClasses(SimpleTest.class) + private class InnerSuite { + + } + + @Test + void nestedSuiteIsNotExecuted() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(NestedSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .isEmpty(); + // @formatter:on + } + + @Test + void dynamicSuite() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(DynamicSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(2, event(test(DynamicTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void suiteSuite() { + // @formatter:off + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(SuiteSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(1, event(test(SuiteSuite.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(SelectClassesSuite.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(SimpleTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void selectClassesByUniqueId() { + // @formatter:off + UniqueId uniqId = UniqueId.forEngine(ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, SelectClassesSuite.class.getName()); + EngineTestKit.engine(ENGINE_ID) + .selectors(selectUniqueId(uniqId)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(1, event(test(SelectClassesSuite.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(SimpleTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void selectMethodInTestPlanByUniqueId() { + // @formatter:off + UniqueId uniqueId = UniqueId.forEngine(ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, MultipleSuite.class.getName()) + .append("engine", JupiterEngineDescriptor.ENGINE_ID) + .append(ClassTestDescriptor.SEGMENT_TYPE, MultipleTest.class.getName()) + .append(TestMethodTestDescriptor.SEGMENT_TYPE, "test()"); + + EngineTestKit.engine(ENGINE_ID) + .selectors(selectUniqueId(uniqueId)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(1, event(test(MultipleSuite.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(MultipleTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void selectSuiteByUniqueId() { + // @formatter:off + UniqueId uniqueId = UniqueId.forEngine(ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, MultipleSuite.class.getName()); + + EngineTestKit.engine(ENGINE_ID) + .selectors(selectUniqueId(uniqueId)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(2, event(test(MultipleSuite.class.getName()), finishedSuccessfully())) + .haveExactly(2, event(test(MultipleTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void selectMethodAndSuiteInTestPlanByUniqueId() { + // @formatter:off + UniqueId uniqueId = UniqueId.forEngine(ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, MultipleSuite.class.getName()) + .append("engine", JupiterEngineDescriptor.ENGINE_ID) + .append(ClassTestDescriptor.SEGMENT_TYPE, MultipleTest.class.getName()) + .append(TestMethodTestDescriptor.SEGMENT_TYPE, "test()"); + + EngineTestKit.engine(ENGINE_ID) + .selectors(selectUniqueId(uniqueId)) + .selectors(selectClass(SelectClassesSuite.class)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(1, event(test(SelectClassesSuite.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(SimpleTest.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(MultipleSuite.class.getName()), finishedSuccessfully())) + .haveExactly(1, event(test(MultipleTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void selectMethodsInTestPlanByUniqueId() { + // @formatter:off + UniqueId uniqueId = UniqueId.forEngine(ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, MultipleSuite.class.getName()) + .append("engine", JupiterEngineDescriptor.ENGINE_ID) + .append(ClassTestDescriptor.SEGMENT_TYPE, MultipleTest.class.getName()) + .append(TestMethodTestDescriptor.SEGMENT_TYPE, "test()"); + + UniqueId uniqueId2 = UniqueId.forEngine(ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, MultipleSuite.class.getName()) + .append("engine", JupiterEngineDescriptor.ENGINE_ID) + .append(ClassTestDescriptor.SEGMENT_TYPE, MultipleTest.class.getName()) + .append(TestMethodTestDescriptor.SEGMENT_TYPE, "test2()"); + + EngineTestKit.engine(ENGINE_ID) + .selectors(selectUniqueId(uniqueId)) + .selectors(selectUniqueId(uniqueId2)) + .execute() + .testEvents() + .assertThatEvents() + .haveExactly(2, event(test(MultipleSuite.class.getName()), finishedSuccessfully())) + .haveExactly(2, event(test(MultipleTest.class.getName()), finishedSuccessfully())); + // @formatter:on + } + + @Test + void postDiscoveryCanRemoveTestDescriptorsInSuite() { + // @formatter:off + PostDiscoveryFilter postDiscoveryFilter = testDescriptor -> testDescriptor.getSource() + .filter(MethodSource.class::isInstance) + .map(MethodSource.class::cast) + .filter(classSource -> SimpleTest.class.equals(classSource.getJavaClass())) + .map(classSource -> FilterResult.excluded("Was a test in SimpleTest")) + .orElseGet(() -> FilterResult.included("Was not a test in SimpleTest")); + + EngineTestKit.engine(ENGINE_ID) + .selectors(selectClass(SelectClassesSuite.class)) + .filters(postDiscoveryFilter) + .execute() + .testEvents() + .assertThatEvents() + .isEmpty(); + // @formatter:on + } + +} diff --git a/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java b/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java new file mode 100644 index 000000000000..5281cacc7047 --- /dev/null +++ b/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java @@ -0,0 +1,96 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine; + +import static java.util.Collections.emptySet; +import static java.util.stream.Collectors.toSet; +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.Set; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.engine.descriptor.ClassTestDescriptor; +import org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor; +import org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor; +import org.junit.platform.commons.JUnitException; +import org.junit.platform.commons.PreconditionViolationException; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.UniqueId; +import org.junit.platform.suite.engine.testcases.SimpleTest; +import org.junit.platform.suite.engine.testsuites.CyclicSuite; +import org.junit.platform.suite.engine.testsuites.SelectClassesSuite; + +class SuiteTestDescriptorTest { + + UniqueId engineId = UniqueId.forEngine(SuiteEngineDescriptor.ENGINE_ID); + UniqueId suiteId = engineId.append(SuiteTestDescriptor.SEGMENT_TYPE, "test"); + UniqueId jupiterEngineId = suiteId.append("engine", JupiterEngineDescriptor.ENGINE_ID); + UniqueId testClassId = jupiterEngineId.append(ClassTestDescriptor.SEGMENT_TYPE, SimpleTest.class.getName()); + UniqueId methodId = testClassId.append(TestMethodTestDescriptor.SEGMENT_TYPE, "test()"); + + SuiteTestDescriptor suite = new SuiteTestDescriptor(suiteId, Object.class); + + @Test + void suiteIsEmptyBeforeDiscovery() { + suite.addDiscoveryRequestFrom(SelectClassesSuite.class); + assertEquals(emptySet(), suite.getChildren()); + } + + @Test + void suitDiscoversTestsFromClass() { + suite.addDiscoveryRequestFrom(SelectClassesSuite.class); + suite.discover(); + assertEquals(Set.of(jupiterEngineId, testClassId, methodId), + suite.getDescendants().stream().map(TestDescriptor::getUniqueId).collect(toSet())); + } + + @Test + void suitDiscoversTestsFromUniqueId() { + suite.addDiscoveryRequestFrom(methodId); + suite.discover(); + assertEquals(Set.of(jupiterEngineId, testClassId, methodId), + suite.getDescendants().stream().map(TestDescriptor::getUniqueId).collect(toSet())); + } + + @Test + void discoveryPlanCanNotBeModifiedAfterDiscovery() { + suite.addDiscoveryRequestFrom(SelectClassesSuite.class); + suite.discover(); + assertAll(() -> { + PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + () -> suite.addDiscoveryRequestFrom(SelectClassesSuite.class)); + assertEquals("discovery request can not be modified after discovery", exception.getMessage()); + + }, () -> { + PreconditionViolationException exception = assertThrows(PreconditionViolationException.class, + () -> suite.addDiscoveryRequestFrom(methodId)); + assertEquals("discovery request can not be modified after discovery", exception.getMessage()); + }); + } + + @Test + void suitesMayNotContainACycle() { + // @formatter:off + UniqueId expectedCycle = suiteId + .append("engine", SuiteEngineDescriptor.ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, CyclicSuite.class.getName()) + .append("engine", SuiteEngineDescriptor.ENGINE_ID) + .append(SuiteTestDescriptor.SEGMENT_TYPE, CyclicSuite.class.getName()); + // @formatter:on + suite.addDiscoveryRequestFrom(CyclicSuite.class); + JUnitException exception = assertThrows(JUnitException.class, suite::discover); + assertEquals("Configuration error: The suite configuration may not contain a cycle [" + expectedCycle + "]", + exception.getCause().getCause().getCause().getMessage()); + } + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/DynamicTest.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/DynamicTest.java new file mode 100644 index 000000000000..5d7220ab7dd6 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/DynamicTest.java @@ -0,0 +1,30 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testcases; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.Arrays; +import java.util.Collection; + +import org.junit.jupiter.api.TestFactory; + +public class DynamicTest { + + @TestFactory + Collection dynamicTestsWithCollection() { + return Arrays.asList( + org.junit.jupiter.api.DynamicTest.dynamicTest("Add test", () -> assertEquals(2, Math.addExact(1, 1))), + org.junit.jupiter.api.DynamicTest.dynamicTest("Multiply Test", + () -> assertEquals(4, Math.multiplyExact(2, 2)))); + } + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/MultipleTest.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/MultipleTest.java new file mode 100644 index 000000000000..1ce75302e7c2 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/MultipleTest.java @@ -0,0 +1,26 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testcases; + +import org.junit.jupiter.api.Test; + +public class MultipleTest { + + @Test + void test() { + + } + + @Test + void test2() { + + } +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/SimpleTest.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/SimpleTest.java new file mode 100644 index 000000000000..bc8eb9dcc628 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/SimpleTest.java @@ -0,0 +1,21 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testcases; + +import org.junit.jupiter.api.Test; + +public class SimpleTest { + + @Test + void test() { + + } +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java new file mode 100644 index 000000000000..7862260ac52a --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java @@ -0,0 +1,21 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.engine.testcases.SimpleTest; + +@Suite +@SelectClasses(SimpleTest.class) +public abstract class AbstractSuite { + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java new file mode 100644 index 000000000000..3871f8bee0a4 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java @@ -0,0 +1,22 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeClassNamePatterns(".*") +@SelectClasses(CyclicSuite.class) +public class CyclicSuite { + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java new file mode 100644 index 000000000000..fd1aa14bdd78 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java @@ -0,0 +1,20 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.SelectPackages; +import org.junit.platform.suite.api.Suite; + +@Suite +@SelectPackages("org.junit.platform.suite.engine.testcases") +public class DynamicSuite { + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java new file mode 100644 index 000000000000..c0b7e5324d7f --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java @@ -0,0 +1,21 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.engine.testcases.MultipleTest; + +@Suite +@SelectClasses(MultipleTest.class) +public class MultipleSuite { + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java new file mode 100644 index 000000000000..fccc7923d534 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java @@ -0,0 +1,32 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.engine.testcases.MultipleTest; +import org.junit.platform.suite.engine.testcases.SimpleTest; + +public class NestedSuite { + + @Suite + @SelectClasses(SimpleTest.class) + static public class Jupiter { + + } + + @Suite + @SelectClasses(MultipleTest.class) + static public class Tagged { + + } + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java new file mode 100644 index 000000000000..cc4efeec05a3 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java @@ -0,0 +1,21 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.engine.testcases.SimpleTest; + +@Suite +@SelectClasses(SimpleTest.class) +public class SelectClassesSuite { + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java new file mode 100644 index 000000000000..102bedec99ad --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java @@ -0,0 +1,23 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; +import org.junit.platform.suite.api.SuiteDisplayName; +import org.junit.platform.suite.engine.testcases.SimpleTest; + +@Suite +@SelectClasses(SimpleTest.class) +@SuiteDisplayName("Suite Display Name") +public class SuiteDisplayNameSuite { + +} diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java new file mode 100644 index 000000000000..6a46a6a73de8 --- /dev/null +++ b/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java @@ -0,0 +1,22 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.suite.engine.testsuites; + +import org.junit.platform.suite.api.IncludeClassNamePatterns; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeClassNamePatterns(".*") +@SelectClasses(SelectClassesSuite.class) +public class SuiteSuite { + +} diff --git a/junit-platform-suite/junit-platform-suite.gradle.kts b/junit-platform-suite/junit-platform-suite.gradle.kts new file mode 100644 index 000000000000..e9ff61917051 --- /dev/null +++ b/junit-platform-suite/junit-platform-suite.gradle.kts @@ -0,0 +1,13 @@ +plugins { + `java-library-conventions` +} + +description = "JUnit Platform Suite (Aggregator)" + +dependencies { + internal(platform(project(":dependencies"))) + + api(platform(project(":junit-bom"))) + api(project(":junit-platform-suite-api")) + implementation(project(":junit-platform-suite-engine")) +} diff --git a/junit-platform-suite/src/module/org.junit.platform.suite/module-info.java b/junit-platform-suite/src/module/org.junit.platform.suite/module-info.java new file mode 100644 index 000000000000..74a575d71c5e --- /dev/null +++ b/junit-platform-suite/src/module/org.junit.platform.suite/module-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2015-2020 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +/** + * Aggregates all JUnit Platform Suite modules. + * + * @since 1.8 + */ +module org.junit.platform.suite { + requires transitive org.junit.platform.suite.api; + requires transitive org.junit.platform.suite.engine; +} diff --git a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java index f3a01a506da3..9f31532958f7 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/UniqueIdTests.java @@ -36,6 +36,7 @@ class UniqueIdTests { private static final String ENGINE_ID = "junit-jupiter"; + private static final String SUITE_ENGINE_ID = "junit-platform-suite"; @Nested class Creation { @@ -48,6 +49,13 @@ void uniqueIdCanBeCreatedFromEngineId() { assertSegment(uniqueId.getSegments().get(0), "engine", "junit-jupiter"); } + @Test + void engineIdCanBeAppended() { + var suiteEngineId = UniqueId.forEngine(SUITE_ENGINE_ID); + var uniqueId = suiteEngineId.appendEngine(ENGINE_ID); + assertSegment(uniqueId.getSegments().get(1), "engine", "junit-jupiter"); + } + @Test void retrievingOptionalEngineId() { var uniqueIdWithEngine = UniqueId.forEngine(ENGINE_ID); diff --git a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java index cb4665600b52..edcd0546e5ed 100644 --- a/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java +++ b/platform-tests/src/test/java/org/junit/platform/runner/JUnitPlatformRunnerTests.java @@ -269,13 +269,13 @@ class TestCase { var filters = request.getEngineFilters(); assertThat(filters).hasSize(2); - var includeFilter = filters.get(0); + var includeFilter = filters.get(1); assertTrue(includeFilter.apply(fooEngine).included()); assertTrue(includeFilter.apply(barEngine).included()); assertTrue(includeFilter.apply(bazEngine).included()); assertTrue(includeFilter.apply(quuxEngine).excluded()); - var excludeFilter = filters.get(1); + var excludeFilter = filters.get(0); assertTrue(excludeFilter.apply(fooEngine).included()); assertTrue(excludeFilter.apply(barEngine).excluded()); assertTrue(excludeFilter.apply(bazEngine).included()); diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt index 6633c600100d..ad6e2c7c66d4 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt @@ -7,5 +7,5 @@ requires java.base mandated requires java.logging requires java.management requires org.apiguardian.api transitive -qualified exports org.junit.platform.commons.logging to org.junit.jupiter.api org.junit.jupiter.engine org.junit.jupiter.migrationsupport org.junit.jupiter.params org.junit.platform.console org.junit.platform.engine org.junit.platform.launcher org.junit.platform.reporting org.junit.platform.runner org.junit.platform.suite.api org.junit.platform.testkit org.junit.vintage.engine -qualified exports org.junit.platform.commons.util to org.junit.jupiter.api org.junit.jupiter.engine org.junit.jupiter.migrationsupport org.junit.jupiter.params org.junit.platform.console org.junit.platform.engine org.junit.platform.launcher org.junit.platform.reporting org.junit.platform.runner org.junit.platform.suite.api org.junit.platform.testkit org.junit.vintage.engine \ No newline at end of file +qualified exports org.junit.platform.commons.logging to org.junit.jupiter.api org.junit.jupiter.engine org.junit.jupiter.migrationsupport org.junit.jupiter.params org.junit.platform.console org.junit.platform.engine org.junit.platform.launcher org.junit.platform.reporting org.junit.platform.runner org.junit.platform.suite.api org.junit.platform.suite.engine org.junit.platform.testkit org.junit.vintage.engine +qualified exports org.junit.platform.commons.util to org.junit.jupiter.api org.junit.jupiter.engine org.junit.jupiter.migrationsupport org.junit.jupiter.params org.junit.platform.console org.junit.platform.engine org.junit.platform.launcher org.junit.platform.reporting org.junit.platform.runner org.junit.platform.suite.api org.junit.platform.suite.commons org.junit.platform.suite.engine org.junit.platform.testkit org.junit.vintage.engine diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt index 8ebeee20a3dd..e7ec0686461e 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt @@ -4,4 +4,5 @@ requires java.base mandated requires junit transitive requires org.apiguardian.api transitive requires org.junit.platform.launcher transitive -requires org.junit.platform.suite.api transitive \ No newline at end of file +requires org.junit.platform.suite.api transitive +requires org.junit.platform.suite.commons diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt index cf4f7fdcad33..89ec3ed1b94d 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt @@ -2,3 +2,4 @@ org.junit.platform.suite.api@${platformVersion} jar:file:.+junit-platform-suite- exports org.junit.platform.suite.api requires java.base mandated requires org.apiguardian.api transitive +requires org.junit.platform.commons transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt new file mode 100644 index 000000000000..88011288252d --- /dev/null +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt @@ -0,0 +1,8 @@ +org.junit.platform.suite.commons@${platformVersion} jar:file:.+junit-platform-suite-commons/build/libs/junit-platform-suite-commons-${platformVersion}.jar..module-info.class +requires java.base mandated +requires org.apiguardian.api transitive +requires org.junit.platform.commons +requires org.junit.platform.engine +requires org.junit.platform.launcher transitive +requires org.junit.platform.suite.api +qualified exports org.junit.platform.suite.commons to org.junit.platform.runner org.junit.platform.suite.engine diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt new file mode 100644 index 000000000000..f3ca8fbc91f5 --- /dev/null +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt @@ -0,0 +1,10 @@ +org.junit.platform.suite.engine@${platformVersion} jar:file:.+junit-platform-suite-engine/build/libs/junit-platform-suite-engine-${platformVersion}.jar..module-info.class +requires java.base mandated +requires org.apiguardian.api +requires org.junit.platform.commons +requires org.junit.platform.engine +requires org.junit.platform.launcher +requires org.junit.platform.suite.api +requires org.junit.platform.suite.commons +provides org.junit.platform.engine.TestEngine with org.junit.platform.suite.engine.SuiteTestEngine +contains org.junit.platform.suite.engine diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt new file mode 100644 index 000000000000..c70a146e3c3f --- /dev/null +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt @@ -0,0 +1,4 @@ +org.junit.platform.suite@${platformVersion} jar:file:.+junit-platform-suite/build/libs/junit-platform-suite-${platformVersion}.jar..module-info.class +requires java.base mandated +requires org.junit.platform.suite.api transitive +requires org.junit.platform.suite.engine transitive diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java index 816504c33e11..2895a7bbbf85 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/HelperTests.java @@ -41,7 +41,10 @@ void loadModuleDirectoryNames() { "junit-platform-launcher", // "junit-platform-reporting", // "junit-platform-runner", // + "junit-platform-suite", // "junit-platform-suite-api", // + "junit-platform-suite-commons", // + "junit-platform-suite-engine", // "junit-platform-testkit", // "junit-vintage-engine"// ), Helper.loadModuleDirectoryNames()); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java index e5affb4b7588..7fa8a022bfdb 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java @@ -105,7 +105,7 @@ private static List compileModules(Path temp, Writer out, Writer err, Fu .map(base::resolve) // .map(Project::new) // .collect(Collectors.toList()); - assertEquals(15, projects.size()); + assertEquals(18, projects.size()); args.add("--module-source-path"); args.add(projects.stream() // diff --git a/settings.gradle.kts b/settings.gradle.kts index 0f3cc86dbbfd..f8d7de5104dd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -97,7 +97,10 @@ include("junit-platform-jfr") include("junit-platform-launcher") include("junit-platform-reporting") include("junit-platform-runner") +include("junit-platform-suite") include("junit-platform-suite-api") +include("junit-platform-suite-commons") +include("junit-platform-suite-engine") include("junit-platform-testkit") include("junit-vintage-engine") include("platform-tests") diff --git a/src/publishDocumentationSnapshotOnlyIfNecessary.sh b/src/publishDocumentationSnapshotOnlyIfNecessary.sh index 14372c100b91..c4ed2762ebf0 100755 --- a/src/publishDocumentationSnapshotOnlyIfNecessary.sh +++ b/src/publishDocumentationSnapshotOnlyIfNecessary.sh @@ -26,7 +26,10 @@ md5sum $(find junit-platform-engine -wholename '**/src/main/*.java') >> "${curre md5sum $(find junit-platform-launcher -wholename '**/src/main/*.java') >> "${current}" md5sum $(find junit-platform-reporting -wholename '**/src/main/*.java') >> "${current}" md5sum $(find junit-platform-runner -wholename '**/src/main/*.java') >> "${current}" +md5sum $(find junit-platform-suite -wholename '**/src/main/*.java') >> "${current}" md5sum $(find junit-platform-suite-api -wholename '**/src/main/*.java') >> "${current}" +md5sum $(find junit-platform-suite-commons -wholename '**/src/main/*.java') >> "${current}" +md5sum $(find junit-platform-suite-engine -wholename '**/src/main/*.java') >> "${current}" md5sum $(find junit-platform-testkit -wholename '**/src/main/*.java') >> "${current}" md5sum $(find junit-vintage-engine -wholename '**/src/main/*.java') >> "${current}" # skip module platform-tests because it doesn't contain relevant documentation From e884aa6acbc06d984fab3ecd715314711072424f Mon Sep 17 00:00:00 2001 From: Juliette de Rancourt Date: Tue, 9 Feb 2021 21:58:41 +0100 Subject: [PATCH 0204/1433] =?UTF-8?q?Support=20named=20sources=20for=20Dyn?= =?UTF-8?q?amicTest.stream(=E2=80=A6)=20(#2548)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduction of `DynamicTest.stream(Iterator>, ThrowingConsumer)` and `DynamicTest.stream(Stream>, ThrowingConsumer)`. Both methods use each name-value pair provided by the first parameter as the display name and value for each generated dynamic test. Resolves #2375. --- .../release-notes/release-notes-5.8.0-M1.adoc | 4 ++ .../test/java/example/DynamicTestsDemo.java | 18 +++++ .../org/junit/jupiter/api/DynamicTest.java | 71 +++++++++++++++++++ .../junit/jupiter/api/DynamicTestTests.java | 35 +++++++++ 4 files changed, 128 insertions(+) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index d9be75d3f793..cf5dcc022ecc 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -88,6 +88,10 @@ on GitHub. * In parameterized tests with `@MethodSource` or `@ArgumentSource`, arguments can now have optional names. When the argument is included in the display name of an iteration, this name will be used instead of the value. +* `DynamicTests.stream()` can now consume `Named` input and will use each name-value + pair as the display name and value for each generated dynamic test (see + <<../user-guide/index.adoc#writing-tests-dynamic-tests-examples,User Guide>> for details). + [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage diff --git a/documentation/src/test/java/example/DynamicTestsDemo.java b/documentation/src/test/java/example/DynamicTestsDemo.java index 34360741f672..f93a60aef728 100644 --- a/documentation/src/test/java/example/DynamicTestsDemo.java +++ b/documentation/src/test/java/example/DynamicTestsDemo.java @@ -33,6 +33,7 @@ import org.junit.jupiter.api.DynamicNode; import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.Named; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.TestFactory; import org.junit.jupiter.api.function.ThrowingConsumer; @@ -151,6 +152,23 @@ Stream dynamicTestsFromStreamFactoryMethod() { return DynamicTest.stream(inputStream, displayNameGenerator, testExecutor); } + @TestFactory + Stream dynamicTestsFromStreamFactoryMethodWithNames() { + // Stream of palindromes to check + Stream> inputStream = Stream.of( + Named.of("racecar is a palindrome", "racecar"), + Named.of("radar is also a palindrome", "radar"), + Named.of("mom also seems to be a palindrome", "mom"), + Named.of("dad is yet another palindrome", "dad") + ); + + // Executes tests based on the current input value. + ThrowingConsumer testExecutor = text -> assertTrue(isPalindrome(text)); + + // Returns a stream of dynamic tests. + return DynamicTest.stream(inputStream, testExecutor); + } + @TestFactory Stream dynamicTestsWithContainers() { return Stream.of("A", "B", "C") diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java index 23b380df07c5..de0e03cfe88e 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/DynamicTest.java @@ -155,6 +155,77 @@ public static Stream stream(Stream inputStream, .map(input -> dynamicTest(displayNameGenerator.apply(input), () -> testExecutor.accept(input))); } + /** + * Generate a stream of dynamic tests based on the given generator and test + * executor. + * + *

    Use this method when the set of dynamic tests is nondeterministic in + * nature or when the input comes from an existing {@link Iterator}. See + * {@link #stream(Stream, ThrowingConsumer)} as an alternative. + * + *

    The given {@code inputGenerator} is responsible for generating + * input values and display names. A {@link DynamicTest} will be added to + * the resulting stream for each dynamically generated input value, + * using the given {@code testExecutor}. + * + * @param inputGenerator an {@code Iterator} with {@code Named} values + * that serves as a dynamic input generator; never {@code null} + * @param testExecutor a consumer that executes a test based on an input + * value; never {@code null} + * @param the type of input generated by the {@code inputGenerator} + * and used by the {@code testExecutor} + * @return a stream of dynamic tests based on the given generator and + * executor; never {@code null} + * @since 5.8 + * + * @see #dynamicTest(String, Executable) + * @see #stream(Stream, ThrowingConsumer) + * @see Named + */ + @API(status = MAINTAINED, since = "5.8") + public static Stream stream(Iterator> inputGenerator, + ThrowingConsumer testExecutor) { + Preconditions.notNull(inputGenerator, "inputGenerator must not be null"); + + return stream(StreamSupport.stream(spliteratorUnknownSize(inputGenerator, ORDERED), false), testExecutor); + } + + /** + * Generate a stream of dynamic tests based on the given input stream and + * test executor. + * + *

    Use this method when the set of dynamic tests is nondeterministic in + * nature or when the input comes from an existing {@link Stream}. See + * {@link #stream(Iterator, ThrowingConsumer)} as an alternative. + * + *

    The given {@code inputStream} is responsible for supplying input values + * and display names. A {@link DynamicTest} will be added to the resulting stream for + * each dynamically supplied input value, using the given {@code testExecutor}. + * + * @param inputStream a {@code Stream} that supplies dynamic {@code Named} + * input values; never {@code null} + * @param testExecutor a consumer that executes a test based on an input + * value; never {@code null} + * @param the type of input supplied by the {@code inputStream} + * and used by the {@code displayNameGenerator} and {@code testExecutor} + * @return a stream of dynamic tests based on the given generator and + * executor; never {@code null} + * @since 5.8 + * + * @see #dynamicTest(String, Executable) + * @see #stream(Iterator, ThrowingConsumer) + * @see Named + */ + @API(status = MAINTAINED, since = "5.8") + public static Stream stream(Stream> inputStream, + ThrowingConsumer testExecutor) { + Preconditions.notNull(inputStream, "inputStream must not be null"); + Preconditions.notNull(testExecutor, "testExecutor must not be null"); + + return inputStream // + .map(input -> dynamicTest(input.getName(), () -> testExecutor.accept(input.getPayload()))); + } + private final Executable executable; private DynamicTest(String displayName, URI testSourceUri, Executable executable) { diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java index 5709868ad41b..7ea7c1e926fb 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/api/DynamicTestTests.java @@ -70,6 +70,26 @@ void streamFromIteratorPreconditions() { () -> DynamicTest.stream(emptyIterator(), displayNameGenerator, null)); } + @Test + void streamFromStreamWithNamesPreconditions() { + ThrowingConsumer testExecutor = input -> { + }; + + assertThrows(PreconditionViolationException.class, + () -> DynamicTest.stream((Stream>) null, testExecutor)); + assertThrows(PreconditionViolationException.class, () -> DynamicTest.stream(Stream.empty(), null)); + } + + @Test + void streamFromIteratorWithNamesPreconditions() { + ThrowingConsumer testExecutor = input -> { + }; + + assertThrows(PreconditionViolationException.class, + () -> DynamicTest.stream((Iterator>) null, testExecutor)); + assertThrows(PreconditionViolationException.class, () -> DynamicTest.stream(emptyIterator(), null)); + } + @Test void streamFromStream() throws Throwable { Stream stream = DynamicTest.stream(Stream.of("foo", "bar", "baz"), String::toUpperCase, @@ -84,6 +104,21 @@ void streamFromIterator() throws Throwable { assertStream(stream); } + @Test + void streamFromStreamWithNames() throws Throwable { + Stream stream = DynamicTest.stream( + Stream.of(Named.of("FOO", "foo"), Named.of("BAR", "bar"), Named.of("BAZ", "baz")), this::throwingConsumer); + assertStream(stream); + } + + @Test + void streamFromIteratorWithNames() throws Throwable { + Stream stream = DynamicTest.stream( + List.of(Named.of("FOO", "foo"), Named.of("BAR", "bar"), Named.of("BAZ", "baz")).iterator(), + this::throwingConsumer); + assertStream(stream); + } + private void assertStream(Stream stream) throws Throwable { List dynamicTests = stream.collect(Collectors.toList()); From ce82b18c93b06dc4e7419316432131c5a65cedd8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Feb 2021 12:09:12 +0100 Subject: [PATCH 0205/1433] Make SummaryGeneratingListener thread-safe (#2549) Prior to this commit, concurrently reported failures were stored in an unguarded `ArrayList` which caused a race condition that sometimes caused failures to get lost and hence not reported. Now the list of failures is wrapped in `synchronizedList` to make it thread-safe. Fixes #2546. Co-authored-by: Christian Stein --- .../release-notes/release-notes-5.8.0-M1.adoc | 3 +- .../junit-jupiter-engine.gradle.kts | 1 + .../execution/ExtensionValuesStoreTests.java | 34 +-------- .../junit-platform-commons.gradle.kts | 1 + .../commons/test/ConcurrencyTestingUtils.java | 69 +++++++++++++++++++ .../MutableTestExecutionSummary.java | 3 +- platform-tests/platform-tests.gradle.kts | 1 + .../listeners/SummaryGenerationTests.java | 23 +++++++ 8 files changed, 101 insertions(+), 34 deletions(-) create mode 100644 junit-platform-commons/src/testFixtures/java/org/junit/platform/commons/test/ConcurrencyTestingUtils.java diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index cf5dcc022ecc..46dcffd460d1 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -15,7 +15,8 @@ on GitHub. ==== Bug Fixes -* ❓ +* `SummaryGeneratingListener` is now thread-safe and can handle concurrently failing + tests. ==== Deprecations and Breaking Changes diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 9f739e03db44..9cb4fd434c14 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -17,6 +17,7 @@ dependencies { testImplementation(project(":junit-platform-launcher")) testImplementation(project(":junit-platform-runner")) testImplementation(project(":junit-platform-testkit")) + testImplementation(testFixtures(project(":junit-platform-commons"))) testImplementation("org.jetbrains.kotlin:kotlin-stdlib") testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") testImplementation("org.codehaus.groovy:groovy") diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java index 661f6087f86a..b804b6feba9a 100644 --- a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/ExtensionValuesStoreTests.java @@ -10,22 +10,16 @@ package org.junit.jupiter.engine.execution; -import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.platform.commons.test.ConcurrencyTestingUtils.executeConcurrently; -import java.util.ArrayList; import java.util.List; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; -import java.util.function.Supplier; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -300,7 +294,7 @@ void removeNullValueWithTypeSafety() { } @Test - void simulateRaceConditionInGetOrComputeIfAbsent() { + void simulateRaceConditionInGetOrComputeIfAbsent() throws Exception { int threads = 10; AtomicInteger counter = new AtomicInteger(); ExtensionValuesStore localStore = new ExtensionValuesStore(null); @@ -313,30 +307,6 @@ void simulateRaceConditionInGetOrComputeIfAbsent() { } } - private List executeConcurrently(int threads, Supplier supplier) { - ExecutorService executorService = Executors.newFixedThreadPool(threads); - try { - CountDownLatch latch = new CountDownLatch(threads); - List> futures = new ArrayList<>(); - for (int i = 0; i < threads; i++) { - futures.add(CompletableFuture.supplyAsync(() -> { - latch.countDown(); - try { - latch.await(); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - return supplier.get(); - }, executorService)); - } - return futures.stream().map(CompletableFuture::join).collect(toList()); - } - finally { - executorService.shutdown(); - } - } - @Nested class InheritedValuesTests { diff --git a/junit-platform-commons/junit-platform-commons.gradle.kts b/junit-platform-commons/junit-platform-commons.gradle.kts index c720729127d8..4fe02c95ee33 100644 --- a/junit-platform-commons/junit-platform-commons.gradle.kts +++ b/junit-platform-commons/junit-platform-commons.gradle.kts @@ -4,6 +4,7 @@ plugins { `java-library-conventions` `java-multi-release-sources` `java-repackage-jars` + `java-test-fixtures` } description = "JUnit Platform Commons" diff --git a/junit-platform-commons/src/testFixtures/java/org/junit/platform/commons/test/ConcurrencyTestingUtils.java b/junit-platform-commons/src/testFixtures/java/org/junit/platform/commons/test/ConcurrencyTestingUtils.java new file mode 100644 index 000000000000..62b235b5fca6 --- /dev/null +++ b/junit-platform-commons/src/testFixtures/java/org/junit/platform/commons/test/ConcurrencyTestingUtils.java @@ -0,0 +1,69 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.commons.test; + +import static java.util.concurrent.TimeUnit.SECONDS; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class ConcurrencyTestingUtils { + + public static void executeConcurrently(int threads, Runnable action) throws Exception { + executeConcurrently(threads, () -> { + action.run(); + return null; + }); + } + + public static List executeConcurrently(int threads, Callable action) throws Exception { + ExecutorService executorService = Executors.newFixedThreadPool(threads); + try { + CountDownLatch latch = new CountDownLatch(threads); + List> futures = new ArrayList<>(); + for (int i = 0; i < threads; i++) { + futures.add(CompletableFuture.supplyAsync(() -> { + try { + latch.countDown(); + latch.await(); + return action.call(); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new CompletionException(e); + } + catch (Exception e) { + throw new CompletionException("Action failed", e); + } + }, executorService)); + } + List list = new ArrayList<>(); + for (CompletableFuture future : futures) { + list.add(future.get(5, SECONDS)); + } + return list; + } + finally { + executorService.shutdownNow(); + var terminated = executorService.awaitTermination(5, SECONDS); + if (!terminated) { + //noinspection ThrowFromFinallyBlock + throw new AssertionError("ExecutorService did not cleanly shut down"); + } + } + } +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java index e1b5af2030fb..f9236ad91cae 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java @@ -11,6 +11,7 @@ package org.junit.platform.launcher.listeners; import static java.lang.String.join; +import static java.util.Collections.synchronizedList; import java.io.PrintWriter; import java.util.ArrayList; @@ -54,7 +55,7 @@ class MutableTestExecutionSummary implements TestExecutionSummary { final AtomicLong testsFailed = new AtomicLong(); private final TestPlan testPlan; - private final List failures = new ArrayList<>(); + private final List failures = synchronizedList(new ArrayList<>()); private final long timeStarted; long timeFinished; diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index c8d92f145b1f..babacf5a3439 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -18,6 +18,7 @@ dependencies { // --- Things we are testing with --------------------------------------------- testImplementation(project(":junit-platform-runner")) testImplementation(project(":junit-platform-testkit")) + testImplementation(testFixtures(project(":junit-platform-commons"))) testImplementation(testFixtures(project(":junit-platform-engine"))) testImplementation(testFixtures(project(":junit-platform-launcher"))) testImplementation(project(":junit-jupiter-engine")) diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java index 85fb04c13524..229e82f1f639 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/SummaryGenerationTests.java @@ -15,12 +15,14 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.platform.commons.test.ConcurrencyTestingUtils.executeConcurrently; import java.io.PrintWriter; import java.io.StringWriter; import java.util.List; import java.util.Optional; +import org.junit.jupiter.api.RepeatedTest; import org.junit.jupiter.api.Test; import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.TestSource; @@ -220,6 +222,27 @@ public Optional getSource() { ); } + @RepeatedTest(10) + void reportingConcurrentlyFinishedTests() throws Exception { + var numThreads = 250; + var testIdentifier = TestIdentifier.from(new TestDescriptorStub(UniqueId.root("root", "2"), "failingTest") { + @Override + public Optional getSource() { + return Optional.of(ClassSource.from(Object.class)); + } + }); + var result = TestExecutionResult.failed(new RuntimeException()); + + listener.testPlanExecutionStarted(testPlan); + executeConcurrently(numThreads, () -> { + listener.executionStarted(testIdentifier); + listener.executionFinished(testIdentifier, result); + }); + listener.testPlanExecutionFinished(testPlan); + + assertThat(listener.getSummary().getFailures()).hasSize(numThreads); + } + @SuppressWarnings("deprecation") private TestIdentifier createTestIdentifier(String uniqueId) { var identifier = TestIdentifier.from(new TestDescriptorStub(UniqueId.root("test", uniqueId), uniqueId)); From 0bdb0ff61647a43d7a864df898e3f534056a15b6 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Feb 2021 18:40:30 +0100 Subject: [PATCH 0206/1433] Prepare release notes for 5.8.0-M1 --- .../release-notes/release-notes-5.8.0-M1.adoc | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index 46dcffd460d1..e403990f5b80 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -1,9 +1,15 @@ [[release-notes-5.8.0-M1]] == 5.8.0-M1 -*Date of Release:* ❓ +*Date of Release:* February 11, 2021 -*Scope:* ❓ +*Scope:* + +* Declarative test suites +* Test class ordering +* `LauncherSession` and accompanying listener +* More fine-grained JFR events +* Memory and performance optimizations For a complete list of all _closed_ issues and pull requests for this release, consult the link:{junit5-repo}+/milestone/51?closed=1+[5.8 M1] milestone page in the JUnit repository @@ -50,13 +56,10 @@ on GitHub. Platform Launcher. * Added additional selectors to the `junit-platform-suite-api` + [[release-notes-5.8.0-M1-junit-jupiter]] === JUnit Jupiter -==== Bug Fixes - -* ❓ - ==== Deprecations and Breaking Changes * `InvocationInterceptor.interceptDynamicTest(Invocation, ExtensionContext)` has @@ -76,7 +79,6 @@ on GitHub. * `assertNull()` failure messages now include the actual object's type if the `toString()` implementation for the actual object returns `null` or `"null"`. This avoids the generation of confusing failure messages such as `expected but was `. - * Numeric literals used with `@CsvSource` or `CsvFileSource` can now be expressed using underscores as in some JVM languages, to improve readability of long numbers like `700_000_000`. @@ -97,14 +99,6 @@ on GitHub. [[release-notes-5.8.0-M1-junit-vintage]] === JUnit Vintage -==== Bug Fixes - -* ❓ - -==== Deprecations and Breaking Changes - -* ❓ - ==== New Features and Improvements * The JUnit Vintage engine now requires less memory and allows for earlier garbage From 9b7a0edcdb0eaca40b66e3fe35c96f73bbfb00b7 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 11 Feb 2021 18:54:08 +0100 Subject: [PATCH 0207/1433] Polish release notes for 5.8 M1 --- .../release-notes/release-notes-5.8.0-M1.adoc | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index e403990f5b80..bff82f016661 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -21,8 +21,7 @@ on GitHub. ==== Bug Fixes -* `SummaryGeneratingListener` is now thread-safe and can handle concurrently failing - tests. +* `SummaryGeneratingListener` is now thread-safe and can handle concurrently failing tests. ==== Deprecations and Breaking Changes @@ -45,16 +44,16 @@ on GitHub. * Documented constant value of `ExclusiveResource.GLOBAL_KEY`. * Instances of `TestIdentifier` and `UniqueId` now retain less memory because they no longer store `String` representations of unique IDs. -* Improved of `ExclusiveResource` handling: if a `Node` has only read locks and no - read-write locks, then descendants are not forced into `SAME_THREAD` execution and can - run concurrently. +* Improved `ExclusiveResource` handling: if a `Node` has only read locks and no read-write + locks, then descendants are not forced into `SAME_THREAD` execution and can run + concurrently. * Tools that make multiple calls to the `Launcher` API should now create a `LauncherSession` in order to allow for executing global setup and teardown code exactly once via the new `LauncherSessionListener` interface that can be registered via Java’s `{ServiceLoader}` mechanism. * New `junit-platform-suite-engine` to execute declarative test suites using the JUnit Platform Launcher. -* Added additional selectors to the `junit-platform-suite-api` +* Additional selectors in the suite API in the `junit-platform-suite-api` module. [[release-notes-5.8.0-M1-junit-jupiter]] @@ -70,8 +69,8 @@ on GitHub. ==== New Features and Improvements -* Top-level test classes can now be ordered by passing the fully-qualified name of a - class implementing `ClassOrderer` as the value of the new +* Top-level test classes can now be ordered by passing the fully-qualified name of a class + implementing `ClassOrderer` as the value of the new `junit.jupiter.testclass.order.default` configuration parameter. * New `assertInstanceOf()` methods which produce better error messages comparable to those produced by `assertThrows`. These new methods serve as a replacement for @@ -89,10 +88,10 @@ on GitHub. data structures. * Documented constant values in `org.junit.jupiter.api.parallel.Resources`. * In parameterized tests with `@MethodSource` or `@ArgumentSource`, arguments can now have - optional names. When the argument is included in the display name of an iteration, this - name will be used instead of the value. -* `DynamicTests.stream()` can now consume `Named` input and will use each name-value - pair as the display name and value for each generated dynamic test (see + optional names (supplied via the new `Named` API). When the argument is included in the + display name of an iteration, this name will be used instead of the value. +* `DynamicTests.stream()` can now consume `Named` input and will use each name-value pair + as the display name and value for each generated dynamic test (see <<../user-guide/index.adoc#writing-tests-dynamic-tests-examples,User Guide>> for details). From 375f55b5ac6063d546d9f9bc5d97a49a7bb91b9d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Feb 2021 19:56:28 +0100 Subject: [PATCH 0208/1433] Ensure platform-tests use junit-jupiter from current build --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 32c14b50524c..ef60d6f4539a 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -40,10 +40,7 @@ dependencies { } if (project.name != "junit-jupiter-engine") { - "testImplementation"(project(":junit-jupiter-api")) - "testImplementation"(project(":junit-jupiter-params")) - - "testRuntimeOnly"(project(":junit-jupiter-engine")) + "testImplementation"(project(":junit-jupiter")) } "testImplementation"(testFixtures(project(":junit-jupiter-api"))) From b38e3a309cb27eebe748263b3bef55bb065fca76 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Feb 2021 19:39:36 +0100 Subject: [PATCH 0209/1433] Release 5.8.0-M1 --- README.md | 2 +- gradle.properties | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c6b6e453af25..ec2a28a4db85 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This repository is the home of the next generation of JUnit, _JUnit 5_. ## Latest Releases - General Availability (GA): [JUnit 5.7.1](https://github.com/junit-team/junit5/releases/tag/r5.7.1) (February 4, 2021) -- Preview (Milestone/Release Candidate): n/a +- Preview (Milestone/Release Candidate): [JUnit 5.8.0-M1](https://github.com/junit-team/junit5/releases/tag/r5.8.0-M1) (February 11, 2021) ## Documentation diff --git a/gradle.properties b/gradle.properties index c7a69ac63ad5..c8478c73a009 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,13 @@ group = org.junit -version = 5.8.0-SNAPSHOT +version = 5.8.0-M1 jupiterGroup = org.junit.jupiter platformGroup = org.junit.platform -platformVersion = 1.8.0-SNAPSHOT +platformVersion = 1.8.0-M1 vintageGroup = org.junit.vintage -vintageVersion = 5.8.0-SNAPSHOT +vintageVersion = 5.8.0-M1 defaultBuiltBy = JUnit Team From 7d91d0ac73d2bde57f6a72db441d29407338f8e5 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Feb 2021 20:22:15 +0100 Subject: [PATCH 0210/1433] Fix docs --- documentation/src/docs/asciidoc/link-attributes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/docs/asciidoc/link-attributes.adoc b/documentation/src/docs/asciidoc/link-attributes.adoc index 987287be3d68..297c2bab8441 100644 --- a/documentation/src/docs/asciidoc/link-attributes.adoc +++ b/documentation/src/docs/asciidoc/link-attributes.adoc @@ -45,7 +45,7 @@ endif::[] :JUnitPlatform-Runner: {javadoc-root}/org.junit.platform.runnner/org/junit/platform/runner/JUnitPlatform.html[JUnitPlatform] // Platform Suite :suite-api-package: {javadoc-root}/org.junit.platform.suite.api/org/junit/platform/suite/api/package-summary.html[org.junit.platform.suite.api] -:junit-platform-suite-engine {javadoc-root}/org.junit.platform.suite.engine/org/junit/platform/suite/engine/package-summary.html[junit-platform-suite-engine] +:junit-platform-suite-engine: {javadoc-root}/org.junit.platform.suite.engine/org/junit/platform/suite/engine/package-summary.html[junit-platform-suite-engine] // Platform Test Kit :testkit-engine-package: {javadoc-root}/org.junit.platform.testkit/org/junit/platform/testkit/engine/package-summary.html[org.junit.platform.testkit.engine] :EngineExecutionResults: {javadoc-root}/org.junit.platform.testkit/org/junit/platform/testkit/engine/EngineExecutionResults.html[EngineExecutionResults] From 9bcbc5b8c39d7083175e470faca777759b9a64de Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Feb 2021 20:29:35 +0100 Subject: [PATCH 0211/1433] Back to snapshots for further development --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index c8478c73a009..c7a69ac63ad5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,13 @@ group = org.junit -version = 5.8.0-M1 +version = 5.8.0-SNAPSHOT jupiterGroup = org.junit.jupiter platformGroup = org.junit.platform -platformVersion = 1.8.0-M1 +platformVersion = 1.8.0-SNAPSHOT vintageGroup = org.junit.vintage -vintageVersion = 5.8.0-M1 +vintageVersion = 5.8.0-SNAPSHOT defaultBuiltBy = JUnit Team From d65aff05d1422ed8fb11ba166b301359724571c9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 13 Feb 2021 15:02:54 +0100 Subject: [PATCH 0212/1433] Resolve Gradle deprecation warnings Annotate `getName()` with `@Internal` --- .../main/kotlin/java-library-conventions.gradle.kts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 1d52ba465358..6b2e0625aba5 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -222,16 +222,21 @@ tasks.compileTestJava { } inner class ModulePathArgumentProvider : CommandLineArgumentProvider, Named { - @get:CompileClasspath val modulePath: Provider = configurations.compileClasspath + @get:CompileClasspath + val modulePath: Provider = configurations.compileClasspath override fun asArguments() = listOf("--module-path", modulePath.get().asPath) + @Internal override fun getName() = "module-path" } inner class PatchModuleArgumentProvider(it: Project) : CommandLineArgumentProvider, Named { - @get:Input val module: String = it.javaModuleName + @get:Input + val module: String = it.javaModuleName - @get:InputFiles @get:PathSensitive(RELATIVE) val patch: Provider = provider { + @get:InputFiles + @get:PathSensitive(RELATIVE) + val patch: Provider = provider { if (it == project) files(sourceSets.matching { it.name.startsWith("main") }.map { it.output }) else @@ -246,6 +251,7 @@ inner class PatchModuleArgumentProvider(it: Project) : CommandLineArgumentProvid return listOf("--patch-module", "$module=$path") } + @Internal override fun getName() = "patch-module($module)" } From b0c6e3623f0727cf5cd83538fe8e9eea759fa175 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 13 Feb 2021 15:50:02 +0100 Subject: [PATCH 0213/1433] Fix Javadoc stylesheet for JDK 15 Fixes #2513. --- .../src/javadoc/junit-stylesheet.css | 102 +++++++++++------- 1 file changed, 63 insertions(+), 39 deletions(-) diff --git a/documentation/src/javadoc/junit-stylesheet.css b/documentation/src/javadoc/junit-stylesheet.css index 4ad313bfeb8c..19fe4f0cee0a 100644 --- a/documentation/src/javadoc/junit-stylesheet.css +++ b/documentation/src/javadoc/junit-stylesheet.css @@ -36,96 +36,120 @@ pre, code, tt, dt code, table tr td dt code { background-color:#25a162; } -.topNav { +.top-nav { background-color:#25a162; } -.bottomNav { +.bottom-nav { background-color:#25a162; } -.subNav { +.sub-nav { background-color:#f5f5f5; } -.topNav a:hover, .bottomNav a:hover { +.top-nav a:hover, .bottom-nav a:hover { text-decoration:underline; color:inherit; } -.navBarCell1Rev { +.nav-bar-cell1-rev { background-color:#fff; color:#dc524a; border-radius: 6px; } -.indexNav { +.index-nav { background-color:#eee; } -div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { - background-color:#ddd; - border:1px solid #ddd; +body.class-declaration-page .summary h2, +body.class-declaration-page .details h2, +body.class-use-page h2, +body.module-declaration-page .block-list h2 { + font-style: italic; + padding:0; + margin:15px 0; } - -ul.blockList ul.blockList ul.blockList li.blockList h3 { +body.class-declaration-page .summary h3, +body.class-declaration-page .details h3, +body.class-declaration-page .summary .inherited-list h2, +div.details ul.block-list ul.block-list ul.block-list li.block-list h4, +ul.block-list ul.block-list ul.block-list li.block-list h3 { background-color:#ddd; border:1px solid #ddd; } -.constantsSummary caption a:link, .constantsSummary caption a:visited, -.useSummary caption a:link, .useSummary caption a:visited { +.constants-summary caption a:link, .constants-summary caption a:visited, +.use-summary caption a:link, .use-summary caption a:visited { color:#fff; } -.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, -.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, -.requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span, -.usesSummary caption span, -.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span, -.overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span, -.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, -.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd, -.requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd, -.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd, -.overviewSummary .activeTableTab .tabEnd, .typeSummary .activeTableTab .tabEnd { +.overview-summary caption span, .member-summary caption span, .type-summary caption span, +.use-summary caption span, .constants-summary caption span, .deprecated-summary caption span, +.requires-summary caption span, .packages-summary caption span, .provides-summary caption span, +.uses-summary caption span, +.member-summary caption span.active-table-tab span, .packages-summary caption span.active-table-tab span, +.overview-summary caption span.active-table-tab span, .type-summary caption span.active-table-tab span, +div.table-tabs > button.active-table-tab +{ background-color:#dc524a; color: #fff; } -.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span, -.overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span, -.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd, -.overviewSummary .tableTab .tabEnd, .typeSummary .tableTab .tabEnd, -.ui-autocomplete-category { +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + /* Overrides the color of selection used in jQuery UI */ + background: #dc524a !important; + color: #fff !important; +} + +main a[href*="://"]::after, +main a[href*="://"]:hover::after, +main a[href*="://"]:focus::after { + background-image:url('data:image/svg+xml; utf8, \ + \ + \ + '); +} + +.member-summary caption span.table-tab span, .packages-summary caption span.table-tab span, +.overview-summary caption span.table-tab span, .type-summary caption span.table-tab span, +.ui-autocomplete-category, +div.table-tabs > button.table-tab { background-color:#aaa; color: #fff; } -th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .constantsSummary th, -.packagesSummary th { +th.col-first, th.col-second, th.col-last, th.col-constructor-name, th.col-deprecated-item-name, .constants-summary th, +.packages-summary th { background:#eee; } -.tableSubHeadingColor { +.table-sub-heading-color { background-color:#eee; } -.altColor, .altColor th { +.alt-color, .alt-color th { background-color:#fff; } -.rowColor, .rowColor th { +.row-color, .row-color th { background-color:#eee; } .block { - margin:0px 10px 5px 0px; + margin:0 10px 5px 0; } -th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .constantsSummary th, -.packagesSummary th, .overviewSummary td, .memberSummary td, .typeSummary td, -.useSummary td, .constantsSummary td, .deprecatedSummary td, -.requiresSummary td, .packagesSummary td, .providesSummary td, .usesSummary td { +th.col-first, th.col-second, th.col-last, th.col-constructor-name, th.col-deprecated-item-name, .constants-summary th, +.packages-summary th, .overview-summary td, .member-summary td, .type-summary td, +.use-summary td, .constants-summary td, .deprecated-summary td, +.requires-summary td, .packages-summary td, .provides-summary td, .uses-summary td { padding-left:7px; } From 06eda3ea91d6476e5cbd904fb9f4cea515ebe205 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 13 Feb 2021 15:50:25 +0100 Subject: [PATCH 0214/1433] Add missing Javadoc for new suite modules --- .../org.junit.platform.suite.commons/module-info.java | 5 +++++ .../org.junit.platform.suite.engine/module-info.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java b/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java index a65200213874..9fc4a5293162 100644 --- a/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java +++ b/junit-platform-suite-commons/src/module/org.junit.platform.suite.commons/module-info.java @@ -8,6 +8,11 @@ * https://www.eclipse.org/legal/epl-v20.html */ +/** + * Common support utilities for declarative test suite executors. + * + * @since 1.8 + */ module org.junit.platform.suite.commons { requires transitive org.apiguardian.api; requires org.junit.platform.suite.api; diff --git a/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java b/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java index 79f6fe1c45e6..a5c077e99461 100644 --- a/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java +++ b/junit-platform-suite-engine/src/module/org.junit.platform.suite.engine/module-info.java @@ -8,6 +8,13 @@ * https://www.eclipse.org/legal/epl-v20.html */ +/** + * Provides a {@linkplain org.junit.platform.engine.TestEngine} for running + * declarative test suites. + * + * @since 1.8 + * @provides org.junit.platform.engine.TestEngine + */ module org.junit.platform.suite.engine { requires org.apiguardian.api; requires org.junit.platform.suite.api; From b12136c9ff2b4957c00213f69e5b2ce15d5a5e19 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 13 Feb 2021 15:50:37 +0100 Subject: [PATCH 0215/1433] Fix Javadoc reference --- .../src/main/java/org/junit/jupiter/api/ClassDescriptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java index db6dafcc42c3..9a6a660b9497 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/ClassDescriptor.java @@ -35,7 +35,7 @@ public interface ClassDescriptor { Class getTestClass(); /** - * Get the display name for this descriptor's {@link #getClass() class}. + * Get the display name for this descriptor's {@link #getTestClass() class}. * * @return the display name for this descriptor's class; never {@code null} * or blank From 108df22cf125bc33488bc4594b9e40402fa7837e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 13 Feb 2021 18:03:21 +0100 Subject: [PATCH 0216/1433] Upgrade to JUnit 4.13.2 --- gradle.properties | 2 +- .../java/org/junit/vintage/engine/JUnit4VersionCheckTests.java | 1 + .../platform/tooling/support/tests/ModularUserGuideTests.java | 2 +- .../tooling/support/tests/VintageGradleIntegrationTests.java | 2 +- .../tooling/support/tests/VintageMavenIntegrationTests.java | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index c7a69ac63ad5..e1e2eb455f97 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ org.gradle.parallel=true # Dependencies apiguardian.version=1.1.1 assertj.version=3.19.0 -junit4.version=4.13.1 +junit4.version=4.13.2 junit4.osgi.version=4.13.1_1 junit4Min.version=4.12 opentest4j.version=1.2.0 diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java index 45212a158416..00cbe0f49d20 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/JUnit4VersionCheckTests.java @@ -32,6 +32,7 @@ void handlesParsingSupportedVersionIdWithStandardVersionFormat() { assertDoesNotThrow(() -> JUnit4VersionCheck.checkSupported(() -> "4.12")); assertDoesNotThrow(() -> JUnit4VersionCheck.checkSupported(() -> "4.13")); assertDoesNotThrow(() -> JUnit4VersionCheck.checkSupported(() -> "4.13.1")); + assertDoesNotThrow(() -> JUnit4VersionCheck.checkSupported(() -> "4.13.2")); } /** diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java index 5986b927b988..d06bb399deb3 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ModularUserGuideTests.java @@ -69,7 +69,7 @@ private static List compile(Path temp, Writer out, Writer err) throws Ex args.add(temp.resolve("destination").toString()); var lib = Files.createDirectories(temp.resolve("lib")); - Helper.load(lib, "junit", "junit", Helper.version("junit4", "4.13.1")); + Helper.load(lib, "junit", "junit", Helper.version("junit4", "4.13.2")); Helper.load(lib, "org.assertj", "assertj-core", Helper.version("assertJ", "3.14.0")); Helper.load(lib, "org.apiguardian", "apiguardian-api", Helper.version("apiGuardian", "1.1.0")); Helper.load(lib, "org.hamcrest", "hamcrest", Helper.version("hamcrest", "2.2")); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java index 2823ee61cbf3..9604d834729d 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java @@ -40,7 +40,7 @@ void unsupportedVersion() { } @ParameterizedTest(name = "{0}") - @ValueSource(strings = { "4.12", "4.13.1" }) + @ValueSource(strings = { "4.12", "4.13.2" }) void supportedVersions(String version) { var result = run(version); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index e654d896c294..5bd512335ecc 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -37,7 +37,7 @@ void unsupportedVersion() { } @ParameterizedTest(name = "{0}") - @ValueSource(strings = { "4.12", "4.13.1" }) + @ValueSource(strings = { "4.12", "4.13.2" }) void supportedVersions(String version) { var result = run(version); From d93cd35e2c7afb97584ad827742c8fb4d7d47fb7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 13 Feb 2021 20:55:41 +0100 Subject: [PATCH 0217/1433] Omit automatic compile dependency on kotlin-stdlib Fixes #2551. --- gradle.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gradle.properties b/gradle.properties index e1e2eb455f97..163e7fd3bdaf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,6 +16,10 @@ org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr org.gradle.caching=true org.gradle.parallel=true +# Omit automatic compile dependency on kotlin-stdlib +# https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library +kotlin.stdlib.default.dependency=false + # Dependencies apiguardian.version=1.1.1 assertj.version=3.19.0 From a1d9bbece3318342ccedd9d7c64c232b529b9211 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 15 Feb 2021 12:25:33 +0100 Subject: [PATCH 0218/1433] Use new Nexus publish-plugin --- build.gradle.kts | 8 ++++++++ buildSrc/build.gradle.kts | 1 - .../main/kotlin/publishing-conventions.gradle.kts | 12 ------------ gradle.properties | 1 + settings.gradle.kts | 1 + 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index beec328ed747..a744ac40be8c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,7 @@ plugins { id("com.github.ben-manes.versions") // gradle dependencyUpdates id("com.diffplug.spotless") id("io.spring.nohttp") + id("io.github.gradle-nexus.publish-plugin") } val buildTimeAndDate by extra { @@ -87,6 +88,13 @@ val jacocoTestProjects = listOf( val jacocoCoveredProjects = modularProjects val jacocoClassesDir = file("$buildDir/jacoco/classes") +nexusPublishing { + packageGroup.set("org.junit") + repositories { + sonatype() + } +} + allprojects { apply(plugin = "eclipse") diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index d97ba94cbd15..b3c266a5ba3b 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -11,7 +11,6 @@ repositories { dependencies { implementation(kotlin("gradle-plugin")) - implementation("de.marcphilipp.gradle:nexus-publish-plugin:0.4.0") implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.2.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.gradle:test-retry-gradle-plugin:1.2.0") diff --git a/buildSrc/src/main/kotlin/publishing-conventions.gradle.kts b/buildSrc/src/main/kotlin/publishing-conventions.gradle.kts index 6f58ce7453af..2dae1cc8f8ca 100644 --- a/buildSrc/src/main/kotlin/publishing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/publishing-conventions.gradle.kts @@ -1,9 +1,6 @@ -import java.time.Duration - plugins { `maven-publish` signing - id("de.marcphilipp.nexus-publish") } val isSnapshot = project.version.toString().contains("SNAPSHOT") @@ -29,15 +26,6 @@ tasks.withType().configureEach { } } -nexusPublishing { - connectTimeout.set(Duration.ofMinutes(2)) - clientTimeout.set(Duration.ofMinutes(2)) - packageGroup.set("org.junit") - repositories { - sonatype() - } -} - publishing { publications { create("maven") { diff --git a/gradle.properties b/gradle.properties index 163e7fd3bdaf..8ac76b1e4a7c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -64,3 +64,4 @@ asciidoctor-pdf.version=1.5.3 asciidoctor.plugin.version=3.3.0 jmh.plugin.version=0.5.2 nohttp.plugin.version=0.0.5.RELEASE +nexus-publish.plugin.version=1.0.0 diff --git a/settings.gradle.kts b/settings.gradle.kts index f8d7de5104dd..84641ffc19e9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,6 +13,7 @@ pluginManagement { id("org.asciidoctor.jvm.pdf") version settings.extra["asciidoctor.plugin.version"] as String id("me.champeau.gradle.jmh") version settings.extra["jmh.plugin.version"] as String id("io.spring.nohttp") version settings.extra["nohttp.plugin.version"] as String + id("io.github.gradle-nexus.publish-plugin") version settings.extra["nexus-publish.plugin.version"] as String } } From fdadcbcb736742a325517bc20a0dac913aaf3fca Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Thu, 18 Feb 2021 10:28:23 +0100 Subject: [PATCH 0219/1433] Improve Javadoc for Assumptions.assumingThat Closes: #2554 --- .../org/junit/jupiter/api/Assumptions.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java index f4711a285274..d4055d43b18c 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java @@ -212,11 +212,12 @@ public static void assumeFalse(BooleanSupplier assumptionSupplier, SupplierIf the assumption is invalid, this method does nothing. - * - *

    If the {@code executable} throws an exception, it will be rethrown - * as is but {@link ExceptionUtils#throwAsUncheckedException masked} - * as an unchecked exception. + *

    Unlike the other assumption methods, this method will not abort the test. + * If the assumption is invalid, this method does nothing. If the assumption is + * valid and the {@code executable} throws an exception, it will be treated like + * a regular test error. That exception will be rethrown as is + * but {@link ExceptionUtils#throwAsUncheckedException masked} as an unchecked + * exception. * * @param assumptionSupplier the supplier of the assumption to validate * @param executable the block of code to execute if the assumption is valid @@ -230,11 +231,12 @@ public static void assumingThat(BooleanSupplier assumptionSupplier, Executable e * Execute the supplied {@link Executable}, but only if the supplied * assumption is valid. * - *

    If the assumption is invalid, this method does nothing. - * - *

    If the {@code executable} throws an exception, it will be rethrown - * as is but {@link ExceptionUtils#throwAsUncheckedException masked} - * as an unchecked exception. + *

    Unlike the other assumption methods, this method will not abort the test. + * If the assumption is invalid, this method does nothing. If the assumption is + * valid and the {@code executable} throws an exception, it will be treated like + * a regular test error. That exception will be rethrown as is + * but {@link ExceptionUtils#throwAsUncheckedException masked} as an unchecked + * exception. * * @param assumption the assumption to validate * @param executable the block of code to execute if the assumption is valid From d8b4504dbd5ff7115738448a5a87724fbf0249e6 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 18 Feb 2021 10:30:38 +0100 Subject: [PATCH 0220/1433] Polish contribution See: #2554 --- .../src/main/java/org/junit/jupiter/api/Assumptions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java index d4055d43b18c..51e308cced3a 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java @@ -215,7 +215,7 @@ public static void assumeFalse(BooleanSupplier assumptionSupplier, SupplierUnlike the other assumption methods, this method will not abort the test. * If the assumption is invalid, this method does nothing. If the assumption is * valid and the {@code executable} throws an exception, it will be treated like - * a regular test error. That exception will be rethrown as is + * a regular test failure. That exception will be rethrown as is * but {@link ExceptionUtils#throwAsUncheckedException masked} as an unchecked * exception. * @@ -234,7 +234,7 @@ public static void assumingThat(BooleanSupplier assumptionSupplier, Executable e *

    Unlike the other assumption methods, this method will not abort the test. * If the assumption is invalid, this method does nothing. If the assumption is * valid and the {@code executable} throws an exception, it will be treated like - * a regular test error. That exception will be rethrown as is + * a regular test failure. That exception will be rethrown as is * but {@link ExceptionUtils#throwAsUncheckedException masked} as an unchecked * exception. * From c6b363f36373732977848dbb90998c28a35ce85d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 24 Feb 2021 21:26:02 +0100 Subject: [PATCH 0221/1433] Upgrade bnd to 5.3.0 --- buildSrc/build.gradle.kts | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index b3c266a5ba3b..864391b24205 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -11,7 +11,7 @@ repositories { dependencies { implementation(kotlin("gradle-plugin")) - implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.2.0") + implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.gradle:test-retry-gradle-plugin:1.2.0") } diff --git a/gradle.properties b/gradle.properties index 8ac76b1e4a7c..f272a78e6051 100644 --- a/gradle.properties +++ b/gradle.properties @@ -50,7 +50,7 @@ jacoco.version=0.8.6 jmh.version=1.27 ktlint.version=0.35.0 surefire.version=2.22.2 -bnd.version=5.2.0 +bnd.version=5.3.0 # Plugins gradle.enterprise.plugin.version=3.5.1 From a58ff5d355043b90ec29dd72601f33f26ef6f106 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Wed, 24 Feb 2021 21:26:13 +0100 Subject: [PATCH 0222/1433] Upgrade ArchUnit to 0.17.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index f272a78e6051..ebb5019aff16 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,7 +31,7 @@ picocli.version=4.6.1 univocity-parsers.version=2.9.0 # Test Dependencies -archunit.version=0.16.0 +archunit.version=0.17.0 bartholdy.version=0.2.3 classgraph.version=4.8.98 commons-io.version=2.8.0 From 0fcdb516495199c78bcd3dd628c94bcb43a4d851 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Tue, 2 Mar 2021 17:29:25 +0100 Subject: [PATCH 0223/1433] Update Gradle Enterprise Gradle Plugin to 3.5.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ebb5019aff16..04ef91553ef7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -53,7 +53,7 @@ surefire.version=2.22.2 bnd.version=5.3.0 # Plugins -gradle.enterprise.plugin.version=3.5.1 +gradle.enterprise.plugin.version=3.5.2 gradle.user-data.plugin.version=1.0 versioning.plugin.version=2.14.0 versions.plugin.version=0.36.0 From 0d6d21f0d8bcc3d06e1524b87b7dcdd3f308941a Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Sun, 7 Mar 2021 03:13:48 +0800 Subject: [PATCH 0224/1433] Make default parameterized display name template configurable This commit introduces the `junit.jupiter.params.displayname.default` configuration parameter for configuring the default display name template of parameterized tests. --- .../asciidoc/user-guide/writing-tests.adoc | 14 +++++ .../jupiter/params/ParameterizedTest.java | 10 +++- .../params/ParameterizedTestExtension.java | 14 +++-- .../ParameterizedTestExtensionTests.java | 52 ++++++++++++++++++- .../ParameterizedTestIntegrationTests.java | 11 ++++ 5 files changed, 93 insertions(+), 8 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index e4cc3b40aae1..6d754563811c 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -1649,6 +1649,20 @@ A parameterized test with named arguments ✔ └─ 2: Another file ✔ .... +If you'd like to set default name pattern for all parameterized tests in your project, you can add the following +configuration to `junit-platform.properties` + +[source,properties,indent=0] +---- +junit.jupiter.params.displayname.default = {index} +---- + +the display name for a parameterized method is determined according to the following precedence rules: + +1. `name` of `@ParameterizedTest`, if present +2. the value of `junit.jupiter.params.displayname.default` (from junit-platform.properties), if present +3. `DEFAULT_DISPLAY_NAME` constant defined in `@ParameterizedTest` + [[writing-tests-parameterized-tests-lifecycle-interop]] ==== Lifecycle and Interoperability diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java index f2faa61bbe20..f4a740f690a9 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java @@ -182,7 +182,11 @@ * The display name to be used for individual invocations of the * parameterized test; never blank or consisting solely of whitespace. * - *

    Defaults to {@link #DEFAULT_DISPLAY_NAME}. + *

    If "{default_display_name}" is returned when invoking name(), we will: + *

      + *
    • Look up the new config param from junit-platform.properties, and if it has been set, use it
    • + *
    • otherwise, we will use the value of the {@link #DEFAULT_DISPLAY_NAME} constant.
    • + *
    * *

    Supported placeholders

    *
      @@ -192,6 +196,8 @@ *
    • {0}, {1}, etc.: an individual argument (0-based)
    • *
    * + *

    Note that "{default_display_name}" is a flag rather than a placeholder. + * *

    For the latter, you may use {@link java.text.MessageFormat} patterns * to customize formatting. Please note that the original arguments are * passed when formatting, regardless of any implicit or explicit argument @@ -199,6 +205,6 @@ * * @see java.text.MessageFormat */ - String name() default DEFAULT_DISPLAY_NAME; + String name() default "{default_display_name}"; } diff --git a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java index 7d110ce37805..ec6aac46ba5f 100644 --- a/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java +++ b/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTestExtension.java @@ -39,6 +39,8 @@ class ParameterizedTestExtension implements TestTemplateInvocationContextProvide private static final String METHOD_CONTEXT_KEY = "context"; static final String ARGUMENT_MAX_LENGTH_KEY = "junit.jupiter.params.displayname.argument.maxlength"; + private static final String DEFAULT_DISPLAY_NAME = "{default_display_name}"; + static final String DISPLAY_NAME_PATTERN_KEY = "junit.jupiter.params.displayname.default"; @Override public boolean supportsTestTemplate(ExtensionContext context) { @@ -75,8 +77,8 @@ public Stream provideTestTemplateInvocationContex .get(METHOD_CONTEXT_KEY, ParameterizedTestMethodContext.class); int argumentMaxLength = extensionContext.getConfigurationParameter(ARGUMENT_MAX_LENGTH_KEY, Integer::parseInt).orElse(512); - ParameterizedTestNameFormatter formatter = createNameFormatter(templateMethod, methodContext, displayName, - argumentMaxLength); + ParameterizedTestNameFormatter formatter = createNameFormatter(extensionContext, templateMethod, methodContext, + displayName, argumentMaxLength); AtomicLong invocationCount = new AtomicLong(0); // @formatter:off @@ -122,10 +124,14 @@ private TestTemplateInvocationContext createInvocationContext(ParameterizedTestN return new ParameterizedTestInvocationContext(formatter, methodContext, arguments); } - private ParameterizedTestNameFormatter createNameFormatter(Method templateMethod, + private ParameterizedTestNameFormatter createNameFormatter(ExtensionContext extensionContext, Method templateMethod, ParameterizedTestMethodContext methodContext, String displayName, int argumentMaxLength) { ParameterizedTest parameterizedTest = findAnnotation(templateMethod, ParameterizedTest.class).get(); - String pattern = Preconditions.notBlank(parameterizedTest.name().trim(), + String pattern = parameterizedTest.name().equals(DEFAULT_DISPLAY_NAME) + ? extensionContext.getConfigurationParameter(DISPLAY_NAME_PATTERN_KEY).orElse( + ParameterizedTest.DEFAULT_DISPLAY_NAME) + : parameterizedTest.name(); + pattern = Preconditions.notBlank(pattern.trim(), () -> String.format( "Configuration error: @ParameterizedTest on method [%s] must be declared with a non-empty name.", templateMethod)); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java index 24f4df196a0d..f83ddcc68a8c 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestExtensionTests.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Stream; @@ -37,6 +38,7 @@ import org.junit.jupiter.params.provider.ArgumentsProvider; import org.junit.jupiter.params.provider.ArgumentsSource; import org.junit.platform.commons.JUnitException; +import org.junit.platform.commons.PreconditionViolationException; /** * Unit tests for {@link ParameterizedTestExtension}. @@ -85,6 +87,31 @@ void streamsReturnedByProvidersAreClosedWhenCallingProvide() { assertTrue(streamWasClosed); } + @Test + void emptyDisplayNameIsIllegal() { + var extensionContext = getExtensionContextReturningSingleMethod(new EmptyDisplayNameProviderTestCase()); + assertThrows(PreconditionViolationException.class, + () -> this.parameterizedTestExtension.provideTestTemplateInvocationContexts(extensionContext)); + } + + @Test + void defaultDisplayNameWithEmptyStringInConfigurationIsIllegal() { + AtomicInteger invocations = new AtomicInteger(); + Function> configurationSupplier = key -> { + if (key.equals(ParameterizedTestExtension.DISPLAY_NAME_PATTERN_KEY)) { + invocations.incrementAndGet(); + return Optional.of(""); + } + else + return Optional.empty(); + }; + var extensionContext = getExtensionContextReturningSingleMethod(new DefaultDisplayNameProviderTestCase(), + configurationSupplier); + assertThrows(PreconditionViolationException.class, + () -> this.parameterizedTestExtension.provideTestTemplateInvocationContexts(extensionContext)); + assertEquals(1, invocations.get()); + } + @Test void argumentsRethrowsOriginalExceptionFromProviderAsUncheckedException() { ArgumentsProvider failingProvider = (context) -> { @@ -145,6 +172,11 @@ private void assertArgumentsProviderInstantiationException(JUnitException ex } private ExtensionContext getExtensionContextReturningSingleMethod(Object testCase) { + return getExtensionContextReturningSingleMethod(testCase, ignored -> Optional.empty()); + } + + private ExtensionContext getExtensionContextReturningSingleMethod(Object testCase, + Function> configurationSupplier) { // @formatter:off var optional = Arrays.stream(testCase.getClass().getDeclaredMethods()) @@ -218,12 +250,12 @@ public Optional getExecutionException() { @Override public Optional getConfigurationParameter(String key) { - return Optional.empty(); + return configurationSupplier.apply(key); } @Override public Optional getConfigurationParameter(String key, Function transformer) { - return Optional.empty(); + return configurationSupplier.apply(key).map(transformer); } @Override @@ -294,6 +326,22 @@ void method() { } } + static class EmptyDisplayNameProviderTestCase { + + @ParameterizedTest(name = "") + @ArgumentsSource(MissingNoArgumentsConstructorArgumentsProvider.class) + void method() { + } + } + + static class DefaultDisplayNameProviderTestCase { + + @ParameterizedTest + @ArgumentsSource(MissingNoArgumentsConstructorArgumentsProvider.class) + void method() { + } + } + static class MissingNoArgumentsConstructorArgumentsProvider implements ArgumentsProvider { MissingNoArgumentsConstructorArgumentsProvider(String parameter) { diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java index 8423b3c23fb3..69da7f6d47f2 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java @@ -268,6 +268,17 @@ void truncatesArgumentsThatExceedMaxLength() { .haveExactly(1, event(displayName("[2] argument=b…"), started())); } + @Test + void displayNamePatternFromConfiguration() { + var results = EngineTestKit.engine(new JupiterTestEngine()) // + .configurationParameter(ParameterizedTestExtension.DISPLAY_NAME_PATTERN_KEY, "{index}") // + .selectors(selectMethod(TestCase.class, "testWithCsvSource", String.class.getName())) // + .execute(); + results.testEvents().assertThatEvents() // + .haveExactly(1, event(displayName("1"), started())) // + .haveExactly(1, event(displayName("2"), started())); + } + private EngineExecutionResults execute(DiscoverySelector... selectors) { return EngineTestKit.engine(new JupiterTestEngine()).selectors(selectors).execute(); } From ce95634e08cf69105967c19ed2448440ef8d672f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Mar 2021 20:40:39 +0100 Subject: [PATCH 0225/1433] Upgrade common-custom-user-data-gradle-plugin --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 04ef91553ef7..7b723a2f6d46 100644 --- a/gradle.properties +++ b/gradle.properties @@ -54,7 +54,7 @@ bnd.version=5.3.0 # Plugins gradle.enterprise.plugin.version=3.5.2 -gradle.user-data.plugin.version=1.0 +gradle.user-data.plugin.version=1.2 versioning.plugin.version=2.14.0 versions.plugin.version=0.36.0 spotless.plugin.version=5.9.0 From 9558af1961a8f539288f4c7ac59d4666417c9990 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 11 Mar 2021 20:52:12 +0100 Subject: [PATCH 0226/1433] Upgradle to 6.8.3 --- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 299cd1a9e796..51d930a381f3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=8de6efc274ab52332a9c820366dd5cf5fc9d35ec7078fd70c8ec6913431ee610 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip +distributionSha256Sum=7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205 +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 760a5d1c1a3428555950e9e4ad0c3a4672e405c2 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 15 Mar 2021 14:41:04 +0100 Subject: [PATCH 0227/1433] Upgrade Gradle Enterprise plugin to 3.6 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 7b723a2f6d46..bc9c1e4d74b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -53,7 +53,7 @@ surefire.version=2.22.2 bnd.version=5.3.0 # Plugins -gradle.enterprise.plugin.version=3.5.2 +gradle.enterprise.plugin.version=3.6 gradle.user-data.plugin.version=1.2 versioning.plugin.version=2.14.0 versions.plugin.version=0.36.0 From bc31a17e3d119e8ef73a1064208323e0003f4cb8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 15 Mar 2021 15:03:58 +0100 Subject: [PATCH 0228/1433] Simplify injection of GE credentials --- .github/workflows/codeql-analysis.yml | 5 +---- .github/workflows/cross-version.yml | 5 +---- .github/workflows/main.yml | 15 +-------------- .github/workflows/reproducible-build.yml | 6 +----- settings.gradle.kts | 5 +---- 5 files changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e91dd4d6a5bb..a302ec4aae6c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -11,6 +11,7 @@ on: env: ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: analyze: @@ -40,10 +41,6 @@ jobs: uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} - - name: Prepare Gradle Enterprise credentials - run: | - mkdir -p $HOME/.gradle/enterprise/ - echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties - name: Build run: | ./gradlew --version diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index bb2b9332c347..628ce793c1e5 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -13,6 +13,7 @@ env: ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: openjdk: @@ -42,10 +43,6 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- - - name: Prepare Gradle Enterprise credentials - run: | - mkdir -p /root/.gradle/enterprise/ - echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > /root/.gradle/enterprise/keys.properties - name: Test run: | ./gradlew --version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc4a46f444b0..a40d3ee9644d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,7 @@ env: ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: linux: @@ -40,10 +41,6 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- - - name: Prepare Gradle Enterprise credentials - run: | - mkdir -p /root/.gradle/enterprise/ - echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > /root/.gradle/enterprise/keys.properties - name: Test and Coverage run: | ./gradlew --version @@ -85,11 +82,6 @@ jobs: uses: actions/setup-java@v1 with: java-version: 15 - - name: Prepare Gradle Enterprise credentials - shell: bash - run: | - mkdir -p $HOME/.gradle/enterprise/ - echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties - name: Test shell: bash run: | @@ -124,10 +116,6 @@ jobs: uses: actions/setup-java@v1 with: java-version: 15 - - name: Prepare Gradle Enterprise credentials - run: | - mkdir -p $HOME/.gradle/enterprise/ - echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties - name: 'Test' run: | ./gradlew --version @@ -159,7 +147,6 @@ jobs: env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} run: ./gradlew publish -x check update_documentation: diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index b53c03ef6d2a..8171bb2fbb04 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -11,6 +11,7 @@ on: env: ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: check_build_reproducibility: @@ -33,11 +34,6 @@ jobs: uses: actions/setup-java@v1 with: java-version: 15 - - name: Prepare Gradle Enterprise credentials - shell: bash - run: | - mkdir -p $HOME/.gradle/enterprise/ - echo "${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}" > $HOME/.gradle/enterprise/keys.properties - name: Build and compare checksums shell: bash run: | diff --git a/settings.gradle.kts b/settings.gradle.kts index 84641ffc19e9..40b99b011640 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,10 +32,7 @@ gradleEnterprise { isCaptureTaskInputFiles = true isUploadInBackground = !isCiServer - fun accessKeysAreMissingOrBlank(): Boolean { - val accessKeys = File(gradle.gradleUserHomeDir, "enterprise/keys.properties") - return !accessKeys.isFile || accessKeys.readText().isBlank() - } + fun accessKeysAreMissingOrBlank() = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY").isNullOrBlank() if (gradle.startParameter.isBuildScan || (isCiServer && accessKeysAreMissingOrBlank())) { termsOfServiceUrl = "https://gradle.com/terms-of-service" From 9ba84f853d591b19b6b8d27d70e34415bcb55141 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 18 Mar 2021 15:25:22 +0100 Subject: [PATCH 0229/1433] Use JDK 11 to run Gradle (#2566) * Use JDK 11 toolchain for Spock 2.x test classes * Use default toolchain to look up "jar" executable * Document JDK requirements --- .github/workflows/main.yml | 35 +++++++++++++------ .github/workflows/reproducible-build.yml | 10 +++++- README.md | 6 ++-- .../java-toolchain-conventions.gradle.kts | 2 +- .../junit-platform-commons.gradle.kts | 10 ++++-- .../junit-platform-console.gradle.kts | 10 ++++-- .../junit-vintage-engine.gradle.kts | 6 ++++ 7 files changed, 61 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a40d3ee9644d..01e0f8bf1445 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,11 +82,18 @@ jobs: uses: actions/setup-java@v1 with: java-version: 15 + - name: Prepare JDK15 env var + shell: bash + run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 - name: Test shell: bash run: | ./gradlew --version - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8 build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK15 build ./gradlew --stop mac: @@ -112,19 +119,34 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- + - name: Set up JDK 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Prepare JDK8 env var + shell: bash + run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 15 uses: actions/setup-java@v1 with: java-version: 15 + - name: Prepare JDK15 env var + shell: bash + run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 - name: 'Test' run: | ./gradlew --version - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK15 build publish_artifacts: name: Publish Snapshot Artifacts needs: linux runs-on: ubuntu-latest + container: ghcr.io/junit-team/build if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') steps: - uses: actions/checkout@v2 @@ -139,10 +161,6 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: Set up JDK 15 - uses: actions/setup-java@v1 - with: - java-version: 15 - name: Publish env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} @@ -153,6 +171,7 @@ jobs: name: Update Snapshot Documentation needs: linux runs-on: ubuntu-latest + container: ghcr.io/junit-team/build if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 @@ -167,10 +186,6 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: Set up JDK 15 - uses: actions/setup-java@v1 - with: - java-version: 15 - name: Upload Documentation env: GRGIT_USER: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 8171bb2fbb04..19921775356c 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -11,6 +11,7 @@ on: env: ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' + ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK15' GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: @@ -30,10 +31,17 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: 'Set up JDK 15' + - name: Set up JDK 15 uses: actions/setup-java@v1 with: java-version: 15 + - name: Prepare JDK15 env var + shell: bash + run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 - name: Build and compare checksums shell: bash run: | diff --git a/README.md b/README.md index ec2a28a4db85..166f0b7ad4e7 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,8 @@ so that local builds can reuse task outputs from previous CI builds. ## Building from Source -You need [JDK 15] to build JUnit 5. +You need [JDK 11] to build JUnit 5. [Gradle toolchains] are used to detect and +potentially download additional JDKs for compilation and test execution. All modules can be _built_ with the [Gradle Wrapper] using the following command. @@ -91,10 +92,11 @@ See also for releases and [CONTRIBUTING.md]: https://github.com/junit-team/junit5/blob/HEAD/CONTRIBUTING.md [Dependency Metadata]: https://junit.org/junit5/docs/current/user-guide/#dependency-metadata [Gitter]: https://gitter.im/junit-team/junit5 +[Gradle toolchains]: https://docs.gradle.org/current/userguide/toolchains.html [Gradle Wrapper]: https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:using_wrapper [JaCoCo]: https://www.eclemma.org/jacoco/ [Javadoc]: https://junit.org/junit5/docs/current/api/ -[JDK 15]: https://jdk.java.net/15/ +[JDK 11]: https://adoptopenjdk.net/archive.html?variant=openjdk11&jvmVariant=hotspot [Release Notes]: https://junit.org/junit5/docs/current/release-notes/ [Samples]: https://github.com/junit-team/junit5-samples [StackOverflow]: https://stackoverflow.com/questions/tagged/junit5 diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index 7d97f10b2479..7ec8dc3971af 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -21,7 +21,7 @@ project.pluginManager.withPlugin("java") { } tasks.withType().configureEach { javaLauncher.set(javaToolchainService.launcherFor { - // Groovy does not yet support JDK 16, see https://issues.apache.org/jira/browse/GROOVY-9752 + // Groovy does not yet support JDK 17, see https://issues.apache.org/jira/browse/GROOVY-9943 languageVersion.set(minOf(javaLanguageVersion, defaultLanguageVersion)) }) } diff --git a/junit-platform-commons/junit-platform-commons.gradle.kts b/junit-platform-commons/junit-platform-commons.gradle.kts index 4fe02c95ee33..47df635c1339 100644 --- a/junit-platform-commons/junit-platform-commons.gradle.kts +++ b/junit-platform-commons/junit-platform-commons.gradle.kts @@ -19,10 +19,16 @@ tasks.jar { val release9ClassesDir = sourceSets.mainRelease9.get().output.classesDirs.singleFile inputs.dir(release9ClassesDir).withPathSensitivity(PathSensitivity.RELATIVE) doLast { - ToolProvider.findFirst("jar").get().run(System.out, System.err, "--update", + exec { + executable = project.the().launcherFor(java.toolchain).get() + .metadata.installationPath.file("bin/jar").asFile.absolutePath + args( + "--update", "--file", archiveFile.get().asFile.absolutePath, "--release", "9", - "-C", release9ClassesDir.absolutePath, ".") + "-C", release9ClassesDir.absolutePath, "." + ) + } } } diff --git a/junit-platform-console/junit-platform-console.gradle.kts b/junit-platform-console/junit-platform-console.gradle.kts index 97cb4f5dfe32..869f90e5b962 100644 --- a/junit-platform-console/junit-platform-console.gradle.kts +++ b/junit-platform-console/junit-platform-console.gradle.kts @@ -30,9 +30,15 @@ tasks { } from(sourceSets.mainRelease9.get().output.classesDirs) doLast { - ToolProvider.findFirst("jar").get().run(System.out, System.err, "--update", + exec { + executable = project.the().launcherFor(java.toolchain).get() + .metadata.installationPath.file("bin/jar").asFile.absolutePath + args( + "--update", "--file", archiveFile.get().asFile.absolutePath, - "--main-class", "org.junit.platform.console.ConsoleLauncher") + "--main-class", "org.junit.platform.console.ConsoleLauncher" + ) + } } } jar { diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index 360e763da5af..440eaf775b4b 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -37,6 +37,12 @@ configurations.all { } tasks { + compileTestFixturesGroovy { + javaLauncher.set(project.the().launcherFor { + // Groovy 2.x (used for Spock tests) does not support JDK 16 + languageVersion.set(JavaLanguageVersion.of(11)) + }) + } jar { withConvention(BundleTaskConvention::class) { bnd(""" From 9c5063c1cd8b70afb343f241daf4600f7259660a Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 18 Mar 2021 15:56:41 +0100 Subject: [PATCH 0230/1433] Use Ubuntu for docs publishing job --- .github/workflows/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 01e0f8bf1445..7cfe6a48b472 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -171,7 +171,6 @@ jobs: name: Update Snapshot Documentation needs: linux runs-on: ubuntu-latest - container: ghcr.io/junit-team/build if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 @@ -186,10 +185,22 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- + - name: Set up JDK 15 + uses: actions/setup-java@v1 + with: + java-version: 15 + - name: Prepare JDK15 env var + shell: bash + run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 - name: Upload Documentation env: GRGIT_USER: ${{ secrets.GH_TOKEN }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK15' run: | sudo apt-get install graphviz ./src/publishDocumentationSnapshotOnlyIfNecessary.sh From 87673a0c4905ba21ecbb5f5920dbe9bbaa0e253e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 18 Mar 2021 16:51:33 +0100 Subject: [PATCH 0231/1433] Test on JDK 16 (#2574) --- .github/workflows/cross-version.yml | 2 +- .github/workflows/main.yml | 30 +++++++-------- .github/workflows/reproducible-build.yml | 10 ++--- .../src/main/kotlin/JavaLibraryExtension.kt | 2 +- .../java-toolchain-conventions.gradle.kts | 2 +- gradle.properties | 3 ++ .../org/junit/jupiter/engine/RecordTests.java | 38 +++++++++++++++++++ 7 files changed, 64 insertions(+), 23 deletions(-) create mode 100644 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/RecordTests.java diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 628ce793c1e5..1f2794bc6a18 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -19,7 +19,7 @@ jobs: openjdk: strategy: matrix: - jdk: [16, 17] + jdk: [17] name: "OpenJDK ${{ matrix.jdk }}" runs-on: ubuntu-latest container: "ghcr.io/junit-team/build:${{ matrix.jdk }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7cfe6a48b472..e7710a1b56c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,13 +78,13 @@ jobs: - name: Prepare JDK8 env var shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - - name: Set up JDK 15 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 15 - - name: Prepare JDK15 env var + java-version: 16 + - name: Prepare JDK16 env var shell: bash - run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 11 uses: actions/setup-java@v1 with: @@ -93,7 +93,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK15 build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 build ./gradlew --stop mac: @@ -126,13 +126,13 @@ jobs: - name: Prepare JDK8 env var shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - - name: Set up JDK 15 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 15 - - name: Prepare JDK15 env var + java-version: 16 + - name: Prepare JDK16 env var shell: bash - run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 11 uses: actions/setup-java@v1 with: @@ -140,7 +140,7 @@ jobs: - name: 'Test' run: | ./gradlew --version - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK15 build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 build publish_artifacts: name: Publish Snapshot Artifacts @@ -185,13 +185,13 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: Set up JDK 15 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 15 - - name: Prepare JDK15 env var + java-version: 16 + - name: Prepare JDK16 env var shell: bash - run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 11 uses: actions/setup-java@v1 with: @@ -200,7 +200,7 @@ jobs: env: GRGIT_USER: ${{ secrets.GH_TOKEN }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK15' + ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK16' run: | sudo apt-get install graphviz ./src/publishDocumentationSnapshotOnlyIfNecessary.sh diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 19921775356c..6a67d1ea1e91 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -11,7 +11,7 @@ on: env: ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' - ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK15' + ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK16' GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: @@ -31,13 +31,13 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: Set up JDK 15 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 15 - - name: Prepare JDK15 env var + java-version: 16 + - name: Prepare JDK16 env var shell: bash - run: echo "JDK15=$JAVA_HOME" >> $GITHUB_ENV + run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 11 uses: actions/setup-java@v1 with: diff --git a/buildSrc/src/main/kotlin/JavaLibraryExtension.kt b/buildSrc/src/main/kotlin/JavaLibraryExtension.kt index 86da500d0a5f..acd240f6cb0e 100644 --- a/buildSrc/src/main/kotlin/JavaLibraryExtension.kt +++ b/buildSrc/src/main/kotlin/JavaLibraryExtension.kt @@ -3,5 +3,5 @@ import org.gradle.api.JavaVersion @Suppress("UnstableApiUsage") open class JavaLibraryExtension { var mainJavaVersion: JavaVersion = Versions.jvmTarget - var testJavaVersion: JavaVersion = JavaVersion.VERSION_15 + var testJavaVersion: JavaVersion = JavaVersion.VERSION_16 } diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index 7ec8dc3971af..6653c80374df 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile val javaToolchainVersion: String? by project -val defaultLanguageVersion = JavaLanguageVersion.of(15) +val defaultLanguageVersion = JavaLanguageVersion.of(16) val javaLanguageVersion = javaToolchainVersion?.let { JavaLanguageVersion.of(it) } ?: defaultLanguageVersion project.pluginManager.withPlugin("java") { diff --git a/gradle.properties b/gradle.properties index bc9c1e4d74b9..71a1b8b79609 100644 --- a/gradle.properties +++ b/gradle.properties @@ -65,3 +65,6 @@ asciidoctor.plugin.version=3.3.0 jmh.plugin.version=0.5.2 nohttp.plugin.version=0.0.5.RELEASE nexus-publish.plugin.version=1.0.0 + +# Temporarily disabled until test-retry plugin is compatible with JDK 16 +retries=0 diff --git a/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/RecordTests.java b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/RecordTests.java new file mode 100644 index 000000000000..2ab8697f041d --- /dev/null +++ b/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/RecordTests.java @@ -0,0 +1,38 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.engine; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import org.junit.jupiter.api.Test; + +class RecordTests extends AbstractJupiterTestEngineTests { + + @Test + void recordsAreTestClasses() { + executeTestsForClass(TestCase.class).testEvents() // + .assertStatistics(stats -> stats.finished(2).succeeded(1).failed(1)); + } + + record TestCase() { + + @Test + void succeedingTest() { + assertTrue(true); + } + + @Test + void failingTest() { + fail("always fails"); + } + } +} From e8d91f94920fe6bc065f7b2f58c6bb53ebc61c29 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 10:22:08 +0100 Subject: [PATCH 0232/1433] Print Java toolchains --- .github/workflows/codeql-analysis.yml | 1 + .github/workflows/cross-version.yml | 1 + .github/workflows/main.yml | 8 +++++++- .github/workflows/reproducible-build.yml | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a302ec4aae6c..ab09ccaca923 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,6 +44,7 @@ jobs: - name: Build run: | ./gradlew --version + ./gradlew javaToolchains ./gradlew --no-build-cache allMainClasses -PjavaToolchainVersion=11 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 1f2794bc6a18..edd1bc0fe724 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -46,4 +46,5 @@ jobs: - name: Test run: | ./gradlew --version + ./gradlew javaToolchains ./gradlew --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7710a1b56c6..011ca71fe3c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,6 +44,7 @@ jobs: - name: Test and Coverage run: | ./gradlew --version + ./gradlew javaToolchains ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo build jacocoRootReport - name: Upload to Codecov.io uses: codecov/codecov-action@v1 @@ -93,6 +94,7 @@ jobs: shell: bash run: | ./gradlew --version + ./gradlew javaToolchains ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 build ./gradlew --stop @@ -140,6 +142,7 @@ jobs: - name: 'Test' run: | ./gradlew --version + ./gradlew javaToolchains ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 build publish_artifacts: @@ -165,7 +168,9 @@ jobs: env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} - run: ./gradlew publish -x check + run: | + ./gradlew javaToolchains + ./gradlew publish -x check update_documentation: name: Update Snapshot Documentation @@ -203,4 +208,5 @@ jobs: ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK16' run: | sudo apt-get install graphviz + ./gradlew javaToolchains ./src/publishDocumentationSnapshotOnlyIfNecessary.sh diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 6a67d1ea1e91..342b45101cad 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -45,4 +45,5 @@ jobs: - name: Build and compare checksums shell: bash run: | + ./gradlew javaToolchains ./src/checkBuildReproducibility.sh From 113ca4d43f2668ed9b2c8ce516de118bf371a36f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 10:22:45 +0100 Subject: [PATCH 0233/1433] Publish documentation from Docker container --- .github/workflows/main.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 011ca71fe3c0..0ba4f09190d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -176,6 +176,7 @@ jobs: name: Update Snapshot Documentation needs: linux runs-on: ubuntu-latest + container: ghcr.io/junit-team/build if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 @@ -190,23 +191,11 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- - - name: Set up JDK 16 - uses: actions/setup-java@v1 - with: - java-version: 16 - - name: Prepare JDK16 env var - shell: bash - run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - name: Upload Documentation env: GRGIT_USER: ${{ secrets.GH_TOKEN }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK16' run: | - sudo apt-get install graphviz ./gradlew javaToolchains ./src/publishDocumentationSnapshotOnlyIfNecessary.sh From 53fb099e2360ccdf73b3af8cfba6137746024ca9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 10:28:08 +0100 Subject: [PATCH 0234/1433] Remove ineffectual env vars Env vars with dots don't work on most OSes --- .github/workflows/codeql-analysis.yml | 1 - .github/workflows/cross-version.yml | 1 - .github/workflows/main.yml | 2 -- .github/workflows/reproducible-build.yml | 2 -- 4 files changed, 6 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ab09ccaca923..91dc3cf47d14 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -10,7 +10,6 @@ on: - cron: '0 19 * * 3' env: - ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index edd1bc0fe724..7ea9420251dc 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -12,7 +12,6 @@ on: env: ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} - ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ba4f09190d5..cbeeafb65d46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,6 @@ on: env: ORG_GRADLE_PROJECT_junitBuildCacheUsername: ${{ secrets.BUILD_CACHE_USERNAME }} ORG_GRADLE_PROJECT_junitBuildCachePassword: ${{ secrets.BUILD_CACHE_PASSWORD }} - ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: @@ -195,7 +194,6 @@ jobs: env: GRGIT_USER: ${{ secrets.GH_TOKEN }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK16' run: | ./gradlew javaToolchains ./src/publishDocumentationSnapshotOnlyIfNecessary.sh diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 342b45101cad..9cb23a2a9d86 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -10,8 +10,6 @@ on: - '*' env: - ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: 'false' - ORG_GRADLE_PROJECT_org.gradle.java.installations.fromEnv: 'JDK16' GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} jobs: From 882a9a76915e8bbc621b4758ba8bd8243264ab1b Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 10:36:20 +0100 Subject: [PATCH 0235/1433] Disable toolchain download on CI --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/cross-version.yml | 2 +- .github/workflows/main.yml | 8 ++++---- src/checkBuildReproducibility.sh | 2 +- src/publishDocumentationSnapshotOnlyIfNecessary.sh | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 91dc3cf47d14..2d0b5bb66543 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,6 +44,6 @@ jobs: run: | ./gradlew --version ./gradlew javaToolchains - ./gradlew --no-build-cache allMainClasses -PjavaToolchainVersion=11 + ./gradlew --no-build-cache allMainClasses -PjavaToolchainVersion=11 -Porg.gradle.java.installations.auto-download=false - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 7ea9420251dc..c8e5d9e474c7 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -46,4 +46,4 @@ jobs: run: | ./gradlew --version ./gradlew javaToolchains - ./gradlew --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} build "-Dscan.tag.JDK_${{ matrix.jdk }}" + ./gradlew --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} -Porg.gradle.java.installations.auto-download=false build "-Dscan.tag.JDK_${{ matrix.jdk }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cbeeafb65d46..c2740c5e0709 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,7 +44,7 @@ jobs: run: | ./gradlew --version ./gradlew javaToolchains - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo build jacocoRootReport + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo -Porg.gradle.java.installations.auto-download=false build jacocoRootReport - name: Upload to Codecov.io uses: codecov/codecov-action@v1 @@ -94,7 +94,7 @@ jobs: run: | ./gradlew --version ./gradlew javaToolchains - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 -Porg.gradle.java.installations.auto-download=false build ./gradlew --stop mac: @@ -142,7 +142,7 @@ jobs: run: | ./gradlew --version ./gradlew javaToolchains - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 -Porg.gradle.java.installations.auto-download=false build publish_artifacts: name: Publish Snapshot Artifacts @@ -169,7 +169,7 @@ jobs: ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} run: | ./gradlew javaToolchains - ./gradlew publish -x check + ./gradlew publish -x check -Porg.gradle.java.installations.auto-download=false update_documentation: name: Update Snapshot Documentation diff --git a/src/checkBuildReproducibility.sh b/src/checkBuildReproducibility.sh index a9fe7071ecdd..6432c6d242c0 100755 --- a/src/checkBuildReproducibility.sh +++ b/src/checkBuildReproducibility.sh @@ -7,7 +7,7 @@ export SOURCE_DATE_EPOCH=$(date +%s) function calculate_checksums() { OUTPUT=$1 - ./gradlew --no-build-cache clean assemble --parallel + ./gradlew --no-build-cache clean assemble --parallel -Porg.gradle.java.installations.auto-download=false find . -name '*.jar' \ | grep '/build/libs/' \ diff --git a/src/publishDocumentationSnapshotOnlyIfNecessary.sh b/src/publishDocumentationSnapshotOnlyIfNecessary.sh index c4ed2762ebf0..76013da728b6 100755 --- a/src/publishDocumentationSnapshotOnlyIfNecessary.sh +++ b/src/publishDocumentationSnapshotOnlyIfNecessary.sh @@ -58,5 +58,5 @@ else echo "Creating and publishing documentation..." echo cp --force "${current}" "${published}" - ./gradlew --scan gitPublishPush + ./gradlew --scan gitPublishPush -Porg.gradle.java.installations.auto-download=false fi From d9b83a9fb365a00150b41a2face5e69a41a2637e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 10:40:15 +0100 Subject: [PATCH 0236/1433] Inject toolchains via env vars consistently --- .github/workflows/main.yml | 4 ++-- gradle.properties | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c2740c5e0709..53f56064e034 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,7 +94,7 @@ jobs: run: | ./gradlew --version ./gradlew javaToolchains - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 -Porg.gradle.java.installations.auto-download=false build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.auto-download=false build ./gradlew --stop mac: @@ -142,7 +142,7 @@ jobs: run: | ./gradlew --version ./gradlew javaToolchains - ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.fromEnv=JDK8,JDK16 -Porg.gradle.java.installations.auto-download=false build + ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.auto-download=false build publish_artifacts: name: Publish Snapshot Artifacts diff --git a/gradle.properties b/gradle.properties index 71a1b8b79609..a93d783b30fd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,6 +15,7 @@ defaultBuiltBy = JUnit Team org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError org.gradle.caching=true org.gradle.parallel=true +org.gradle.java.installations.fromEnv=JDK8,JDK16 # Omit automatic compile dependency on kotlin-stdlib # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library From b81ca8957d0cdb873250389d5a25c04f1eac5ab6 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 10:48:49 +0100 Subject: [PATCH 0237/1433] Apply auto-download settings to javaToolchains task --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/cross-version.yml | 2 +- .github/workflows/main.yml | 10 +++++----- .github/workflows/reproducible-build.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2d0b5bb66543..835adf22a476 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,7 +43,7 @@ jobs: - name: Build run: | ./gradlew --version - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew --no-build-cache allMainClasses -PjavaToolchainVersion=11 -Porg.gradle.java.installations.auto-download=false - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index c8e5d9e474c7..843af6e7833d 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -45,5 +45,5 @@ jobs: - name: Test run: | ./gradlew --version - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} -Porg.gradle.java.installations.auto-download=false build "-Dscan.tag.JDK_${{ matrix.jdk }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 53f56064e034..c48ca538b915 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,7 +43,7 @@ jobs: - name: Test and Coverage run: | ./gradlew --version - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo -Porg.gradle.java.installations.auto-download=false build jacocoRootReport - name: Upload to Codecov.io uses: codecov/codecov-action@v1 @@ -93,7 +93,7 @@ jobs: shell: bash run: | ./gradlew --version - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.auto-download=false build ./gradlew --stop @@ -141,7 +141,7 @@ jobs: - name: 'Test' run: | ./gradlew --version - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -Porg.gradle.java.installations.auto-download=false build publish_artifacts: @@ -168,7 +168,7 @@ jobs: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} run: | - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew publish -x check -Porg.gradle.java.installations.auto-download=false update_documentation: @@ -195,5 +195,5 @@ jobs: GRGIT_USER: ${{ secrets.GH_TOKEN }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} run: | - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./src/publishDocumentationSnapshotOnlyIfNecessary.sh diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index 9cb23a2a9d86..f9c60055c82a 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -43,5 +43,5 @@ jobs: - name: Build and compare checksums shell: bash run: | - ./gradlew javaToolchains + ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./src/checkBuildReproducibility.sh From b5a35fc2c1801622c2614375aeb7c88a3c86e7d4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 11:05:26 +0100 Subject: [PATCH 0238/1433] Only output toolchains when building docs --- .github/workflows/main.yml | 4 +--- src/publishDocumentationSnapshotOnlyIfNecessary.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c48ca538b915..c778fd6ddb23 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -194,6 +194,4 @@ jobs: env: GRGIT_USER: ${{ secrets.GH_TOKEN }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - run: | - ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false - ./src/publishDocumentationSnapshotOnlyIfNecessary.sh + run: ./src/publishDocumentationSnapshotOnlyIfNecessary.sh diff --git a/src/publishDocumentationSnapshotOnlyIfNecessary.sh b/src/publishDocumentationSnapshotOnlyIfNecessary.sh index 76013da728b6..613ea73759a2 100755 --- a/src/publishDocumentationSnapshotOnlyIfNecessary.sh +++ b/src/publishDocumentationSnapshotOnlyIfNecessary.sh @@ -58,5 +58,5 @@ else echo "Creating and publishing documentation..." echo cp --force "${current}" "${published}" - ./gradlew --scan gitPublishPush -Porg.gradle.java.installations.auto-download=false + ./gradlew javaToolchains gitPublishPush -Porg.gradle.java.installations.auto-download=false fi From bbe0f1fff07c36dd10692018d5f3214697356f85 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 13:34:57 +0100 Subject: [PATCH 0239/1433] Remove Jupiter API dependency to avoid confusion --- .../junit-vintage-engine.gradle.kts | 1 - .../junit4/AbstractJUnit4TestCase.java | 2 +- .../junit4/JUnit4ParameterizedTestCase.java | 2 +- ...nerWithCustomUniqueIdsAndDisplayNames.java | 14 ++++++++++--- ...nerWithCustomUniqueIdsAndDisplayNames.java | 21 ++++++++++++------- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index 440eaf775b4b..75985528acf7 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -19,7 +19,6 @@ dependencies { api("junit:junit") testFixturesApi("org.spockframework:spock-core") - testFixturesApi(project(":junit-jupiter-api")) testFixturesImplementation(project(":junit-platform-runner")) testImplementation(project(":junit-platform-launcher")) diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java index 582aa3e03827..210f6e883007 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/AbstractJUnit4TestCase.java @@ -10,7 +10,7 @@ package org.junit.vintage.engine.samples.junit4; -import org.junit.jupiter.api.Test; +import org.junit.Test; public abstract class AbstractJUnit4TestCase { diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java index 7811e4b33ffd..16b4bbb897db 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4ParameterizedTestCase.java @@ -10,7 +10,7 @@ package org.junit.vintage.engine.samples.junit4; -import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.Assert.fail; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java index 175cfeec0d26..713c0abd9c0e 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames.java @@ -10,22 +10,30 @@ package org.junit.vintage.engine.samples.junit4; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; + import org.junit.Assert; import org.junit.Test; -import org.junit.jupiter.api.DisplayName; import org.junit.runner.RunWith; /** * @since 4.12 */ -@DisplayName("(TestClass)") +@Label("(TestClass)") @RunWith(RunnerWithCustomUniqueIdsAndDisplayNames.class) public class JUnit4TestCaseWithRunnerWithCustomUniqueIdsAndDisplayNames { @Test - @DisplayName("(TestMethod)") + @Label("(TestMethod)") public void test() { Assert.fail(); } } + +@Retention(RUNTIME) +@interface Label { + String value(); +} diff --git a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java index 971f19cc642f..c106c6649cd4 100644 --- a/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java +++ b/junit-vintage-engine/src/testFixtures/java/org/junit/vintage/engine/samples/junit4/RunnerWithCustomUniqueIdsAndDisplayNames.java @@ -12,12 +12,14 @@ import static org.junit.runner.Description.createTestDescription; +import java.io.Serial; import java.io.Serializable; import java.util.Objects; +import java.util.function.Supplier; -import org.junit.jupiter.api.DisplayName; import org.junit.runner.Description; import org.junit.runners.BlockJUnit4ClassRunner; +import org.junit.runners.model.Annotatable; import org.junit.runners.model.FrameworkMethod; import org.junit.runners.model.InitializationError; @@ -32,23 +34,28 @@ public RunnerWithCustomUniqueIdsAndDisplayNames(Class klass) throws Initializ @Override protected String getName() { - var displayName = getTestClass().getAnnotation(DisplayName.class); - return displayName == null ? super.getName() : displayName.value(); + return getLabel(getTestClass(), super::getName); } @Override protected Description describeChild(FrameworkMethod method) { - var testName = getTestName(method); + var testName = testName(method); return createTestDescription(getTestClass().getJavaClass().getName(), testName, new CustomUniqueId(testName)); } - private String getTestName(FrameworkMethod method) { - var displayName = method.getAnnotation(DisplayName.class); - return displayName == null ? testName(method) : displayName.value(); + @Override + protected String testName(FrameworkMethod method) { + return getLabel(method, () -> super.testName(method)); + } + + private String getLabel(Annotatable element, Supplier fallback) { + var label = element.getAnnotation(Label.class); + return label == null ? fallback.get() : label.value(); } private static class CustomUniqueId implements Serializable { + @Serial private static final long serialVersionUID = 1L; private final String testName; From bd72a4f3d42892ab4d11f7c9d209ded2bcfc0c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc=20Pap?= Date: Fri, 19 Mar 2021 17:57:47 +0100 Subject: [PATCH 0240/1433] Remove package name validation from classpath scanning (#2571) The validation was problematic since it re-implemented name validation to avoid a dependency to a JDK class and was missing checks for primitive types. Removing it is fine since classpath scanning with invalid package names does not cause errors but merely doesn't find any classes, just like classpath scanning for a non-existent package. Fixes #2570. --- .../commons/util/ClasspathScanner.java | 6 +- .../platform/commons/util/PackageUtils.java | 92 +------------------ .../support/ReflectionSupportTests.java | 6 +- .../commons/util/PackageUtilsTests.java | 53 ----------- 4 files changed, 8 insertions(+), 149 deletions(-) diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java index 398332d7d25a..c1cc51fab77b 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java @@ -15,6 +15,7 @@ import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toList; import static org.junit.platform.commons.util.ClassFileVisitor.CLASS_FILE_SUFFIX; +import static org.junit.platform.commons.util.StringUtils.isNotBlank; import java.io.IOException; import java.net.URI; @@ -69,8 +70,9 @@ class ClasspathScanner { } List> scanForClassesInPackage(String basePackageName, ClassFilter classFilter) { - - PackageUtils.assertPackageNameIsValid(basePackageName); + Preconditions.condition( + PackageUtils.DEFAULT_PACKAGE_NAME.equals(basePackageName) || isNotBlank(basePackageName), + "basePackageName must not be null or blank"); Preconditions.notNull(classFilter, "classFilter must not be null"); basePackageName = basePackageName.trim(); diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java index 0e220bde4a75..12978601f6f3 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/PackageUtils.java @@ -14,17 +14,11 @@ import java.io.File; import java.net.URL; -import java.security.CodeSource; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; import java.util.Optional; -import java.util.Set; import java.util.function.Function; import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.Manifest; -import java.util.regex.Pattern; import org.apiguardian.api.API; @@ -48,36 +42,6 @@ private PackageUtils() { static final String DEFAULT_PACKAGE_NAME = ""; - /** - * Compiled {@code "\."} pattern used to split canonical package (and type) names. - */ - private static final Pattern DOT_PATTERN = Pattern.compile("\\."); - - /** - * Assert that the supplied package name is valid in terms of Java syntax. - * - *

    Note: this method does not actually verify if the named package - * exists in the classpath. - * - *

    The default package is represented by an empty string ({@code ""}). - * - * @param packageName the package name to validate - * @throws org.junit.platform.commons.PreconditionViolationException if the - * supplied package name is {@code null}, contains only whitespace, or - * contains parts that are not valid in terms of Java syntax (e.g., - * containing keywords such as {@code void}, {@code import}, etc.) - * @see JavaNameUtils#isJavaName(String) - */ - public static void assertPackageNameIsValid(String packageName) { - Preconditions.notNull(packageName, "package name must not be null"); - if (packageName.equals(DEFAULT_PACKAGE_NAME)) { - return; - } - Preconditions.notBlank(packageName, "package name must not contain only whitespace"); - boolean allValid = Arrays.stream(DOT_PATTERN.split(packageName, -1)).allMatch(JavaNameUtils::isJavaName); - Preconditions.condition(allValid, "invalid part(s) in package name: " + packageName); - } - /** * Get the package attribute for the supplied {@code type} using the * supplied {@code function}. @@ -101,11 +65,7 @@ public static void assertPackageNameIsValid(String packageName) { public static Optional getAttribute(Class type, Function function) { Preconditions.notNull(type, "type must not be null"); Preconditions.notNull(function, "function must not be null"); - Package typePackage = type.getPackage(); - if (typePackage != null) { - return Optional.ofNullable(function.apply(typePackage)); - } - return Optional.empty(); + return Optional.ofNullable(type.getPackage()).map(function); } /** @@ -129,11 +89,9 @@ public static Optional getAttribute(Class type, String name) { Preconditions.notNull(type, "type must not be null"); Preconditions.notBlank(name, "name must not be blank"); try { - CodeSource codeSource = type.getProtectionDomain().getCodeSource(); - URL jarUrl = codeSource.getLocation(); + URL jarUrl = type.getProtectionDomain().getCodeSource().getLocation(); try (JarFile jarFile = new JarFile(new File(jarUrl.toURI()))) { - Manifest manifest = jarFile.getManifest(); - Attributes mainAttributes = manifest.getMainAttributes(); + Attributes mainAttributes = jarFile.getManifest().getMainAttributes(); return Optional.ofNullable(mainAttributes.getValue(name)); } } @@ -141,48 +99,4 @@ public static Optional getAttribute(Class type, String name) { return Optional.empty(); } } - - /** - * Collection of utilities for working with qualified names in Java. - * - * @since 1.6 - */ - static class JavaNameUtils { - - private static final Set RESTRICTED_KEYWORDS = Collections.unmodifiableSet( - new HashSet<>(Arrays.asList("_", "abstract", "assert", "break", "case", "catch", "const", "continue", - "default", "do", "else", "enum", "false", "final", "finally", "for", "goto", "if", "import", - "instanceof", "native", "new", "null", "private", "protected", "public", "return", "static", "strictfp", - "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "volatile", "while"))); - - /** - * Determine if the supplied {@code name} is a syntactically valid qualified name. - * - * @param name the string to check - * @return {@code true} if the supplied string is a syntactically valid name - */ - static boolean isJavaName(String name) { - return name != null && !name.isEmpty() && isNotRestrictedKeyword(name) && isJavaIdentifier(name); - } - - private static boolean isNotRestrictedKeyword(String name) { - return !RESTRICTED_KEYWORDS.contains(name); - } - - private static boolean isJavaIdentifier(String name) { - int start = name.codePointAt(0); - if (!Character.isJavaIdentifierStart(start)) { - return false; - } - int charCount = Character.charCount(start); - for (int i = charCount; i < name.length(); i += charCount) { - int codePoint = name.codePointAt(i); - if (!Character.isJavaIdentifierPart(codePoint)) { - return false; - } - } - return true; - } - } - } diff --git a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java index 46b9dedc1288..3e3298ad4879 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/support/ReflectionSupportTests.java @@ -105,10 +105,6 @@ void findAllClassesInClasspathRootPreconditions() { @Test void findAllClassesInPackageDelegates() { - assertThrows(PreconditionViolationException.class, - () -> ReflectionUtils.findAllClassesInPackage("void.return.null", allTypes, allNames)); - assertThrows(PreconditionViolationException.class, - () -> ReflectionSupport.findAllClassesInPackage("void.return.null", allTypes, allNames)); assertNotEquals(0, ReflectionSupport.findAllClassesInPackage("org.junit", allTypes, allNames).size()); assertEquals(ReflectionUtils.findAllClassesInPackage("org.junit", allTypes, allNames), ReflectionSupport.findAllClassesInPackage("org.junit", allTypes, allNames)); @@ -116,7 +112,7 @@ void findAllClassesInPackageDelegates() { @Test void findAllClassesInPackagePreconditions() { - assertPreconditionViolationException("package name", + assertPreconditionViolationExceptionForString("basePackageName", () -> ReflectionSupport.findAllClassesInPackage(null, allTypes, allNames)); assertPreconditionViolationException("class predicate", () -> ReflectionSupport.findAllClassesInPackage("org.junit", null, allNames)); diff --git a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java index ee9fe5b8e26d..0005995a1e00 100644 --- a/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java +++ b/platform-tests/src/test/java/org/junit/platform/commons/util/PackageUtilsTests.java @@ -19,17 +19,11 @@ import java.util.List; import java.util.function.Function; -import javax.lang.model.SourceVersion; - import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestFactory; import org.junit.jupiter.api.function.Executable; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; import org.junit.platform.commons.PreconditionViolationException; -import org.junit.platform.commons.util.PackageUtils.JavaNameUtils; import org.opentest4j.ValueWrapper; /** @@ -39,30 +33,6 @@ */ class PackageUtilsTests { - @Test - void assertPackageNameIsValidForValidPackageNames() { - PackageUtils.assertPackageNameIsValid(""); // default package - PackageUtils.assertPackageNameIsValid("non.existing.but.all.segments.are.syntactically.valid"); - } - - @Test - void assertPackageNameIsValidForNullPackageName() { - assertThrows(PreconditionViolationException.class, () -> PackageUtils.assertPackageNameIsValid(null)); - } - - @Test - void assertPackageNameIsValidForWhitespacePackageName() { - assertThrows(PreconditionViolationException.class, () -> PackageUtils.assertPackageNameIsValid(" ")); - } - - @Test - void assertPackageNameIsValidForInvalidPackageNames() { - assertThrows(PreconditionViolationException.class, () -> PackageUtils.assertPackageNameIsValid(".a")); - assertThrows(PreconditionViolationException.class, () -> PackageUtils.assertPackageNameIsValid("a.")); - assertThrows(PreconditionViolationException.class, () -> PackageUtils.assertPackageNameIsValid("a..b")); - assertThrows(PreconditionViolationException.class, () -> PackageUtils.assertPackageNameIsValid("byte.true")); - } - @Test void getAttributeWithNullType() { var exception = assertThrows(PreconditionViolationException.class, @@ -125,27 +95,4 @@ void getAttributeWithEmptyName() { () -> PackageUtils.getAttribute(getClass(), "")); assertEquals("name must not be blank", exception.getMessage()); } - - @Nested - class JavaNameUtilsTests { - - @ParameterizedTest - @ValueSource(strings = { "name", "_NAME", "null", "var", "public", "$+!", "", " ", "123", "true" }) - void isJavaName(String s) { - assertEquals(SourceVersion.isName(s), JavaNameUtils.isJavaName(s)); - } - - @Test - void isJavaNameWithNullValue() { - // According to https://bugs.openjdk.java.net/browse/JDK-6362039, - // SourceVersion.isName(null) throws a NullPointerException instead - // of returning false. - assertThrows(NullPointerException.class, () -> SourceVersion.isName(null)); - - // However, for our purposes, we return false for a null value. - assertFalse(JavaNameUtils.isJavaName(null)); - } - - } - } From 37171ef100573126e0b70ec95c6ffd7556a3142f Mon Sep 17 00:00:00 2001 From: Juliette de Rancourt Date: Sun, 21 Mar 2021 19:36:06 +0100 Subject: [PATCH 0241/1433] Document fully qualified method name syntax for custom conditions This commit adds a sample in the user guide to clarify the use of custom conditions located in external classes. Resolves #2556 --- .../asciidoc/user-guide/writing-tests.adoc | 14 ++++++-- .../example/ExternalCustomConditionDemo.java | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 documentation/src/test/java/example/ExternalCustomConditionDemo.java diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 6d754563811c..88d3ee2c1137 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -462,8 +462,7 @@ indirectly present, or meta-present on a given element. A container or test may be enabled or disabled based on the boolean return of a method via the `{EnabledIf}` and `{DisabledIf}` annotations. The method is provided to -the annotation via its name, or its fully qualified name if located outside the test -class. +the annotation via its name. If needed, the condition method can take a single parameter of type `ExtensionContext`. [source,java,indent=0] @@ -471,6 +470,17 @@ If needed, the condition method can take a single parameter of type `ExtensionCo include::{testDir}/example/ConditionalTestExecutionDemo.java[tags=user_guide_custom] ---- +Alternatively, the condition method can be located outside the test class. In this case, +it has to be referenced by its _fully qualified name_ as demonstrated in the following +example. + +[source,java,indent=0] +---- +package example; + +include::{testDir}/example/ExternalCustomConditionDemo.java[tags=user_guide_external_custom_condition] +---- + NOTE: When `{EnabledIf}` or `{DisabledIf}` is used at class level, the condition method must always be `static`. Condition methods located in external classes must also be `static`. In any other case, you can use both static or instance methods. diff --git a/documentation/src/test/java/example/ExternalCustomConditionDemo.java b/documentation/src/test/java/example/ExternalCustomConditionDemo.java new file mode 100644 index 000000000000..c577c61f0741 --- /dev/null +++ b/documentation/src/test/java/example/ExternalCustomConditionDemo.java @@ -0,0 +1,34 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package example; + +// tag::user_guide_external_custom_condition[] +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIf; + +class ExternalCustomConditionDemo { + + @Test + @EnabledIf("example.ExternalCondition#customCondition") + void enabled() { + // ... + } + +} + +class ExternalCondition { + + static boolean customCondition() { + return true; + } + +} +// end::user_guide_external_custom_condition[] From e16bf9e64e6d7bff2e765aee5421314f52307f63 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 22 Mar 2021 17:12:07 +0100 Subject: [PATCH 0242/1433] Upgrade to latest test-retry plugin and remove workaround --- buildSrc/build.gradle.kts | 2 +- gradle.properties | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 864391b24205..1d44413d34d1 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -13,7 +13,7 @@ dependencies { implementation(kotlin("gradle-plugin")) implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") - implementation("org.gradle:test-retry-gradle-plugin:1.2.0") + implementation("org.gradle:test-retry-gradle-plugin:1.2.1") } tasks.withType().configureEach { diff --git a/gradle.properties b/gradle.properties index a93d783b30fd..a20933fbd46a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -66,6 +66,3 @@ asciidoctor.plugin.version=3.3.0 jmh.plugin.version=0.5.2 nohttp.plugin.version=0.0.5.RELEASE nexus-publish.plugin.version=1.0.0 - -# Temporarily disabled until test-retry plugin is compatible with JDK 16 -retries=0 From 3dc9650ef34084d291004efdbe7d6b118948b3a8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 19 Mar 2021 17:46:57 +0100 Subject: [PATCH 0243/1433] Enable Test Distribution in all but one project --- buildSrc/build.gradle.kts | 2 ++ buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 5 +++++ gradle.properties | 4 ++++ junit-jupiter-engine/junit-jupiter-engine.gradle.kts | 8 ++++++++ .../launcher/listeners/MutableTestExecutionSummary.java | 6 +++++- .../launcher/listeners/SummaryGeneratingListener.java | 1 + junit-vintage-engine/junit-vintage-engine.gradle.kts | 4 +--- .../junit/vintage/engine/VintageTestEngineBasicTests.java | 5 ----- platform-tests/platform-tests.gradle.kts | 5 +++++ .../java/org/junit/jupiter/extensions/Heavyweight.java | 1 + .../options/PicocliCommandLineOptionsParserTests.java | 8 +++++--- .../platform-tooling-support-tests.gradle.kts | 4 ++++ settings.gradle.kts | 6 ++++++ 13 files changed, 47 insertions(+), 12 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 1d44413d34d1..b48dc52db322 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -7,6 +7,7 @@ plugins { repositories { mavenCentral() gradlePluginPortal() + maven(url = "https://repo.gradle.org/gradle/enterprise-libs-release-candidates-local/") } dependencies { @@ -14,6 +15,7 @@ dependencies { implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.gradle:test-retry-gradle-plugin:1.2.1") + compileOnly("com.gradle.enterprise:test-distribution-gradle-plugin:2.0.2-rc-2") } tasks.withType().configureEach { diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index ef60d6f4539a..e4a9073dae02 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -18,6 +18,11 @@ tasks.withType().configureEach { retry { maxRetries.set(providers.gradleProperty("retries").map(String::toInt).orElse(2)) } + distribution { + enabled.convention(providers.gradleProperty("enableTestDistribution").map(String::toBoolean).orElse(false)) + maxLocalExecutors.set(providers.gradleProperty("testDistribution.maxLocalExecutors").map(String::toInt).orElse(1)) + maxRemoteExecutors.set(providers.gradleProperty("testDistribution.maxRemoteExecutors").map(String::toInt)) + } systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") // Required until ASM officially supports the JDK 14 systemProperty("net.bytebuddy.experimental", true) diff --git a/gradle.properties b/gradle.properties index a20933fbd46a..25acc52bf6a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,6 +17,9 @@ org.gradle.caching=true org.gradle.parallel=true org.gradle.java.installations.fromEnv=JDK8,JDK16 +# Test Distribution +gradle.internal.testdistribution.writeTraceFile=true + # Omit automatic compile dependency on kotlin-stdlib # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library kotlin.stdlib.default.dependency=false @@ -55,6 +58,7 @@ bnd.version=5.3.0 # Plugins gradle.enterprise.plugin.version=3.6 +test.distribution.plugin.version=2.0.2-rc-2 gradle.user-data.plugin.version=1.2 versioning.plugin.version=2.14.0 versions.plugin.version=0.36.0 diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 9cb4fd434c14..9c6763e75174 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -1,3 +1,5 @@ +import org.gradle.api.tasks.PathSensitivity.RELATIVE + plugins { `kotlin-library-conventions` `testing-conventions` @@ -22,3 +24,9 @@ dependencies { testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") testImplementation("org.codehaus.groovy:groovy") } + +tasks { + test { + inputs.dir("src/test/resources").withPathSensitivity(RELATIVE) + } +} diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java index f9236ad91cae..09890e551fe4 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/MutableTestExecutionSummary.java @@ -14,6 +14,7 @@ import static java.util.Collections.synchronizedList; import java.io.PrintWriter; +import java.time.Duration; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -57,13 +58,16 @@ class MutableTestExecutionSummary implements TestExecutionSummary { private final TestPlan testPlan; private final List failures = synchronizedList(new ArrayList<>()); private final long timeStarted; + private final long timeStartedNanos; long timeFinished; + long timeFinishedNanos; MutableTestExecutionSummary(TestPlan testPlan) { this.testPlan = testPlan; this.containersFound.set(testPlan.countTestIdentifiers(TestIdentifier::isContainer)); this.testsFound.set(testPlan.countTestIdentifiers(TestIdentifier::isTest)); this.timeStarted = System.currentTimeMillis(); + this.timeStartedNanos = System.nanoTime(); } void addFailure(TestIdentifier testIdentifier, Throwable throwable) { @@ -165,7 +169,7 @@ public void printTo(PrintWriter writer) { + "[%10d tests failed ]%n" + "%n", - (this.timeFinished - this.timeStarted), + Duration.ofNanos(this.timeFinishedNanos - this.timeStartedNanos).toMillis(), getContainersFoundCount(), getContainersSkippedCount(), diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java index 39ce7fe0540e..451e92e98bf4 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/SummaryGeneratingListener.java @@ -51,6 +51,7 @@ public void testPlanExecutionStarted(TestPlan testPlan) { @Override public void testPlanExecutionFinished(TestPlan testPlan) { this.summary.timeFinished = System.currentTimeMillis(); + this.summary.timeFinishedNanos = System.nanoTime(); } @Override diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index 75985528acf7..c02f2158124b 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -63,9 +63,7 @@ tasks { (options as JUnitPlatformOptions).apply { includeTags("missing-junit4") } - filter { - includeTestsMatching("org.junit.vintage.engine.JUnit4VersionCheckTests") - } + setIncludes(listOf("**/JUnit4VersionCheckTests.class")) classpath = classpath.filter { !it.name.startsWith("junit-4") } diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java index 00abbdbdedc1..f16342cad37c 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageTestEngineBasicTests.java @@ -39,9 +39,4 @@ void artifactId() { assertEquals("junit-vintage-engine", vintage.getArtifactId().get()); } - @Test - void version() { - assertEquals("DEVELOPMENT", vintage.getVersion().get()); - } - } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index babacf5a3439..bc75c1ae9638 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -1,3 +1,5 @@ +import org.gradle.api.tasks.PathSensitivity.RELATIVE + plugins { `java-library-conventions` `junit4-compatibility` @@ -59,6 +61,9 @@ tasks { } jvmArgs("-Xmx1g") } + test { + inputs.dir("src/test/resources").withPathSensitivity(RELATIVE) + } test_4_12 { useJUnitPlatform { includeTags("junit4") diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java index ae8998cb783d..499b00220308 100644 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java +++ b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java @@ -72,6 +72,7 @@ private static class ResourceValue implements Resource, CloseableResource, AutoC public void close() { // Close resources here. assertEquals(9, usages.get(), "Usage counter mismatch!"); + usages.set(0); } @Override diff --git a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java index e163214ef7a1..9bea3b47d942 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java @@ -26,6 +26,7 @@ import java.io.Writer; import java.net.URI; import java.nio.file.Files; +import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.Map; @@ -34,6 +35,7 @@ import java.util.stream.Stream; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.platform.commons.JUnitException; @@ -265,7 +267,7 @@ void parseInvalidExcludedEngines() { @ParameterizedTest @EnumSource - void parseValidAdditionalClasspathEntries(ArgsType type) { + void parseValidAdditionalClasspathEntries(ArgsType type, @TempDir Path tempDir) { var dir = Paths.get("."); // @formatter:off assertAll( @@ -277,8 +279,8 @@ void parseValidAdditionalClasspathEntries(ArgsType type) { () -> assertEquals(List.of(dir), type.parseArgLine("--classpath=.").getAdditionalClasspathEntries()), () -> assertEquals(List.of(dir), type.parseArgLine("--class-path .").getAdditionalClasspathEntries()), () -> assertEquals(List.of(dir), type.parseArgLine("--class-path=.").getAdditionalClasspathEntries()), - () -> assertEquals(List.of(dir, Paths.get("src", "test", "java")), type.parseArgLine("-cp . -cp src/test/java").getAdditionalClasspathEntries()), - () -> assertEquals(List.of(dir, Paths.get("src", "test", "java")), type.parseArgLine("-cp ." + File.pathSeparator + "src/test/java").getAdditionalClasspathEntries()) + () -> assertEquals(List.of(dir, tempDir), type.parseArgLine("-cp . -cp " + tempDir).getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir, tempDir), type.parseArgLine("-cp ." + File.pathSeparator + tempDir).getAdditionalClasspathEntries()) ); // @formatter:on } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index e14f5271015e..d4c15d41d159 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -78,6 +78,10 @@ tasks.test { includeEngines("archunit") } + distribution { + enabled.set(false) + } + maxParallelForks = 1 // Bartholdy.install is not parallel safe, see https://github.com/sormuras/bartholdy/issues/4 } diff --git a/settings.gradle.kts b/settings.gradle.kts index 40b99b011640..06d3bf2b961e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,8 +1,13 @@ import com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures pluginManagement { + repositories { + gradlePluginPortal() + maven(url = "https://repo.gradle.org/gradle/enterprise-libs-release-candidates-local/") + } plugins { id("com.gradle.enterprise") version settings.extra["gradle.enterprise.plugin.version"] as String + id("com.gradle.enterprise.test-distribution") version settings.extra["test.distribution.plugin.version"] as String id("com.gradle.common-custom-user-data-gradle-plugin") version settings.extra["gradle.user-data.plugin.version"] as String id("net.nemerosa.versioning") version settings.extra["versioning.plugin.version"] as String id("com.github.ben-manes.versions") version settings.extra["versions.plugin.version"] as String @@ -19,6 +24,7 @@ pluginManagement { plugins { id("com.gradle.enterprise") + id("com.gradle.enterprise.test-distribution") id("com.gradle.common-custom-user-data-gradle-plugin") } From 7ded907944fc8cccdf7cee8465b7433c316d6dc8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 25 Mar 2021 18:33:47 +0100 Subject: [PATCH 0244/1433] Clear temp repo so it only contains single snapshot --- build.gradle.kts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index a744ac40be8c..71a131c240f0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -123,6 +123,12 @@ allprojects { } } +val clearTempRepoDir by tasks.registering { + doFirst { + tempRepoDir.deleteRecursively() + } +} + subprojects { if (project in jupiterProjects) { @@ -201,6 +207,11 @@ subprojects { } } } + tasks.withType().configureEach { + if (name.endsWith("To${tempRepoName.capitalize()}Repository")) { + dependsOn(clearTempRepoDir) + } + } } } From 500be6e20106a8ca1673616c27102f5c0830b013 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 25 Mar 2021 18:34:26 +0100 Subject: [PATCH 0245/1433] Only pass toolchain JDK if TD is disabled --- .../platform-tooling-support-tests.gradle.kts | 12 +++++++++--- .../main/java/platform/tooling/support/Helper.java | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index d4c15d41d159..47b9c12a8f6d 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -90,6 +90,9 @@ class MavenRepo(@get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) } class JavaHomeDir(project: Project, @Input val version: Int) : CommandLineArgumentProvider { + @Internal + val passToolchain = project.providers.gradleProperty("enableTestDistribution").map(String::toBoolean).orElse(false).map { !it } + @Internal val javaLauncher: Property = project.objects.property() .value(project.provider { @@ -103,8 +106,11 @@ class JavaHomeDir(project: Project, @Input val version: Int) : CommandLineArgume }) override fun asArguments(): List { - val metadata = javaLauncher.map { it.metadata } - val javaHome = metadata.map { it.installationPath.asFile.absolutePath }.orNull - return javaHome?.let { listOf("-Djava.home.$version=$it") } ?: emptyList() + if (passToolchain.get()) { + val metadata = javaLauncher.map { it.metadata } + val javaHome = metadata.map { it.installationPath.asFile.absolutePath }.orNull + return javaHome?.let { listOf("-Djava.home.$version=$it") } ?: emptyList() + } + return emptyList() } } diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java index 9bdfe26f6547..b6c79dec27a0 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java @@ -117,7 +117,8 @@ public static Optional getJavaHome(String version) { System.getProperty("jdk.home." + version), // System.getProperty("jdk." + version), // System.getenv("JAVA_HOME_" + version), // - System.getenv("JAVA_" + version) // + System.getenv("JAVA_" + version), // + System.getenv("JDK" + version) // ); return sources.filter(Objects::nonNull).findFirst().map(Path::of); } From 07302b3e30cb5b734fd6a9fc5f283544e73f8423 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 25 Mar 2021 18:34:45 +0100 Subject: [PATCH 0246/1433] Add build scan tag when TD is enabled --- settings.gradle.kts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 06d3bf2b961e..154de8d6475b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -62,6 +62,14 @@ gradleEnterprise { ipAddresses { emptyList() } } } + + val enableTestDistribution = providers.gradleProperty("enableTestDistribution") + .forUseAtConfigurationTime() + .map(String::toBoolean) + .getOrElse(false) + if (enableTestDistribution) { + tag("test-distribution") + } } } From 1d01ba77e8d0b98b1a03ed16e38806cbf674aa39 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 11:34:38 +0100 Subject: [PATCH 0247/1433] Delete JavacModulesTest The test duplicates what the build is doing when compiling module descriptors. --- .../support/tests/JavacModulesTests.java | 155 ------------------ 1 file changed, 155 deletions(-) delete mode 100644 platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java deleted file mode 100644 index 7fa8a022bfdb..000000000000 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavacModulesTests.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2015-2021 the original author or authors. - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which - * accompanies this distribution and is available at - * - * https://www.eclipse.org/legal/epl-v20.html - */ - -package platform.tooling.support.tests; - -import static java.util.stream.Collectors.joining; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertLinesMatch; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.io.UncheckedIOException; -import java.io.Writer; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.function.Function; -import java.util.regex.Pattern; -import java.util.spi.ToolProvider; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; -import platform.tooling.support.Helper; - -/** - * @since 1.5 - */ -class JavacModulesTests { - - private static final Pattern MODULE_NAME_PATTERN = Pattern.compile("(module)\\s+(.+)\\s*\\{.*"); - - private static class Project { - final Path moduleInfo; - final Path moduleSource; - final String moduleName; - final Path javaClassesDir; - - Project(Path moduleInfo) { - this.moduleInfo = moduleInfo; - this.moduleSource = moduleInfo.getParent().getParent(); - this.javaClassesDir = moduleSource.getParent().getParent().resolve("build/classes/java"); - try { - var nameMatcher = MODULE_NAME_PATTERN.matcher(Files.readString(moduleInfo)); - if (!nameMatcher.find()) { - throw new Error("Expected java module descriptor unit, but got: " + moduleInfo); - } - this.moduleName = nameMatcher.group(2).trim(); - } - catch (Exception e) { - throw new Error("Extracting module name failed", e); - } - } - - private Stream getMainOutputDirs() { - try { - return Files.list(javaClassesDir) // - .filter(Files::isDirectory) // - .filter(dir -> dir.getFileName().toString().startsWith("main")); - } - catch (IOException e) { - throw new UncheckedIOException(e); - } - } - } - - private static List compileModules(Path temp, Writer out, Writer err, Function> patch) - throws Exception { - var args = new ArrayList(); - args.add("-Xlint:all,-requires-automatic,-requires-transitive-automatic"); - args.add("-proc:none"); // disable annotation processing - args.add("-cp"); - args.add(""); // set empty class path, otherwise system property "java.class.path" is read - - args.add("-d"); - args.add(temp.resolve("destination").toString()); - - var lib = temp.resolve("lib"); - Files.createDirectories(lib); - Helper.load(lib, "junit", "junit", "4.12"); - Helper.load(lib, "org.assertj", "assertj-core", "3.13.2"); - Helper.load(lib, "org.apiguardian", "apiguardian-api", "1.1.0"); - Helper.load(lib, "org.opentest4j", "opentest4j", "1.2.0"); - args.add("--module-path"); - args.add(lib.toString()); - - var base = Path.of("..").toAbsolutePath().normalize(); - try (var walk = Files.walk(base)) { - var projects = walk.filter(path -> path.endsWith("module-info.java")) // - .map(base::relativize) // - .filter(path -> !path.startsWith("platform-tests")) // - .filter(path -> !path.startsWith("platform-tooling-support-tests")) // - .map(base::resolve) // - .map(Project::new) // - .collect(Collectors.toList()); - assertEquals(18, projects.size()); - - args.add("--module-source-path"); - args.add(projects.stream() // - .map(project -> project.moduleSource) // - .map(Object::toString) // - .collect(joining(File.pathSeparator))); - - for (var project : projects) { - var path = patch.apply(project).map(Path::toString).collect(joining(File.pathSeparator)); - if (path.isEmpty()) { - continue; - } - args.add("--patch-module"); - args.add(project.moduleName + "=" + path); - } - - projects.forEach(project -> args.add(project.moduleInfo.toString())); - - var javac = ToolProvider.findFirst("javac").orElseThrow(); - javac.run(new PrintWriter(out), new PrintWriter(err), args.toArray(String[]::new)); - - assertTrue(out.toString().isBlank(), out.toString()); - } - return args; - } - - @Test - void patchMainClasses(@TempDir Path temp) throws Exception { - var out = new StringWriter(); - var err = new StringWriter(); - - var args = compileModules(temp, out, err, Project::getMainOutputDirs); - - assertTrue(err.toString().isBlank(), () -> err.toString() + "\n\n" + String.join("\n", args)); - - var listing = Helper.treeWalk(temp); - assertLinesMatch(List.of( // - "destination", // - ">> CLASSES >>", // - "lib", // - "lib/apiguardian-api-1.1.0.jar", // - "lib/assertj-core-3.13.2.jar", // - "lib/junit-4.12.jar", // - "lib/opentest4j-1.2.0.jar"), listing); - } - -} From d767a990873c16dfd548c46c1bf479113af2006e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 11:35:14 +0100 Subject: [PATCH 0248/1433] Remove unnecessary test filter --- .../platform-tooling-support-tests.gradle.kts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 47b9c12a8f6d..c916a13850ae 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -69,11 +69,6 @@ tasks.test { jvmArgumentProviders += JavaHomeDir(project, 8) } - filter { - // Include only tests from this module - includeTestsMatching("platform.tooling.support.*") - } - (options as JUnitPlatformOptions).apply { includeEngines("archunit") } From f105349869c0dad1d65a743b23c8ab56de1226e0 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 11:36:58 +0100 Subject: [PATCH 0249/1433] Read artifacts from local Maven repo --- .../platform-tooling-support-tests.gradle.kts | 36 +++++++----- .../junit-jupiter-api.expected.txt | 4 +- .../junit-jupiter-engine.expected.txt | 2 +- ...unit-jupiter-migrationsupport.expected.txt | 2 +- .../junit-jupiter-params.expected.txt | 4 +- .../junit-jupiter.expected.txt | 2 +- .../junit-platform-commons.expected.txt | 2 +- .../junit-platform-console.expected.txt | 2 +- .../junit-platform-engine.expected.txt | 2 +- .../junit-platform-jfr.expected.txt | 2 +- .../junit-platform-launcher.expected.txt | 2 +- .../junit-platform-reporting.expected.txt | 4 +- .../junit-platform-runner.expected.txt | 2 +- .../junit-platform-suite-api.expected.txt | 2 +- .../junit-platform-suite-commons.expected.txt | 2 +- .../junit-platform-suite-engine.expected.txt | 2 +- .../junit-platform-suite.expected.txt | 2 +- .../junit-platform-testkit.expected.txt | 4 +- .../junit-vintage-engine.expected.txt | 4 +- .../java/platform/tooling/support/Helper.java | 22 ++++--- .../platform/tooling/support/MavenRepo.java | 57 +++++++++++++++++++ .../support/tests/AntStarterTests.java | 7 ++- .../tests/GradleKotlinExtensionsTests.java | 7 ++- .../tests/GradleMissingEngineTests.java | 10 ++-- .../support/tests/GradleModuleFileTests.java | 7 +-- .../support/tests/GradleStarterTests.java | 7 ++- .../tests/JarContainsManifestFirstTests.java | 4 +- .../support/tests/JarDescribeModuleTests.java | 10 ++-- .../support/tests/JavaVersionsTests.java | 7 ++- .../tooling/support/tests/ManifestTests.java | 9 +-- .../support/tests/MavenPomFileTests.java | 12 +--- .../support/tests/MavenStarterTests.java | 7 ++- .../support/tests/MultiReleaseJarTests.java | 8 ++- .../tests/PackageCyclesDetectionTests.java | 4 +- .../support/tests/StandaloneTests.java | 11 ++-- .../support/tests/ToolProviderTests.java | 11 +++- .../tests/VintageGradleIntegrationTests.java | 7 ++- .../tests/VintageMavenIntegrationTests.java | 7 ++- 38 files changed, 186 insertions(+), 110 deletions(-) create mode 100644 platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index c916a13850ae..5086239a2b93 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -1,3 +1,4 @@ +import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.jvm.toolchain.internal.NoToolchainAvailableException plugins { @@ -41,8 +42,6 @@ dependencies { } tasks.test { - inputs.dir("projects") - // Opt-in via system property: '-Dplatform.tooling.support.tests.enabled=true' enabled = System.getProperty("platform.tooling.support.tests.enabled")?.toBoolean() ?: false @@ -53,34 +52,45 @@ tasks.test { // All maven-aware projects must be installed, i.e. published to the local repository val mavenizedProjects: List by rootProject val tempRepoName: String by rootProject - val tempRepoDir: File by rootProject (mavenizedProjects + project(":junit-bom")) .map { project -> project.tasks.named("publishAllPublicationsTo${tempRepoName.capitalize()}Repository") } .forEach { dependsOn(it) } + } - // Pass version constants (declared in Versions.kt) to tests as system properties - systemProperty("Versions.apiGuardian", versions.apiguardian) - systemProperty("Versions.assertJ", versions.assertj) - systemProperty("Versions.junit4", versions.junit4) - systemProperty("Versions.ota4j", versions.opentest4j) + val tempRepoDir: File by rootProject + jvmArgumentProviders += MavenRepo(tempRepoDir) - jvmArgumentProviders += MavenRepo(tempRepoDir) - jvmArgumentProviders += JavaHomeDir(project, 8) - } + // Pass version constants (declared in Versions.kt) to tests as system properties + systemProperty("Versions.apiGuardian", versions.apiguardian) + systemProperty("Versions.assertJ", versions.assertj) + systemProperty("Versions.junit4", versions.junit4) + systemProperty("Versions.ota4j", versions.opentest4j) (options as JUnitPlatformOptions).apply { includeEngines("archunit") } + inputs.apply { + dir("projects").withPathSensitivity(RELATIVE) + file("${rootDir}/gradle.properties") + file("${rootDir}/settings.gradle.kts") + file("${rootDir}/gradlew") + file("${rootDir}/gradlew.bat") + dir("${rootDir}/gradle/wrapper").withPathSensitivity(RELATIVE) + dir("${rootDir}/documentation/src/main").withPathSensitivity(RELATIVE) + dir("${rootDir}/documentation/src/test").withPathSensitivity(RELATIVE) + } + distribution { - enabled.set(false) + requirements.add("jdk=8") } + jvmArgumentProviders += JavaHomeDir(project, 8) maxParallelForks = 1 // Bartholdy.install is not parallel safe, see https://github.com/sormuras/bartholdy/issues/4 } -class MavenRepo(@get:InputDirectory @get:PathSensitive(PathSensitivity.RELATIVE) val repoDir: File) : CommandLineArgumentProvider { +class MavenRepo(@get:InputDirectory @get:PathSensitive(RELATIVE) val repoDir: File) : CommandLineArgumentProvider { override fun asArguments() = listOf("-Dmaven.repo=$repoDir") } diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt index 3e136ea8a241..03c16e3a7fb9 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-api.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.api@${jupiterVersion} jar:file:.+junit-jupiter-api/build/libs/junit-jupiter-api-${jupiterVersion}.jar..module-info.class +org.junit.jupiter.api@${jupiterVersion} jar:file:.+/junit-jupiter-api-\d.+\.jar..module-info\.class exports org.junit.jupiter.api exports org.junit.jupiter.api.condition exports org.junit.jupiter.api.extension @@ -9,4 +9,4 @@ requires java.base mandated requires org.apiguardian.api transitive requires org.junit.platform.commons transitive requires org.opentest4j transitive -qualified opens org.junit.jupiter.api.condition to org.junit.platform.commons \ No newline at end of file +qualified opens org.junit.jupiter.api.condition to org.junit.platform.commons diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt index 40eef7f332f5..d8cd4a2c24a5 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-engine.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.engine@${jupiterVersion} jar:file:.+junit-jupiter-engine/build/libs/junit-jupiter-engine-${jupiterVersion}.jar..module-info.class +org.junit.jupiter.engine@${jupiterVersion} jar:file:.+/junit-jupiter-engine-\d.+\.jar..module-info\.class requires java.base mandated requires org.apiguardian.api requires org.junit.jupiter.api diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt index 60f2be783d11..a96ffb5c0185 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-migrationsupport.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.migrationsupport@${jupiterVersion} jar:file:.+junit-jupiter-migrationsupport/build/libs/junit-jupiter-migrationsupport-${jupiterVersion}.jar..module-info.class +org.junit.jupiter.migrationsupport@${jupiterVersion} jar:file:.+/junit-jupiter-migrationsupport-\d.+\.jar..module-info\.class exports org.junit.jupiter.migrationsupport exports org.junit.jupiter.migrationsupport.conditions exports org.junit.jupiter.migrationsupport.rules diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt index 328486500421..341c529915dc 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter-params.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter.params@${jupiterVersion} jar:file:.+junit-jupiter-params/build/libs/junit-jupiter-params-${jupiterVersion}.jar..module-info.class +org.junit.jupiter.params@${jupiterVersion} jar:file:.+/junit-jupiter-params-\d.+\.jar..module-info\.class exports org.junit.jupiter.params exports org.junit.jupiter.params.aggregator exports org.junit.jupiter.params.converter @@ -10,4 +10,4 @@ requires org.junit.jupiter.api transitive requires org.junit.platform.commons transitive qualified opens org.junit.jupiter.params to org.junit.platform.commons qualified opens org.junit.jupiter.params.converter to org.junit.platform.commons -qualified opens org.junit.jupiter.params.provider to org.junit.platform.commons \ No newline at end of file +qualified opens org.junit.jupiter.params.provider to org.junit.platform.commons diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt index 007d3af432ba..768342398c7e 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-jupiter.expected.txt @@ -1,4 +1,4 @@ -org.junit.jupiter@${jupiterVersion} jar:file:.+junit-jupiter/build/libs/junit-jupiter-${jupiterVersion}.jar..module-info.class +org.junit.jupiter@${jupiterVersion} jar:file:.+/junit-jupiter-\d.+\.jar..module-info\.class requires java.base mandated requires org.junit.jupiter.api transitive requires org.junit.jupiter.engine transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt index ad6e2c7c66d4..12c846de99a2 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-commons.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.commons@${platformVersion} jar:file:.+junit-platform-commons/build/libs/junit-platform-commons-${platformVersion}.jar..module-info.class +org.junit.platform.commons@${platformVersion} jar:file:.+/junit-platform-commons-\d.+\.jar..module-info\.class exports org.junit.platform.commons exports org.junit.platform.commons.annotation exports org.junit.platform.commons.function diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt index 54620335d7b3..872aface24f4 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-console.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.console@${platformVersion} jar:file:.+junit-platform-console/build/libs/junit-platform-console-${platformVersion}.jar..module-info.class +org.junit.platform.console@${platformVersion} jar:file:.+/junit-platform-console-\d.+\.jar..module-info\.class requires java.base mandated requires org.apiguardian.api requires org.junit.platform.commons diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt index dc319ccacac0..1db8ec2099e2 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-engine.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.engine@${platformVersion} jar:file:.+junit-platform-engine/build/libs/junit-platform-engine-${platformVersion}.jar..module-info.class +org.junit.platform.engine@${platformVersion} jar:file:.+/junit-platform-engine-\d.+\.jar..module-info\.class exports org.junit.platform.engine exports org.junit.platform.engine.discovery exports org.junit.platform.engine.reporting diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt index ecee3737775f..688eb980e7d5 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-jfr.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.jfr@${platformVersion} jar:file:.+junit-platform-jfr/build/libs/junit-platform-jfr-${platformVersion}.jar..module-info.class +org.junit.platform.jfr@${platformVersion} jar:file:.+/junit-platform-jfr-\d.+\.jar..module-info\.class requires java.base mandated requires jdk.jfr requires org.apiguardian.api diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt index bd0e934131eb..d643d8067969 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-launcher.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.launcher@${platformVersion} jar:file:.+junit-platform-launcher/build/libs/junit-platform-launcher-${platformVersion}.jar..module-info.class +org.junit.platform.launcher@${platformVersion} jar:file:.+/junit-platform-launcher-\d.+\.jar..module-info\.class exports org.junit.platform.launcher exports org.junit.platform.launcher.core exports org.junit.platform.launcher.listeners diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt index 27b0aa74b7bf..71c474d193ff 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-reporting.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.reporting@${platformVersion} jar:file:.+junit-platform-reporting/build/libs/junit-platform-reporting-${platformVersion}.jar..module-info.class +org.junit.platform.reporting@${platformVersion} jar:file:.+/junit-platform-reporting-\d.+\.jar..module-info\.class exports org.junit.platform.reporting.legacy exports org.junit.platform.reporting.legacy.xml requires java.base mandated @@ -6,4 +6,4 @@ requires java.xml requires org.apiguardian.api transitive requires org.junit.platform.commons requires org.junit.platform.engine transitive -requires org.junit.platform.launcher transitive \ No newline at end of file +requires org.junit.platform.launcher transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt index e7ec0686461e..a9da89b60b64 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-runner.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.runner@${platformVersion} jar:file:.+junit-platform-runner/build/libs/junit-platform-runner-${platformVersion}.jar..module-info.class +org.junit.platform.runner@${platformVersion} jar:file:.+/junit-platform-runner-\d.+\.jar..module-info\.class exports org.junit.platform.runner requires java.base mandated requires junit transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt index 89ec3ed1b94d..3d1a3db0ea4d 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-api.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.suite.api@${platformVersion} jar:file:.+junit-platform-suite-api/build/libs/junit-platform-suite-api-${platformVersion}.jar..module-info.class +org.junit.platform.suite.api@${platformVersion} jar:file:.+/junit-platform-suite-api-\d.+\.jar..module-info\.class exports org.junit.platform.suite.api requires java.base mandated requires org.apiguardian.api transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt index 88011288252d..5f099abb5ff3 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-commons.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.suite.commons@${platformVersion} jar:file:.+junit-platform-suite-commons/build/libs/junit-platform-suite-commons-${platformVersion}.jar..module-info.class +org.junit.platform.suite.commons@${platformVersion} jar:file:.+/junit-platform-suite-commons-\d.+\.jar..module-info\.class requires java.base mandated requires org.apiguardian.api transitive requires org.junit.platform.commons diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt index f3ca8fbc91f5..5a1d3ef28734 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite-engine.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.suite.engine@${platformVersion} jar:file:.+junit-platform-suite-engine/build/libs/junit-platform-suite-engine-${platformVersion}.jar..module-info.class +org.junit.platform.suite.engine@${platformVersion} jar:file:.+/junit-platform-suite-engine-\d.+\.jar..module-info\.class requires java.base mandated requires org.apiguardian.api requires org.junit.platform.commons diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt index c70a146e3c3f..d6114f727332 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-suite.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.suite@${platformVersion} jar:file:.+junit-platform-suite/build/libs/junit-platform-suite-${platformVersion}.jar..module-info.class +org.junit.platform.suite@${platformVersion} jar:file:.+/junit-platform-suite-\d.+\.jar..module-info\.class requires java.base mandated requires org.junit.platform.suite.api transitive requires org.junit.platform.suite.engine transitive diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt index 247d82ecccfe..65fdb5f7accc 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-platform-testkit.expected.txt @@ -1,4 +1,4 @@ -org.junit.platform.testkit@${platformVersion} jar:file:.+junit-platform-testkit/build/libs/junit-platform-testkit-${platformVersion}.jar..module-info.class +org.junit.platform.testkit@${platformVersion} jar:file:.+/junit-platform-testkit-\d.+\.jar..module-info\.class exports org.junit.platform.testkit.engine requires java.base mandated requires org.apiguardian.api transitive @@ -7,4 +7,4 @@ requires org.junit.platform.commons requires org.junit.platform.engine transitive requires org.junit.platform.launcher requires org.opentest4j transitive -uses org.junit.platform.engine.TestEngine \ No newline at end of file +uses org.junit.platform.engine.TestEngine diff --git a/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt b/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt index 84259d0cb197..d205b2aea88c 100644 --- a/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt +++ b/platform-tooling-support-tests/projects/jar-describe-module/junit-vintage-engine.expected.txt @@ -1,7 +1,7 @@ -org.junit.vintage.engine@${vintageVersion} jar:file:.+junit-vintage-engine/build/libs/junit-vintage-engine-${jupiterVersion}.jar..module-info.class +org.junit.vintage.engine@${vintageVersion} jar:file:.+/junit-vintage-engine-\d.+\.jar..module-info\.class requires java.base mandated requires junit requires org.apiguardian.api requires org.junit.platform.engine provides org.junit.platform.engine.TestEngine with org.junit.vintage.engine.VintageTestEngine -contains org.junit.vintage.engine \ No newline at end of file +contains org.junit.vintage.engine diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java index b6c79dec27a0..0ab9c0cac804 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/Helper.java @@ -67,6 +67,19 @@ public static String version(String moduleOrSystemProperty, String defaultVersio return System.getProperty("Versions." + moduleOrSystemProperty, defaultVersion); } + static String groupId(String artifactId) { + if (artifactId.startsWith("junit-jupiter")) { + return "org.junit.jupiter"; + } + if (artifactId.startsWith("junit-platform")) { + return "org.junit.platform"; + } + if (artifactId.startsWith("junit-vintage")) { + return "org.junit.vintage"; + } + return "org.junit"; + } + public static String replaceVersionPlaceholders(String line) { line = line.replace("${jupiterVersion}", version("junit-jupiter")); line = line.replace("${vintageVersion}", version("junit-vintage")); @@ -90,13 +103,8 @@ public static List loadModuleDirectoryNames() { } } - public static Path createJarPath(String module) { - return Paths.get("..", module, "build", "libs") // - .resolve(module + '-' + version(module) + ".jar"); - } - static JarFile createJarFile(String module) { - var path = createJarPath(module); + var path = MavenRepo.jar(module); try { return new JarFile(path.toFile()); } @@ -126,7 +134,7 @@ public static Optional getJavaHome(String version) { /** Load, here copy, modular jar files to the given target directory. */ public static void loadAllJUnitModules(Path target) throws Exception { for (var module : loadModuleDirectoryNames()) { - var jar = createJarPath(module); + var jar = MavenRepo.jar(module); Files.copy(jar, target.resolve(jar.getFileName())); } } diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java new file mode 100644 index 000000000000..d0cf8151ccfb --- /dev/null +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java @@ -0,0 +1,57 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package platform.tooling.support; + +import java.io.File; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.function.Predicate; + +public class MavenRepo { + + private MavenRepo() { + } + + public static Path dir() { + return Path.of(System.getProperty("maven.repo")); + } + + public static Path jar(String artifactId) { + return artifact(artifactId, fileName -> fileName.endsWith(".jar") // + && !fileName.endsWith("-sources.jar") // + && !fileName.endsWith("-javadoc.jar")); + } + + public static Path gradleModuleMetadata(String artifactId) { + return artifact(artifactId, fileName -> fileName.endsWith(".module")); + } + + public static Path pom(String artifactId) { + return artifact(artifactId, fileName -> fileName.endsWith(".pom")); + } + + private static Path artifact(String artifactId, Predicate fileNamePredicate) { + var parentDir = dir() // + .resolve(Helper.groupId(artifactId).replace('.', File.separatorChar)) // + .resolve(artifactId) // + .resolve(Helper.version(artifactId)); + try (var files = Files.list(parentDir)) { + return files.filter( + file -> fileNamePredicate.test(file.getFileName().toString())).findFirst().orElseThrow(); + } + catch (IOException e) { + throw new UncheckedIOException(e); + } + } + +} diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java index 89e49437044d..cf83d453fae7 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/AntStarterTests.java @@ -12,8 +12,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertLinesMatch; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.nio.file.Paths; import java.util.List; @@ -24,6 +24,7 @@ import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -33,7 +34,7 @@ class AntStarterTests { @Test void ant_1_10_6() { - var standalone = Paths.get("..", "junit-platform-console-standalone", "build", "libs"); + var standalone = MavenRepo.jar("junit-platform-console-standalone").getParent(); var result = Request.builder() // .setTool(Ant.install("1.10.6", Paths.get("build", "test-tools"))) // .setProject("ant-starter") // @@ -42,7 +43,7 @@ void ant_1_10_6() { .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(0, result.getExitCode()); assertEquals("", result.getOutput("err"), "error log isn't empty"); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java index bc920124e32a..839aa1cf4116 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleKotlinExtensionsTests.java @@ -11,8 +11,8 @@ package platform.tooling.support.tests; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.time.Duration; @@ -22,6 +22,7 @@ import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -34,14 +35,14 @@ void gradle_wrapper() { var result = Request.builder() // .setTool(new GradleWrapper(Request.PROJECTS.resolve("gradle-kotlin-extensions"))) // .setProject("gradle-kotlin-extensions") // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("build", "--no-daemon", "--debug", "--stacktrace") // .setTimeout(Duration.ofMinutes(2)) // .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(0, result.getExitCode(), "result=" + result); assertTrue(result.getOutputLines("out").stream().anyMatch(line -> line.contains("BUILD SUCCESSFUL"))); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java index 7aeeb385d13b..0208f6f050b3 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleMissingEngineTests.java @@ -11,10 +11,11 @@ package platform.tooling.support.tests; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertLinesMatch; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.nio.file.Paths; +import java.time.Duration; import java.util.List; import de.sormuras.bartholdy.Tool; @@ -24,6 +25,7 @@ import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -42,13 +44,13 @@ private void test(Tool gradle) { .setProject(project) // .setWorkspace(project + "-wrapper") // .setTool(gradle) // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("build", "--no-daemon", "--debug", "--stacktrace") // .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // - .build() // + .setTimeout(Duration.ofMinutes(2)).build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(1, result.getExitCode()); assertLinesMatch(List.of( // diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java index 17cdcd5829e6..a581df45e1d5 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleModuleFileTests.java @@ -13,10 +13,10 @@ import static org.junit.jupiter.api.Assertions.assertLinesMatch; import java.nio.file.Files; -import java.nio.file.Path; import java.util.List; import org.junit.jupiter.api.Test; +import platform.tooling.support.MavenRepo; /** * @since 1.6 @@ -160,9 +160,6 @@ void jupiterAggregatorGradleModuleMetadataVariants() throws Exception { " ]", // "}"); - System.out.println(Path.of(".").toAbsolutePath().normalize()); - - assertLinesMatch(expected, - Files.readAllLines(Path.of("../junit-jupiter/build/publications/maven/module.json"))); + assertLinesMatch(expected, Files.readAllLines(MavenRepo.gradleModuleMetadata("junit-jupiter"))); } } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java index eafd69e23fc5..5b39603e2938 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/GradleStarterTests.java @@ -12,8 +12,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.nio.file.Paths; import java.time.Duration; @@ -24,6 +24,7 @@ import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -36,14 +37,14 @@ void gradle_wrapper() { var result = Request.builder() // .setTool(new GradleWrapper(Paths.get(".."))) // .setProject("gradle-starter") // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("build", "--no-daemon", "--debug", "--stacktrace") // .setTimeout(Duration.ofMinutes(2)) // .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(0, result.getExitCode()); assertTrue(result.getOutputLines("out").stream().anyMatch(line -> line.contains("BUILD SUCCESSFUL"))); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java index 0b8e60312086..2c3f5a36dc30 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarContainsManifestFirstTests.java @@ -12,7 +12,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; -import static platform.tooling.support.Helper.createJarPath; import java.io.FileInputStream; import java.nio.file.Files; @@ -20,6 +19,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import platform.tooling.support.MavenRepo; /** * @since 1.8 @@ -29,7 +29,7 @@ class JarContainsManifestFirstTests { @ParameterizedTest @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") void manifestFirst(String module) throws Exception { - var modulePath = createJarPath(module); + var modulePath = MavenRepo.jar(module); if (Files.notExists(modulePath)) { fail("No such file: " + modulePath); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java index 4b0b3242e9ff..50d8b5dd35e0 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JarDescribeModuleTests.java @@ -11,11 +11,10 @@ package platform.tooling.support.tests; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertLinesMatch; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import static org.junit.jupiter.api.Assumptions.assumeFalse; -import static platform.tooling.support.Helper.createJarPath; import java.lang.module.ModuleFinder; import java.nio.file.Files; @@ -29,6 +28,7 @@ import org.junit.jupiter.params.provider.MethodSource; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -39,7 +39,7 @@ class JarDescribeModuleTests { @ParameterizedTest @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") void describeModule(String module) throws Exception { - var modulePath = createJarPath(module); + var modulePath = MavenRepo.jar(module); var result = Request.builder() // .setTool(new Jar()) // .setProject("jar-describe-module") // @@ -49,7 +49,7 @@ void describeModule(String module) throws Exception { .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(0, result.getExitCode()); assertEquals("", result.getOutput("err"), "error log isn't empty"); @@ -66,7 +66,7 @@ void describeModule(String module) throws Exception { @ParameterizedTest @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") void packageNamesStartWithNameOfTheModule(String module) { - var modulePath = createJarPath(module); + var modulePath = MavenRepo.jar(module); var moduleDescriptor = ModuleFinder.of(modulePath).findAll().iterator().next().descriptor(); var moduleName = moduleDescriptor.name(); for (var packageName : moduleDescriptor.packages()) { diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java index ae97a03580bb..d8bbac4203b4 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/JavaVersionsTests.java @@ -11,8 +11,8 @@ package platform.tooling.support.tests; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.nio.file.Path; @@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -52,12 +53,12 @@ List execute(String version, Path javaHome) { .setTool(Request.maven()) // .setProject("java-versions") // .setWorkspace("java-versions-" + version) // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("--debug", "verify") // .setTimeout(Duration.ofMinutes(2)) // .setJavaHome(javaHome) // .build().run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(0, result.getExitCode()); assertEquals("", result.getOutput("err")); return result.getOutputLines("out"); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java index c39660a31b7d..4700a5de9e54 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ManifestTests.java @@ -14,10 +14,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static platform.tooling.support.Helper.createJarPath; -import java.io.File; -import java.lang.module.ModuleFinder; import java.util.jar.Attributes; import aQute.bnd.osgi.Domain; @@ -28,7 +25,9 @@ import org.junit.jupiter.params.provider.MethodSource; import org.osgi.framework.Version; import org.osgi.framework.VersionRange; + import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; /** * @since 1.5 @@ -39,9 +38,7 @@ class ManifestTests { @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") void manifestEntriesAdhereToConventions(String module) throws Exception { var version = Helper.version(module); - var modulePath = createJarPath(module); - var uri = ModuleFinder.of(modulePath).findAll().iterator().next().location().orElseThrow(); - var jarFile = new File(uri); + var jarFile = MavenRepo.jar(module).toFile(); try (var jar = new Jar(jarFile)) { var manifest = jar.getManifest(); var attributes = manifest.getMainAttributes(); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java index c33a507fbfdf..e107bb522f47 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenPomFileTests.java @@ -13,10 +13,10 @@ import static org.junit.jupiter.api.Assertions.assertLinesMatch; import java.nio.file.Files; -import java.nio.file.Path; import java.util.List; import org.junit.jupiter.api.Test; +import platform.tooling.support.MavenRepo; /** * @since 1.4 @@ -60,10 +60,7 @@ void jupiterAggregatorPomDependencies() throws Exception { " ", // ">> TAIL >>"); - System.out.println(Path.of(".").toAbsolutePath().normalize()); - - assertLinesMatch(expected, - Files.readAllLines(Path.of("../junit-jupiter/build/publications/maven/pom-default.xml"))); + assertLinesMatch(expected, Files.readAllLines(MavenRepo.pom("junit-jupiter"))); } @Test @@ -73,9 +70,6 @@ void jupiterAggregatorGradleMetadataMarker() throws Exception { " ", // ">> TAIL >>"); - System.out.println(Path.of(".").toAbsolutePath().normalize()); - - assertLinesMatch(expected, - Files.readAllLines(Path.of("../junit-jupiter/build/publications/maven/pom-default.xml"))); + assertLinesMatch(expected, Files.readAllLines(MavenRepo.pom("junit-jupiter"))); } } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java index 971f2c089d69..19a9111220e9 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MavenStarterTests.java @@ -12,8 +12,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.time.Duration; @@ -21,6 +21,7 @@ import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -33,14 +34,14 @@ void verifyMavenStarterProject() { var result = Request.builder() // .setTool(Request.maven()) // .setProject("maven-starter") // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("--debug", "verify") // .setTimeout(Duration.ofMinutes(2)) // .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); assertEquals(0, result.getExitCode()); assertEquals("", result.getOutput("err")); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java index 9784a1030078..971a9192c1e2 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/MultiReleaseJarTests.java @@ -11,9 +11,9 @@ package platform.tooling.support.tests; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertLinesMatch; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.nio.file.Files; import java.nio.file.Path; @@ -23,6 +23,8 @@ import de.sormuras.bartholdy.Result; import org.junit.jupiter.api.Test; + +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -81,13 +83,13 @@ private Result mvn(String variant) { var result = Request.builder() // .setTool(Request.maven()) // .setProject("multi-release-jar") // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("--show-version", "--errors", "--file", variant, "test") // .setTimeout(Duration.ofMinutes(2)) // .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); return result; } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java index 055eb4f0e6f4..213988361fac 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/PackageCyclesDetectionTests.java @@ -18,7 +18,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; /** * @since 1.3 @@ -29,7 +29,7 @@ class PackageCyclesDetectionTests { @MethodSource("platform.tooling.support.Helper#loadModuleDirectoryNames") @Disabled("Need to pass --module-path...") void moduleDoesNotContainCyclicPackageReferences(String module) { - var jar = Helper.createJarPath(module); + var jar = MavenRepo.jar(module); var result = new CyclesDetector(jar, this::ignore).run(Configuration.of()); assertEquals(0, result.getExitCode(), "result=" + result); } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java index 55a79bf4c779..9a13a30a19c1 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java @@ -17,7 +17,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; -import java.nio.file.Path; import java.util.ArrayList; import de.sormuras.bartholdy.jdk.Jar; @@ -31,6 +30,7 @@ import org.junit.jupiter.api.TestMethodOrder; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -47,7 +47,7 @@ void compile() throws Exception { .setTool(new Javac()) // .setProject("standalone") // .addArguments("-d", workspace.resolve("bin")) // - .addArguments("--class-path", Helper.createJarPath("junit-platform-console-standalone")) // + .addArguments("--class-path", MavenRepo.jar("junit-platform-console-standalone")) // .addArguments(workspace.resolve("src/standalone/JupiterIntegration.java")) // .addArguments(workspace.resolve("src/standalone/JupiterParamsIntegration.java")) // .addArguments(workspace.resolve("src/standalone/VintageIntegration.java")).build() // @@ -72,15 +72,13 @@ void compile() throws Exception { @Test @Order(2) void test() throws IOException { - var root = Path.of("../../.."); - var jar = root.resolve(Helper.createJarPath("junit-platform-console-standalone")); var result = Request.builder() // .setTool(new Java()) // .setProject("standalone") // .addArguments("--show-version") // .addArguments("-enableassertions") // .addArguments("-Djava.util.logging.config.file=logging.properties") // - .addArguments("-jar", jar) // + .addArguments("-jar", MavenRepo.jar("junit-platform-console-standalone")) // .addArguments("--scan-class-path") // .addArguments("--disable-banner") // .addArguments("--include-classname", "standalone.*") // @@ -107,8 +105,7 @@ void test() throws IOException { @Order(3) @Disabled("https://github.com/junit-team/junit5/issues/1724") void testWithJarredTestClasses() { - var root = Path.of("../../.."); - var jar = root.resolve(Helper.createJarPath("junit-platform-console-standalone")); + var jar = MavenRepo.jar("junit-platform-console-standalone"); var path = new ArrayList(); // path.add("bin"); // "exploded" test classes are found, see also test() above path.add(Request.WORKSPACE.resolve("standalone/jar/tests.jar").toAbsolutePath().toString()); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java index afbae951f852..90e1c369ab0e 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/ToolProviderTests.java @@ -26,7 +26,6 @@ import java.net.URLClassLoader; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.List; import java.util.ServiceLoader; @@ -39,6 +38,7 @@ import org.junit.jupiter.api.Test; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; /** @@ -52,10 +52,15 @@ class ToolProviderTests { static void prepareLocalLibraryDirectoryWithJUnitPlatformModules() { try { var lib = Files.createDirectories(LIB); + try (var directoryStream = Files.newDirectoryStream(lib, "*.jar")) { + for (Path jarFile : directoryStream) { + Files.delete(jarFile); + } + } for (var module : Helper.loadModuleDirectoryNames()) { if (module.startsWith("junit-platform")) { - var jar = Helper.createJarPath(module); - Files.copy(jar, lib.resolve(jar.getFileName()), StandardCopyOption.REPLACE_EXISTING); + var jar = MavenRepo.jar(module); + Files.copy(jar, lib.resolve(module + ".jar")); } } Helper.load(lib, "org.apiguardian", "apiguardian-api", Helper.version("apiGuardian", "1.1.0")); diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java index 9604d834729d..f795bb2dd6b3 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageGradleIntegrationTests.java @@ -11,7 +11,7 @@ package platform.tooling.support.tests; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assumptions.assumeFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import java.nio.file.Paths; import java.time.Duration; @@ -25,6 +25,7 @@ import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; class VintageGradleIntegrationTests { @@ -60,12 +61,12 @@ private Result run(String version) { .setProject("vintage") // .setWorkspace("vintage-gradle-" + version) // .addArguments("clean", "test", "--stacktrace") // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("-Djunit4Version=" + version) // .setTimeout(Duration.ofMinutes(2)) // .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); return result; } diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java index 5bd512335ecc..bdb10eb257bb 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/VintageMavenIntegrationTests.java @@ -11,7 +11,7 @@ package platform.tooling.support.tests; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assumptions.assumeFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import java.time.Duration; @@ -23,6 +23,7 @@ import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; +import platform.tooling.support.MavenRepo; import platform.tooling.support.Request; class VintageMavenIntegrationTests { @@ -60,12 +61,12 @@ private Result run(String version) { .setProject("vintage") // .setWorkspace("vintage-maven-" + version) // .addArguments("clean", "test", "--debug") // - .addArguments("-Dmaven.repo=" + System.getProperty("maven.repo")) // + .addArguments("-Dmaven.repo=" + MavenRepo.dir()) // .addArguments("-Djunit4Version=" + version) // .setTimeout(Duration.ofMinutes(2)) // .build() // .run(); - assumeFalse(result.isTimedOut(), () -> "tool timed out: " + result); + assertFalse(result.isTimedOut(), () -> "tool timed out: " + result); return result; } From 3ace14cc672d8c071a7d7e19949af120bef001c2 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 13:20:05 +0100 Subject: [PATCH 0250/1433] Merge Heavyweight test classes --- .../junit/jupiter/extensions/Heavyweight.java | 5 +- .../extensions/HeavyweightAlphaTests.java | 64 ---------- .../extensions/HeavyweightBetaTests.java | 57 --------- .../jupiter/extensions/HeavyweightTests.java | 110 ++++++++++++++++++ 4 files changed, 112 insertions(+), 124 deletions(-) delete mode 100644 platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java delete mode 100644 platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java create mode 100644 platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightTests.java diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java index 499b00220308..59ed57442b64 100644 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java +++ b/platform-tests/src/test/java/org/junit/jupiter/extensions/Heavyweight.java @@ -57,9 +57,9 @@ interface Resource { * {@link ResourceValue#close()} method implementation is needed to comply * with both interfaces. */ - private static class ResourceValue implements Resource, CloseableResource, AutoCloseable { + static class ResourceValue implements Resource, CloseableResource, AutoCloseable { - private static final AtomicInteger creations = new AtomicInteger(); + static final AtomicInteger creations = new AtomicInteger(); private final AtomicInteger usages = new AtomicInteger(); @SuppressWarnings("unused") // used via reflection @@ -72,7 +72,6 @@ private static class ResourceValue implements Resource, CloseableResource, AutoC public void close() { // Close resources here. assertEquals(9, usages.get(), "Usage counter mismatch!"); - usages.set(0); } @Override diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java deleted file mode 100644 index c57687960147..000000000000 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightAlphaTests.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2015-2021 the original author or authors. - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which - * accompanies this distribution and is available at - * - * https://www.eclipse.org/legal/epl-v20.html - */ - -package org.junit.jupiter.extensions; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.DynamicTest.dynamicTest; - -import java.util.stream.Stream; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.DynamicTest; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestFactory; -import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.parallel.ResourceLock; - -/** - * Unit tests for {@link org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource} - * stored values. - * - * @since 1.1 - */ -@ExtendWith(Heavyweight.class) -@ResourceLock(Heavyweight.Resource.ID) -class HeavyweightAlphaTests { - - private static int mark; - - @BeforeAll - static void setMark(Heavyweight.Resource resource) { - assertTrue(resource.usages() > 0); - mark = resource.usages(); - } - - @TestFactory - Stream alpha1(Heavyweight.Resource resource) { - return Stream.of(dynamicTest("foo", () -> assertTrue(resource.usages() > 1))); - } - - @Test - void alpha2(Heavyweight.Resource resource) { - assertTrue(resource.usages() > 1); - } - - @Test - void alpha3(Heavyweight.Resource resource) { - assertTrue(resource.usages() > 1); - } - - @AfterAll - static void checkMark(Heavyweight.Resource resource) { - assertEquals(mark, resource.usages() - 4); - } -} diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java deleted file mode 100644 index a2823d758210..000000000000 --- a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightBetaTests.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2015-2021 the original author or authors. - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v2.0 which - * accompanies this distribution and is available at - * - * https://www.eclipse.org/legal/epl-v20.html - */ - -package org.junit.jupiter.extensions; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.parallel.ResourceLock; - -/** - * Unit tests for {@link org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource} - * stored values. - * - * @since 1.1 - */ -@ExtendWith(Heavyweight.class) -@TestInstance(TestInstance.Lifecycle.PER_CLASS) -@ResourceLock(Heavyweight.Resource.ID) -class HeavyweightBetaTests { - - private int mark; - - @BeforeAll - void beforeAll(Heavyweight.Resource resource) { - assertTrue(resource.usages() > 0); - mark = resource.usages(); - } - - @BeforeEach - void beforeEach(Heavyweight.Resource resource) { - assertTrue(resource.usages() > 1); - } - - @Test - void beta(Heavyweight.Resource resource) { - assertTrue(resource.usages() > 2); - } - - @AfterAll - void afterAll(Heavyweight.Resource resource) { - assertEquals(mark, resource.usages() - 3); - } -} diff --git a/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightTests.java b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightTests.java new file mode 100644 index 000000000000..641f8a2ffbfe --- /dev/null +++ b/platform-tests/src/test/java/org/junit/jupiter/extensions/HeavyweightTests.java @@ -0,0 +1,110 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.jupiter.extensions; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.DynamicTest.dynamicTest; +import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; + +import java.util.stream.Stream; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestFactory; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.parallel.ResourceLock; + +/** + * Unit tests for {@link org.junit.jupiter.api.extension.ExtensionContext.Store.CloseableResource} + * stored values. + * + * @since 1.1 + */ +class HeavyweightTests { + + @AfterAll + static void afterAll() { + Heavyweight.ResourceValue.creations.set(0); + } + + @Nested + @TestInstance(PER_CLASS) + @ExtendWith(Heavyweight.class) + @ResourceLock(Heavyweight.Resource.ID) + class Alpha { + + private int mark; + + @BeforeAll + void setMark(Heavyweight.Resource resource) { + assertTrue(resource.usages() > 0); + mark = resource.usages(); + } + + @TestFactory + Stream alpha1(Heavyweight.Resource resource) { + return Stream.of(dynamicTest("foo", () -> assertTrue(resource.usages() > 1))); + } + + @Test + void alpha2(Heavyweight.Resource resource) { + assertTrue(resource.usages() > 1); + } + + @Test + void alpha3(Heavyweight.Resource resource) { + assertTrue(resource.usages() > 1); + } + + @AfterAll + void checkMark(Heavyweight.Resource resource) { + assertEquals(mark, resource.usages() - 4); + } + + } + + @Nested + @TestInstance(PER_CLASS) + @ExtendWith(Heavyweight.class) + @ResourceLock(Heavyweight.Resource.ID) + class Beta { + + private int mark; + + @BeforeAll + void beforeAll(Heavyweight.Resource resource) { + assertTrue(resource.usages() > 0); + mark = resource.usages(); + } + + @BeforeEach + void beforeEach(Heavyweight.Resource resource) { + assertTrue(resource.usages() > 1); + } + + @Test + void beta(Heavyweight.Resource resource) { + assertTrue(resource.usages() > 2); + } + + @AfterAll + void afterAll(Heavyweight.Resource resource) { + assertEquals(mark, resource.usages() - 3); + } + + } +} From 8f78ed8cecb037401848686a9c4ae092b7717de7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 13:20:14 +0100 Subject: [PATCH 0251/1433] Remove unused imports --- junit-platform-commons/junit-platform-commons.gradle.kts | 2 -- junit-platform-console/junit-platform-console.gradle.kts | 2 -- 2 files changed, 4 deletions(-) diff --git a/junit-platform-commons/junit-platform-commons.gradle.kts b/junit-platform-commons/junit-platform-commons.gradle.kts index 47df635c1339..f19d86f85175 100644 --- a/junit-platform-commons/junit-platform-commons.gradle.kts +++ b/junit-platform-commons/junit-platform-commons.gradle.kts @@ -1,5 +1,3 @@ -import java.util.spi.ToolProvider - plugins { `java-library-conventions` `java-multi-release-sources` diff --git a/junit-platform-console/junit-platform-console.gradle.kts b/junit-platform-console/junit-platform-console.gradle.kts index 869f90e5b962..32c1ff5fe90a 100644 --- a/junit-platform-console/junit-platform-console.gradle.kts +++ b/junit-platform-console/junit-platform-console.gradle.kts @@ -1,5 +1,3 @@ -import java.util.spi.ToolProvider - plugins { `java-library-conventions` `shadow-conventions` From 42f7f77ab59b9edc56d0c689cc73970aaae30e87 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 13:59:39 +0100 Subject: [PATCH 0252/1433] Require same OS on CI --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 7 +++++++ settings.gradle.kts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index e4a9073dae02..4acc3f68cdd9 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -22,6 +22,13 @@ tasks.withType().configureEach { enabled.convention(providers.gradleProperty("enableTestDistribution").map(String::toBoolean).orElse(false)) maxLocalExecutors.set(providers.gradleProperty("testDistribution.maxLocalExecutors").map(String::toInt).orElse(1)) maxRemoteExecutors.set(providers.gradleProperty("testDistribution.maxRemoteExecutors").map(String::toInt)) + if (System.getenv("CI") != null) { + when { + OperatingSystem.current().isLinux -> requirements.add("os=linux") + OperatingSystem.current().isWindows -> requirements.add("os=windows") + OperatingSystem.current().isMacOsX -> requirements.add("os=macos") + } + } } systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") // Required until ASM officially supports the JDK 14 diff --git a/settings.gradle.kts b/settings.gradle.kts index 154de8d6475b..658e4a4807cf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -29,7 +29,7 @@ plugins { } val gradleEnterpriseServer = "https://ge.junit.org" -val isCiServer = System.getenv("CI") != null || System.getenv("GITHUB_ACTIONS") != null +val isCiServer = System.getenv("CI") != null val junitBuildCacheUsername: String? by extra val junitBuildCachePassword: String? by extra From 16fbf9bb73636a7b774741a15de7fcc969269ad4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 14:11:42 +0100 Subject: [PATCH 0253/1433] Enable TD on CI --- .github/workflows/cross-version.yml | 7 +++++++ .github/workflows/main.yml | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 843af6e7833d..3f7e2bb69581 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -43,7 +43,14 @@ jobs: restore-keys: | test-${{ runner.os }}-maven- - name: Test + env: + ORG_GRADLE_PROJECT_enableTestDistribution: true run: | ./gradlew --version ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew --no-parallel -Dplatform.tooling.support.tests.enabled=true -PjavaToolchainVersion=${{ matrix.jdk }} -Porg.gradle.java.installations.auto-download=false build "-Dscan.tag.JDK_${{ matrix.jdk }}" + - name: Upload Test Distribution trace files + uses: actions/upload-artifact@v2 + with: + name: Test Distribution trace files + path: '**/build/test-results/*/trace.json' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c778fd6ddb23..87c440afe851 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,11 +40,18 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- - - name: Test and Coverage + - name: Test and coverage + env: + ORG_GRADLE_PROJECT_enableTestDistribution: true run: | ./gradlew --version ./gradlew javaToolchains -Porg.gradle.java.installations.auto-download=false ./gradlew --no-parallel --stacktrace -Dplatform.tooling.support.tests.enabled=true -PenableJaCoCo -Porg.gradle.java.installations.auto-download=false build jacocoRootReport + - name: Upload Test Distribution trace files + uses: actions/upload-artifact@v2 + with: + name: Test Distribution trace files + path: '**/build/test-results/*/trace.json' - name: Upload to Codecov.io uses: codecov/codecov-action@v1 From 253658f87656af538b7b5811e8522e6017c5df0b Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 14:37:05 +0100 Subject: [PATCH 0254/1433] Add support for PR builds --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 4acc3f68cdd9..b0c55706efe5 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -19,10 +19,14 @@ tasks.withType().configureEach { maxRetries.set(providers.gradleProperty("retries").map(String::toInt).orElse(2)) } distribution { - enabled.convention(providers.gradleProperty("enableTestDistribution").map(String::toBoolean).orElse(false)) + val isCiServer = System.getenv("CI") != null + enabled.convention(providers.gradleProperty("enableTestDistribution") + .map(String::toBoolean) + .map { enabled -> enabled && (!isCiServer || System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY").isNotBlank()) } + .orElse(false)) maxLocalExecutors.set(providers.gradleProperty("testDistribution.maxLocalExecutors").map(String::toInt).orElse(1)) maxRemoteExecutors.set(providers.gradleProperty("testDistribution.maxRemoteExecutors").map(String::toInt)) - if (System.getenv("CI") != null) { + if (isCiServer) { when { OperatingSystem.current().isLinux -> requirements.add("os=linux") OperatingSystem.current().isWindows -> requirements.add("os=windows") From 43638eb6a870e0d6c49224053dfeb39dcf0ef33f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 26 Mar 2021 17:12:14 +0100 Subject: [PATCH 0255/1433] Filter additional classpath entries lazily --- .../platform/console/options/CommandLineOptions.java | 10 ++++++---- .../platform/console/tasks/ConsoleTestExecutor.java | 2 +- .../console/tasks/DiscoveryRequestCreator.java | 2 +- .../options/PicocliCommandLineOptionsParserTests.java | 7 +++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java b/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java index 7607cade328e..c289beb9308f 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/options/CommandLineOptions.java @@ -13,6 +13,7 @@ import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; import static java.util.Collections.singletonList; +import static java.util.stream.Collectors.toList; import static org.apiguardian.api.API.Status.INTERNAL; import static org.junit.platform.engine.discovery.ClassNameFilter.STANDARD_INCLUDE_PATTERN; @@ -20,7 +21,6 @@ import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -128,14 +128,16 @@ public void setTheme(Theme theme) { this.theme = theme; } + public List getExistingAdditionalClasspathEntries() { + return this.additionalClasspathEntries.stream().filter(Files::exists).collect(toList()); + } + public List getAdditionalClasspathEntries() { return this.additionalClasspathEntries; } public void setAdditionalClasspathEntries(List additionalClasspathEntries) { - // Create a modifiable copy - this.additionalClasspathEntries = new ArrayList<>(additionalClasspathEntries); - this.additionalClasspathEntries.removeIf(path -> !Files.exists(path)); + this.additionalClasspathEntries = additionalClasspathEntries; } public boolean isFailIfNoTests() { diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java index a76d5c93545a..adad9244a17b 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/ConsoleTestExecutor.java @@ -74,7 +74,7 @@ private TestExecutionSummary executeTests(PrintWriter out) { } private Optional createCustomClassLoader() { - List additionalClasspathEntries = options.getAdditionalClasspathEntries(); + List additionalClasspathEntries = options.getExistingAdditionalClasspathEntries(); if (!additionalClasspathEntries.isEmpty()) { URL[] urls = additionalClasspathEntries.stream().map(this::toURL).toArray(URL[]::new); ClassLoader parentClassLoader = ClassLoaderUtils.getDefaultClassLoader(); diff --git a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java index a240ff9db664..021603d4fe8b 100644 --- a/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java +++ b/junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java @@ -77,7 +77,7 @@ private List createClasspathRootSelectors(CommandLineOpti private Set determineClasspathRoots(CommandLineOptions options) { if (options.getSelectedClasspathEntries().isEmpty()) { Set rootDirs = new LinkedHashSet<>(ReflectionUtils.getAllClasspathRootDirectories()); - rootDirs.addAll(options.getAdditionalClasspathEntries()); + rootDirs.addAll(options.getExistingAdditionalClasspathEntries()); return rootDirs; } return new LinkedHashSet<>(options.getSelectedClasspathEntries()); diff --git a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java index 9bea3b47d942..07a522f8c7d5 100644 --- a/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java +++ b/platform-tests/src/test/java/org/junit/platform/console/options/PicocliCommandLineOptionsParserTests.java @@ -35,7 +35,6 @@ import java.util.stream.Stream; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.platform.commons.JUnitException; @@ -267,7 +266,7 @@ void parseInvalidExcludedEngines() { @ParameterizedTest @EnumSource - void parseValidAdditionalClasspathEntries(ArgsType type, @TempDir Path tempDir) { + void parseValidAdditionalClasspathEntries(ArgsType type) { var dir = Paths.get("."); // @formatter:off assertAll( @@ -279,8 +278,8 @@ void parseValidAdditionalClasspathEntries(ArgsType type, @TempDir Path tempDir) () -> assertEquals(List.of(dir), type.parseArgLine("--classpath=.").getAdditionalClasspathEntries()), () -> assertEquals(List.of(dir), type.parseArgLine("--class-path .").getAdditionalClasspathEntries()), () -> assertEquals(List.of(dir), type.parseArgLine("--class-path=.").getAdditionalClasspathEntries()), - () -> assertEquals(List.of(dir, tempDir), type.parseArgLine("-cp . -cp " + tempDir).getAdditionalClasspathEntries()), - () -> assertEquals(List.of(dir, tempDir), type.parseArgLine("-cp ." + File.pathSeparator + tempDir).getAdditionalClasspathEntries()) + () -> assertEquals(List.of(dir, Path.of("lib/some.jar")), type.parseArgLine("-cp . -cp lib/some.jar").getAdditionalClasspathEntries()), + () -> assertEquals(List.of(dir, Path.of("lib/some.jar")), type.parseArgLine("-cp ." + File.pathSeparator + "lib/some.jar").getAdditionalClasspathEntries()) ); // @formatter:on } From dc762488bb828d750dcd2008b68bd49d5a387999 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 8 Apr 2021 20:31:26 +0200 Subject: [PATCH 0256/1433] Remove Gradle distribution checksum for IDEA 2021.1 compatibility --- gradle/wrapper/gradle-wrapper.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 51d930a381f3..442d9132ea32 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205 distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 34a9b0a1c09064f69449ec3fe1cda040512451bf Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 9 Apr 2021 13:12:33 +0200 Subject: [PATCH 0257/1433] Update to Gradle Enterprise Gradle Plugin 3.6.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 25acc52bf6a9..c6f3dfd75fa7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -57,7 +57,7 @@ surefire.version=2.22.2 bnd.version=5.3.0 # Plugins -gradle.enterprise.plugin.version=3.6 +gradle.enterprise.plugin.version=3.6.1 test.distribution.plugin.version=2.0.2-rc-2 gradle.user-data.plugin.version=1.2 versioning.plugin.version=2.14.0 From 352e5c12e8f560de16e3f2f8c9730151ab2aff31 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 9 Apr 2021 13:46:46 +0200 Subject: [PATCH 0258/1433] Update test-distribution plugin --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c6f3dfd75fa7..87ae366fcafe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -58,7 +58,7 @@ bnd.version=5.3.0 # Plugins gradle.enterprise.plugin.version=3.6.1 -test.distribution.plugin.version=2.0.2-rc-2 +test.distribution.plugin.version=2.0.2 gradle.user-data.plugin.version=1.2 versioning.plugin.version=2.14.0 versions.plugin.version=0.36.0 From 286cf076eba8414d7fe2c395b74d06b21318ef86 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 9 Apr 2021 13:47:19 +0200 Subject: [PATCH 0259/1433] Update common-custom-user-data-gradle-plugin --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 87ae366fcafe..93681e0d0d3c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -59,7 +59,7 @@ bnd.version=5.3.0 # Plugins gradle.enterprise.plugin.version=3.6.1 test.distribution.plugin.version=2.0.2 -gradle.user-data.plugin.version=1.2 +gradle.user-data.plugin.version=1.2.1 versioning.plugin.version=2.14.0 versions.plugin.version=0.36.0 spotless.plugin.version=5.9.0 From 64befca7bd5c985d72716a493f9ae985037681d9 Mon Sep 17 00:00:00 2001 From: Mincong Huang Date: Fri, 9 Apr 2021 23:35:31 +0800 Subject: [PATCH 0260/1433] Document array of dynamic tests in the User Guide Closes #2588 --- documentation/src/docs/asciidoc/user-guide/writing-tests.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index 88d3ee2c1137..af89e8bca78a 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -1766,8 +1766,8 @@ and dynamic tests. The first method returns an invalid return type. Since an invalid return type cannot be detected at compile time, a `JUnitException` is thrown when it is detected at runtime. -The next five methods are very simple examples that demonstrate the generation of a -`Collection`, `Iterable`, `Iterator`, or `Stream` of `DynamicTest` instances. Most of +The next six methods are very simple examples that demonstrate the generation of a +`Collection`, `Iterable`, `Iterator`, array, or `Stream` of `DynamicTest` instances. Most of these examples do not really exhibit dynamic behavior but merely demonstrate the supported return types in principle. However, `dynamicTestsFromStream()` and `dynamicTestsFromIntStream()` demonstrate how easy it is to generate dynamic tests for a From 3deb9032712f9f454d2302a1268bb63c132760fc Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 10 Apr 2021 16:53:33 +0200 Subject: [PATCH 0261/1433] Update Gradle plugins and dependencies --- gradle.properties | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gradle.properties b/gradle.properties index 93681e0d0d3c..d7b55970b6dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,21 +28,21 @@ kotlin.stdlib.default.dependency=false apiguardian.version=1.1.1 assertj.version=3.19.0 junit4.version=4.13.2 -junit4.osgi.version=4.13.1_1 +junit4.osgi.version=4.13.2_1 junit4Min.version=4.12 opentest4j.version=1.2.0 picocli.version=4.6.1 -univocity-parsers.version=2.9.0 +univocity-parsers.version=2.9.1 # Test Dependencies archunit.version=0.17.0 bartholdy.version=0.2.3 -classgraph.version=4.8.98 +classgraph.version=4.8.104 commons-io.version=2.8.0 -kotlinx-coroutines-core.version=1.4.2 +kotlinx-coroutines-core.version=1.4.3 groovy.version=3.0.7 -log4j.version=2.14.0 -mockito.version=3.7.7 +log4j.version=2.14.1 +mockito.version=3.9.0 slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 jfrunit.version=main-SNAPSHOT @@ -51,7 +51,7 @@ joox.version=1.6.2 # Tools checkstyle.version=8.36.2 jacoco.version=0.8.6 -jmh.version=1.27 +jmh.version=1.29 ktlint.version=0.35.0 surefire.version=2.22.2 bnd.version=5.3.0 @@ -61,12 +61,12 @@ gradle.enterprise.plugin.version=3.6.1 test.distribution.plugin.version=2.0.2 gradle.user-data.plugin.version=1.2.1 versioning.plugin.version=2.14.0 -versions.plugin.version=0.36.0 -spotless.plugin.version=5.9.0 +versions.plugin.version=0.38.0 +spotless.plugin.version=5.12.0 git-publish.plugin.version=3.0.0 kotlin.plugin.version=1.4.0 asciidoctor-pdf.version=1.5.3 -asciidoctor.plugin.version=3.3.0 -jmh.plugin.version=0.5.2 -nohttp.plugin.version=0.0.5.RELEASE +asciidoctor.plugin.version=3.3.2 +jmh.plugin.version=0.5.3 +nohttp.plugin.version=0.0.6.RELEASE nexus-publish.plugin.version=1.0.0 From 5ef975c783dbfda2abc1babdc334e1f1fdfeb1b3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 10 Apr 2021 17:25:19 +0200 Subject: [PATCH 0262/1433] Upgradle to 7.0 --- buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts | 2 -- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index 6653c80374df..ed8746404c4b 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -16,8 +16,6 @@ project.pluginManager.withPlugin("java") { } tasks.withType().configureEach { javaCompiler.set(compiler) - // Temporary workaround for https://github.com/gradle/gradle/issues/15538 - options.forkOptions.jvmArgs!!.addAll(listOf("--add-opens", "jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED")) } tasks.withType().configureEach { javaLauncher.set(javaToolchainService.launcherFor { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d9132ea32..f371643eed77 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 5ea021da226899dfb6f7599ab73e33eb29435c45 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:34:28 +0200 Subject: [PATCH 0263/1433] Suppress deprecation warning when compiling against JUnit 4.13.2 --- .../junit/vintage/engine/descriptor/DescriptionUtilsTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java index c03f613f89fe..29de0ec67a43 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/descriptor/DescriptionUtilsTests.java @@ -27,6 +27,7 @@ class DescriptionUtilsTests { + @SuppressWarnings("deprecation") AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); @TestFactory From 1f33b5e891ec78131b2f2ae5351fd45a06a1d732 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:36:27 +0200 Subject: [PATCH 0264/1433] Use version catalog for main dependencies --- buildSrc/src/main/kotlin/Versions.kt | 6 ------ .../main/kotlin/junit4-compatibility.gradle.kts | 4 +++- .../main/kotlin/testing-conventions.gradle.kts | 3 ++- dependencies/dependencies.gradle.kts | 10 ---------- documentation/documentation.gradle.kts | 14 +++++++------- gradle.properties | 10 ---------- gradle/libs.versions.toml | 17 +++++++++++++++++ junit-jupiter-api/junit-jupiter-api.gradle.kts | 6 ++---- .../junit-jupiter-engine.gradle.kts | 2 +- .../junit-jupiter-migrationsupport.gradle.kts | 8 ++++---- .../junit-jupiter-params.gradle.kts | 5 ++--- junit-jupiter/junit-jupiter.gradle.kts | 2 -- .../junit-platform-commons.gradle.kts | 3 +-- .../junit-platform-console.gradle.kts | 7 ++----- .../junit-platform-engine.gradle.kts | 8 +++----- .../junit-platform-jfr.gradle.kts | 4 +--- .../junit-platform-launcher.gradle.kts | 4 +--- .../junit-platform-reporting.gradle.kts | 4 +--- .../junit-platform-runner.gradle.kts | 8 +++----- .../junit-platform-suite-api.gradle.kts | 4 +--- .../junit-platform-suite-commons.gradle.kts | 2 +- .../junit-platform-suite-engine.gradle.kts | 2 +- .../junit-platform-suite.gradle.kts | 2 -- .../junit-platform-testkit.gradle.kts | 8 +++----- .../junit-vintage-engine.gradle.kts | 17 +++++++++-------- platform-tests/platform-tests.gradle.kts | 2 +- .../platform-tooling-support-tests.gradle.kts | 8 ++++---- settings.gradle.kts | 2 ++ 28 files changed, 72 insertions(+), 100 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index c74c5265d80f..be96753eccd8 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -13,12 +13,6 @@ class Versions(private val project: Project) { operator fun getValue(receiver: Any?, property: KProperty<*>) = get(property.name) } - val junit4 by properties - val junit4Min by properties - val opentest4j by properties - val apiguardian by properties - val assertj by properties - operator fun get(name: String) = project.extra.get("$name.version") as String } diff --git a/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts b/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts index 2c1dfc17e4d9..70a5072cb015 100644 --- a/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts +++ b/buildSrc/src/main/kotlin/junit4-compatibility.gradle.kts @@ -13,7 +13,9 @@ dependencies { } } pluginManager.withPlugin("osgi-conventions") { - "osgiVerification"("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:${versions["junit4.osgi"]}") + val libs = project.extensions["libs"] as VersionCatalog + val junit4Osgi = libs.findVersion("junit4Osgi").get().requiredVersion + "osgiVerification"("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:${junit4Osgi}") } } diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index b0c55706efe5..677d53cefc65 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -50,7 +50,8 @@ tasks.withType().configureEach { } dependencies { - "testImplementation"("org.assertj:assertj-core") + val libs = project.extensions["libs"] as VersionCatalog + "testImplementation"(libs.findDependency("assertj").get()) "testImplementation"("org.mockito:mockito-junit-jupiter") { exclude(module = "junit-jupiter-engine") } diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 10470cb05888..719383d45398 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -13,19 +13,9 @@ dependencies { // runtime means "the dependency is only for runtime, not for compilation" // In other words, marking dependency as "runtime" would avoid accidental // dependency on it during compilation - api("org.apiguardian:apiguardian-api:${versions.apiguardian}") - api("org.opentest4j:opentest4j:${versions.opentest4j}") runtime("org.apache.logging.log4j:log4j-core:${versions["log4j"]}") runtime("org.apache.logging.log4j:log4j-jul:${versions["log4j"]}") api("io.github.classgraph:classgraph:${versions["classgraph"]}") - api("junit:junit:[${versions.junit4Min},)") { - version { - prefer(versions.junit4) - } - } - api("com.univocity:univocity-parsers:${versions["univocity-parsers"]}") - api("info.picocli:picocli:${versions["picocli"]}") - api("org.assertj:assertj-core:${versions.assertj}") api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("de.sormuras:bartholdy:${versions["bartholdy"]}") diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 6ecf26cbb3ef..f46b6b480c15 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -68,8 +68,8 @@ val docsDir = file("$buildDir/ghpages-docs") val replaceCurrentDocs = project.hasProperty("replaceCurrentDocs") val uploadPdfs = !snapshot val userGuidePdfFileName = "junit-user-guide-${rootProject.version}.pdf" -val ota4jDocVersion = if (versions.opentest4j.contains("SNAPSHOT")) "snapshot" else versions.opentest4j -val apiGuardianDocVersion = if (versions.apiguardian.contains("SNAPSHOT")) "snapshot" else versions.apiguardian +val ota4jDocVersion = if (libs.versions.opentest4j.get().contains("SNAPSHOT")) "snapshot" else libs.versions.opentest4j.get() +val apiGuardianDocVersion = if (libs.versions.apiguardian.get().contains("SNAPSHOT")) "snapshot" else libs.versions.apiguardian.get() gitPublish { repoUri.set("https://github.com/junit-team/junit5.git") @@ -99,7 +99,7 @@ val jdkJavadocBaseUrl = "https://docs.oracle.com/en/java/javase/11/docs/api" val elementListsDir = file("$buildDir/elementLists") val externalModulesWithoutModularJavadoc = mapOf( "org.apiguardian.api" to "https://apiguardian-team.github.io/apiguardian/docs/$apiGuardianDocVersion/api/", - "org.assertj.core" to "https://javadoc.io/doc/org.assertj/assertj-core/${versions.assertj}/", + "org.assertj.core" to "https://javadoc.io/doc/org.assertj/assertj-core/${libs.versions.assertj.get()}/", "org.opentest4j" to "https://ota4j-team.github.io/opentest4j/docs/$ota4jDocVersion/api/" ) require(externalModulesWithoutModularJavadoc.values.all { it.endsWith("/") }) { @@ -181,9 +181,9 @@ tasks { "platform-version" to project.property("platformVersion"), "vintage-version" to project.property("vintageVersion"), "bom-version" to version, - "junit4-version" to versions.junit4, - "apiguardian-version" to versions.apiguardian, - "ota4j-version" to versions.opentest4j, + "junit4-version" to libs.versions.junit4.get(), + "apiguardian-version" to libs.versions.apiguardian.get(), + "ota4j-version" to libs.versions.opentest4j.get(), "surefire-version" to versions["surefire"], "release-branch" to releaseBranch, "docs-version" to docsVersion, @@ -287,7 +287,7 @@ tasks { ) links(jdkJavadocBaseUrl) - links("https://junit.org/junit4/javadoc/${versions.junit4}/") + links("https://junit.org/junit4/javadoc/${libs.versions.junit4.get()}/") externalModulesWithoutModularJavadoc.forEach { (moduleName, baseUrl) -> linksOffline(baseUrl, "$elementListsDir/$moduleName") } diff --git a/gradle.properties b/gradle.properties index d7b55970b6dc..0da627fd2910 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,16 +24,6 @@ gradle.internal.testdistribution.writeTraceFile=true # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library kotlin.stdlib.default.dependency=false -# Dependencies -apiguardian.version=1.1.1 -assertj.version=3.19.0 -junit4.version=4.13.2 -junit4.osgi.version=4.13.2_1 -junit4Min.version=4.12 -opentest4j.version=1.2.0 -picocli.version=4.6.1 -univocity-parsers.version=2.9.1 - # Test Dependencies archunit.version=0.17.0 bartholdy.version=0.2.3 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000000..109adff3a9de --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,17 @@ +[versions] +apiguardian = "1.1.1" +assertj = "3.19.0" +junit4 = "4.13.2" +junit4Osgi = "4.13.2_1" +junit4Min = "4.12" +opentest4j = "1.2.0" +picocli = "4.6.1" +univocity-parsers = "2.9.1" + +[libraries] +apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } +assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } +junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } +opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } +picocli = { module = "info.picocli:picocli", version.ref = "picocli" } +univocity-parsers = { module = "com.univocity:univocity-parsers", version.ref = "univocity-parsers" } diff --git a/junit-jupiter-api/junit-jupiter-api.gradle.kts b/junit-jupiter-api/junit-jupiter-api.gradle.kts index f7a66e3c419b..10b082dde7bd 100644 --- a/junit-jupiter-api/junit-jupiter-api.gradle.kts +++ b/junit-jupiter-api/junit-jupiter-api.gradle.kts @@ -6,11 +6,9 @@ plugins { description = "JUnit Jupiter API" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") - api("org.opentest4j:opentest4j") + api(libs.apiguardian) + api(libs.opentest4j) api(project(":junit-platform-commons")) compileOnly("org.jetbrains.kotlin:kotlin-stdlib") diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 9c6763e75174..36d817c0559a 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -12,7 +12,7 @@ dependencies { internal(platform(project(":dependencies"))) api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-engine")) api(project(":junit-jupiter-api")) diff --git a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts index 847707f90724..a8ca3e348220 100644 --- a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts +++ b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts @@ -12,8 +12,8 @@ dependencies { internal(platform(project(":dependencies"))) api(platform(project(":junit-bom"))) - api("junit:junit") - api("org.apiguardian:apiguardian-api") + api(libs.junit4) + api(libs.apiguardian) api(project(":junit-jupiter-api")) testImplementation(project(":junit-jupiter-engine")) @@ -28,9 +28,9 @@ tasks.jar { # Import JUnit4 packages with a version Import-Package: \ !org.apiguardian.api,\ - org.junit;version="[${versions.junit4Min},5)",\ + org.junit;version="[${libs.versions.junit4Min.get()},5)",\ org.junit.platform.commons.logging;status=INTERNAL,\ - org.junit.rules;version="[${versions.junit4Min},5)",\ + org.junit.rules;version="[${libs.versions.junit4Min.get()},5)",\ * """) } diff --git a/junit-jupiter-params/junit-jupiter-params.gradle.kts b/junit-jupiter-params/junit-jupiter-params.gradle.kts index 234fb19d0f4b..ce35c90cd25e 100644 --- a/junit-jupiter-params/junit-jupiter-params.gradle.kts +++ b/junit-jupiter-params/junit-jupiter-params.gradle.kts @@ -10,11 +10,10 @@ dependencies { internal(platform(project(":dependencies"))) api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-jupiter-api")) - shadowed(platform(project(":dependencies"))) - shadowed("com.univocity:univocity-parsers") + shadowed(libs.univocity.parsers) testImplementation(project(":junit-platform-testkit")) testImplementation(project(":junit-jupiter-engine")) diff --git a/junit-jupiter/junit-jupiter.gradle.kts b/junit-jupiter/junit-jupiter.gradle.kts index 3ef81ae52660..f19ef52b086c 100644 --- a/junit-jupiter/junit-jupiter.gradle.kts +++ b/junit-jupiter/junit-jupiter.gradle.kts @@ -5,8 +5,6 @@ plugins { description = "JUnit Jupiter (Aggregator)" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(project(":junit-jupiter-api")) api(project(":junit-jupiter-params")) diff --git a/junit-platform-commons/junit-platform-commons.gradle.kts b/junit-platform-commons/junit-platform-commons.gradle.kts index f19d86f85175..fb5a6651d721 100644 --- a/junit-platform-commons/junit-platform-commons.gradle.kts +++ b/junit-platform-commons/junit-platform-commons.gradle.kts @@ -8,9 +8,8 @@ plugins { description = "JUnit Platform Commons" dependencies { - internal(platform(project(":dependencies"))) api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) } tasks.jar { diff --git a/junit-platform-console/junit-platform-console.gradle.kts b/junit-platform-console/junit-platform-console.gradle.kts index 32c1ff5fe90a..5566a2512011 100644 --- a/junit-platform-console/junit-platform-console.gradle.kts +++ b/junit-platform-console/junit-platform-console.gradle.kts @@ -8,14 +8,11 @@ plugins { description = "JUnit Platform Console" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-reporting")) - shadowed(platform(project(":dependencies"))) - shadowed("info.picocli:picocli") + shadowed(libs.picocli) } tasks { diff --git a/junit-platform-engine/junit-platform-engine.gradle.kts b/junit-platform-engine/junit-platform-engine.gradle.kts index af2a6092e17a..c7d91f6e2c4d 100644 --- a/junit-platform-engine/junit-platform-engine.gradle.kts +++ b/junit-platform-engine/junit-platform-engine.gradle.kts @@ -6,12 +6,10 @@ plugins { description = "JUnit Platform Engine API" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") - api("org.opentest4j:opentest4j") + api(libs.apiguardian) + api(libs.opentest4j) api(project(":junit-platform-commons")) - testImplementation("org.assertj:assertj-core") + testImplementation(libs.assertj) } diff --git a/junit-platform-jfr/junit-platform-jfr.gradle.kts b/junit-platform-jfr/junit-platform-jfr.gradle.kts index 0882b63d5761..fab69f5ecf3b 100644 --- a/junit-platform-jfr/junit-platform-jfr.gradle.kts +++ b/junit-platform-jfr/junit-platform-jfr.gradle.kts @@ -5,10 +5,8 @@ plugins { description = "JUnit Platform Flight Recorder Support" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-launcher")) } diff --git a/junit-platform-launcher/junit-platform-launcher.gradle.kts b/junit-platform-launcher/junit-platform-launcher.gradle.kts index d3a5ecf284fe..0e2c4412bbdf 100644 --- a/junit-platform-launcher/junit-platform-launcher.gradle.kts +++ b/junit-platform-launcher/junit-platform-launcher.gradle.kts @@ -6,9 +6,7 @@ plugins { description = "JUnit Platform Launcher" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-engine")) } diff --git a/junit-platform-reporting/junit-platform-reporting.gradle.kts b/junit-platform-reporting/junit-platform-reporting.gradle.kts index bc0b0867c790..0812110890c9 100644 --- a/junit-platform-reporting/junit-platform-reporting.gradle.kts +++ b/junit-platform-reporting/junit-platform-reporting.gradle.kts @@ -5,9 +5,7 @@ plugins { description = "JUnit Platform Reporting" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-launcher")) } diff --git a/junit-platform-runner/junit-platform-runner.gradle.kts b/junit-platform-runner/junit-platform-runner.gradle.kts index a6aab3ce037c..3be2a0e79c74 100644 --- a/junit-platform-runner/junit-platform-runner.gradle.kts +++ b/junit-platform-runner/junit-platform-runner.gradle.kts @@ -8,11 +8,9 @@ plugins { description = "JUnit Platform Runner" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("junit:junit") - api("org.apiguardian:apiguardian-api") + api(libs.junit4) + api(libs.apiguardian) api(project(":junit-platform-launcher")) api(project(":junit-platform-suite-api")) @@ -29,7 +27,7 @@ tasks.jar { Import-Package: \ !org.apiguardian.api,\ org.junit.platform.commons.logging;status=INTERNAL,\ - org.junit.runner.*;version="[${versions.junit4Min},5)",\ + org.junit.runner.*;version="[${libs.versions.junit4Min.get()},5)",\ * """) } diff --git a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts index 434370974777..b519350f9d0c 100644 --- a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts +++ b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts @@ -5,10 +5,8 @@ plugins { description = "JUnit Platform Suite API" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-commons")) osgiVerification(project(":junit-platform-commons")) diff --git a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts index 11ffb7fe7a53..81f528c0ba52 100644 --- a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts +++ b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts @@ -9,7 +9,7 @@ dependencies { internal(platform(project(":dependencies"))) api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-launcher")) implementation(project(":junit-platform-engine")) diff --git a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts index 9618efbab32f..b55280b8280b 100644 --- a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts +++ b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts @@ -10,7 +10,7 @@ dependencies { internal(platform(project(":dependencies"))) api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-engine")) api(project(":junit-platform-suite-api")) diff --git a/junit-platform-suite/junit-platform-suite.gradle.kts b/junit-platform-suite/junit-platform-suite.gradle.kts index e9ff61917051..77a097c4aa91 100644 --- a/junit-platform-suite/junit-platform-suite.gradle.kts +++ b/junit-platform-suite/junit-platform-suite.gradle.kts @@ -5,8 +5,6 @@ plugins { description = "JUnit Platform Suite (Aggregator)" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(project(":junit-platform-suite-api")) implementation(project(":junit-platform-suite-engine")) diff --git a/junit-platform-testkit/junit-platform-testkit.gradle.kts b/junit-platform-testkit/junit-platform-testkit.gradle.kts index 2ba9c4a12089..cc8de483bc25 100644 --- a/junit-platform-testkit/junit-platform-testkit.gradle.kts +++ b/junit-platform-testkit/junit-platform-testkit.gradle.kts @@ -5,11 +5,9 @@ plugins { description = "JUnit Platform Test Kit" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") - api("org.assertj:assertj-core") - api("org.opentest4j:opentest4j") + api(libs.apiguardian) + api(libs.assertj) + api(libs.opentest4j) api(project(":junit-platform-launcher")) } diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index c02f2158124b..0d2b3fdd0f5d 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -14,9 +14,9 @@ dependencies { internal(platform(project(":dependencies"))) api(platform(project(":junit-bom"))) - api("org.apiguardian:apiguardian-api") + api(libs.apiguardian) api(project(":junit-platform-engine")) - api("junit:junit") + api(libs.junit4) testFixturesApi("org.spockframework:spock-core") testFixturesImplementation(project(":junit-platform-runner")) @@ -44,17 +44,18 @@ tasks { } jar { withConvention(BundleTaskConvention::class) { + val junit4Min = libs.versions.junit4Min.get() bnd(""" # Import JUnit4 packages with a version Import-Package: \ !org.apiguardian.api,\ - junit.runner;version="[${versions.junit4Min},5)",\ - org.junit;version="[${versions.junit4Min},5)",\ - org.junit.experimental.categories;version="[${versions.junit4Min},5)",\ - org.junit.internal.builders;version="[${versions.junit4Min},5)",\ + junit.runner;version="[${junit4Min},5)",\ + org.junit;version="[${junit4Min},5)",\ + org.junit.experimental.categories;version="[${junit4Min},5)",\ + org.junit.internal.builders;version="[${junit4Min},5)",\ org.junit.platform.commons.logging;status=INTERNAL,\ - org.junit.runner.*;version="[${versions.junit4Min},5)",\ - org.junit.runners.model;version="[${versions.junit4Min},5)",\ + org.junit.runner.*;version="[${junit4Min},5)",\ + org.junit.runners.model;version="[${junit4Min},5)",\ * """) } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index bc75c1ae9638..bf12638089c2 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -42,7 +42,7 @@ dependencies { jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess") jmh(platform(project(":dependencies"))) jmh(project(":junit-jupiter-api")) - jmh("junit:junit") + jmh(libs.junit4) } jmh { diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 5086239a2b93..91b77154f428 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -62,10 +62,10 @@ tasks.test { jvmArgumentProviders += MavenRepo(tempRepoDir) // Pass version constants (declared in Versions.kt) to tests as system properties - systemProperty("Versions.apiGuardian", versions.apiguardian) - systemProperty("Versions.assertJ", versions.assertj) - systemProperty("Versions.junit4", versions.junit4) - systemProperty("Versions.ota4j", versions.opentest4j) + systemProperty("Versions.apiGuardian", libs.versions.apiguardian.get()) + systemProperty("Versions.assertJ", libs.versions.assertj.get()) + systemProperty("Versions.junit4", libs.versions.junit4.get()) + systemProperty("Versions.ota4j", libs.versions.opentest4j.get()) (options as JUnitPlatformOptions).apply { includeEngines("archunit") diff --git a/settings.gradle.kts b/settings.gradle.kts index 658e4a4807cf..eaadc6d14352 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -130,3 +130,5 @@ rootProject.children.forEach { project -> "${project.buildFile} must exist" } } + +enableFeaturePreview("VERSION_CATALOGS") From 4e76ca0e6d76c46734b17caab6d2948fa563b55e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:36:39 +0200 Subject: [PATCH 0265/1433] Use shorthand notation for kotlin-stdlib --- documentation/documentation.gradle.kts | 2 +- junit-jupiter-api/junit-jupiter-api.gradle.kts | 2 +- junit-jupiter-engine/junit-jupiter-engine.gradle.kts | 2 +- junit-jupiter-params/junit-jupiter-params.gradle.kts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index f46b6b480c15..9932e09f2ba8 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -43,7 +43,7 @@ dependencies { testImplementation(project(":junit-platform-runner")) testImplementation(project(":junit-platform-suite")) testImplementation(project(":junit-platform-testkit")) - testImplementation("org.jetbrains.kotlin:kotlin-stdlib") + testImplementation(kotlin("stdlib")) testImplementation(project(":junit-vintage-engine")) testRuntimeOnly("org.apache.logging.log4j:log4j-core") diff --git a/junit-jupiter-api/junit-jupiter-api.gradle.kts b/junit-jupiter-api/junit-jupiter-api.gradle.kts index 10b082dde7bd..43ded844f9d6 100644 --- a/junit-jupiter-api/junit-jupiter-api.gradle.kts +++ b/junit-jupiter-api/junit-jupiter-api.gradle.kts @@ -11,5 +11,5 @@ dependencies { api(libs.opentest4j) api(project(":junit-platform-commons")) - compileOnly("org.jetbrains.kotlin:kotlin-stdlib") + compileOnly(kotlin("stdlib")) } diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 36d817c0559a..43f787856b07 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -20,7 +20,7 @@ dependencies { testImplementation(project(":junit-platform-runner")) testImplementation(project(":junit-platform-testkit")) testImplementation(testFixtures(project(":junit-platform-commons"))) - testImplementation("org.jetbrains.kotlin:kotlin-stdlib") + testImplementation(kotlin("stdlib")) testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") testImplementation("org.codehaus.groovy:groovy") } diff --git a/junit-jupiter-params/junit-jupiter-params.gradle.kts b/junit-jupiter-params/junit-jupiter-params.gradle.kts index ce35c90cd25e..d9152ccbb6d7 100644 --- a/junit-jupiter-params/junit-jupiter-params.gradle.kts +++ b/junit-jupiter-params/junit-jupiter-params.gradle.kts @@ -20,8 +20,8 @@ dependencies { testImplementation(project(":junit-platform-launcher")) testImplementation(project(":junit-platform-runner")) - compileOnly("org.jetbrains.kotlin:kotlin-stdlib") - testImplementation("org.jetbrains.kotlin:kotlin-stdlib") + compileOnly(kotlin("stdlib")) + testImplementation(kotlin("stdlib")) } tasks { From cfbb9e772abfff1fe54594275669bab830e9dd40 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:43:09 +0200 Subject: [PATCH 0266/1433] Move ArchUnit to version catalog --- dependencies/dependencies.gradle.kts | 2 -- gradle.properties | 1 - gradle/libs.versions.toml | 2 ++ .../platform-tooling-support-tests.gradle.kts | 5 +---- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 719383d45398..ce0ee626391c 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -20,8 +20,6 @@ dependencies { api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("de.sormuras:bartholdy:${versions["bartholdy"]}") api("commons-io:commons-io:${versions["commons-io"]}") - api("com.tngtech.archunit:archunit-junit5-api:${versions["archunit"]}") - api("com.tngtech.archunit:archunit-junit5-engine:${versions["archunit"]}") api("org.slf4j:slf4j-jdk14:${versions["slf4j"]}") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions["kotlinx-coroutines-core"]}") api("org.mockito:mockito-junit-jupiter:${versions["mockito"]}") diff --git a/gradle.properties b/gradle.properties index 0da627fd2910..c2d1258e0918 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -archunit.version=0.17.0 bartholdy.version=0.2.3 classgraph.version=4.8.104 commons-io.version=2.8.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 109adff3a9de..cca97f55b5c7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,6 @@ [versions] apiguardian = "1.1.1" +archunit = "0.17.0" assertj = "3.19.0" junit4 = "4.13.2" junit4Osgi = "4.13.2_1" @@ -10,6 +11,7 @@ univocity-parsers = "2.9.1" [libraries] apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } +archunit = { module = "com.tngtech.archunit:archunit-junit5", version.ref = "archunit" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 91b77154f428..ff37c0e87e0f 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -23,7 +23,7 @@ dependencies { testImplementation("org.assertj:assertj-core") { because("more assertions") } - testImplementation("com.tngtech.archunit:archunit-junit5-api") { + testImplementation(libs.archunit) { because("checking the architecture of JUnit 5") } testImplementation("org.codehaus.groovy:groovy") { @@ -33,9 +33,6 @@ dependencies { testImplementation("biz.aQute.bnd:biz.aQute.bndlib") { because("parsing OSGi metadata") } - testRuntimeOnly("com.tngtech.archunit:archunit-junit5-engine") { - because("contains the ArchUnit TestEngine implementation") - } testRuntimeOnly("org.slf4j:slf4j-jdk14") { because("provide appropriate SLF4J binding") } From 1681e8ec05500215090630fdf565426c881297a4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:43:22 +0200 Subject: [PATCH 0267/1433] Remove duplicate declaration of AssertJ --- .../platform-tooling-support-tests.gradle.kts | 3 --- 1 file changed, 3 deletions(-) diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index ff37c0e87e0f..016d9b76ae31 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -20,9 +20,6 @@ dependencies { because("moving/deleting directory trees") } - testImplementation("org.assertj:assertj-core") { - because("more assertions") - } testImplementation(libs.archunit) { because("checking the architecture of JUnit 5") } From 2829f2dc3142bfe0b52bedd2a08de147b5b06cbd Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:48:48 +0200 Subject: [PATCH 0268/1433] Move Bartholdy to version catalog --- dependencies/dependencies.gradle.kts | 1 - gradle/libs.versions.toml | 1 + .../platform-tooling-support-tests.gradle.kts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index ce0ee626391c..48c71d8e4436 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -18,7 +18,6 @@ dependencies { api("io.github.classgraph:classgraph:${versions["classgraph"]}") api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") - api("de.sormuras:bartholdy:${versions["bartholdy"]}") api("commons-io:commons-io:${versions["commons-io"]}") api("org.slf4j:slf4j-jdk14:${versions["slf4j"]}") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions["kotlinx-coroutines-core"]}") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cca97f55b5c7..b45c2f106015 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,6 +13,7 @@ univocity-parsers = "2.9.1" apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } archunit = { module = "com.tngtech.archunit:archunit-junit5", version.ref = "archunit" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } +bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version.ref = "picocli" } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 016d9b76ae31..52bcf2dd840f 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -13,7 +13,7 @@ javaLibrary { dependencies { internal(platform(project(":dependencies"))) - implementation("de.sormuras:bartholdy") { + implementation(libs.bartholdy) { because("manage external tool installations") } implementation("commons-io:commons-io") { From 9de985004971d60e13772aec86b12eca84c134e9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:49:08 +0200 Subject: [PATCH 0269/1433] Inline versions that are only used once --- gradle.properties | 1 - gradle/libs.versions.toml | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index c2d1258e0918..8002a166cd29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -bartholdy.version=0.2.3 classgraph.version=4.8.104 commons-io.version=2.8.0 kotlinx-coroutines-core.version=1.4.3 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b45c2f106015..7ac421515672 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,20 +1,17 @@ [versions] apiguardian = "1.1.1" -archunit = "0.17.0" assertj = "3.19.0" junit4 = "4.13.2" junit4Osgi = "4.13.2_1" junit4Min = "4.12" opentest4j = "1.2.0" -picocli = "4.6.1" -univocity-parsers = "2.9.1" [libraries] apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } -archunit = { module = "com.tngtech.archunit:archunit-junit5", version.ref = "archunit" } +archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.17.0" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } -picocli = { module = "info.picocli:picocli", version.ref = "picocli" } -univocity-parsers = { module = "com.univocity:univocity-parsers", version.ref = "univocity-parsers" } +picocli = { module = "info.picocli:picocli", version = "4.6.1" } +univocity-parsers = { module = "com.univocity:univocity-parsers", version = "2.9.1" } From ddc91afebc2f4d6b93ec0f091a18e8e36e0100ec Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:50:36 +0200 Subject: [PATCH 0270/1433] Move Classgraph to version catalog --- dependencies/dependencies.gradle.kts | 1 - documentation/documentation.gradle.kts | 2 +- gradle.properties | 1 - gradle/libs.versions.toml | 1 + 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 48c71d8e4436..455fff32da0a 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -15,7 +15,6 @@ dependencies { // dependency on it during compilation runtime("org.apache.logging.log4j:log4j-core:${versions["log4j"]}") runtime("org.apache.logging.log4j:log4j-jul:${versions["log4j"]}") - api("io.github.classgraph:classgraph:${versions["classgraph"]}") api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("commons-io:commons-io:${versions["commons-io"]}") diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 9932e09f2ba8..433d466a9b76 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -49,7 +49,7 @@ dependencies { testRuntimeOnly("org.apache.logging.log4j:log4j-core") testRuntimeOnly("org.apache.logging.log4j:log4j-jul") - testImplementation("io.github.classgraph:classgraph") { + testImplementation(libs.classgraph) { because("ApiReportGenerator needs it") } } diff --git a/gradle.properties b/gradle.properties index 8002a166cd29..eab8b05e99ec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -classgraph.version=4.8.104 commons-io.version=2.8.0 kotlinx-coroutines-core.version=1.4.3 groovy.version=3.0.7 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7ac421515672..306feee6b58c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,6 +11,7 @@ apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apigu archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.17.0" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } +classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version = "4.6.1" } From 048468129357ee79870d9b834b082400f210333f Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:55:13 +0200 Subject: [PATCH 0271/1433] Move commons-io to version catalog --- dependencies/dependencies.gradle.kts | 1 - gradle.properties | 1 - gradle/libs.versions.toml | 1 + .../platform-tooling-support-tests.gradle.kts | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 455fff32da0a..c53c79108ce9 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -17,7 +17,6 @@ dependencies { runtime("org.apache.logging.log4j:log4j-jul:${versions["log4j"]}") api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") - api("commons-io:commons-io:${versions["commons-io"]}") api("org.slf4j:slf4j-jdk14:${versions["slf4j"]}") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions["kotlinx-coroutines-core"]}") api("org.mockito:mockito-junit-jupiter:${versions["mockito"]}") diff --git a/gradle.properties b/gradle.properties index eab8b05e99ec..5da1dea8ed29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -commons-io.version=2.8.0 kotlinx-coroutines-core.version=1.4.3 groovy.version=3.0.7 log4j.version=2.14.1 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 306feee6b58c..e12eae93f4ff 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,6 +12,7 @@ archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.17.0" assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } +commons-io = { module = "commons-io:commons-io", version = "2.8.0" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version = "4.6.1" } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 52bcf2dd840f..0587da6a19ed 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -16,7 +16,7 @@ dependencies { implementation(libs.bartholdy) { because("manage external tool installations") } - implementation("commons-io:commons-io") { + implementation(libs.commons.io) { because("moving/deleting directory trees") } From 4622a6f49d3217e63f0e127dc78e6c2cd196a8dc Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 12:57:14 +0200 Subject: [PATCH 0272/1433] Move kotlinx-coroutines to version catalog --- dependencies/dependencies.gradle.kts | 1 - gradle.properties | 1 - gradle/libs.versions.toml | 1 + junit-jupiter-engine/junit-jupiter-engine.gradle.kts | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index c53c79108ce9..eb0a54d0d75f 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -18,7 +18,6 @@ dependencies { api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("org.slf4j:slf4j-jdk14:${versions["slf4j"]}") - api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions["kotlinx-coroutines-core"]}") api("org.mockito:mockito-junit-jupiter:${versions["mockito"]}") api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") api("org.spockframework:spock-core:${versions["spock"]}") diff --git a/gradle.properties b/gradle.properties index 5da1dea8ed29..df6350160ac6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -kotlinx-coroutines-core.version=1.4.3 groovy.version=3.0.7 log4j.version=2.14.1 mockito.version=3.9.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e12eae93f4ff..5625f50980ba 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,6 +14,7 @@ bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } commons-io = { module = "commons-io:commons-io", version = "2.8.0" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } +kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version = "4.6.1" } univocity-parsers = { module = "com.univocity:univocity-parsers", version = "2.9.1" } diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 43f787856b07..3cfee6695ba7 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -21,7 +21,7 @@ dependencies { testImplementation(project(":junit-platform-testkit")) testImplementation(testFixtures(project(":junit-platform-commons"))) testImplementation(kotlin("stdlib")) - testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") + testImplementation(libs.kotlinx.coroutines) testImplementation("org.codehaus.groovy:groovy") } From 31f41401c32487ceb8e6756f344626ebaba78788 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 13:20:14 +0200 Subject: [PATCH 0273/1433] Move Groovy to version catalog --- dependencies/dependencies.gradle.kts | 5 ----- gradle.properties | 1 - gradle/libs.versions.toml | 2 ++ junit-jupiter-engine/junit-jupiter-engine.gradle.kts | 2 +- junit-vintage-engine/junit-vintage-engine.gradle.kts | 10 +--------- platform-tests/platform-tests.gradle.kts | 4 ++-- .../platform-tooling-support-tests.gradle.kts | 3 +-- 7 files changed, 7 insertions(+), 20 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index eb0a54d0d75f..25de163c35e3 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -2,12 +2,7 @@ plugins { `java-platform` } -javaPlatform { - allowDependencies() -} - dependencies { - api(platform("org.codehaus.groovy:groovy-bom:${versions["groovy"]}")) constraints { // api means "the dependency is for both compilation and runtime" // runtime means "the dependency is only for runtime, not for compilation" diff --git a/gradle.properties b/gradle.properties index df6350160ac6..295371e375e3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -groovy.version=3.0.7 log4j.version=2.14.1 mockito.version=3.9.0 slf4j.version=1.7.30 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5625f50980ba..4a61c7cb0dbd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,6 +13,8 @@ assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } commons-io = { module = "commons-io:commons-io", version = "2.8.0" } +groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.7" } +groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.14" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 3cfee6695ba7..1e202a5f9693 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -22,7 +22,7 @@ dependencies { testImplementation(testFixtures(project(":junit-platform-commons"))) testImplementation(kotlin("stdlib")) testImplementation(libs.kotlinx.coroutines) - testImplementation("org.codehaus.groovy:groovy") + testImplementation(libs.groovy3) } tasks { diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index 0d2b3fdd0f5d..566fab76e8a1 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -18,6 +18,7 @@ dependencies { api(project(":junit-platform-engine")) api(libs.junit4) + testFixturesApi(platform(libs.groovy2.bom)) testFixturesApi("org.spockframework:spock-core") testFixturesImplementation(project(":junit-platform-runner")) @@ -26,15 +27,6 @@ dependencies { testImplementation(project(":junit-platform-testkit")) } -configurations.all { - resolutionStrategy.eachDependency { - if (requested.group == "org.codehaus.groovy") { - useVersion("2.5.11") - because("Spock is not yet compatible with Groovy 3.x") - } - } -} - tasks { compileTestFixturesGroovy { javaLauncher.set(project.the().launcherFor { diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index bf12638089c2..4e7de10cb497 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -24,13 +24,13 @@ dependencies { testImplementation(testFixtures(project(":junit-platform-engine"))) testImplementation(testFixtures(project(":junit-platform-launcher"))) testImplementation(project(":junit-jupiter-engine")) - testImplementation("org.apiguardian:apiguardian-api") + testImplementation(libs.apiguardian) testImplementation("com.github.gunnarmorling:jfrunit") testImplementation("org.jooq:joox") // --- Test run-time dependencies --------------------------------------------- testRuntimeOnly(project(":junit-vintage-engine")) - testRuntimeOnly("org.codehaus.groovy:groovy") { + testRuntimeOnly(libs.groovy3) { because("`ReflectionUtilsTests.findNestedClassesWithInvalidNestedClassFile` needs it") } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index 0587da6a19ed..fdbb917b87b0 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -23,9 +23,8 @@ dependencies { testImplementation(libs.archunit) { because("checking the architecture of JUnit 5") } - testImplementation("org.codehaus.groovy:groovy") { + testImplementation(libs.groovy3) { because("it provides convenience methods to handle process output") - exclude(group = "org.junit.platform", module = "junit-platform-launcher") } testImplementation("biz.aQute.bnd:biz.aQute.bndlib") { because("parsing OSGi metadata") From 51e7f418e7cdeebc77e3fcd1f620fe5b4aeec102 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 13:30:15 +0200 Subject: [PATCH 0274/1433] Move Log4J to version catalog --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 3 +-- dependencies/dependencies.gradle.kts | 6 ------ documentation/documentation.gradle.kts | 3 +-- gradle.properties | 1 - gradle/libs.versions.toml | 6 ++++++ 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 677d53cefc65..7acb9e3ce059 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -64,6 +64,5 @@ dependencies { "testRuntimeOnly"(project(":junit-platform-launcher")) "testRuntimeOnly"(project(":junit-platform-jfr")) - "testRuntimeOnly"("org.apache.logging.log4j:log4j-core") - "testRuntimeOnly"("org.apache.logging.log4j:log4j-jul") + "testRuntimeOnly"(libs.findBundle("log4j").get()) } diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 25de163c35e3..e77521646bbc 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -4,12 +4,6 @@ plugins { dependencies { constraints { - // api means "the dependency is for both compilation and runtime" - // runtime means "the dependency is only for runtime, not for compilation" - // In other words, marking dependency as "runtime" would avoid accidental - // dependency on it during compilation - runtime("org.apache.logging.log4j:log4j-core:${versions["log4j"]}") - runtime("org.apache.logging.log4j:log4j-jul:${versions["log4j"]}") api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("org.slf4j:slf4j-jdk14:${versions["slf4j"]}") diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 433d466a9b76..f3c93e89e32e 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -46,8 +46,7 @@ dependencies { testImplementation(kotlin("stdlib")) testImplementation(project(":junit-vintage-engine")) - testRuntimeOnly("org.apache.logging.log4j:log4j-core") - testRuntimeOnly("org.apache.logging.log4j:log4j-jul") + testRuntimeOnly(libs.bundles.log4j) testImplementation(libs.classgraph) { because("ApiReportGenerator needs it") diff --git a/gradle.properties b/gradle.properties index 295371e375e3..ce93340ccba1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -log4j.version=2.14.1 mockito.version=3.9.0 slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4a61c7cb0dbd..407140a895a0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,6 +4,7 @@ assertj = "3.19.0" junit4 = "4.13.2" junit4Osgi = "4.13.2_1" junit4Min = "4.12" +log4j = "2.14.1" opentest4j = "1.2.0" [libraries] @@ -17,6 +18,11 @@ groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.7" } groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.14" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } +log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } +log4j-jul = { module = "org.apache.logging.log4j:log4j-jul", version.ref = "log4j" } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version = "4.6.1" } univocity-parsers = { module = "com.univocity:univocity-parsers", version = "2.9.1" } + +[bundles] +log4j = ["log4j-core", "log4j-jul"] From 6e3954dcb388b24dcacd407b4ea35a9cdf69d51a Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 13:48:42 +0200 Subject: [PATCH 0275/1433] Move SLF4J to version catalog --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 4 +--- dependencies/dependencies.gradle.kts | 2 -- gradle.properties | 2 -- gradle/libs.versions.toml | 2 ++ .../platform-tooling-support-tests.gradle.kts | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 7acb9e3ce059..8f1af23b18ed 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -52,9 +52,7 @@ tasks.withType().configureEach { dependencies { val libs = project.extensions["libs"] as VersionCatalog "testImplementation"(libs.findDependency("assertj").get()) - "testImplementation"("org.mockito:mockito-junit-jupiter") { - exclude(module = "junit-jupiter-engine") - } + "testImplementation"(libs.findDependency("mockito").get()) if (project.name != "junit-jupiter-engine") { "testImplementation"(project(":junit-jupiter")) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index e77521646bbc..94c06a3f4cc6 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -6,8 +6,6 @@ dependencies { constraints { api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") - api("org.slf4j:slf4j-jdk14:${versions["slf4j"]}") - api("org.mockito:mockito-junit-jupiter:${versions["mockito"]}") api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") api("org.spockframework:spock-core:${versions["spock"]}") api("com.github.gunnarmorling:jfrunit:${versions["jfrunit"]}") diff --git a/gradle.properties b/gradle.properties index ce93340ccba1..6b25587e5abb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,8 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -mockito.version=3.9.0 -slf4j.version=1.7.30 spock.version=1.3-groovy-2.5 jfrunit.version=main-SNAPSHOT joox.version=1.6.2 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 407140a895a0..fecdd2c8d693 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -20,8 +20,10 @@ junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4 kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } log4j-jul = { module = "org.apache.logging.log4j:log4j-jul", version.ref = "log4j" } +mockito = { module = "org.mockito:mockito-junit-jupiter", version = "3.9.0" } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version = "4.6.1" } +slf4j-julBinding = { module = "org.slf4j:slf4j-jdk14", version = "1.7.30" } univocity-parsers = { module = "com.univocity:univocity-parsers", version = "2.9.1" } [bundles] diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index fdbb917b87b0..aff47a96941e 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -29,7 +29,7 @@ dependencies { testImplementation("biz.aQute.bnd:biz.aQute.bndlib") { because("parsing OSGi metadata") } - testRuntimeOnly("org.slf4j:slf4j-jdk14") { + testRuntimeOnly(libs.slf4j.julBinding) { because("provide appropriate SLF4J binding") } } From 2e43c396d9500a6beef3a1322b2c09fbb37ef333 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 13:56:12 +0200 Subject: [PATCH 0276/1433] Move Spock to version catalog --- dependencies/dependencies.gradle.kts | 1 - gradle.properties | 1 - gradle/libs.versions.toml | 1 + junit-vintage-engine/junit-vintage-engine.gradle.kts | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 94c06a3f4cc6..0cb165fd15a6 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -7,7 +7,6 @@ dependencies { api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") - api("org.spockframework:spock-core:${versions["spock"]}") api("com.github.gunnarmorling:jfrunit:${versions["jfrunit"]}") api("org.jooq:joox:${versions["joox"]}") } diff --git a/gradle.properties b/gradle.properties index 6b25587e5abb..9c83faa65f96 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -spock.version=1.3-groovy-2.5 jfrunit.version=main-SNAPSHOT joox.version=1.6.2 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fecdd2c8d693..6ac570587760 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,6 +24,7 @@ mockito = { module = "org.mockito:mockito-junit-jupiter", version = "3.9.0" } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version = "4.6.1" } slf4j-julBinding = { module = "org.slf4j:slf4j-jdk14", version = "1.7.30" } +spock1 = { module = "org.spockframework:spock-core", version = "1.3-groovy-2.5" } univocity-parsers = { module = "com.univocity:univocity-parsers", version = "2.9.1" } [bundles] diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index 566fab76e8a1..ac8b762e5522 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -19,7 +19,7 @@ dependencies { api(libs.junit4) testFixturesApi(platform(libs.groovy2.bom)) - testFixturesApi("org.spockframework:spock-core") + testFixturesApi(libs.spock1) testFixturesImplementation(project(":junit-platform-runner")) testImplementation(project(":junit-platform-launcher")) From d7d226870b410499621d2b39ba2a0a98bce424bd Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 14:04:35 +0200 Subject: [PATCH 0277/1433] Move JFRUnit to version catalog --- dependencies/dependencies.gradle.kts | 1 - gradle.properties | 1 - gradle/libs.versions.toml | 1 + platform-tests/platform-tests.gradle.kts | 2 +- 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 0cb165fd15a6..bd6f72e9936c 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -7,7 +7,6 @@ dependencies { api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") - api("com.github.gunnarmorling:jfrunit:${versions["jfrunit"]}") api("org.jooq:joox:${versions["joox"]}") } } diff --git a/gradle.properties b/gradle.properties index 9c83faa65f96..b3bc912140f6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,6 @@ gradle.internal.testdistribution.writeTraceFile=true kotlin.stdlib.default.dependency=false # Test Dependencies -jfrunit.version=main-SNAPSHOT joox.version=1.6.2 # Tools diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6ac570587760..d8465005d249 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,6 +16,7 @@ classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } commons-io = { module = "commons-io:commons-io", version = "2.8.0" } groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.7" } groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.14" } +jfrunit = { module = "com.github.gunnarmorling:jfrunit", version = "main-SNAPSHOT" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 4e7de10cb497..6c891b13bf0b 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -25,7 +25,7 @@ dependencies { testImplementation(testFixtures(project(":junit-platform-launcher"))) testImplementation(project(":junit-jupiter-engine")) testImplementation(libs.apiguardian) - testImplementation("com.github.gunnarmorling:jfrunit") + testImplementation(libs.jfrunit) testImplementation("org.jooq:joox") // --- Test run-time dependencies --------------------------------------------- From c12497b2f9fc1c09ce2d52ef5e58767c96469c77 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 14:07:11 +0200 Subject: [PATCH 0278/1433] Move JOOX to version catalog --- dependencies/dependencies.gradle.kts | 1 - gradle.properties | 3 --- gradle/libs.versions.toml | 1 + platform-tests/platform-tests.gradle.kts | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index bd6f72e9936c..6247855a5763 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -7,6 +7,5 @@ dependencies { api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") - api("org.jooq:joox:${versions["joox"]}") } } diff --git a/gradle.properties b/gradle.properties index b3bc912140f6..a947666b922d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,9 +24,6 @@ gradle.internal.testdistribution.writeTraceFile=true # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library kotlin.stdlib.default.dependency=false -# Test Dependencies -joox.version=1.6.2 - # Tools checkstyle.version=8.36.2 jacoco.version=0.8.6 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d8465005d249..8a0097ac4390 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -17,6 +17,7 @@ commons-io = { module = "commons-io:commons-io", version = "2.8.0" } groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.7" } groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.14" } jfrunit = { module = "com.github.gunnarmorling:jfrunit", version = "main-SNAPSHOT" } +joox = { module = "org.jooq:joox", version = "1.6.2" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 6c891b13bf0b..c575a7ee18c7 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -26,7 +26,7 @@ dependencies { testImplementation(project(":junit-jupiter-engine")) testImplementation(libs.apiguardian) testImplementation(libs.jfrunit) - testImplementation("org.jooq:joox") + testImplementation(libs.joox) // --- Test run-time dependencies --------------------------------------------- testRuntimeOnly(project(":junit-vintage-engine")) From 4463885c91a8998a004625c2cbd951a5af528b72 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 14:23:14 +0200 Subject: [PATCH 0279/1433] Move JMH to version catalog --- dependencies/dependencies.gradle.kts | 2 -- gradle.properties | 1 - gradle/libs.versions.toml | 3 +++ platform-tests/platform-tests.gradle.kts | 10 +++------- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 6247855a5763..1dbb3f59251e 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -4,8 +4,6 @@ plugins { dependencies { constraints { - api("org.openjdk.jmh:jmh-core:${versions["jmh"]}") - api("org.openjdk.jmh:jmh-generator-annprocess:${versions["jmh"]}") api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") } } diff --git a/gradle.properties b/gradle.properties index a947666b922d..b911c3343657 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,6 @@ kotlin.stdlib.default.dependency=false # Tools checkstyle.version=8.36.2 jacoco.version=0.8.6 -jmh.version=1.29 ktlint.version=0.35.0 surefire.version=2.22.2 bnd.version=5.3.0 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8a0097ac4390..49a309439aee 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,7 @@ [versions] apiguardian = "1.1.1" assertj = "3.19.0" +jmh = "1.29" junit4 = "4.13.2" junit4Osgi = "4.13.2_1" junit4Min = "4.12" @@ -17,6 +18,8 @@ commons-io = { module = "commons-io:commons-io", version = "2.8.0" } groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.7" } groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.14" } jfrunit = { module = "com.github.gunnarmorling:jfrunit", version = "main-SNAPSHOT" } +jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" } +jmh-generator-annprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" } joox = { module = "org.jooq:joox", version = "1.6.2" } junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4.13.2" } } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index c575a7ee18c7..65e4c36759ed 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -35,18 +35,14 @@ dependencies { } // --- https://openjdk.java.net/projects/code-tools/jmh/ ----------------------- - jmh("org.openjdk.jmh:jmh-core") { - exclude(module = "jopt-simple") - } - jmhAnnotationProcessor(platform(project(":dependencies"))) - jmhAnnotationProcessor("org.openjdk.jmh:jmh-generator-annprocess") - jmh(platform(project(":dependencies"))) + jmh(libs.jmh.core) jmh(project(":junit-jupiter-api")) jmh(libs.junit4) + jmhAnnotationProcessor(libs.jmh.generator.annprocess) } jmh { - jmhVersion = versions["jmh"] + jmhVersion = libs.versions.jmh.get() duplicateClassesStrategy = DuplicatesStrategy.WARN fork = 0 // Too long command line on Windows... From b79c024145e35d48b533dc5d6aea11e806c13fc4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 17:35:06 +0200 Subject: [PATCH 0280/1433] Move BND to version catalog --- dependencies/dependencies.gradle.kts | 6 ------ gradle.properties | 1 - gradle/libs.versions.toml | 1 + .../platform-tooling-support-tests.gradle.kts | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts index 1dbb3f59251e..6784570ded6a 100644 --- a/dependencies/dependencies.gradle.kts +++ b/dependencies/dependencies.gradle.kts @@ -1,9 +1,3 @@ plugins { `java-platform` } - -dependencies { - constraints { - api("biz.aQute.bnd:biz.aQute.bndlib:${versions["bnd"]}") - } -} diff --git a/gradle.properties b/gradle.properties index b911c3343657..b4adf5a33445 100644 --- a/gradle.properties +++ b/gradle.properties @@ -29,7 +29,6 @@ checkstyle.version=8.36.2 jacoco.version=0.8.6 ktlint.version=0.35.0 surefire.version=2.22.2 -bnd.version=5.3.0 # Plugins gradle.enterprise.plugin.version=3.6.1 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 49a309439aee..5ed4c43857a4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,6 +13,7 @@ apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apigu archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.17.0" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } +bnd = { module = "biz.aQute.bnd:biz.aQute.bndlib", version = "5.3.0" } classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } commons-io = { module = "commons-io:commons-io", version = "2.8.0" } groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.7" } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index aff47a96941e..ea8a952d1491 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -26,7 +26,7 @@ dependencies { testImplementation(libs.groovy3) { because("it provides convenience methods to handle process output") } - testImplementation("biz.aQute.bnd:biz.aQute.bndlib") { + testImplementation(libs.bnd) { because("parsing OSGi metadata") } testRuntimeOnly(libs.slf4j.julBinding) { From 53c2a857b6ef300956b4300a549d577a4751bc07 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 17:50:25 +0200 Subject: [PATCH 0281/1433] Remove internal platform project and configuration --- .../kotlin/java-library-conventions.gradle.kts | 15 --------------- .../src/main/kotlin/shadow-conventions.gradle.kts | 4 +--- dependencies/dependencies.gradle.kts | 3 --- documentation/documentation.gradle.kts | 6 +----- .../junit-jupiter-engine.gradle.kts | 2 -- .../junit-jupiter-migrationsupport.gradle.kts | 2 -- .../junit-jupiter-params.gradle.kts | 2 -- .../junit-platform-console-standalone.gradle.kts | 1 - .../junit-platform-suite-commons.gradle.kts | 2 -- .../junit-platform-suite-engine.gradle.kts | 2 -- .../junit-vintage-engine.gradle.kts | 2 -- platform-tests/platform-tests.gradle.kts | 2 -- .../platform-tooling-support-tests.gradle.kts | 2 -- settings.gradle.kts | 1 - 14 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 dependencies/dependencies.gradle.kts diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 6b2e0625aba5..8dfabc75345d 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -15,25 +15,12 @@ val buildTime: String by rootProject.extra val buildRevision: Any by rootProject.extra val builtByValue: String by rootProject.extra -val internal by configurations.creating { - isVisible = false - isCanBeConsumed = false - isCanBeResolved = false -} - val extension = extensions.create("javaLibrary") val moduleSourceDir = file("src/module/$javaModuleName") val moduleOutputDir = file("$buildDir/classes/java/module") val javaVersion = JavaVersion.current() -configurations { - compileClasspath.get().extendsFrom(internal) - runtimeClasspath.get().extendsFrom(internal) - testCompileClasspath.get().extendsFrom(internal) - testRuntimeClasspath.get().extendsFrom(internal) -} - eclipse { jdt { file { @@ -98,8 +85,6 @@ if (project in mavenizedProjects) { val javaComponent = components["java"] as AdhocComponentWithVariants javaComponent.withVariantsFromConfiguration(configurations["testFixturesApiElements"]) { skip() } javaComponent.withVariantsFromConfiguration(configurations["testFixturesRuntimeElements"]) { skip() } - configurations["testFixturesCompileClasspath"].extendsFrom(internal) - configurations["testFixturesRuntimeClasspath"].extendsFrom(internal) } configure { diff --git a/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts b/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts index 0f1a4bc8d36d..33474a01a36a 100644 --- a/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts @@ -3,9 +3,7 @@ plugins { id("com.github.johnrengelman.shadow") } -val shadowed by configurations.creating { - extendsFrom(configurations["internal"]) -} +val shadowed by configurations.creating configurations.forEach { configuration -> configuration.outgoing.apply { diff --git a/dependencies/dependencies.gradle.kts b/dependencies/dependencies.gradle.kts deleted file mode 100644 index 6784570ded6a..000000000000 --- a/dependencies/dependencies.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `java-platform` -} diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index f3c93e89e32e..57cb970dd5c0 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -22,13 +22,9 @@ javaLibrary { testJavaVersion = JavaVersion.VERSION_1_8 } -val apiReport by configurations.creating { - extendsFrom(configurations.internal.get()) -} +val apiReport by configurations.creating dependencies { - internal(platform(project(":dependencies"))) - implementation(project(":junit-jupiter-api")) { because("Jupiter API is used in src/main/java") } diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 1e202a5f9693..64be7221ca2b 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -9,8 +9,6 @@ plugins { description = "JUnit Jupiter Engine" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(libs.apiguardian) api(project(":junit-platform-engine")) diff --git a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts index a8ca3e348220..c4447c5d28ba 100644 --- a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts +++ b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts @@ -9,8 +9,6 @@ plugins { description = "JUnit Jupiter Migration Support" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(libs.junit4) api(libs.apiguardian) diff --git a/junit-jupiter-params/junit-jupiter-params.gradle.kts b/junit-jupiter-params/junit-jupiter-params.gradle.kts index d9152ccbb6d7..4ca58a8e8cff 100644 --- a/junit-jupiter-params/junit-jupiter-params.gradle.kts +++ b/junit-jupiter-params/junit-jupiter-params.gradle.kts @@ -7,8 +7,6 @@ plugins { description = "JUnit Jupiter Params" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(libs.apiguardian) api(project(":junit-jupiter-api")) diff --git a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts index 00777e1c3486..007edd487d24 100644 --- a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts +++ b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts @@ -8,7 +8,6 @@ plugins { description = "JUnit Platform Console Standalone" dependencies { - internal(platform(project(":dependencies"))) shadowed(project(":junit-platform-reporting")) shadowed(project(":junit-platform-console")) shadowed(project(":junit-jupiter-engine")) diff --git a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts index 81f528c0ba52..70bd5f27d121 100644 --- a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts +++ b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts @@ -6,8 +6,6 @@ plugins { description = "JUnit Platform Suite Commons" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(libs.apiguardian) api(project(":junit-platform-launcher")) diff --git a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts index b55280b8280b..0a2b0345cd02 100644 --- a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts +++ b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts @@ -7,8 +7,6 @@ plugins { description = "JUnit Platform Suite Engine" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(libs.apiguardian) api(project(":junit-platform-engine")) diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index ac8b762e5522..bfe478eb145a 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -11,8 +11,6 @@ plugins { description = "JUnit Vintage Engine" dependencies { - internal(platform(project(":dependencies"))) - api(platform(project(":junit-bom"))) api(libs.apiguardian) api(project(":junit-platform-engine")) diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 65e4c36759ed..cded8420ac07 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -8,8 +8,6 @@ plugins { } dependencies { - internal(platform(project(":dependencies"))) - // --- Things we are testing -------------------------------------------------- testImplementation(project(":junit-platform-commons")) testImplementation(project(":junit-platform-console")) diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index ea8a952d1491..acd9690f6f83 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -11,8 +11,6 @@ javaLibrary { } dependencies { - internal(platform(project(":dependencies"))) - implementation(libs.bartholdy) { because("manage external tool installations") } diff --git a/settings.gradle.kts b/settings.gradle.kts index eaadc6d14352..20f29cbba575 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -94,7 +94,6 @@ require(javaVersion.isJava9Compatible) { rootProject.name = "junit5" -include("dependencies") include("documentation") include("junit-jupiter") include("junit-jupiter-api") From 81b40ca24b238aded2d8109224dd008012919077 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 18:14:43 +0200 Subject: [PATCH 0282/1433] Move tool versions to version catalog --- build.gradle.kts | 4 ++-- .../src/main/kotlin/JavaLibraryExtension.kt | 2 +- buildSrc/src/main/kotlin/ProjectExtensions.kt | 6 ------ buildSrc/src/main/kotlin/Versions.kt | 18 ------------------ .../kotlin/java-library-conventions.gradle.kts | 3 ++- .../kotlin-library-conventions.gradle.kts | 2 +- documentation/documentation.gradle.kts | 4 ++-- gradle.properties | 7 ------- gradle/libs.versions.toml | 5 +++++ 9 files changed, 13 insertions(+), 38 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/Versions.kt diff --git a/build.gradle.kts b/build.gradle.kts index 71a131c240f0..c1d56e7d864f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,7 +104,7 @@ allprojects { if (enableJaCoCo) { apply(plugin = "jacoco") configure { - toolVersion = versions["jacoco"] + toolVersion = libs.versions.jacoco.get() } } @@ -170,7 +170,7 @@ subprojects { } kotlin { - ktlint(versions["ktlint"]) + ktlint(libs.versions.ktlint.get()) licenseHeaderFile(headerFile) trimTrailingWhitespace() endWithNewline() diff --git a/buildSrc/src/main/kotlin/JavaLibraryExtension.kt b/buildSrc/src/main/kotlin/JavaLibraryExtension.kt index acd240f6cb0e..1f92e1b24c0b 100644 --- a/buildSrc/src/main/kotlin/JavaLibraryExtension.kt +++ b/buildSrc/src/main/kotlin/JavaLibraryExtension.kt @@ -2,6 +2,6 @@ import org.gradle.api.JavaVersion @Suppress("UnstableApiUsage") open class JavaLibraryExtension { - var mainJavaVersion: JavaVersion = Versions.jvmTarget + var mainJavaVersion: JavaVersion = JavaVersion.VERSION_1_8 var testJavaVersion: JavaVersion = JavaVersion.VERSION_16 } diff --git a/buildSrc/src/main/kotlin/ProjectExtensions.kt b/buildSrc/src/main/kotlin/ProjectExtensions.kt index d6d2f4215049..315126c5bae3 100644 --- a/buildSrc/src/main/kotlin/ProjectExtensions.kt +++ b/buildSrc/src/main/kotlin/ProjectExtensions.kt @@ -4,9 +4,3 @@ import org.gradle.kotlin.dsl.provideDelegate val Project.javaModuleName: String get() = "org." + this.name.replace('-', '.') - -val Project.versions: Versions - get() { - var versions: Versions? by rootProject.extra - return versions ?: Versions(rootProject).also { versions = it } - } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt deleted file mode 100644 index be96753eccd8..000000000000 --- a/buildSrc/src/main/kotlin/Versions.kt +++ /dev/null @@ -1,18 +0,0 @@ -import org.gradle.api.JavaVersion -import org.gradle.api.Project -import org.gradle.kotlin.dsl.extra -import kotlin.reflect.KProperty - -class Versions(private val project: Project) { - - companion object { - val jvmTarget = JavaVersion.VERSION_1_8 - } - - private val properties = object { - operator fun getValue(receiver: Any?, property: KProperty<*>) = get(property.name) - } - - operator fun get(name: String) = project.extra.get("$name.version") as String - -} diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 8dfabc75345d..8cd196d81e10 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -274,7 +274,8 @@ afterEvaluate { } checkstyle { - toolVersion = versions["checkstyle"] + val libs = project.extensions["libs"] as VersionCatalog + toolVersion = libs.findVersion("checkstyle").get().requiredVersion configDirectory.set(rootProject.file("src/checkstyle")) } diff --git a/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts index 9f0d594d327a..dccb39c91d35 100644 --- a/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/kotlin-library-conventions.gradle.kts @@ -7,7 +7,7 @@ plugins { tasks.withType().configureEach { kotlinOptions { - jvmTarget = Versions.jvmTarget.toString() + jvmTarget = "1.8" apiVersion = "1.3" languageVersion = "1.3" allWarningsAsErrors = true diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 57cb970dd5c0..c4e1f95c385e 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -52,7 +52,7 @@ dependencies { asciidoctorj { modules { diagram.use() - pdf.version(versions["asciidoctor-pdf"]) + pdf.version(libs.versions.asciidoctor.pdf) } } @@ -179,7 +179,7 @@ tasks { "junit4-version" to libs.versions.junit4.get(), "apiguardian-version" to libs.versions.apiguardian.get(), "ota4j-version" to libs.versions.opentest4j.get(), - "surefire-version" to versions["surefire"], + "surefire-version" to libs.versions.surefire.get(), "release-branch" to releaseBranch, "docs-version" to docsVersion, "revnumber" to version, diff --git a/gradle.properties b/gradle.properties index b4adf5a33445..38816f771f4e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,12 +24,6 @@ gradle.internal.testdistribution.writeTraceFile=true # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library kotlin.stdlib.default.dependency=false -# Tools -checkstyle.version=8.36.2 -jacoco.version=0.8.6 -ktlint.version=0.35.0 -surefire.version=2.22.2 - # Plugins gradle.enterprise.plugin.version=3.6.1 test.distribution.plugin.version=2.0.2 @@ -39,7 +33,6 @@ versions.plugin.version=0.38.0 spotless.plugin.version=5.12.0 git-publish.plugin.version=3.0.0 kotlin.plugin.version=1.4.0 -asciidoctor-pdf.version=1.5.3 asciidoctor.plugin.version=3.3.2 jmh.plugin.version=0.5.3 nohttp.plugin.version=0.0.6.RELEASE diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5ed4c43857a4..fafce9a52ecc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,17 @@ [versions] apiguardian = "1.1.1" +asciidoctor-pdf = "1.5.3" assertj = "3.19.0" +checkstyle = "8.36.2" +jacoco = "0.8.6" jmh = "1.29" junit4 = "4.13.2" junit4Osgi = "4.13.2_1" junit4Min = "4.12" +ktlint = "0.35.0" log4j = "2.14.1" opentest4j = "1.2.0" +surefire = "2.22.2" [libraries] apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } From 83858253cebcdd9b6a5a0d9daab5c9ff8257e01d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 18:20:29 +0200 Subject: [PATCH 0283/1433] Move plugin versions to settings.gradle.kts --- gradle.properties | 14 -------------- settings.gradle.kts | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/gradle.properties b/gradle.properties index 38816f771f4e..83439302e974 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,17 +23,3 @@ gradle.internal.testdistribution.writeTraceFile=true # Omit automatic compile dependency on kotlin-stdlib # https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library kotlin.stdlib.default.dependency=false - -# Plugins -gradle.enterprise.plugin.version=3.6.1 -test.distribution.plugin.version=2.0.2 -gradle.user-data.plugin.version=1.2.1 -versioning.plugin.version=2.14.0 -versions.plugin.version=0.38.0 -spotless.plugin.version=5.12.0 -git-publish.plugin.version=3.0.0 -kotlin.plugin.version=1.4.0 -asciidoctor.plugin.version=3.3.2 -jmh.plugin.version=0.5.3 -nohttp.plugin.version=0.0.6.RELEASE -nexus-publish.plugin.version=1.0.0 diff --git a/settings.gradle.kts b/settings.gradle.kts index 20f29cbba575..e83e834f42c3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,19 +6,19 @@ pluginManagement { maven(url = "https://repo.gradle.org/gradle/enterprise-libs-release-candidates-local/") } plugins { - id("com.gradle.enterprise") version settings.extra["gradle.enterprise.plugin.version"] as String - id("com.gradle.enterprise.test-distribution") version settings.extra["test.distribution.plugin.version"] as String - id("com.gradle.common-custom-user-data-gradle-plugin") version settings.extra["gradle.user-data.plugin.version"] as String - id("net.nemerosa.versioning") version settings.extra["versioning.plugin.version"] as String - id("com.github.ben-manes.versions") version settings.extra["versions.plugin.version"] as String - id("com.diffplug.spotless") version settings.extra["spotless.plugin.version"] as String - id("org.ajoberstar.git-publish") version settings.extra["git-publish.plugin.version"] as String - kotlin("jvm") version settings.extra["kotlin.plugin.version"] as String - id("org.asciidoctor.jvm.convert") version settings.extra["asciidoctor.plugin.version"] as String - id("org.asciidoctor.jvm.pdf") version settings.extra["asciidoctor.plugin.version"] as String - id("me.champeau.gradle.jmh") version settings.extra["jmh.plugin.version"] as String - id("io.spring.nohttp") version settings.extra["nohttp.plugin.version"] as String - id("io.github.gradle-nexus.publish-plugin") version settings.extra["nexus-publish.plugin.version"] as String + id("com.gradle.enterprise") version "3.6.1" + id("com.gradle.enterprise.test-distribution") version "2.0.2" + id("com.gradle.common-custom-user-data-gradle-plugin") version "1.2.1" + id("net.nemerosa.versioning") version "2.14.0" + id("com.github.ben-manes.versions") version "0.38.0" + id("com.diffplug.spotless") version "5.12.0" + id("org.ajoberstar.git-publish") version "3.0.0" + kotlin("jvm") version "1.4.0" + id("org.asciidoctor.jvm.convert") version "3.3.2" + id("org.asciidoctor.jvm.pdf") version "3.3.2" + id("me.champeau.gradle.jmh") version "0.5.3" + id("io.spring.nohttp") version "0.0.6.RELEASE" + id("io.github.gradle-nexus.publish-plugin") version "1.0.0" } } From cb37d9ac7d8fa960284f324768abeeaec570cf7d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 19:48:22 +0200 Subject: [PATCH 0284/1433] Always reference extension on root project in allprojects block --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index c1d56e7d864f..450f9480d20d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,7 +104,7 @@ allprojects { if (enableJaCoCo) { apply(plugin = "jacoco") configure { - toolVersion = libs.versions.jacoco.get() + toolVersion = rootProject.libs.versions.jacoco.get() } } From 0da4a414aa2eda5ea8de3f34515d566c15277c12 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 11 Apr 2021 20:43:20 +0200 Subject: [PATCH 0285/1433] Manually add type safe project accessors --- build.gradle.kts | 56 +++++++++---------- buildSrc/src/main/kotlin/ProjectExtensions.kt | 6 ++ buildSrc/src/main/kotlin/Projects.kt | 53 ++++++++++++++++++ .../kotlin/testing-conventions.gradle.kts | 10 ++-- documentation/documentation.gradle.kts | 24 ++++---- .../junit-jupiter-api.gradle.kts | 4 +- .../junit-jupiter-engine.gradle.kts | 14 ++--- .../junit-jupiter-migrationsupport.gradle.kts | 12 ++-- .../junit-jupiter-params.gradle.kts | 12 ++-- junit-jupiter/junit-jupiter.gradle.kts | 8 +-- .../junit-platform-commons.gradle.kts | 2 +- ...nit-platform-console-standalone.gradle.kts | 14 ++--- .../junit-platform-console.gradle.kts | 4 +- .../junit-platform-engine.gradle.kts | 4 +- .../junit-platform-jfr.gradle.kts | 4 +- .../junit-platform-launcher.gradle.kts | 4 +- .../junit-platform-reporting.gradle.kts | 4 +- .../junit-platform-runner.gradle.kts | 12 ++-- .../junit-platform-suite-api.gradle.kts | 6 +- .../junit-platform-suite-commons.gradle.kts | 10 ++-- .../junit-platform-suite-engine.gradle.kts | 16 +++--- .../junit-platform-suite.gradle.kts | 6 +- .../junit-platform-testkit.gradle.kts | 4 +- .../junit-vintage-engine.gradle.kts | 12 ++-- platform-tests/platform-tests.gradle.kts | 30 +++++----- .../platform-tooling-support-tests.gradle.kts | 2 +- 26 files changed, 196 insertions(+), 137 deletions(-) create mode 100644 buildSrc/src/main/kotlin/Projects.kt diff --git a/build.gradle.kts b/build.gradle.kts index 450f9480d20d..6cc7b38fda96 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,35 +35,35 @@ val buildRevision by extra { versioning.info.commit } val builtByValue by extra { project.findProperty("builtBy") ?: project.property("defaultBuiltBy") } val platformProjects by extra(listOf( - project(":junit-platform-commons"), - project(":junit-platform-console"), - project(":junit-platform-console-standalone"), - project(":junit-platform-engine"), - project(":junit-platform-jfr"), - project(":junit-platform-launcher"), - project(":junit-platform-reporting"), - project(":junit-platform-runner"), - project(":junit-platform-suite"), - project(":junit-platform-suite-api"), - project(":junit-platform-suite-commons"), - project(":junit-platform-suite-engine"), - project(":junit-platform-testkit") + projects.platform.commons, + projects.platform.console, + projects.platform.`console-standalone`, + projects.platform.engine, + projects.platform.jfr, + projects.platform.launcher, + projects.platform.reporting, + projects.platform.runner, + projects.platform.suite.aggregator, + projects.platform.suite.api, + projects.platform.suite.commons, + projects.platform.suite.engine, + projects.platform.testkit )) val jupiterProjects by extra(listOf( - project(":junit-jupiter"), - project(":junit-jupiter-api"), - project(":junit-jupiter-engine"), - project(":junit-jupiter-migrationsupport"), - project(":junit-jupiter-params") + projects.jupiter.aggregator, + projects.jupiter.api, + projects.jupiter.engine, + projects.jupiter.migrationsupport, + projects.jupiter.params )) val vintageProjects by extra(listOf( - project(":junit-vintage-engine") + projects.vintage.engine )) val mavenizedProjects by extra(platformProjects + jupiterProjects + vintageProjects) -val modularProjects by extra(mavenizedProjects - listOf(project(":junit-platform-console-standalone"))) +val modularProjects by extra(mavenizedProjects - listOf(projects.platform.`console-standalone`)) val license by extra(License( name = "Eclipse Public License v2.0", @@ -76,14 +76,14 @@ val tempRepoDir by extra(file("$buildDir/repo")) val enableJaCoCo = project.hasProperty("enableJaCoCo") val jacocoTestProjects = listOf( - project(":junit-jupiter-engine"), - project(":junit-jupiter-migrationsupport"), - project(":junit-jupiter-params"), - project(":junit-platform-runner"), - project(":junit-platform-suite-commons"), - project(":junit-platform-suite-engine"), - project(":junit-vintage-engine"), - project(":platform-tests") + projects.jupiter.engine, + projects.jupiter.migrationsupport, + projects.jupiter.params, + projects.platform.runner, + projects.platform.suite.commons, + projects.platform.suite.engine, + projects.vintage.engine, + projects.platform.tests ) val jacocoCoveredProjects = modularProjects val jacocoClassesDir = file("$buildDir/jacoco/classes") diff --git a/buildSrc/src/main/kotlin/ProjectExtensions.kt b/buildSrc/src/main/kotlin/ProjectExtensions.kt index 315126c5bae3..8bac577a5d6e 100644 --- a/buildSrc/src/main/kotlin/ProjectExtensions.kt +++ b/buildSrc/src/main/kotlin/ProjectExtensions.kt @@ -4,3 +4,9 @@ import org.gradle.kotlin.dsl.provideDelegate val Project.javaModuleName: String get() = "org." + this.name.replace('-', '.') + +val Project.projects: Projects + get() { + var versions: Projects? by rootProject.extra + return versions ?: Projects(rootProject).also { versions = it } + } diff --git a/buildSrc/src/main/kotlin/Projects.kt b/buildSrc/src/main/kotlin/Projects.kt new file mode 100644 index 000000000000..2738c4608ce9 --- /dev/null +++ b/buildSrc/src/main/kotlin/Projects.kt @@ -0,0 +1,53 @@ +import org.gradle.api.Project +import kotlin.reflect.KProperty + +class Projects(private val rootProject: Project) { + val bom = project("junit-bom") + val platform = Platform() + val jupiter = Jupiter() + val vintage = Vintage() + + private fun project(name: String) = rootProject.project(":${name}") + + inner class Platform { + private val platformProject = object { + operator fun getValue(receiver: Any?, property: KProperty<*>) = project("junit-platform-${property.name}") + } + val commons by platformProject + val console by platformProject + val `console-standalone` by platformProject + val engine by platformProject + val jfr by platformProject + val launcher by platformProject + val reporting by platformProject + val runner by platformProject + val suite = Suite() + val testkit by platformProject + val tests = project("platform-tests") + + inner class Suite { + private val suiteProject = object { + operator fun getValue(receiver: Any?, property: KProperty<*>) = project("junit-platform-suite-${property.name}") + } + val aggregator = project("junit-platform-suite") + val api by suiteProject + val commons by suiteProject + val engine by suiteProject + } + } + + inner class Jupiter { + private val jupiterProject = object { + operator fun getValue(receiver: Any?, property: KProperty<*>) = project("junit-jupiter-${property.name}") + } + val aggregator = project("junit-jupiter") + val api by jupiterProject + val engine by jupiterProject + val migrationsupport by jupiterProject + val params by jupiterProject + } + + inner class Vintage { + val engine = project("junit-vintage-engine") + } +} diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 8f1af23b18ed..2b8ddb33cfe3 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -54,13 +54,13 @@ dependencies { "testImplementation"(libs.findDependency("assertj").get()) "testImplementation"(libs.findDependency("mockito").get()) - if (project.name != "junit-jupiter-engine") { - "testImplementation"(project(":junit-jupiter")) + if (project != projects.jupiter.engine) { + "testImplementation"(projects.jupiter.aggregator) } - "testImplementation"(testFixtures(project(":junit-jupiter-api"))) + "testImplementation"(testFixtures(projects.jupiter.api)) - "testRuntimeOnly"(project(":junit-platform-launcher")) - "testRuntimeOnly"(project(":junit-platform-jfr")) + "testRuntimeOnly"(projects.platform.launcher) + "testRuntimeOnly"(projects.platform.jfr) "testRuntimeOnly"(libs.findBundle("log4j").get()) } diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index c4e1f95c385e..83eff2fd3811 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -25,7 +25,7 @@ javaLibrary { val apiReport by configurations.creating dependencies { - implementation(project(":junit-jupiter-api")) { + implementation(project(projects.jupiter.api.path)) { because("Jupiter API is used in src/main/java") } @@ -33,15 +33,15 @@ dependencies { // in reports generated by the ApiReportGenerator. modularProjects.forEach { apiReport(it) } - testImplementation(project(":junit-jupiter")) - testImplementation(project(":junit-jupiter-migrationsupport")) - testImplementation(project(":junit-platform-console")) - testImplementation(project(":junit-platform-runner")) - testImplementation(project(":junit-platform-suite")) - testImplementation(project(":junit-platform-testkit")) + testImplementation(projects.jupiter.aggregator) + testImplementation(projects.jupiter.migrationsupport) + testImplementation(projects.platform.console) + testImplementation(projects.platform.runner) + testImplementation(projects.platform.suite.aggregator) + testImplementation(projects.platform.testkit) testImplementation(kotlin("stdlib")) - testImplementation(project(":junit-vintage-engine")) + testImplementation(projects.vintage.engine) testRuntimeOnly(libs.bundles.log4j) testImplementation(libs.classgraph) { @@ -409,14 +409,14 @@ fun JavaExec.redirectOutput(outputFile: File) { eclipse { classpath { - plusConfigurations.add(project(":junit-platform-console").configurations["shadowed"]) - plusConfigurations.add(project(":junit-jupiter-params").configurations["shadowed"]) + plusConfigurations.add(projects.platform.console.configurations["shadowed"]) + plusConfigurations.add(projects.jupiter.params.configurations["shadowed"]) } } idea { module { - scopes["PROVIDED"]!!["plus"]!!.add(project(":junit-platform-console").configurations["shadowed"]) - scopes["PROVIDED"]!!["plus"]!!.add(project(":junit-jupiter-params").configurations["shadowed"]) + scopes["PROVIDED"]!!["plus"]!!.add(projects.platform.console.configurations["shadowed"]) + scopes["PROVIDED"]!!["plus"]!!.add(projects.jupiter.params.configurations["shadowed"]) } } diff --git a/junit-jupiter-api/junit-jupiter-api.gradle.kts b/junit-jupiter-api/junit-jupiter-api.gradle.kts index 43ded844f9d6..247887a63bde 100644 --- a/junit-jupiter-api/junit-jupiter-api.gradle.kts +++ b/junit-jupiter-api/junit-jupiter-api.gradle.kts @@ -6,10 +6,10 @@ plugins { description = "JUnit Jupiter API" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) api(libs.opentest4j) - api(project(":junit-platform-commons")) + api(projects.platform.commons) compileOnly(kotlin("stdlib")) } diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 64be7221ca2b..1e4c05756764 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -9,15 +9,15 @@ plugins { description = "JUnit Jupiter Engine" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-engine")) - api(project(":junit-jupiter-api")) + api(projects.platform.engine) + api(projects.jupiter.api) - testImplementation(project(":junit-platform-launcher")) - testImplementation(project(":junit-platform-runner")) - testImplementation(project(":junit-platform-testkit")) - testImplementation(testFixtures(project(":junit-platform-commons"))) + testImplementation(projects.platform.launcher) + testImplementation(projects.platform.runner) + testImplementation(projects.platform.testkit) + testImplementation(testFixtures(projects.platform.commons)) testImplementation(kotlin("stdlib")) testImplementation(libs.kotlinx.coroutines) testImplementation(libs.groovy3) diff --git a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts index c4447c5d28ba..ebdd9bf9bf15 100644 --- a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts +++ b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts @@ -9,15 +9,15 @@ plugins { description = "JUnit Jupiter Migration Support" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.junit4) api(libs.apiguardian) - api(project(":junit-jupiter-api")) + api(projects.jupiter.api) - testImplementation(project(":junit-jupiter-engine")) - testImplementation(project(":junit-platform-launcher")) - testImplementation(project(":junit-platform-runner")) - testImplementation(project(":junit-platform-testkit")) + testImplementation(projects.jupiter.engine) + testImplementation(projects.platform.launcher) + testImplementation(projects.platform.runner) + testImplementation(projects.platform.testkit) } tasks.jar { diff --git a/junit-jupiter-params/junit-jupiter-params.gradle.kts b/junit-jupiter-params/junit-jupiter-params.gradle.kts index 4ca58a8e8cff..4e4a727844c0 100644 --- a/junit-jupiter-params/junit-jupiter-params.gradle.kts +++ b/junit-jupiter-params/junit-jupiter-params.gradle.kts @@ -7,16 +7,16 @@ plugins { description = "JUnit Jupiter Params" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-jupiter-api")) + api(projects.jupiter.api) shadowed(libs.univocity.parsers) - testImplementation(project(":junit-platform-testkit")) - testImplementation(project(":junit-jupiter-engine")) - testImplementation(project(":junit-platform-launcher")) - testImplementation(project(":junit-platform-runner")) + testImplementation(projects.platform.testkit) + testImplementation(projects.jupiter.engine) + testImplementation(projects.platform.launcher) + testImplementation(projects.platform.runner) compileOnly(kotlin("stdlib")) testImplementation(kotlin("stdlib")) diff --git a/junit-jupiter/junit-jupiter.gradle.kts b/junit-jupiter/junit-jupiter.gradle.kts index f19ef52b086c..a95f708ce8dd 100644 --- a/junit-jupiter/junit-jupiter.gradle.kts +++ b/junit-jupiter/junit-jupiter.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Jupiter (Aggregator)" dependencies { - api(platform(project(":junit-bom"))) - api(project(":junit-jupiter-api")) - api(project(":junit-jupiter-params")) + api(platform(projects.bom)) + api(projects.jupiter.api) + api(projects.jupiter.params) - runtimeOnly(project(":junit-jupiter-engine")) + runtimeOnly(projects.jupiter.engine) } diff --git a/junit-platform-commons/junit-platform-commons.gradle.kts b/junit-platform-commons/junit-platform-commons.gradle.kts index fb5a6651d721..1b0962546f56 100644 --- a/junit-platform-commons/junit-platform-commons.gradle.kts +++ b/junit-platform-commons/junit-platform-commons.gradle.kts @@ -8,7 +8,7 @@ plugins { description = "JUnit Platform Commons" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) } diff --git a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts index 007edd487d24..dc805c9b8a3e 100644 --- a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts +++ b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts @@ -8,11 +8,11 @@ plugins { description = "JUnit Platform Console Standalone" dependencies { - shadowed(project(":junit-platform-reporting")) - shadowed(project(":junit-platform-console")) - shadowed(project(":junit-jupiter-engine")) - shadowed(project(":junit-jupiter-params")) - shadowed(project(":junit-vintage-engine")) + shadowed(projects.platform.reporting) + shadowed(projects.platform.console) + shadowed(projects.jupiter.engine) + shadowed(projects.jupiter.params) + shadowed(projects.vintage.engine) } val jupiterVersion = rootProject.version @@ -28,11 +28,11 @@ tasks { // https://github.com/junit-team/junit5/issues/761 // prevent duplicates, add 3rd-party licenses explicitly exclude("META-INF/LICENSE*.md") - from(project(":junit-platform-console").projectDir) { + from(project.projects.platform.console.projectDir) { include("LICENSE-picocli.md") into("META-INF") } - from(project(":junit-jupiter-params").projectDir) { + from(project.projects.jupiter.params.projectDir) { include("LICENSE-univocity-parsers.md") into("META-INF") } diff --git a/junit-platform-console/junit-platform-console.gradle.kts b/junit-platform-console/junit-platform-console.gradle.kts index 5566a2512011..0f6610d79545 100644 --- a/junit-platform-console/junit-platform-console.gradle.kts +++ b/junit-platform-console/junit-platform-console.gradle.kts @@ -8,9 +8,9 @@ plugins { description = "JUnit Platform Console" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-reporting")) + api(projects.platform.reporting) shadowed(libs.picocli) } diff --git a/junit-platform-engine/junit-platform-engine.gradle.kts b/junit-platform-engine/junit-platform-engine.gradle.kts index c7d91f6e2c4d..d223d80a7e78 100644 --- a/junit-platform-engine/junit-platform-engine.gradle.kts +++ b/junit-platform-engine/junit-platform-engine.gradle.kts @@ -6,10 +6,10 @@ plugins { description = "JUnit Platform Engine API" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) api(libs.opentest4j) - api(project(":junit-platform-commons")) + api(projects.platform.commons) testImplementation(libs.assertj) } diff --git a/junit-platform-jfr/junit-platform-jfr.gradle.kts b/junit-platform-jfr/junit-platform-jfr.gradle.kts index fab69f5ecf3b..3aaeb32fb78b 100644 --- a/junit-platform-jfr/junit-platform-jfr.gradle.kts +++ b/junit-platform-jfr/junit-platform-jfr.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Platform Flight Recorder Support" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-launcher")) + api(projects.platform.launcher) } javaLibrary { diff --git a/junit-platform-launcher/junit-platform-launcher.gradle.kts b/junit-platform-launcher/junit-platform-launcher.gradle.kts index 0e2c4412bbdf..89355b7abf98 100644 --- a/junit-platform-launcher/junit-platform-launcher.gradle.kts +++ b/junit-platform-launcher/junit-platform-launcher.gradle.kts @@ -6,7 +6,7 @@ plugins { description = "JUnit Platform Launcher" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-engine")) + api(projects.platform.engine) } diff --git a/junit-platform-reporting/junit-platform-reporting.gradle.kts b/junit-platform-reporting/junit-platform-reporting.gradle.kts index 0812110890c9..b872ef23b69e 100644 --- a/junit-platform-reporting/junit-platform-reporting.gradle.kts +++ b/junit-platform-reporting/junit-platform-reporting.gradle.kts @@ -5,7 +5,7 @@ plugins { description = "JUnit Platform Reporting" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-launcher")) + api(projects.platform.launcher) } diff --git a/junit-platform-runner/junit-platform-runner.gradle.kts b/junit-platform-runner/junit-platform-runner.gradle.kts index 3be2a0e79c74..6f864fe0bf12 100644 --- a/junit-platform-runner/junit-platform-runner.gradle.kts +++ b/junit-platform-runner/junit-platform-runner.gradle.kts @@ -8,16 +8,16 @@ plugins { description = "JUnit Platform Runner" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.junit4) api(libs.apiguardian) - api(project(":junit-platform-launcher")) - api(project(":junit-platform-suite-api")) + api(projects.platform.launcher) + api(projects.platform.suite.api) - implementation(project(":junit-platform-suite-commons")) + implementation(projects.platform.suite.commons) - testImplementation(testFixtures(project(":junit-platform-engine"))) - testImplementation(testFixtures(project(":junit-platform-launcher"))) + testImplementation(testFixtures(projects.platform.engine)) + testImplementation(testFixtures(projects.platform.launcher)) } tasks.jar { diff --git a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts index b519350f9d0c..9845a3142657 100644 --- a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts +++ b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Platform Suite API" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-commons")) + api(projects.platform.commons) - osgiVerification(project(":junit-platform-commons")) + osgiVerification(projects.platform.commons) } diff --git a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts index 70bd5f27d121..155ced0af6a1 100644 --- a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts +++ b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts @@ -6,12 +6,12 @@ plugins { description = "JUnit Platform Suite Commons" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-launcher")) + api(projects.platform.launcher) - implementation(project(":junit-platform-engine")) - implementation(project(":junit-platform-suite-api")) + implementation(projects.platform.engine) + implementation(projects.platform.suite.api) - testImplementation(project(":junit-jupiter-engine")) + testImplementation(projects.jupiter.engine) } diff --git a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts index 0a2b0345cd02..6a9a5dd1e4d5 100644 --- a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts +++ b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts @@ -7,16 +7,16 @@ plugins { description = "JUnit Platform Suite Engine" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-engine")) - api(project(":junit-platform-suite-api")) + api(projects.platform.engine) + api(projects.platform.suite.api) - implementation(project(":junit-platform-suite-commons")) + implementation(projects.platform.suite.commons) - testFixturesApi(project(":junit-jupiter-api")) - testFixturesApi(project(":junit-platform-suite-api")) + testFixturesApi(projects.jupiter.api) + testFixturesApi(projects.platform.suite.api) - testImplementation(project(":junit-platform-testkit")) - testImplementation(project(":junit-jupiter-engine")) + testImplementation(projects.platform.testkit) + testImplementation(projects.jupiter.engine) } diff --git a/junit-platform-suite/junit-platform-suite.gradle.kts b/junit-platform-suite/junit-platform-suite.gradle.kts index 77a097c4aa91..f1c104ab9efe 100644 --- a/junit-platform-suite/junit-platform-suite.gradle.kts +++ b/junit-platform-suite/junit-platform-suite.gradle.kts @@ -5,7 +5,7 @@ plugins { description = "JUnit Platform Suite (Aggregator)" dependencies { - api(platform(project(":junit-bom"))) - api(project(":junit-platform-suite-api")) - implementation(project(":junit-platform-suite-engine")) + api(platform(projects.bom)) + api(projects.platform.suite.api) + implementation(projects.platform.suite.engine) } diff --git a/junit-platform-testkit/junit-platform-testkit.gradle.kts b/junit-platform-testkit/junit-platform-testkit.gradle.kts index cc8de483bc25..8defbaae230b 100644 --- a/junit-platform-testkit/junit-platform-testkit.gradle.kts +++ b/junit-platform-testkit/junit-platform-testkit.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Platform Test Kit" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) api(libs.assertj) api(libs.opentest4j) - api(project(":junit-platform-launcher")) + api(projects.platform.launcher) } diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index bfe478eb145a..d6b53b33da81 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -11,18 +11,18 @@ plugins { description = "JUnit Vintage Engine" dependencies { - api(platform(project(":junit-bom"))) + api(platform(projects.bom)) api(libs.apiguardian) - api(project(":junit-platform-engine")) + api(projects.platform.engine) api(libs.junit4) testFixturesApi(platform(libs.groovy2.bom)) testFixturesApi(libs.spock1) - testFixturesImplementation(project(":junit-platform-runner")) + testFixturesImplementation(projects.platform.runner) - testImplementation(project(":junit-platform-launcher")) - testImplementation(project(":junit-platform-runner")) - testImplementation(project(":junit-platform-testkit")) + testImplementation(projects.platform.launcher) + testImplementation(projects.platform.runner) + testImplementation(projects.platform.testkit) } tasks { diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index cded8420ac07..979e7068b2de 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -9,32 +9,32 @@ plugins { dependencies { // --- Things we are testing -------------------------------------------------- - testImplementation(project(":junit-platform-commons")) - testImplementation(project(":junit-platform-console")) - testImplementation(project(":junit-platform-engine")) - testImplementation(project(":junit-platform-jfr")) - testImplementation(project(":junit-platform-launcher")) + testImplementation(projects.platform.commons) + testImplementation(projects.platform.console) + testImplementation(projects.platform.engine) + testImplementation(projects.platform.jfr) + testImplementation(projects.platform.launcher) // --- Things we are testing with --------------------------------------------- - testImplementation(project(":junit-platform-runner")) - testImplementation(project(":junit-platform-testkit")) - testImplementation(testFixtures(project(":junit-platform-commons"))) - testImplementation(testFixtures(project(":junit-platform-engine"))) - testImplementation(testFixtures(project(":junit-platform-launcher"))) - testImplementation(project(":junit-jupiter-engine")) + testImplementation(projects.platform.runner) + testImplementation(projects.platform.testkit) + testImplementation(testFixtures(projects.platform.commons)) + testImplementation(testFixtures(projects.platform.engine)) + testImplementation(testFixtures(projects.platform.launcher)) + testImplementation(projects.jupiter.engine) testImplementation(libs.apiguardian) testImplementation(libs.jfrunit) testImplementation(libs.joox) // --- Test run-time dependencies --------------------------------------------- - testRuntimeOnly(project(":junit-vintage-engine")) + testRuntimeOnly(projects.vintage.engine) testRuntimeOnly(libs.groovy3) { because("`ReflectionUtilsTests.findNestedClassesWithInvalidNestedClassFile` needs it") } // --- https://openjdk.java.net/projects/code-tools/jmh/ ----------------------- jmh(libs.jmh.core) - jmh(project(":junit-jupiter-api")) + jmh(projects.jupiter.api) jmh(libs.junit4) jmhAnnotationProcessor(libs.jmh.generator.annprocess) } @@ -70,12 +70,12 @@ tasks { eclipse { classpath { - plusConfigurations.add(project(":junit-platform-console").configurations["shadowed"]) + plusConfigurations.add(projects.platform.console.configurations["shadowed"]) } } idea { module { - scopes["PROVIDED"]!!["plus"]!!.add(project(":junit-platform-console").configurations["shadowed"]) + scopes["PROVIDED"]!!["plus"]!!.add(projects.platform.console.configurations["shadowed"]) } } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index acd9690f6f83..bf54593ac0d9 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -44,7 +44,7 @@ tasks.test { val mavenizedProjects: List by rootProject val tempRepoName: String by rootProject - (mavenizedProjects + project(":junit-bom")) + (mavenizedProjects + projects.bom) .map { project -> project.tasks.named("publishAllPublicationsTo${tempRepoName.capitalize()}Repository") } .forEach { dependsOn(it) } } From b54793d575a1bdad90fcbf7519f7e8c0bf773d81 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 12 Apr 2021 20:59:54 +0200 Subject: [PATCH 0286/1433] Downgrade Asciidoctor plugin --- settings.gradle.kts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index e83e834f42c3..90e2ae6fbe6e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,8 +14,9 @@ pluginManagement { id("com.diffplug.spotless") version "5.12.0" id("org.ajoberstar.git-publish") version "3.0.0" kotlin("jvm") version "1.4.0" - id("org.asciidoctor.jvm.convert") version "3.3.2" - id("org.asciidoctor.jvm.pdf") version "3.3.2" + // Don't upgrade until https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/599 is fixed + id("org.asciidoctor.jvm.convert") version "3.3.0" + id("org.asciidoctor.jvm.pdf") version "3.3.0" id("me.champeau.gradle.jmh") version "0.5.3" id("io.spring.nohttp") version "0.0.6.RELEASE" id("io.github.gradle-nexus.publish-plugin") version "1.0.0" From 4f4f6b73b4fc705c0c20202ed50c717e9685b57d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 12 Apr 2021 21:13:56 +0200 Subject: [PATCH 0287/1433] Use BOM --- .../asciidoc/user-guide/running-tests.adoc | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index a6c1d3e34c39..c04c9cc352fb 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -28,35 +28,47 @@ include the corresponding versions of the `junit-platform-launcher`, [source,groovy] [subs=attributes+] ---- +testImplementation(platform("org.junit:junit-bom:{bom-version}")) // Only needed to run tests in a version of IntelliJ IDEA that bundles older versions -testRuntimeOnly("org.junit.platform:junit-platform-launcher:{platform-version}") -testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:{jupiter-version}") -testRuntimeOnly("org.junit.vintage:junit-vintage-engine:{vintage-version}") +testRuntimeOnly("org.junit.platform:junit-platform-launcher") +testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") +testRuntimeOnly("org.junit.vintage:junit-vintage-engine") ---- .Additional Maven Dependencies [source,xml] [subs=attributes+] ---- - - - org.junit.platform - junit-platform-launcher - {platform-version} - test - - - org.junit.jupiter - junit-jupiter-engine - {jupiter-version} - test - - - org.junit.vintage - junit-vintage-engine - {vintage-version} - test - + + + + + org.junit.platform + junit-platform-launcher + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + + + + org.junit + junit-bom + {bom-version} + pom + import + + + ---- [[running-tests-ide-eclipse]] From 5a292f2800f92317bd79a7fe6ece7200f80ee2f3 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 12 Apr 2021 21:14:44 +0200 Subject: [PATCH 0288/1433] Fix indentation and syntax highlighting --- .../asciidoc/user-guide/running-tests.adoc | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index c04c9cc352fb..84fa873d121d 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -133,25 +133,25 @@ https://docs.gradle.org/current/userguide/java_testing.html#using_junit5[native for executing tests on the JUnit Platform. To enable it, you just need to specify `useJUnitPlatform()` within a `test` task declaration in `build.gradle`: -[source,java,indent=0] +[source,groovy,indent=0] [subs=attributes+] ---- test { - useJUnitPlatform() + useJUnitPlatform() } ---- Filtering by tags or engines is also supported: -[source,java,indent=0] +[source,groovy,indent=0] [subs=attributes+] ---- test { - useJUnitPlatform { - includeTags 'fast', 'smoke & feature-a' - // excludeTags 'slow', 'ci' - includeEngines 'junit-jupiter' - // excludeEngines 'junit-vintage' + useJUnitPlatform { + includeTags("fast", "smoke & feature-a") + // excludeTags("slow", "ci") + includeEngines("junit-jupiter") + // excludeEngines("junit-vintage") } } ---- @@ -169,15 +169,13 @@ discovery and execution. However, you can provide configuration parameters withi build script via system properties (as shown below) or via the `junit-platform.properties` file. -[source,java,indent=0] +[source,groovy,indent=0] ---- test { // ... - systemProperty 'junit.jupiter.conditions.deactivate', '*' - systemProperties = [ - 'junit.jupiter.extensions.autodetection.enabled': 'true', - 'junit.jupiter.testinstance.lifecycle.default': 'per_class' - ] + systemProperty("junit.jupiter.conditions.deactivate", "*") + systemProperty("junit.jupiter.extensions.autodetection.enabled", true) + systemProperty("junit.jupiter.testinstance.lifecycle.default", "per_class") // ... } ---- @@ -191,7 +189,7 @@ To configure support for JUnit Jupiter based tests, configure a `testImplementat on the JUnit Jupiter API and a `testRuntimeOnly` dependency on the JUnit Jupiter `TestEngine` implementation similar to the following. -[source,java,indent=0] +[source,groovy,indent=0] [subs=attributes+] ---- dependencies { @@ -204,7 +202,7 @@ The JUnit Platform can run JUnit 4 based tests as long as you configure a `testI dependency on JUnit 4 and a `testRuntimeOnly` dependency on the JUnit Vintage `TestEngine` implementation similar to the following. -[source,java,indent=0] +[source,groovy,indent=0] [subs=attributes+] ---- dependencies { @@ -227,11 +225,11 @@ qualified class name_ of the `{LogManager}` implementation to use. The example b demonstrates how to configure Log4j{nbsp}2.x (see {Log4j_JDK_Logging_Adapter} for details). -[source,java,indent=0] +[source,groovy,indent=0] [subs=attributes+] ---- test { - systemProperty 'java.util.logging.manager', 'org.apache.logging.log4j.jul.LogManager' + systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") } ---- @@ -406,7 +404,7 @@ the following configuration properties. acceptance | !feature-a integration, regression - + From 28c68fa94074f3fd22b18a2a3de10617fe5c2293 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 12 Apr 2021 21:15:48 +0200 Subject: [PATCH 0289/1433] Use junit-jupiter dependency-aggregating artifact --- .../docs/asciidoc/user-guide/running-tests.adoc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index 84fa873d121d..d1aafe8e1620 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -186,15 +186,13 @@ test { In order to run any tests at all, a `TestEngine` implementation must be on the classpath. To configure support for JUnit Jupiter based tests, configure a `testImplementation` dependency -on the JUnit Jupiter API and a `testRuntimeOnly` dependency on the JUnit Jupiter `TestEngine` -implementation similar to the following. +on the dependency-aggregating JUnit Jupiter artifact similar to the following. [source,groovy,indent=0] [subs=attributes+] ---- dependencies { - testImplementation("org.junit.jupiter:junit-jupiter-api:{jupiter-version}") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:{jupiter-version}") + testImplementation("org.junit.jupiter:junit-jupiter:{jupiter-version}") } ---- @@ -286,13 +284,7 @@ following. org.junit.jupiter - junit-jupiter-api - {jupiter-version} - test - - - org.junit.jupiter - junit-jupiter-engine + junit-jupiter {jupiter-version} test From f6b320980c984b5986094e83425b3df19d1074eb Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Mon, 12 Apr 2021 21:16:00 +0200 Subject: [PATCH 0290/1433] Use canonical POM order --- .../asciidoc/user-guide/running-tests.adoc | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index d1aafe8e1620..9adaf6895044 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -267,18 +267,6 @@ following. [source,xml,indent=0] [subs=attributes+] ---- - - - - maven-surefire-plugin - {surefire-version} - - - maven-failsafe-plugin - {surefire-version} - - - @@ -290,17 +278,6 @@ following. - ----- - -Maven Surefire and Maven Failsafe can run JUnit 4 based tests alongside Jupiter tests as -long as you configure `test` scoped dependencies on JUnit 4 and the JUnit Vintage -`TestEngine` implementation similar to the following. - -[source,xml,indent=0] -[subs=attributes+] ----- - @@ -314,6 +291,16 @@ long as you configure `test` scoped dependencies on JUnit 4 and the JUnit Vintag +---- + +Maven Surefire and Maven Failsafe can run JUnit 4 based tests alongside Jupiter tests as +long as you configure `test` scoped dependencies on JUnit 4 and the JUnit Vintage +`TestEngine` implementation similar to the following. + +[source,xml,indent=0] +[subs=attributes+] +---- + @@ -331,6 +318,19 @@ long as you configure `test` scoped dependencies on JUnit 4 and the JUnit Vintag + + + + maven-surefire-plugin + {surefire-version} + + + maven-failsafe-plugin + {surefire-version} + + + + ---- [[running-tests-build-maven-filter-test-class-names]] From 0820cf3e8c2617302cb3421b2cd062d77012bc51 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Apr 2021 19:02:34 +0200 Subject: [PATCH 0291/1433] Disable inferring module path for compileModule tasks This resolves a warning that appeared after upgrading to Gradle 7.0 --- buildSrc/src/main/kotlin/java-library-conventions.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 8cd196d81e10..cc11a6b4e807 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -150,6 +150,7 @@ val compileModule by tasks.registering(JavaCompile::class) { )) options.compilerArgumentProviders.add(ModulePathArgumentProvider()) options.compilerArgumentProviders.addAll(modularProjects.map { PatchModuleArgumentProvider(it) }) + modularity.inferModulePath.set(false) } tasks.withType().configureEach { From dd6df993a48ec790af787d1960a2b3b595c1cbf1 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Apr 2021 19:11:15 +0200 Subject: [PATCH 0292/1433] Add explicit dependency to resolve deprecation warning --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index 6cc7b38fda96..f8218daa8c32 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -268,6 +268,7 @@ rootProject.apply { register("jacocoRootReport") { dependsOn(jacocoMerge) jacocoCoveredProjects.forEach { + dependsOn(it.tasks.named("extractJar")) it.pluginManager.withPlugin("java") { sourceDirectories.from(it.the()["main"].allSource.srcDirs) } From 477498dc4c7e959bd12acffb7cbc130c06e4c2b0 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Apr 2021 19:11:43 +0200 Subject: [PATCH 0293/1433] Resolve IDEA warnings --- build.gradle.kts | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f8218daa8c32..b3d340918d1b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,7 +11,7 @@ plugins { id("io.github.gradle-nexus.publish-plugin") } -val buildTimeAndDate by extra { +val buildTimeAndDate: OffsetDateTime by extra { // SOURCE_DATE_EPOCH is a UNIX timestamp for pinning build metadata against // in order to achieve reproducible builds @@ -29,9 +29,9 @@ val buildTimeAndDate by extra { } } -val buildDate by extra { DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate) } -val buildTime by extra { DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate) } -val buildRevision by extra { versioning.info.commit } +val buildDate: String by extra { DateTimeFormatter.ISO_LOCAL_DATE.format(buildTimeAndDate) } +val buildTime: String by extra { DateTimeFormatter.ofPattern("HH:mm:ss.SSSZ").format(buildTimeAndDate) } +val buildRevision: String by extra { versioning.info.commit } val builtByValue by extra { project.findProperty("builtBy") ?: project.property("defaultBuiltBy") } val platformProjects by extra(listOf( @@ -131,16 +131,18 @@ val clearTempRepoDir by tasks.registering { subprojects { - if (project in jupiterProjects) { - group = property("jupiterGroup")!! - } - else if (project in platformProjects) { - group = property("platformGroup")!! - version = property("platformVersion")!! - } - else if (project in vintageProjects) { - group = property("vintageGroup")!! - version = property("vintageVersion")!! + when (project) { + in jupiterProjects -> { + group = property("jupiterGroup")!! + } + in platformProjects -> { + group = property("platformGroup")!! + version = property("platformVersion")!! + } + in vintageProjects -> { + group = property("vintageGroup")!! + version = property("vintageVersion")!! + } } tasks.withType().configureEach { @@ -181,7 +183,7 @@ subprojects { if (enableJaCoCo && project in jacocoCoveredProjects) { val jarTask = (tasks.findByName("shadowJar") ?: tasks["jar"]) as Jar val extractJar by tasks.registering(Copy::class) { - from(zipTree(jarTask.archivePath)) + from(zipTree(jarTask.archiveFile)) into(jacocoClassesDir) include("**/*.class") // don't report coverage for shadowed classes From 7dbc414b5caa78650917ab97b80ef9437d5bfdc7 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Apr 2021 19:25:20 +0200 Subject: [PATCH 0294/1433] Work around Asciidoctor Gradle plugin issue Issue: asciidoctor/asciidoctor-gradle-plugin#599 --- documentation/documentation.gradle.kts | 4 ++++ settings.gradle.kts | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 83eff2fd3811..3b32739e91a8 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -1,4 +1,5 @@ import org.asciidoctor.gradle.jvm.AbstractAsciidoctorTask +import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.junit.gradle.exec.ClasspathSystemPropertyProvider import org.junit.gradle.javadoc.ModuleSpecificJavadocFileOption @@ -171,6 +172,9 @@ tasks { } } + // Temporary workaround for https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/599 + inputs.dir(sourceDir).withPropertyName("sourceDir").withPathSensitivity(RELATIVE) + attributes(mapOf( "jupiter-version" to version, "platform-version" to project.property("platformVersion"), diff --git a/settings.gradle.kts b/settings.gradle.kts index 90e2ae6fbe6e..468b21ba55f3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,9 +14,9 @@ pluginManagement { id("com.diffplug.spotless") version "5.12.0" id("org.ajoberstar.git-publish") version "3.0.0" kotlin("jvm") version "1.4.0" - // Don't upgrade until https://github.com/asciidoctor/asciidoctor-gradle-plugin/issues/599 is fixed - id("org.asciidoctor.jvm.convert") version "3.3.0" - id("org.asciidoctor.jvm.pdf") version "3.3.0" + // Check if workaround in documentation.gradle.kts can be removed when upgrading + id("org.asciidoctor.jvm.convert") version "3.3.2" + id("org.asciidoctor.jvm.pdf") version "3.3.2" id("me.champeau.gradle.jmh") version "0.5.3" id("io.spring.nohttp") version "0.0.6.RELEASE" id("io.github.gradle-nexus.publish-plugin") version "1.0.0" From b9601f2bd705c651385a7cf111ddfd57986b2436 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 13 Apr 2021 21:49:24 +0200 Subject: [PATCH 0295/1433] Use auto-generated type-safe project accessors --- build.gradle.kts | 60 +++++++++---------- buildSrc/src/main/kotlin/ProjectExtensions.kt | 6 -- buildSrc/src/main/kotlin/Projects.kt | 53 ---------------- .../kotlin/testing-conventions.gradle.kts | 10 ++-- documentation/documentation.gradle.kts | 24 ++++---- .../junit-jupiter-api.gradle.kts | 4 +- .../junit-jupiter-engine.gradle.kts | 14 ++--- .../junit-jupiter-migrationsupport.gradle.kts | 12 ++-- .../junit-jupiter-params.gradle.kts | 12 ++-- junit-jupiter/junit-jupiter.gradle.kts | 8 +-- .../junit-platform-commons.gradle.kts | 2 +- ...nit-platform-console-standalone.gradle.kts | 14 ++--- .../junit-platform-console.gradle.kts | 4 +- .../junit-platform-engine.gradle.kts | 4 +- .../junit-platform-jfr.gradle.kts | 4 +- .../junit-platform-launcher.gradle.kts | 4 +- .../junit-platform-reporting.gradle.kts | 4 +- .../junit-platform-runner.gradle.kts | 12 ++-- .../junit-platform-suite-api.gradle.kts | 6 +- .../junit-platform-suite-commons.gradle.kts | 10 ++-- .../junit-platform-suite-engine.gradle.kts | 16 ++--- .../junit-platform-suite.gradle.kts | 6 +- .../junit-platform-testkit.gradle.kts | 4 +- .../junit-vintage-engine.gradle.kts | 12 ++-- platform-tests/platform-tests.gradle.kts | 30 +++++----- .../platform-tooling-support-tests.gradle.kts | 2 +- settings.gradle.kts | 1 + 27 files changed, 140 insertions(+), 198 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/Projects.kt diff --git a/build.gradle.kts b/build.gradle.kts index b3d340918d1b..0aa286988901 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,35 +35,35 @@ val buildRevision: String by extra { versioning.info.commit } val builtByValue by extra { project.findProperty("builtBy") ?: project.property("defaultBuiltBy") } val platformProjects by extra(listOf( - projects.platform.commons, - projects.platform.console, - projects.platform.`console-standalone`, - projects.platform.engine, - projects.platform.jfr, - projects.platform.launcher, - projects.platform.reporting, - projects.platform.runner, - projects.platform.suite.aggregator, - projects.platform.suite.api, - projects.platform.suite.commons, - projects.platform.suite.engine, - projects.platform.testkit -)) + projects.junitPlatformCommons, + projects.junitPlatformConsole, + projects.junitPlatformConsoleStandalone, + projects.junitPlatformEngine, + projects.junitPlatformJfr, + projects.junitPlatformLauncher, + projects.junitPlatformReporting, + projects.junitPlatformRunner, + projects.junitPlatformSuite, + projects.junitPlatformSuiteApi, + projects.junitPlatformSuiteCommons, + projects.junitPlatformSuiteEngine, + projects.junitPlatformTestkit +).map { it.dependencyProject }) val jupiterProjects by extra(listOf( - projects.jupiter.aggregator, - projects.jupiter.api, - projects.jupiter.engine, - projects.jupiter.migrationsupport, - projects.jupiter.params -)) + projects.junitJupiter, + projects.junitJupiterApi, + projects.junitJupiterEngine, + projects.junitJupiterMigrationsupport, + projects.junitJupiterParams +).map { it.dependencyProject }) val vintageProjects by extra(listOf( - projects.vintage.engine + projects.junitVintageEngine.dependencyProject )) val mavenizedProjects by extra(platformProjects + jupiterProjects + vintageProjects) -val modularProjects by extra(mavenizedProjects - listOf(projects.platform.`console-standalone`)) +val modularProjects by extra(mavenizedProjects - listOf(projects.junitPlatformConsoleStandalone.dependencyProject)) val license by extra(License( name = "Eclipse Public License v2.0", @@ -76,14 +76,14 @@ val tempRepoDir by extra(file("$buildDir/repo")) val enableJaCoCo = project.hasProperty("enableJaCoCo") val jacocoTestProjects = listOf( - projects.jupiter.engine, - projects.jupiter.migrationsupport, - projects.jupiter.params, - projects.platform.runner, - projects.platform.suite.commons, - projects.platform.suite.engine, - projects.vintage.engine, - projects.platform.tests + projects.junitJupiterEngine, + projects.junitJupiterMigrationsupport, + projects.junitJupiterParams, + projects.junitPlatformRunner, + projects.junitPlatformSuiteCommons, + projects.junitPlatformSuiteEngine, + projects.junitVintageEngine, + projects.platformTests ) val jacocoCoveredProjects = modularProjects val jacocoClassesDir = file("$buildDir/jacoco/classes") diff --git a/buildSrc/src/main/kotlin/ProjectExtensions.kt b/buildSrc/src/main/kotlin/ProjectExtensions.kt index 8bac577a5d6e..315126c5bae3 100644 --- a/buildSrc/src/main/kotlin/ProjectExtensions.kt +++ b/buildSrc/src/main/kotlin/ProjectExtensions.kt @@ -4,9 +4,3 @@ import org.gradle.kotlin.dsl.provideDelegate val Project.javaModuleName: String get() = "org." + this.name.replace('-', '.') - -val Project.projects: Projects - get() { - var versions: Projects? by rootProject.extra - return versions ?: Projects(rootProject).also { versions = it } - } diff --git a/buildSrc/src/main/kotlin/Projects.kt b/buildSrc/src/main/kotlin/Projects.kt deleted file mode 100644 index 2738c4608ce9..000000000000 --- a/buildSrc/src/main/kotlin/Projects.kt +++ /dev/null @@ -1,53 +0,0 @@ -import org.gradle.api.Project -import kotlin.reflect.KProperty - -class Projects(private val rootProject: Project) { - val bom = project("junit-bom") - val platform = Platform() - val jupiter = Jupiter() - val vintage = Vintage() - - private fun project(name: String) = rootProject.project(":${name}") - - inner class Platform { - private val platformProject = object { - operator fun getValue(receiver: Any?, property: KProperty<*>) = project("junit-platform-${property.name}") - } - val commons by platformProject - val console by platformProject - val `console-standalone` by platformProject - val engine by platformProject - val jfr by platformProject - val launcher by platformProject - val reporting by platformProject - val runner by platformProject - val suite = Suite() - val testkit by platformProject - val tests = project("platform-tests") - - inner class Suite { - private val suiteProject = object { - operator fun getValue(receiver: Any?, property: KProperty<*>) = project("junit-platform-suite-${property.name}") - } - val aggregator = project("junit-platform-suite") - val api by suiteProject - val commons by suiteProject - val engine by suiteProject - } - } - - inner class Jupiter { - private val jupiterProject = object { - operator fun getValue(receiver: Any?, property: KProperty<*>) = project("junit-jupiter-${property.name}") - } - val aggregator = project("junit-jupiter") - val api by jupiterProject - val engine by jupiterProject - val migrationsupport by jupiterProject - val params by jupiterProject - } - - inner class Vintage { - val engine = project("junit-vintage-engine") - } -} diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 2b8ddb33cfe3..3f04b3535976 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -54,13 +54,13 @@ dependencies { "testImplementation"(libs.findDependency("assertj").get()) "testImplementation"(libs.findDependency("mockito").get()) - if (project != projects.jupiter.engine) { - "testImplementation"(projects.jupiter.aggregator) + if (project != project(":junit-jupiter-engine")) { + "testImplementation"(project(":junit-jupiter")) } - "testImplementation"(testFixtures(projects.jupiter.api)) + "testImplementation"(testFixtures(project(":junit-jupiter-api"))) - "testRuntimeOnly"(projects.platform.launcher) - "testRuntimeOnly"(projects.platform.jfr) + "testRuntimeOnly"(project(":junit-platform-engine")) + "testRuntimeOnly"(project(":junit-platform-jfr")) "testRuntimeOnly"(libs.findBundle("log4j").get()) } diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index 3b32739e91a8..c223b69da7b1 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -26,7 +26,7 @@ javaLibrary { val apiReport by configurations.creating dependencies { - implementation(project(projects.jupiter.api.path)) { + implementation(projects.junitJupiterApi) { because("Jupiter API is used in src/main/java") } @@ -34,15 +34,15 @@ dependencies { // in reports generated by the ApiReportGenerator. modularProjects.forEach { apiReport(it) } - testImplementation(projects.jupiter.aggregator) - testImplementation(projects.jupiter.migrationsupport) - testImplementation(projects.platform.console) - testImplementation(projects.platform.runner) - testImplementation(projects.platform.suite.aggregator) - testImplementation(projects.platform.testkit) + testImplementation(projects.junitJupiter) + testImplementation(projects.junitJupiterMigrationsupport) + testImplementation(projects.junitPlatformConsole) + testImplementation(projects.junitPlatformRunner) + testImplementation(projects.junitPlatformSuite) + testImplementation(projects.junitPlatformTestkit) testImplementation(kotlin("stdlib")) - testImplementation(projects.vintage.engine) + testImplementation(projects.junitVintageEngine) testRuntimeOnly(libs.bundles.log4j) testImplementation(libs.classgraph) { @@ -413,14 +413,14 @@ fun JavaExec.redirectOutput(outputFile: File) { eclipse { classpath { - plusConfigurations.add(projects.platform.console.configurations["shadowed"]) - plusConfigurations.add(projects.jupiter.params.configurations["shadowed"]) + plusConfigurations.add(projects.junitPlatformConsole.dependencyProject.configurations["shadowed"]) + plusConfigurations.add(projects.junitJupiterParams.dependencyProject.configurations["shadowed"]) } } idea { module { - scopes["PROVIDED"]!!["plus"]!!.add(projects.platform.console.configurations["shadowed"]) - scopes["PROVIDED"]!!["plus"]!!.add(projects.jupiter.params.configurations["shadowed"]) + scopes["PROVIDED"]!!["plus"]!!.add(projects.junitPlatformConsole.dependencyProject.configurations["shadowed"]) + scopes["PROVIDED"]!!["plus"]!!.add(projects.junitJupiterParams.dependencyProject.configurations["shadowed"]) } } diff --git a/junit-jupiter-api/junit-jupiter-api.gradle.kts b/junit-jupiter-api/junit-jupiter-api.gradle.kts index 247887a63bde..8e8e39ac6ea6 100644 --- a/junit-jupiter-api/junit-jupiter-api.gradle.kts +++ b/junit-jupiter-api/junit-jupiter-api.gradle.kts @@ -6,10 +6,10 @@ plugins { description = "JUnit Jupiter API" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) api(libs.opentest4j) - api(projects.platform.commons) + api(projects.junitPlatformCommons) compileOnly(kotlin("stdlib")) } diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index 1e4c05756764..be338ed699d8 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -9,15 +9,15 @@ plugins { description = "JUnit Jupiter Engine" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.engine) - api(projects.jupiter.api) + api(projects.junitPlatformEngine) + api(projects.junitJupiterApi) - testImplementation(projects.platform.launcher) - testImplementation(projects.platform.runner) - testImplementation(projects.platform.testkit) - testImplementation(testFixtures(projects.platform.commons)) + testImplementation(projects.junitPlatformLauncher) + testImplementation(projects.junitPlatformRunner) + testImplementation(projects.junitPlatformTestkit) + testImplementation(testFixtures(projects.junitPlatformCommons)) testImplementation(kotlin("stdlib")) testImplementation(libs.kotlinx.coroutines) testImplementation(libs.groovy3) diff --git a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts index ebdd9bf9bf15..4f778d0298a6 100644 --- a/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts +++ b/junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts @@ -9,15 +9,15 @@ plugins { description = "JUnit Jupiter Migration Support" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.junit4) api(libs.apiguardian) - api(projects.jupiter.api) + api(projects.junitJupiterApi) - testImplementation(projects.jupiter.engine) - testImplementation(projects.platform.launcher) - testImplementation(projects.platform.runner) - testImplementation(projects.platform.testkit) + testImplementation(projects.junitJupiterEngine) + testImplementation(projects.junitPlatformLauncher) + testImplementation(projects.junitPlatformRunner) + testImplementation(projects.junitPlatformTestkit) } tasks.jar { diff --git a/junit-jupiter-params/junit-jupiter-params.gradle.kts b/junit-jupiter-params/junit-jupiter-params.gradle.kts index 4e4a727844c0..e52ed31bfceb 100644 --- a/junit-jupiter-params/junit-jupiter-params.gradle.kts +++ b/junit-jupiter-params/junit-jupiter-params.gradle.kts @@ -7,16 +7,16 @@ plugins { description = "JUnit Jupiter Params" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.jupiter.api) + api(projects.junitJupiterApi) shadowed(libs.univocity.parsers) - testImplementation(projects.platform.testkit) - testImplementation(projects.jupiter.engine) - testImplementation(projects.platform.launcher) - testImplementation(projects.platform.runner) + testImplementation(projects.junitPlatformTestkit) + testImplementation(projects.junitJupiterEngine) + testImplementation(projects.junitPlatformLauncher) + testImplementation(projects.junitPlatformRunner) compileOnly(kotlin("stdlib")) testImplementation(kotlin("stdlib")) diff --git a/junit-jupiter/junit-jupiter.gradle.kts b/junit-jupiter/junit-jupiter.gradle.kts index a95f708ce8dd..e453e4325d7c 100644 --- a/junit-jupiter/junit-jupiter.gradle.kts +++ b/junit-jupiter/junit-jupiter.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Jupiter (Aggregator)" dependencies { - api(platform(projects.bom)) - api(projects.jupiter.api) - api(projects.jupiter.params) + api(platform(projects.junitBom)) + api(projects.junitJupiterApi) + api(projects.junitJupiterParams) - runtimeOnly(projects.jupiter.engine) + runtimeOnly(projects.junitJupiterEngine) } diff --git a/junit-platform-commons/junit-platform-commons.gradle.kts b/junit-platform-commons/junit-platform-commons.gradle.kts index 1b0962546f56..80582cdf3f2a 100644 --- a/junit-platform-commons/junit-platform-commons.gradle.kts +++ b/junit-platform-commons/junit-platform-commons.gradle.kts @@ -8,7 +8,7 @@ plugins { description = "JUnit Platform Commons" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) } diff --git a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts index dc805c9b8a3e..03544646a5f2 100644 --- a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts +++ b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts @@ -8,11 +8,11 @@ plugins { description = "JUnit Platform Console Standalone" dependencies { - shadowed(projects.platform.reporting) - shadowed(projects.platform.console) - shadowed(projects.jupiter.engine) - shadowed(projects.jupiter.params) - shadowed(projects.vintage.engine) + shadowed(projects.junitPlatformReporting) + shadowed(projects.junitPlatformConsole) + shadowed(projects.junitJupiterEngine) + shadowed(projects.junitJupiterParams) + shadowed(projects.junitVintageEngine) } val jupiterVersion = rootProject.version @@ -28,11 +28,11 @@ tasks { // https://github.com/junit-team/junit5/issues/761 // prevent duplicates, add 3rd-party licenses explicitly exclude("META-INF/LICENSE*.md") - from(project.projects.platform.console.projectDir) { + from(project.projects.junitPlatformConsole.dependencyProject.projectDir) { include("LICENSE-picocli.md") into("META-INF") } - from(project.projects.jupiter.params.projectDir) { + from(project.projects.junitJupiterParams.dependencyProject.projectDir) { include("LICENSE-univocity-parsers.md") into("META-INF") } diff --git a/junit-platform-console/junit-platform-console.gradle.kts b/junit-platform-console/junit-platform-console.gradle.kts index 0f6610d79545..6f4561ee0192 100644 --- a/junit-platform-console/junit-platform-console.gradle.kts +++ b/junit-platform-console/junit-platform-console.gradle.kts @@ -8,9 +8,9 @@ plugins { description = "JUnit Platform Console" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.reporting) + api(projects.junitPlatformReporting) shadowed(libs.picocli) } diff --git a/junit-platform-engine/junit-platform-engine.gradle.kts b/junit-platform-engine/junit-platform-engine.gradle.kts index d223d80a7e78..8d1a06e2f51c 100644 --- a/junit-platform-engine/junit-platform-engine.gradle.kts +++ b/junit-platform-engine/junit-platform-engine.gradle.kts @@ -6,10 +6,10 @@ plugins { description = "JUnit Platform Engine API" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) api(libs.opentest4j) - api(projects.platform.commons) + api(projects.junitPlatformCommons) testImplementation(libs.assertj) } diff --git a/junit-platform-jfr/junit-platform-jfr.gradle.kts b/junit-platform-jfr/junit-platform-jfr.gradle.kts index 3aaeb32fb78b..ebcc646c8b29 100644 --- a/junit-platform-jfr/junit-platform-jfr.gradle.kts +++ b/junit-platform-jfr/junit-platform-jfr.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Platform Flight Recorder Support" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.launcher) + api(projects.junitPlatformLauncher) } javaLibrary { diff --git a/junit-platform-launcher/junit-platform-launcher.gradle.kts b/junit-platform-launcher/junit-platform-launcher.gradle.kts index 89355b7abf98..a80a02901aac 100644 --- a/junit-platform-launcher/junit-platform-launcher.gradle.kts +++ b/junit-platform-launcher/junit-platform-launcher.gradle.kts @@ -6,7 +6,7 @@ plugins { description = "JUnit Platform Launcher" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.engine) + api(projects.junitPlatformEngine) } diff --git a/junit-platform-reporting/junit-platform-reporting.gradle.kts b/junit-platform-reporting/junit-platform-reporting.gradle.kts index b872ef23b69e..3b33528cbe97 100644 --- a/junit-platform-reporting/junit-platform-reporting.gradle.kts +++ b/junit-platform-reporting/junit-platform-reporting.gradle.kts @@ -5,7 +5,7 @@ plugins { description = "JUnit Platform Reporting" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.launcher) + api(projects.junitPlatformLauncher) } diff --git a/junit-platform-runner/junit-platform-runner.gradle.kts b/junit-platform-runner/junit-platform-runner.gradle.kts index 6f864fe0bf12..9a12966b91b5 100644 --- a/junit-platform-runner/junit-platform-runner.gradle.kts +++ b/junit-platform-runner/junit-platform-runner.gradle.kts @@ -8,16 +8,16 @@ plugins { description = "JUnit Platform Runner" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.junit4) api(libs.apiguardian) - api(projects.platform.launcher) - api(projects.platform.suite.api) + api(projects.junitPlatformLauncher) + api(projects.junitPlatformSuiteApi) - implementation(projects.platform.suite.commons) + implementation(projects.junitPlatformSuiteCommons) - testImplementation(testFixtures(projects.platform.engine)) - testImplementation(testFixtures(projects.platform.launcher)) + testImplementation(testFixtures(projects.junitPlatformEngine)) + testImplementation(testFixtures(projects.junitPlatformLauncher)) } tasks.jar { diff --git a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts index 9845a3142657..84011b85987a 100644 --- a/junit-platform-suite-api/junit-platform-suite-api.gradle.kts +++ b/junit-platform-suite-api/junit-platform-suite-api.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Platform Suite API" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.commons) + api(projects.junitPlatformCommons) - osgiVerification(projects.platform.commons) + osgiVerification(projects.junitPlatformCommons) } diff --git a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts index 155ced0af6a1..4c0aa95c9d52 100644 --- a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts +++ b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts @@ -6,12 +6,12 @@ plugins { description = "JUnit Platform Suite Commons" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.launcher) + api(projects.junitPlatformLauncher) - implementation(projects.platform.engine) - implementation(projects.platform.suite.api) + implementation(projects.junitPlatformEngine) + implementation(projects.junitPlatformSuiteApi) - testImplementation(projects.jupiter.engine) + testImplementation(projects.junitJupiterEngine) } diff --git a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts index 6a9a5dd1e4d5..701b5ec1ef68 100644 --- a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts +++ b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts @@ -7,16 +7,16 @@ plugins { description = "JUnit Platform Suite Engine" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.engine) - api(projects.platform.suite.api) + api(projects.junitPlatformEngine) + api(projects.junitPlatformSuiteApi) - implementation(projects.platform.suite.commons) + implementation(projects.junitPlatformSuiteCommons) - testFixturesApi(projects.jupiter.api) - testFixturesApi(projects.platform.suite.api) + testFixturesApi(projects.junitJupiterApi) + testFixturesApi(projects.junitPlatformSuiteApi) - testImplementation(projects.platform.testkit) - testImplementation(projects.jupiter.engine) + testImplementation(projects.junitPlatformTestkit) + testImplementation(projects.junitJupiterEngine) } diff --git a/junit-platform-suite/junit-platform-suite.gradle.kts b/junit-platform-suite/junit-platform-suite.gradle.kts index f1c104ab9efe..67ec26ab10a2 100644 --- a/junit-platform-suite/junit-platform-suite.gradle.kts +++ b/junit-platform-suite/junit-platform-suite.gradle.kts @@ -5,7 +5,7 @@ plugins { description = "JUnit Platform Suite (Aggregator)" dependencies { - api(platform(projects.bom)) - api(projects.platform.suite.api) - implementation(projects.platform.suite.engine) + api(platform(projects.junitBom)) + api(projects.junitPlatformSuiteApi) + implementation(projects.junitPlatformSuiteEngine) } diff --git a/junit-platform-testkit/junit-platform-testkit.gradle.kts b/junit-platform-testkit/junit-platform-testkit.gradle.kts index 8defbaae230b..d3b45822f96d 100644 --- a/junit-platform-testkit/junit-platform-testkit.gradle.kts +++ b/junit-platform-testkit/junit-platform-testkit.gradle.kts @@ -5,9 +5,9 @@ plugins { description = "JUnit Platform Test Kit" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) api(libs.assertj) api(libs.opentest4j) - api(projects.platform.launcher) + api(projects.junitPlatformLauncher) } diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index d6b53b33da81..a0433fbec2c0 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -11,18 +11,18 @@ plugins { description = "JUnit Vintage Engine" dependencies { - api(platform(projects.bom)) + api(platform(projects.junitBom)) api(libs.apiguardian) - api(projects.platform.engine) + api(projects.junitPlatformEngine) api(libs.junit4) testFixturesApi(platform(libs.groovy2.bom)) testFixturesApi(libs.spock1) - testFixturesImplementation(projects.platform.runner) + testFixturesImplementation(projects.junitPlatformRunner) - testImplementation(projects.platform.launcher) - testImplementation(projects.platform.runner) - testImplementation(projects.platform.testkit) + testImplementation(projects.junitPlatformLauncher) + testImplementation(projects.junitPlatformRunner) + testImplementation(projects.junitPlatformTestkit) } tasks { diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 979e7068b2de..276f78759fca 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -9,32 +9,32 @@ plugins { dependencies { // --- Things we are testing -------------------------------------------------- - testImplementation(projects.platform.commons) - testImplementation(projects.platform.console) - testImplementation(projects.platform.engine) - testImplementation(projects.platform.jfr) - testImplementation(projects.platform.launcher) + testImplementation(projects.junitPlatformCommons) + testImplementation(projects.junitPlatformConsole) + testImplementation(projects.junitPlatformEngine) + testImplementation(projects.junitPlatformJfr) + testImplementation(projects.junitPlatformLauncher) // --- Things we are testing with --------------------------------------------- - testImplementation(projects.platform.runner) - testImplementation(projects.platform.testkit) - testImplementation(testFixtures(projects.platform.commons)) - testImplementation(testFixtures(projects.platform.engine)) - testImplementation(testFixtures(projects.platform.launcher)) - testImplementation(projects.jupiter.engine) + testImplementation(projects.junitPlatformRunner) + testImplementation(projects.junitPlatformTestkit) + testImplementation(testFixtures(projects.junitPlatformCommons)) + testImplementation(testFixtures(projects.junitPlatformEngine)) + testImplementation(testFixtures(projects.junitPlatformLauncher)) + testImplementation(projects.junitJupiterEngine) testImplementation(libs.apiguardian) testImplementation(libs.jfrunit) testImplementation(libs.joox) // --- Test run-time dependencies --------------------------------------------- - testRuntimeOnly(projects.vintage.engine) + testRuntimeOnly(projects.junitVintageEngine) testRuntimeOnly(libs.groovy3) { because("`ReflectionUtilsTests.findNestedClassesWithInvalidNestedClassFile` needs it") } // --- https://openjdk.java.net/projects/code-tools/jmh/ ----------------------- jmh(libs.jmh.core) - jmh(projects.jupiter.api) + jmh(projects.junitJupiterApi) jmh(libs.junit4) jmhAnnotationProcessor(libs.jmh.generator.annprocess) } @@ -70,12 +70,12 @@ tasks { eclipse { classpath { - plusConfigurations.add(projects.platform.console.configurations["shadowed"]) + plusConfigurations.add(projects.junitPlatformConsole.dependencyProject.configurations["shadowed"]) } } idea { module { - scopes["PROVIDED"]!!["plus"]!!.add(projects.platform.console.configurations["shadowed"]) + scopes["PROVIDED"]!!["plus"]!!.add(projects.junitPlatformConsole.dependencyProject.configurations["shadowed"]) } } diff --git a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts index bf54593ac0d9..7310badca306 100644 --- a/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts +++ b/platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts @@ -44,7 +44,7 @@ tasks.test { val mavenizedProjects: List by rootProject val tempRepoName: String by rootProject - (mavenizedProjects + projects.bom) + (mavenizedProjects + projects.junitBom.dependencyProject) .map { project -> project.tasks.named("publishAllPublicationsTo${tempRepoName.capitalize()}Repository") } .forEach { dependsOn(it) } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 468b21ba55f3..72826880a4c8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -132,3 +132,4 @@ rootProject.children.forEach { project -> } enableFeaturePreview("VERSION_CATALOGS") +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") From bbdb56103a7c394e715858c93a992547a2bb7dd9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 15 Apr 2021 19:55:42 +0200 Subject: [PATCH 0296/1433] Fix jacocoMerge task --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0aa286988901..6f61363dd5a9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -84,7 +84,7 @@ val jacocoTestProjects = listOf( projects.junitPlatformSuiteEngine, projects.junitVintageEngine, projects.platformTests -) +).map { it.dependencyProject } val jacocoCoveredProjects = modularProjects val jacocoClassesDir = file("$buildDir/jacoco/classes") From ddf881c0d4726572150dbb5c64e388ac6e8e70fa Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 15 Apr 2021 09:18:08 +0200 Subject: [PATCH 0297/1433] Update ArchUnit to 0.18.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fafce9a52ecc..0b961306c8d5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ surefire = "2.22.2" [libraries] apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } -archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.17.0" } +archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.18.0" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } bnd = { module = "biz.aQute.bnd:biz.aQute.bndlib", version = "5.3.0" } From 8f81c3477cfacd9777acdd0620ac2ecb6d8f4439 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 16 Apr 2021 08:17:09 +0200 Subject: [PATCH 0298/1433] Resolve build deprecation warning --- documentation/documentation.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/documentation/documentation.gradle.kts b/documentation/documentation.gradle.kts index c223b69da7b1..ed8a0096740a 100644 --- a/documentation/documentation.gradle.kts +++ b/documentation/documentation.gradle.kts @@ -396,8 +396,12 @@ tasks { } } + gitPublishCopy { + dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder) + } + gitPublishCommit { - dependsOn(prepareDocsForUploadToGhPages, createCurrentDocsFolder, configureGitAuthor) + dependsOn(configureGitAuthor) } } From f1ee6b58c1d1dc2e118ace69ae9e76b27a605a77 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Fri, 16 Apr 2021 15:06:01 +0200 Subject: [PATCH 0299/1433] Exclude compiled module descriptors from shadowed JAR files Prior to this commit, compiled module descriptors (`module-info.class` files) weren't excluded while creating the JUnit Platform Console Standalone JAR file. Due to an external change (#2551), one of the shadowed JAR files supplied a compiled module descriptor that; which in turn was persisted in the JAR file of this standalone artifact. This commit excludes all external module descriptor from shadowed JAR files. It also ensures, that the JUnit Platform Console Standalone JAR file is free of any module-info.class file. Fixes #2557 Closes #2558 --- ...unit-platform-console-standalone.gradle.kts | 3 +++ .../platform/tooling/support/MavenRepo.java | 5 ++++- .../tooling/support/tests/StandaloneTests.java | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts index 03544646a5f2..efd599163243 100644 --- a/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts +++ b/junit-platform-console-standalone/junit-platform-console-standalone.gradle.kts @@ -25,6 +25,9 @@ tasks { } } shadowJar { + // https://github.com/junit-team/junit5/issues/2557 + // exclude compiled module declarations from any source (e.g. /*, /META-INF/versions/N/*) + exclude("**/module-info.class") // https://github.com/junit-team/junit5/issues/761 // prevent duplicates, add 3rd-party licenses explicitly exclude("META-INF/LICENSE*.md") diff --git a/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java b/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java index d0cf8151ccfb..d6e5bd2b9130 100644 --- a/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java +++ b/platform-tooling-support-tests/src/main/java/platform/tooling/support/MavenRepo.java @@ -16,6 +16,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.function.Predicate; +import java.util.stream.Stream; public class MavenRepo { @@ -23,7 +24,9 @@ private MavenRepo() { } public static Path dir() { - return Path.of(System.getProperty("maven.repo")); + var candidates = Stream.of(Path.of("../build/repo")); + var candidate = candidates.filter(Files::isDirectory).findFirst().orElse(Path.of("build/repo")); + return Path.of(System.getProperty("maven.repo", candidate.toString())); } public static Path jar(String artifactId) { diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java index 9a13a30a19c1..70a852c997d5 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java @@ -16,7 +16,9 @@ import java.io.File; import java.io.IOException; +import java.nio.file.FileSystems; import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import de.sormuras.bartholdy.jdk.Jar; @@ -39,6 +41,22 @@ @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class StandaloneTests { + @Test + void jarFileWithoutCompiledModuleDescriptorClass() throws Exception { + var jar = MavenRepo.jar("junit-platform-console-standalone"); + var name = "module-info.class"; + var found = new ArrayList(); + try (var fileSystem = FileSystems.newFileSystem(jar)) { + for (var rootDirectory : fileSystem.getRootDirectories()) { + try (var stream = Files.walk(rootDirectory)) { + stream.filter(path -> path.getNameCount() > 0) // skip root entry + .filter(path -> path.getFileName().toString().equals(name)).forEach(found::add); + } + } + } + assertTrue(found.isEmpty(), jar + " must not contain any " + name + " files: " + found); + } + @Test @Order(1) void compile() throws Exception { From d1c54510d6e71cffa21dce8240b8874c2d6c8165 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 16 Apr 2021 15:45:15 +0200 Subject: [PATCH 0300/1433] Move Platform Suite tests to platform-tests module This relocation is necessary in order to allow the projects to be imported into Eclipse IDE without cycles in the classpath. --- .../junit-platform-suite-commons.gradle.kts | 3 --- .../junit-platform-suite-engine.gradle.kts | 8 -------- platform-tests/platform-tests.gradle.kts | 2 ++ .../platform/launcher/core/LauncherFactoryTests.java | 5 +++-- .../commons/SuiteLauncherDiscoveryRequestBuilderTest.java | 0 .../org/junit/platform/suite/engine/SuiteEngineTest.java | 0 .../platform/suite/engine/SuiteTestDescriptorTest.java | 0 .../org/junit/platform/suite}/testcases/DynamicTest.java | 0 .../org/junit/platform/suite}/testcases/MultipleTest.java | 0 .../org/junit/platform/suite}/testcases/SimpleTest.java | 0 .../junit/platform/suite}/testsuites/AbstractSuite.java | 0 .../org/junit/platform/suite}/testsuites/CyclicSuite.java | 0 .../junit/platform/suite}/testsuites/DynamicSuite.java | 0 .../junit/platform/suite}/testsuites/MultipleSuite.java | 0 .../org/junit/platform/suite}/testsuites/NestedSuite.java | 0 .../platform/suite}/testsuites/SelectClassesSuite.java | 0 .../platform/suite}/testsuites/SuiteDisplayNameSuite.java | 0 .../org/junit/platform/suite}/testsuites/SuiteSuite.java | 0 18 files changed, 5 insertions(+), 13 deletions(-) rename {junit-platform-suite-commons => platform-tests}/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java (100%) rename {junit-platform-suite-engine => platform-tests}/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java (100%) rename {junit-platform-suite-engine => platform-tests}/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testcases/DynamicTest.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testcases/MultipleTest.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testcases/SimpleTest.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/AbstractSuite.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/CyclicSuite.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/DynamicSuite.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/MultipleSuite.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/NestedSuite.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/SelectClassesSuite.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/SuiteDisplayNameSuite.java (100%) rename {junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine => platform-tests/src/test/java/org/junit/platform/suite}/testsuites/SuiteSuite.java (100%) diff --git a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts index 4c0aa95c9d52..63b089a7cb56 100644 --- a/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts +++ b/junit-platform-suite-commons/junit-platform-suite-commons.gradle.kts @@ -1,6 +1,5 @@ plugins { `java-library-conventions` - `testing-conventions` } description = "JUnit Platform Suite Commons" @@ -12,6 +11,4 @@ dependencies { implementation(projects.junitPlatformEngine) implementation(projects.junitPlatformSuiteApi) - - testImplementation(projects.junitJupiterEngine) } diff --git a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts index 701b5ec1ef68..3471aada3f72 100644 --- a/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts +++ b/junit-platform-suite-engine/junit-platform-suite-engine.gradle.kts @@ -1,7 +1,5 @@ plugins { `java-library-conventions` - `testing-conventions` - `java-test-fixtures` } description = "JUnit Platform Suite Engine" @@ -13,10 +11,4 @@ dependencies { api(projects.junitPlatformSuiteApi) implementation(projects.junitPlatformSuiteCommons) - - testFixturesApi(projects.junitJupiterApi) - testFixturesApi(projects.junitPlatformSuiteApi) - - testImplementation(projects.junitPlatformTestkit) - testImplementation(projects.junitJupiterEngine) } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 276f78759fca..1e19216bc66a 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -14,6 +14,8 @@ dependencies { testImplementation(projects.junitPlatformEngine) testImplementation(projects.junitPlatformJfr) testImplementation(projects.junitPlatformLauncher) + testImplementation(projects.junitPlatformSuiteCommons) + testImplementation(projects.junitPlatformSuiteEngine) // --- Things we are testing with --------------------------------------------- testImplementation(projects.junitPlatformRunner) diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java index 31e0d98080f9..30400989c8b9 100644 --- a/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java +++ b/platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherFactoryTests.java @@ -72,7 +72,7 @@ void create() { var testPlan = LauncherFactory.create().discover(discoveryRequest); var roots = testPlan.getRoots(); - assertThat(roots).hasSize(2); + assertThat(roots).hasSize(3); // @formatter:off var ids = roots.stream() @@ -80,7 +80,8 @@ void create() { .collect(toList()); // @formatter:on - assertThat(ids).containsOnly("[engine:junit-vintage]", "[engine:junit-jupiter]"); + assertThat(ids).containsOnly("[engine:junit-vintage]", "[engine:junit-jupiter]", + "[engine:junit-platform-suite]"); } @Test diff --git a/junit-platform-suite-commons/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java b/platform-tests/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java similarity index 100% rename from junit-platform-suite-commons/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/commons/SuiteLauncherDiscoveryRequestBuilderTest.java diff --git a/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java similarity index 100% rename from junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/SuiteEngineTest.java diff --git a/junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java similarity index 100% rename from junit-platform-suite-engine/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/SuiteTestDescriptorTest.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/DynamicTest.java b/platform-tests/src/test/java/org/junit/platform/suite/testcases/DynamicTest.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/DynamicTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/testcases/DynamicTest.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/MultipleTest.java b/platform-tests/src/test/java/org/junit/platform/suite/testcases/MultipleTest.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/MultipleTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/testcases/MultipleTest.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/SimpleTest.java b/platform-tests/src/test/java/org/junit/platform/suite/testcases/SimpleTest.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testcases/SimpleTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/testcases/SimpleTest.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/AbstractSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/AbstractSuite.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/CyclicSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/CyclicSuite.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/DynamicSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/DynamicSuite.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/MultipleSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/MultipleSuite.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/NestedSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/NestedSuite.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/SelectClassesSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/SelectClassesSuite.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteDisplayNameSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteDisplayNameSuite.java diff --git a/junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteSuite.java similarity index 100% rename from junit-platform-suite-engine/src/testFixtures/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteSuite.java From 2f690ef5081ac232df1682e035d71a7626465502 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 16 Apr 2021 16:05:57 +0200 Subject: [PATCH 0301/1433] Move Suite test fixtures to correct folder The source code for Suite test fixtures now resides in a folder that matches the package name used in the classes. --- .../junit/platform/suite/{ => engine}/testcases/DynamicTest.java | 0 .../junit/platform/suite/{ => engine}/testcases/MultipleTest.java | 0 .../junit/platform/suite/{ => engine}/testcases/SimpleTest.java | 0 .../platform/suite/{ => engine}/testsuites/AbstractSuite.java | 0 .../junit/platform/suite/{ => engine}/testsuites/CyclicSuite.java | 0 .../platform/suite/{ => engine}/testsuites/DynamicSuite.java | 0 .../platform/suite/{ => engine}/testsuites/MultipleSuite.java | 0 .../junit/platform/suite/{ => engine}/testsuites/NestedSuite.java | 0 .../suite/{ => engine}/testsuites/SelectClassesSuite.java | 0 .../suite/{ => engine}/testsuites/SuiteDisplayNameSuite.java | 0 .../junit/platform/suite/{ => engine}/testsuites/SuiteSuite.java | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testcases/DynamicTest.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testcases/MultipleTest.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testcases/SimpleTest.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/AbstractSuite.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/CyclicSuite.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/DynamicSuite.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/MultipleSuite.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/NestedSuite.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/SelectClassesSuite.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/SuiteDisplayNameSuite.java (100%) rename platform-tests/src/test/java/org/junit/platform/suite/{ => engine}/testsuites/SuiteSuite.java (100%) diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testcases/DynamicTest.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/DynamicTest.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testcases/DynamicTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/DynamicTest.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testcases/MultipleTest.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/MultipleTest.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testcases/MultipleTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/MultipleTest.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testcases/SimpleTest.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/SimpleTest.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testcases/SimpleTest.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testcases/SimpleTest.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/AbstractSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/AbstractSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/AbstractSuite.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/CyclicSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/CyclicSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/CyclicSuite.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/DynamicSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/DynamicSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/DynamicSuite.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/MultipleSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/MultipleSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/MultipleSuite.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/NestedSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/NestedSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/NestedSuite.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/SelectClassesSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/SelectClassesSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SelectClassesSuite.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteDisplayNameSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteDisplayNameSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SuiteDisplayNameSuite.java diff --git a/platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteSuite.java b/platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java similarity index 100% rename from platform-tests/src/test/java/org/junit/platform/suite/testsuites/SuiteSuite.java rename to platform-tests/src/test/java/org/junit/platform/suite/engine/testsuites/SuiteSuite.java From 727f51d316f49074c7fb82e7f1136bfbb42e5a9a Mon Sep 17 00:00:00 2001 From: Oliver Weiler Date: Fri, 9 Apr 2021 13:42:38 +0200 Subject: [PATCH 0302/1433] Introduce Named.named() as an alias for Named.of() Closes #2591 --- .../release-notes/release-notes-5.8.0-M2.adoc | 61 +++++++++++++++++++ .../java/org/junit/jupiter/api/Named.java | 29 +++++++++ .../ParameterizedTestIntegrationTests.java | 20 ++++++ 3 files changed, 110 insertions(+) create mode 100644 documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc new file mode 100644 index 000000000000..5807e436541e --- /dev/null +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc @@ -0,0 +1,61 @@ +// TODO: replace all occurrences of ⚠️ with appropriate values, delete this comment, and +// 'include:' this new file in index.adoc. +[[release-notes-⚠️]] +== ⚠️ + +*Date of Release:* ❓ + +*Scope:* ❓ + +For a complete list of all _closed_ issues and pull requests for this release, consult the +link:{junit5-repo}+/milestone/⚠️?closed=1+[⚠️] milestone page in the JUnit repository on +GitHub. + + +[[release-notes-⚠️-junit-platform]] +=== JUnit Platform + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ + + +[[release-notes-⚠️-junit-jupiter]] +=== JUnit Jupiter + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* New `named()` static factory method in the `Named` interface that serves as an + _alias_ for `Named.of()`. `named()` is intended to be used via `import static`. + + +[[release-notes-⚠️-junit-vintage]] +=== JUnit Vintage + +==== Bug Fixes + +* ❓ + +==== Deprecations and Breaking Changes + +* ❓ + +==== New Features and Improvements + +* ❓ diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java index cd2b6cfbccd5..c1e01367e337 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java @@ -18,10 +18,22 @@ * {@code Named} is used to wrap an object and give it a name. * * @param the type of the payload + * + * @since 5.8 */ @API(status = STABLE, since = "5.8") public interface Named { + /** + * Factory method for creating an instance of {@code Named} based on a + * {@code name} and a {@code payload}. + * + * @param name the name to be used for the wrapped object + * @param payload the object to be wrapped + * @param the type of the payload + * @return an instance of {@code Named}; never {@code null} + * @see #named(String, java.lang.Object) + */ static Named of(String name, T payload) { return new Named() { @Override @@ -41,6 +53,23 @@ public String toString() { }; } + /** + * Factory method for creating an instance of {@code Named} based on a + * {@code name} and a {@code payload}. + * + *

    This method is an alias for {@link Named#of} and is + * intended to be used when statically imported — for example, via: + * {@code import static org.junit.jupiter.api.Named.named;} + * + * @param name the name to be used for the wrapped object + * @param payload the object to be wrapped + * @param the type of the payload + * @return an instance of {@code Named}; never {@code null} + */ + static Named named(String name, T payload) { + return of(name, payload); + } + String getName(); T getPayload(); diff --git a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java index 69da7f6d47f2..14c6df5c5835 100644 --- a/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java +++ b/junit-jupiter-params/src/test/java/org/junit/jupiter/params/ParameterizedTestIntegrationTests.java @@ -13,6 +13,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Named.named; import static org.junit.jupiter.params.provider.Arguments.arguments; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectMethod; @@ -646,6 +647,15 @@ void namedParameters() { event(test(), displayName("default name"), finishedWithFailure(message("default name")))); } + @Test + void nameParametersAlias() { + execute("namedParametersAlias", String.class).allEvents().assertThatEvents() // + .haveAtLeast(1, + event(test(), displayName("cool name"), finishedWithFailure(message("parameter value")))) // + .haveAtLeast(1, + event(test(), displayName("default name"), finishedWithFailure(message("default name")))); + } + } @Nested @@ -1036,6 +1046,12 @@ void namedParameters(String string) { fail(string); } + @MethodSourceTest + @Order(14) + void namedParametersAlias(String string) { + fail(string); + } + // --------------------------------------------------------------------- static Stream emptyMethodSource() { @@ -1097,6 +1113,10 @@ static Stream namedParameters() { return Stream.of(arguments(Named.of("cool name", "parameter value")), arguments("default name")); } + static Stream namedParametersAlias() { + return Stream.of(arguments(named("cool name", "parameter value")), arguments("default name")); + } + // --------------------------------------------------------------------- @MethodSourceTest From ce567289b26f3e9c2591b1ab2444f7ae3f4d28a6 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 16 Apr 2021 18:13:43 +0200 Subject: [PATCH 0303/1433] Polish Named Javadoc and add precondition --- .../java/org/junit/jupiter/api/Named.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java index c1e01367e337..d707529a7e50 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Named.java @@ -13,9 +13,10 @@ import static org.apiguardian.api.API.Status.STABLE; import org.apiguardian.api.API; +import org.junit.platform.commons.util.Preconditions; /** - * {@code Named} is used to wrap an object and give it a name. + * {@code Named} is a container that associates a name with a given payload. * * @param the type of the payload * @@ -28,13 +29,17 @@ public interface Named { * Factory method for creating an instance of {@code Named} based on a * {@code name} and a {@code payload}. * - * @param name the name to be used for the wrapped object - * @param payload the object to be wrapped + * @param name the name associated with the payload; never {@code null} or + * blank + * @param payload the object that serves as the payload; may be {@code null} + * depending on the use case * @param the type of the payload * @return an instance of {@code Named}; never {@code null} * @see #named(String, java.lang.Object) */ static Named of(String name, T payload) { + Preconditions.notBlank(name, "name must not be null or blank"); + return new Named() { @Override public String getName() { @@ -61,8 +66,10 @@ public String toString() { * intended to be used when statically imported — for example, via: * {@code import static org.junit.jupiter.api.Named.named;} * - * @param name the name to be used for the wrapped object - * @param payload the object to be wrapped + * @param name the name associated with the payload; never {@code null} or + * blank + * @param payload the object that serves as the payload; may be {@code null} + * depending on the use case * @param the type of the payload * @return an instance of {@code Named}; never {@code null} */ @@ -70,8 +77,18 @@ static Named named(String name, T payload) { return of(name, payload); } + /** + * Get the name of the payload. + * + * @return the name of the payload; never {@code null} or blank + */ String getName(); + /** + * Get the payload. + * + * @return the payload; may be {@code null} depending on the use case + */ T getPayload(); } From 8d7cdf07388f922212d7f358682f39c3b28648ae Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 16 Apr 2021 18:30:30 +0200 Subject: [PATCH 0304/1433] Include 5.8 M2 in the generated release notes --- .../src/docs/asciidoc/release-notes/index.adoc | 2 ++ .../release-notes/release-notes-5.8.0-M2.adoc | 16 +++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/index.adoc b/documentation/src/docs/asciidoc/release-notes/index.adoc index 1cd60e14ee5a..e9761bc7c414 100644 --- a/documentation/src/docs/asciidoc/release-notes/index.adoc +++ b/documentation/src/docs/asciidoc/release-notes/index.adoc @@ -16,6 +16,8 @@ authors as well as build tool and IDE vendors. include::{includedir}/link-attributes.adoc[] +include::{basedir}/release-notes-5.8.0-M2.adoc[] + include::{basedir}/release-notes-5.8.0-M1.adoc[] include::{basedir}/release-notes-5.7.1.adoc[] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc index 5807e436541e..9f73ac01adcf 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc @@ -1,18 +1,16 @@ -// TODO: replace all occurrences of ⚠️ with appropriate values, delete this comment, and -// 'include:' this new file in index.adoc. -[[release-notes-⚠️]] -== ⚠️ +[[release-notes-5.8.0-M2]] +== 5.8.0-M2 *Date of Release:* ❓ *Scope:* ❓ For a complete list of all _closed_ issues and pull requests for this release, consult the -link:{junit5-repo}+/milestone/⚠️?closed=1+[⚠️] milestone page in the JUnit repository on -GitHub. +link:{junit5-repo}+/milestone/55?closed=1+[5.8 M2] milestone page in the JUnit repository +on GitHub. -[[release-notes-⚠️-junit-platform]] +[[release-notes-5.8.0-M2-junit-platform]] === JUnit Platform ==== Bug Fixes @@ -28,7 +26,7 @@ GitHub. * ❓ -[[release-notes-⚠️-junit-jupiter]] +[[release-notes-5.8.0-M2-junit-jupiter]] === JUnit Jupiter ==== Bug Fixes @@ -45,7 +43,7 @@ GitHub. _alias_ for `Named.of()`. `named()` is intended to be used via `import static`. -[[release-notes-⚠️-junit-vintage]] +[[release-notes-5.8.0-M2-junit-vintage]] === JUnit Vintage ==== Bug Fixes From ea448484a73e60a88f67779256e2b9ccdc8574ef Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 16 Apr 2021 20:34:38 +0200 Subject: [PATCH 0305/1433] Disable inferring module path to fix Eclipse --- buildSrc/src/main/kotlin/java-library-conventions.gradle.kts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index cc11a6b4e807..5a9b2ad2d734 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -33,6 +33,10 @@ eclipse { } } +java { + modularity.inferModulePath.set(false) +} + if (project in mavenizedProjects) { apply(plugin = "publishing-conventions") From 204e3b217993b7a62801aa2e81b863d5bc92b5af Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 16 Apr 2021 20:49:23 +0200 Subject: [PATCH 0306/1433] Fix circular dependency in Eclipse --- buildSrc/src/main/kotlin/testing-conventions.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 3f04b3535976..5049363e737f 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -54,7 +54,7 @@ dependencies { "testImplementation"(libs.findDependency("assertj").get()) "testImplementation"(libs.findDependency("mockito").get()) - if (project != project(":junit-jupiter-engine")) { + if (!project.name.startsWith("junit-jupiter")) { "testImplementation"(project(":junit-jupiter")) } "testImplementation"(testFixtures(project(":junit-jupiter-api"))) From dfee0b923edf650c31a98abd5d3639baceae2eef Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 16 Apr 2021 20:56:17 +0200 Subject: [PATCH 0307/1433] Remove suite projects from JaCoCo config --- build.gradle.kts | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6f61363dd5a9..e2ffbe4960e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -80,8 +80,6 @@ val jacocoTestProjects = listOf( projects.junitJupiterMigrationsupport, projects.junitJupiterParams, projects.junitPlatformRunner, - projects.junitPlatformSuiteCommons, - projects.junitPlatformSuiteEngine, projects.junitVintageEngine, projects.platformTests ).map { it.dependencyProject } From 600cd7d3d0d372fa3f96471807cdcc5d1a4a077e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 20 Apr 2021 22:10:01 +0200 Subject: [PATCH 0308/1433] Update to Groovy 3.0.8 --- .../main/kotlin/java-toolchain-conventions.gradle.kts | 9 --------- gradle/libs.versions.toml | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts index ed8746404c4b..c281cdcd49ad 100644 --- a/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-toolchain-conventions.gradle.kts @@ -14,15 +14,6 @@ project.pluginManager.withPlugin("java") { kotlinOptions.jdkHome = compiler.get().metadata.installationPath.asFile.absolutePath } } - tasks.withType().configureEach { - javaCompiler.set(compiler) - } - tasks.withType().configureEach { - javaLauncher.set(javaToolchainService.launcherFor { - // Groovy does not yet support JDK 17, see https://issues.apache.org/jira/browse/GROOVY-9943 - languageVersion.set(minOf(javaLanguageVersion, defaultLanguageVersion)) - }) - } tasks.withType().configureEach { javaLauncher.set(javaToolchainService.launcherFor(extension.toolchain)) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0b961306c8d5..e7a96785449b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,7 +21,7 @@ bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } bnd = { module = "biz.aQute.bnd:biz.aQute.bndlib", version = "5.3.0" } classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } commons-io = { module = "commons-io:commons-io", version = "2.8.0" } -groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.7" } +groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.8" } groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.14" } jfrunit = { module = "com.github.gunnarmorling:jfrunit", version = "main-SNAPSHOT" } jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" } From da6879b973a3d5910ed97c4809f1f0a6bcef404b Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Fri, 23 Apr 2021 13:24:14 +0200 Subject: [PATCH 0309/1433] Set JMH's fork option to `1` The current version of JMH, namely 1.29, does not produce too long command lines on Windows. This renders setting `fork = 0` superseded. Find more details at https://github.com/openjdk/jmh Closes #1548 --- platform-tests/platform-tests.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 1e19216bc66a..7d275f267040 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -45,7 +45,7 @@ jmh { jmhVersion = libs.versions.jmh.get() duplicateClassesStrategy = DuplicatesStrategy.WARN - fork = 0 // Too long command line on Windows... + fork = 1 warmupIterations = 1 iterations = 5 } From ddaec1bb07b6a3ed3afd318bc9412d9e848b499f Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 23 Apr 2021 17:21:23 +0200 Subject: [PATCH 0310/1433] Require Java 11+ for Gradle build in settings.gradle.kts --- settings.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 72826880a4c8..7eedcb8f0432 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -89,8 +89,8 @@ buildCache { } val javaVersion = JavaVersion.current() -require(javaVersion.isJava9Compatible) { - "The JUnit 5 build requires Java 9 or higher. Currently executing with Java ${javaVersion.majorVersion}." +require(javaVersion.isJava11Compatible) { + "The JUnit 5 build requires Java 11 or higher. Currently executing with Java ${javaVersion.majorVersion}." } rootProject.name = "junit5" From 573abe6d53dfe6dcfd8aace5c3c786f5aa25c641 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 24 Apr 2021 16:25:51 +0200 Subject: [PATCH 0311/1433] Fix NPE when filtering SuiteMethod runner Fixes #2601. --- .../docs/asciidoc/release-notes/index.adoc | 2 ++ .../release-notes/release-notes-5.7.2.adoc | 34 +++++++++++++++++++ .../descriptor/RunnerTestDescriptor.java | 5 ++- .../VintageLauncherIntegrationTests.java | 25 ++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc diff --git a/documentation/src/docs/asciidoc/release-notes/index.adoc b/documentation/src/docs/asciidoc/release-notes/index.adoc index e9761bc7c414..930b50d525af 100644 --- a/documentation/src/docs/asciidoc/release-notes/index.adoc +++ b/documentation/src/docs/asciidoc/release-notes/index.adoc @@ -20,6 +20,8 @@ include::{basedir}/release-notes-5.8.0-M2.adoc[] include::{basedir}/release-notes-5.8.0-M1.adoc[] +include::{basedir}/release-notes-5.7.2.adoc[] + include::{basedir}/release-notes-5.7.1.adoc[] include::{basedir}/release-notes-5.7.0.adoc[] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc new file mode 100644 index 000000000000..2e44999d67e4 --- /dev/null +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc @@ -0,0 +1,34 @@ +[[release-notes-5.7.2]] +== 5.7.2 + +*Date of Release:* ❓ + +*Scope:* Bug fixes since 5.7.1 + +For a complete list of all _closed_ issues and pull requests for this release, consult the +link:{junit5-repo}+/milestone/56?closed=1+[5.7.2] milestone page in the JUnit repository on +GitHub. + + +[[release-notes-5.7.2-junit-platform]] +=== JUnit Platform + +==== Bug Fixes + +* ❓ + + +[[release-notes-5.7.2-junit-jupiter]] +=== JUnit Jupiter + +==== Bug Fixes + +* ❓ + + +[[release-notes-5.7.2-junit-vintage]] +=== JUnit Vintage + +==== Bug Fixes + +* Fix `NullPointerException` that occurred when using JUnit 3 style `suite()` methods in conjunction with `PostDiscoveryFilters`. diff --git a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java index 047ce94ebb11..18d567b32ccc 100644 --- a/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java +++ b/junit-vintage-engine/src/main/java/org/junit/vintage/engine/descriptor/RunnerTestDescriptor.java @@ -115,8 +115,7 @@ else if (rejectedExclusions.containsAll(getDescription().getChildren())) { private void logIncompleteFiltering() { if (runner instanceof Filterable) { logger.warn(() -> "Runner " + getRunnerToReport().getClass().getName() // - + " (used on class " + getDescription().getTestClass().getName() - + ") was not able to satisfy all filter requests."); + + " (used on class " + getLegacyReportingName() + ") was not able to satisfy all filter requests."); } else { warnAboutUnfilterableRunner(); @@ -125,7 +124,7 @@ private void logIncompleteFiltering() { private void warnAboutUnfilterableRunner() { logger.warn(() -> "Runner " + getRunnerToReport().getClass().getName() // - + " (used on class " + getDescription().getTestClass().getName() + ") does not support filtering" // + + " (used on class " + getLegacyReportingName() + ") does not support filtering" // + " and will therefore be run completely."); } diff --git a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java index 2730315e52b3..47b3397e8b88 100644 --- a/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java +++ b/junit-vintage-engine/src/test/java/org/junit/vintage/engine/VintageLauncherIntegrationTests.java @@ -26,6 +26,7 @@ import java.util.logging.Level; import java.util.logging.LogRecord; +import org.junit.internal.runners.SuiteMethod; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.fixtures.TrackLogRecords; import org.junit.platform.commons.logging.LogRecordListener; @@ -39,6 +40,8 @@ import org.junit.platform.launcher.core.LauncherFactory; import org.junit.runners.Suite; import org.junit.vintage.engine.descriptor.RunnerTestDescriptor; +import org.junit.vintage.engine.samples.junit3.JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails; +import org.junit.vintage.engine.samples.junit3.PlainJUnit3TestCaseWithSingleTestWhichFails; import org.junit.vintage.engine.samples.junit4.Categories; import org.junit.vintage.engine.samples.junit4.EnclosedJUnit4TestCase; import org.junit.vintage.engine.samples.junit4.JUnit4SuiteOfSuiteWithFilterableChildRunner; @@ -191,6 +194,28 @@ void executesAllTestsForNotFilterableChildRunnerOfSuite(LogRecordListener logRec + " was not able to satisfy all filter requests."); } + @TrackLogRecords + @Test + void executesAllTestsWhenFilterDidNotExcludeTestForJUnit3Suite(LogRecordListener logRecordListener) { + Class suiteClass = JUnit3SuiteWithSingleTestCaseWithSingleTestWhichFails.class; + Class testClass = PlainJUnit3TestCaseWithSingleTestWhichFails.class; + var request = request() // + .selectors(selectClass(suiteClass)) // + .filters((PostDiscoveryFilter) descriptor -> excluded("not today")); + + var testPlan = discover(request); + logRecordListener.clear(); + assertThat(testPlan.getDescendants(getOnlyElement(testPlan.getRoots()))).hasSize(3); + + var results = execute(request); + assertThat(results.keySet().stream().map(TestIdentifier::getDisplayName)) // + .containsExactlyInAnyOrder("JUnit Vintage", suiteClass.getSimpleName(), testClass.getName(), "test"); + assertThat(logRecordListener.stream(RunnerTestDescriptor.class, Level.WARNING).map(LogRecord::getMessage)) // + .containsExactly( + "Runner " + SuiteMethod.class.getName() + " (used on class " + suiteClass.getName() + ")" // + + " was not able to satisfy all filter requests."); + } + @Test void executesOnlyTaggedMethodsForSuite() { Class suiteClass = JUnit4SuiteWithTwoTestCases.class; From ec2afa1ccbc5637e0f9f3a61d8369adee220a5c2 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 24 Apr 2021 17:45:50 +0200 Subject: [PATCH 0312/1433] Clarify that JUnit 4.12 or later is required for Vintage engine Resolves #2599. --- documentation/src/docs/asciidoc/user-guide/overview.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/src/docs/asciidoc/user-guide/overview.adoc b/documentation/src/docs/asciidoc/user-guide/overview.adoc index afad42176c2f..b4b1b96d64a1 100644 --- a/documentation/src/docs/asciidoc/user-guide/overview.adoc +++ b/documentation/src/docs/asciidoc/user-guide/overview.adoc @@ -36,7 +36,7 @@ support for the JUnit Platform also exists in popular IDEs (see sub-project provides a `TestEngine` for running Jupiter based tests on the platform. **JUnit Vintage** provides a `TestEngine` for running JUnit 3 and JUnit 4 based tests on -the platform. +the platform. It requires JUnit 4.12 or later to be present on the class/module path. [[overview-java-versions]] === Supported Java Versions From d597bb5826ff7c5ccb77e3ed94109ae15dfd5e1d Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sun, 25 Apr 2021 18:38:18 +0200 Subject: [PATCH 0313/1433] Upgrade gradle-nexus.publish-plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 7eedcb8f0432..c376c711ddb0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,7 +19,7 @@ pluginManagement { id("org.asciidoctor.jvm.pdf") version "3.3.2" id("me.champeau.gradle.jmh") version "0.5.3" id("io.spring.nohttp") version "0.0.6.RELEASE" - id("io.github.gradle-nexus.publish-plugin") version "1.0.0" + id("io.github.gradle-nexus.publish-plugin") version "1.1.0" } } From c62cd6ab1183e16b4d3b1c35358f0c31ada13108 Mon Sep 17 00:00:00 2001 From: Christian Stein Date: Wed, 12 May 2021 07:59:24 +0200 Subject: [PATCH 0314/1433] Fix package path computation in `ClasspathScanner` Fix `getRootUrisForPackage()` in class `ClasspathScanner` by looking for two "wordings" of a package name. For example, package `foo.bar` is expanded to `foo/bar` and `foo/bar/`. The latter allows find package `foo.bar` in a module called `foo.bar`, and not `foo`. This commit also ensures, that there's no regression (compared to #2531) by launching test runs using the standalone artifact with `--select-package` and `--scan-class-path`. Fixes #2500 Fixes #2600 Fixes #2612 --- .../release-notes/release-notes-5.8.0-M2.adoc | 4 +- .../commons/util/ClasspathScanner.java | 28 +++++++- .../support/tests/StandaloneTests.java | 68 +++++++++++++++++++ 3 files changed, 96 insertions(+), 4 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc index 9f73ac01adcf..77973e5d40d6 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc @@ -15,7 +15,9 @@ on GitHub. ==== Bug Fixes -* ❓ +* Method `getRootUrisForPackage()` in class `ClasspathScanner` now returns a + valid list of class names when the package name is equal to the name of a + module on the module path and when running on Java 8. ==== Deprecations and Breaking Changes diff --git a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java index c1cc51fab77b..4bac8c3cc789 100644 --- a/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java +++ b/junit-platform-commons/src/main/java/org/junit/platform/commons/util/ClasspathScanner.java @@ -25,7 +25,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Enumeration; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Supplier; @@ -50,6 +52,8 @@ class ClasspathScanner { private static final Logger logger = LoggerFactory.getLogger(ClasspathScanner.class); private static final char CLASSPATH_RESOURCE_PATH_SEPARATOR = '/'; + private static final String CLASSPATH_RESOURCE_PATH_SEPARATOR_STRING = String.valueOf( + CLASSPATH_RESOURCE_PATH_SEPARATOR); private static final char PACKAGE_SEPARATOR_CHAR = '.'; private static final String PACKAGE_SEPARATOR_STRING = String.valueOf(PACKAGE_SEPARATOR_CHAR); @@ -76,7 +80,8 @@ List> scanForClassesInPackage(String basePackageName, ClassFilter class Preconditions.notNull(classFilter, "classFilter must not be null"); basePackageName = basePackageName.trim(); - return findClassesForUris(getRootUrisForPackage(basePackageName), basePackageName, classFilter); + return findClassesForUris(getRootUrisForPackageNameOnClassPathAndModulePath(basePackageName), basePackageName, + classFilter); } List> scanForClassesInClasspathRoot(URI root, ClassFilter classFilter) { @@ -212,12 +217,29 @@ private ClassLoader getClassLoader() { return this.classLoaderSupplier.get(); } + private List getRootUrisForPackageNameOnClassPathAndModulePath(String basePackageName) { + Set uriSet = new LinkedHashSet<>(getRootUrisForPackage(basePackageName)); + if (!basePackageName.isEmpty() && !basePackageName.endsWith(PACKAGE_SEPARATOR_STRING)) { + getRootUrisForPackage(basePackageName + PACKAGE_SEPARATOR_STRING).stream() // + .map(ClasspathScanner::removeTrailingClasspathResourcePathSeparator) // + .forEach(uriSet::add); + } + return new ArrayList<>(uriSet); + } + + private static URI removeTrailingClasspathResourcePathSeparator(URI uri) { + String string = uri.toString(); + if (string.endsWith(CLASSPATH_RESOURCE_PATH_SEPARATOR_STRING)) { + return URI.create(string.substring(0, string.length() - 1)); + } + return uri; + } + private static String packagePath(String packageName) { if (packageName.isEmpty()) { return ""; } - String path = packageName.replace(PACKAGE_SEPARATOR_CHAR, CLASSPATH_RESOURCE_PATH_SEPARATOR); - return path + CLASSPATH_RESOURCE_PATH_SEPARATOR; + return packageName.replace(PACKAGE_SEPARATOR_CHAR, CLASSPATH_RESOURCE_PATH_SEPARATOR); } private List getRootUrisForPackage(String basePackageName) { diff --git a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java index 70a852c997d5..1aa4146550b5 100644 --- a/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java +++ b/platform-tooling-support-tests/src/test/java/platform/tooling/support/tests/StandaloneTests.java @@ -30,6 +30,7 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import org.opentest4j.TestAbortedException; import platform.tooling.support.Helper; import platform.tooling.support.MavenRepo; @@ -121,6 +122,73 @@ void test() throws IOException { @Test @Order(3) + void testOnJava8() throws IOException { + var result = Request.builder() // + .setTool(new Java()) // + .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // + .setProject("standalone") // + .addArguments("--show-version") // + .addArguments("-enableassertions") // + .addArguments("-Djava.util.logging.config.file=logging.properties") // + .addArguments("-jar", MavenRepo.jar("junit-platform-console-standalone")) // + .addArguments("--scan-class-path") // + .addArguments("--disable-banner") // + .addArguments("--include-classname", "standalone.*") // + .addArguments("--classpath", "bin").build() // + .run(false); + + assertEquals(1, result.getExitCode(), String.join("\n", result.getOutputLines("out"))); + + var workspace = Request.WORKSPACE.resolve("standalone"); + var expectedOutLines = Files.readAllLines(workspace.resolve("expected-out.txt")); + var expectedErrLines = Files.readAllLines(workspace.resolve("expected-err.txt")); + assertLinesMatch(expectedOutLines, result.getOutputLines("out")); + assertLinesMatch(expectedErrLines, result.getOutputLines("err")); + + var jupiterVersion = Helper.version("junit-jupiter-engine"); + var vintageVersion = Helper.version("junit-vintage-engine"); + assertTrue(result.getOutput("err").contains("junit-jupiter" + + " (group ID: org.junit.jupiter, artifact ID: junit-jupiter-engine, version: " + jupiterVersion)); + assertTrue(result.getOutput("err").contains("junit-vintage" + + " (group ID: org.junit.vintage, artifact ID: junit-vintage-engine, version: " + vintageVersion)); + } + + @Test + @Order(3) + // https://github.com/junit-team/junit5/issues/2600 + void testOnJava8SelectPackage() throws IOException { + var result = Request.builder() // + .setTool(new Java()) // + .setJavaHome(Helper.getJavaHome("8").orElseThrow(TestAbortedException::new)) // + .setProject("standalone") // + .addArguments("--show-version") // + .addArguments("-enableassertions") // + .addArguments("-Djava.util.logging.config.file=logging.properties") // + .addArguments("-jar", MavenRepo.jar("junit-platform-console-standalone")) // + .addArguments("--select-package", "standalone") // + .addArguments("--disable-banner") // + .addArguments("--include-classname", "standalone.*") // + .addArguments("--classpath", "bin").build() // + .run(false); + + assertEquals(1, result.getExitCode(), String.join("\n", result.getOutputLines("out"))); + + var workspace = Request.WORKSPACE.resolve("standalone"); + var expectedOutLines = Files.readAllLines(workspace.resolve("expected-out.txt")); + var expectedErrLines = Files.readAllLines(workspace.resolve("expected-err.txt")); + assertLinesMatch(expectedOutLines, result.getOutputLines("out")); + assertLinesMatch(expectedErrLines, result.getOutputLines("err")); + + var jupiterVersion = Helper.version("junit-jupiter-engine"); + var vintageVersion = Helper.version("junit-vintage-engine"); + assertTrue(result.getOutput("err").contains("junit-jupiter" + + " (group ID: org.junit.jupiter, artifact ID: junit-jupiter-engine, version: " + jupiterVersion)); + assertTrue(result.getOutput("err").contains("junit-vintage" + + " (group ID: org.junit.vintage, artifact ID: junit-vintage-engine, version: " + vintageVersion)); + } + + @Test + @Order(5) @Disabled("https://github.com/junit-team/junit5/issues/1724") void testWithJarredTestClasses() { var jar = MavenRepo.jar("junit-platform-console-standalone"); From 4a89a78fd7a7c10191fcd5fddc7a7e817b47774e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 11:53:39 +0200 Subject: [PATCH 0315/1433] Update test-distribution plugin --- buildSrc/build.gradle.kts | 3 +-- settings.gradle.kts | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index b48dc52db322..2d1538a3f832 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -7,7 +7,6 @@ plugins { repositories { mavenCentral() gradlePluginPortal() - maven(url = "https://repo.gradle.org/gradle/enterprise-libs-release-candidates-local/") } dependencies { @@ -15,7 +14,7 @@ dependencies { implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0") implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") implementation("org.gradle:test-retry-gradle-plugin:1.2.1") - compileOnly("com.gradle.enterprise:test-distribution-gradle-plugin:2.0.2-rc-2") + compileOnly("com.gradle.enterprise:test-distribution-gradle-plugin:2.0.3") } tasks.withType().configureEach { diff --git a/settings.gradle.kts b/settings.gradle.kts index c376c711ddb0..f1f9397cd904 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,13 +1,9 @@ import com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures pluginManagement { - repositories { - gradlePluginPortal() - maven(url = "https://repo.gradle.org/gradle/enterprise-libs-release-candidates-local/") - } plugins { id("com.gradle.enterprise") version "3.6.1" - id("com.gradle.enterprise.test-distribution") version "2.0.2" + id("com.gradle.enterprise.test-distribution") version "2.0.3" id("com.gradle.common-custom-user-data-gradle-plugin") version "1.2.1" id("net.nemerosa.versioning") version "2.14.0" id("com.github.ben-manes.versions") version "0.38.0" From 721cdd84f156695a1021454ced9a107c1d42411e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 11:53:51 +0200 Subject: [PATCH 0316/1433] Update JaCoCo --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e7a96785449b..b68cb9b131a2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ apiguardian = "1.1.1" asciidoctor-pdf = "1.5.3" assertj = "3.19.0" checkstyle = "8.36.2" -jacoco = "0.8.6" +jacoco = "0.8.7" jmh = "1.29" junit4 = "4.13.2" junit4Osgi = "4.13.2_1" From fef558a308d05a6649d0d57b37ca2e368942fe57 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 11:54:10 +0200 Subject: [PATCH 0317/1433] Update spring-nohttp plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index f1f9397cd904..e844f051cb40 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,7 +14,7 @@ pluginManagement { id("org.asciidoctor.jvm.convert") version "3.3.2" id("org.asciidoctor.jvm.pdf") version "3.3.2" id("me.champeau.gradle.jmh") version "0.5.3" - id("io.spring.nohttp") version "0.0.6.RELEASE" + id("io.spring.nohttp") version "0.0.7" id("io.github.gradle-nexus.publish-plugin") version "1.1.0" } } From 9c44df3c5434b089ff6b9b935e46091e2cf558c1 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 11:54:22 +0200 Subject: [PATCH 0318/1433] Update common-custom-user-data-gradle-plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index e844f051cb40..a80e25c88ead 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,7 +4,7 @@ pluginManagement { plugins { id("com.gradle.enterprise") version "3.6.1" id("com.gradle.enterprise.test-distribution") version "2.0.3" - id("com.gradle.common-custom-user-data-gradle-plugin") version "1.2.1" + id("com.gradle.common-custom-user-data-gradle-plugin") version "1.3" id("net.nemerosa.versioning") version "2.14.0" id("com.github.ben-manes.versions") version "0.38.0" id("com.diffplug.spotless") version "5.12.0" From f363fa3b37d3c1ae263617fea5be6c0e35adb0fa Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 11:54:32 +0200 Subject: [PATCH 0319/1433] Update Spotless --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index a80e25c88ead..392e42ae6750 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,7 +7,7 @@ pluginManagement { id("com.gradle.common-custom-user-data-gradle-plugin") version "1.3" id("net.nemerosa.versioning") version "2.14.0" id("com.github.ben-manes.versions") version "0.38.0" - id("com.diffplug.spotless") version "5.12.0" + id("com.diffplug.spotless") version "5.12.4" id("org.ajoberstar.git-publish") version "3.0.0" kotlin("jvm") version "1.4.0" // Check if workaround in documentation.gradle.kts can be removed when upgrading From 81e6b008f742a5d2a4e1aaa23e409199f1c55b86 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 11:54:42 +0200 Subject: [PATCH 0320/1433] Update Kotlin plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 392e42ae6750..b19286a401e8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,7 +9,7 @@ pluginManagement { id("com.github.ben-manes.versions") version "0.38.0" id("com.diffplug.spotless") version "5.12.4" id("org.ajoberstar.git-publish") version "3.0.0" - kotlin("jvm") version "1.4.0" + kotlin("jvm") version "1.5.0" // Check if workaround in documentation.gradle.kts can be removed when upgrading id("org.asciidoctor.jvm.convert") version "3.3.2" id("org.asciidoctor.jvm.pdf") version "3.3.2" From 4f206d347fda5c84b1a46245b0c57d427f24039b Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 11:54:51 +0200 Subject: [PATCH 0321/1433] Update shadow plugin --- buildSrc/build.gradle.kts | 2 +- buildSrc/src/main/kotlin/java-library-conventions.gradle.kts | 3 ++- buildSrc/src/main/kotlin/shadow-conventions.gradle.kts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 2d1538a3f832..ffec97504145 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -12,7 +12,7 @@ repositories { dependencies { implementation(kotlin("gradle-plugin")) implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.3.0") - implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0") + implementation("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0") implementation("org.gradle:test-retry-gradle-plugin:1.2.1") compileOnly("com.gradle.enterprise:test-distribution-gradle-plugin:2.0.3") } diff --git a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts index 5a9b2ad2d734..aa4e20cae78e 100644 --- a/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/java-library-conventions.gradle.kts @@ -1,3 +1,4 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar import org.gradle.api.tasks.PathSensitivity.RELATIVE plugins { @@ -163,7 +164,7 @@ tasks.withType().configureEach { into("META-INF") } val suffix = archiveClassifier.getOrElse("") - if (suffix.isBlank() || suffix == "all") { // "all" is used by shadow plugin + if (suffix.isBlank() || this is ShadowJar) { dependsOn(allMainClasses, compileModule) from("$moduleOutputDir/$javaModuleName") { include("module-info.class") diff --git a/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts b/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts index 33474a01a36a..44c5bacec51d 100644 --- a/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/shadow-conventions.gradle.kts @@ -47,6 +47,7 @@ tasks { shadowJar { configurations = listOf(shadowed) exclude("META-INF/maven/**") + excludes.remove("module-info.class") archiveClassifier.set("") } jar { From a02c62ac53a9d4d271e4bfd8ee28f438d4dbe4f8 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 13:29:52 +0200 Subject: [PATCH 0322/1433] Move entry to 5.7.2 release notes --- .../src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc | 4 +++- .../docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc index 2e44999d67e4..c99f73578b77 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc @@ -15,7 +15,9 @@ GitHub. ==== Bug Fixes -* ❓ +* Method `getRootUrisForPackage()` in class `ClasspathScanner` now returns a +valid list of class names when the package name is equal to the name of a +module on the module path and when running on Java 8. [[release-notes-5.7.2-junit-jupiter]] diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc index 77973e5d40d6..9f73ac01adcf 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc @@ -15,9 +15,7 @@ on GitHub. ==== Bug Fixes -* Method `getRootUrisForPackage()` in class `ClasspathScanner` now returns a - valid list of class names when the package name is equal to the name of a - module on the module path and when running on Java 8. +* ❓ ==== Deprecations and Breaking Changes From 6359e512436a642ad1efc986f754105344b94ff3 Mon Sep 17 00:00:00 2001 From: kriegfrj Date: Thu, 4 Feb 2021 17:46:17 +1030 Subject: [PATCH 0323/1433] Add Provide-Capability OSGi header to engine bundles Fixes #2100. Closes #2544. --- .../junit-jupiter-engine.gradle.kts | 14 ++++++++++++++ .../junit-vintage-engine.gradle.kts | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts index be338ed699d8..33a01b5bbfb4 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle.kts +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle.kts @@ -1,3 +1,4 @@ +import aQute.bnd.gradle.BundleTaskConvention import org.gradle.api.tasks.PathSensitivity.RELATIVE plugins { @@ -28,3 +29,16 @@ tasks { inputs.dir("src/test/resources").withPathSensitivity(RELATIVE) } } + +tasks { + jar { + withConvention(BundleTaskConvention::class) { + bnd(""" + Provide-Capability:\ + org.junit.platform.engine;\ + org.junit.platform.engine='junit-jupiter';\ + version:Version="${'$'}{version_cleanup;${project.version}}" + """) + } + } +} diff --git a/junit-vintage-engine/junit-vintage-engine.gradle.kts b/junit-vintage-engine/junit-vintage-engine.gradle.kts index a0433fbec2c0..334567d2ea02 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle.kts +++ b/junit-vintage-engine/junit-vintage-engine.gradle.kts @@ -1,4 +1,4 @@ -import aQute.bnd.gradle.BundleTaskConvention; +import aQute.bnd.gradle.BundleTaskConvention plugins { `java-library-conventions` @@ -47,6 +47,11 @@ tasks { org.junit.runner.*;version="[${junit4Min},5)",\ org.junit.runners.model;version="[${junit4Min},5)",\ * + + Provide-Capability:\ + org.junit.platform.engine;\ + org.junit.platform.engine='junit-vintage';\ + version:Version="${'$'}{version_cleanup;${project.version}}" """) } } From 4e98f5530b6d731f9167cbe4e43cf8d0fcc2f525 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 18:10:36 +0200 Subject: [PATCH 0324/1433] Hard-wrap at 90 chars and add indentation --- .../docs/asciidoc/release-notes/release-notes-5.7.2.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc index c99f73578b77..14bf051a4380 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc @@ -15,9 +15,9 @@ GitHub. ==== Bug Fixes -* Method `getRootUrisForPackage()` in class `ClasspathScanner` now returns a -valid list of class names when the package name is equal to the name of a -module on the module path and when running on Java 8. +* Method `getRootUrisForPackage()` in class `ClasspathScanner` now returns a valid list of + class names when the package name is equal to the name of a module on the module path + and when running on Java 8. [[release-notes-5.7.2-junit-jupiter]] From 8d9ef8045bc28645953baace63999cc994e1d4e1 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 19:23:52 +0200 Subject: [PATCH 0325/1433] Update spring-nohttp plugin --- settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index b19286a401e8..76b7b010e2e0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,7 +14,7 @@ pluginManagement { id("org.asciidoctor.jvm.convert") version "3.3.2" id("org.asciidoctor.jvm.pdf") version "3.3.2" id("me.champeau.gradle.jmh") version "0.5.3" - id("io.spring.nohttp") version "0.0.7" + id("io.spring.nohttp") version "0.0.8" id("io.github.gradle-nexus.publish-plugin") version "1.1.0" } } From 05414dc722cee139718c8de7202e3f8a79a1f680 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 19:24:01 +0200 Subject: [PATCH 0326/1433] Upgradle to 7.0.1 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f371643eed77..e5338d370bad 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 267ce626491b02a86af7fb94191313adb8959f8e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 20:00:07 +0200 Subject: [PATCH 0327/1433] Add Stalebot configuration Resolves #2602. --- .github/stale.yml | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000000..2ef85c0b65a5 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,69 @@ +# Configuration for probot-stale - https://github.com/probot/stale +# Configuration options apply to both Issues and Pull Requests. +# We configure those individually to match our workflow (see `pulls:` and `issues:`) + +pulls: + # Number of days of inactivity before a Pull Request becomes stale + daysUntilStale: 60 + + # Number of days of inactivity before a Pull Request with the stale label is closed. + # Set to false to disable. If disabled, Pull Request still need to be closed manually, but will remain marked as stale. + daysUntilClose: 21 + + # Comment to post when marking as stale. Set to `false` to disable + markComment: > + This pull request has been automatically marked as stale because it has not had recent activity. + Given the limited bandwidth of the team, it will be closed if no further activity occurs. + If you intend to work on this pull request, please reopen the PR. + Thank you for your contributions. + # Comment to post when closing a stale Pull Request. + closeComment: > + This pull request has been automatically closed due to inactivity. + If you are still interested in contributing this, please ensure that + it is rebased against the latest branch (usually `main`), all review + comments have been addressed and the build is passing. +issues: + daysUntilStale: 365 + + # Number of days of inactivity before an Issue with the stale label is closed. + # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. + daysUntilClose: 21 + + # Comment to post when marking as stale. Set to `false` to disable + markComment: > + This issue has been automatically marked as stale because it has not had recent activity. + Given the limited bandwidth of the team, it will be automatically closed if no further + activity occurs. + Thank you for your contribution. + # Comment to post when closing a stale Issue. + closeComment: > + This issue has been automatically closed due to inactivity. If you have a good use case for this + feature, please feel free to reopen the issue. + +# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) +#onlyLabels: [] + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: [] + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: false + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: false + +# Set to true to ignore issues with an assignee (defaults to false) +exemptAssignees: false + +# Label to use when marking as stale +staleLabel: "status: stale" + +# Comment to post when removing the stale label. +# unmarkComment: > +# Your comment here. + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +# Limit to only `issues` or `pulls` +# only: issues From e6d74ab2f2d17c88c166a30fbcd8bb97f3fc8f31 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Thu, 13 May 2021 18:21:34 +0200 Subject: [PATCH 0328/1433] Acquire global read lock in presence of other exclusive resources Prior to this commit, the global read lock was not acquired for test classes with `@ResourceLock` annotations causing `@Isolated` tests to run in parallel. Fixes #2605. --- .../release-notes/release-notes-5.7.2.adoc | 5 ++++- .../support/hierarchical/NodeTreeWalker.java | 11 +++++----- .../NodeTreeWalkerIntegrationTests.java | 10 +++++----- .../ParallelExecutionIntegrationTests.java | 20 +++++++++++++++++++ 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc index 14bf051a4380..44b8253af7fd 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc @@ -18,6 +18,8 @@ GitHub. * Method `getRootUrisForPackage()` in class `ClasspathScanner` now returns a valid list of class names when the package name is equal to the name of a module on the module path and when running on Java 8. +* Direct child descriptors of the engine descriptor now also acquire the global read lock + when they require other exclusive resources. [[release-notes-5.7.2-junit-jupiter]] @@ -25,7 +27,8 @@ GitHub. ==== Bug Fixes -* ❓ +* Test classes annotated with `@ResourceLock` no longer run in parallel with `@Isolated` + ones. [[release-notes-5.7.2-junit-vintage]] diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java index 4ba6c20b204e..b1403967eec7 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalker.java @@ -74,15 +74,16 @@ private void walk(TestDescriptor globalLockDescriptor, TestDescriptor testDescri forceDescendantExecutionModeRecursively(advisor, globalLockDescriptor); advisor.useResourceLock(globalLockDescriptor, globalReadWriteLock); } + if (globalLockDescriptor.equals(testDescriptor) && !allResources.contains(GLOBAL_READ_WRITE)) { + allResources.add(GLOBAL_READ); + } advisor.useResourceLock(testDescriptor, lockManager.getLockForResources(allResources)); } } - private void forceDescendantExecutionModeRecursively(NodeExecutionAdvisor advisor, - TestDescriptor globalLockDescriptor) { - advisor.forceDescendantExecutionMode(globalLockDescriptor, SAME_THREAD); - doForChildrenRecursively(globalLockDescriptor, - child -> advisor.forceDescendantExecutionMode(child, SAME_THREAD)); + private void forceDescendantExecutionModeRecursively(NodeExecutionAdvisor advisor, TestDescriptor testDescriptor) { + advisor.forceDescendantExecutionMode(testDescriptor, SAME_THREAD); + doForChildrenRecursively(testDescriptor, child -> advisor.forceDescendantExecutionMode(child, SAME_THREAD)); } private boolean isReadOnly(Set exclusiveResources) { diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java index db399188d59a..4f292c846870 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/NodeTreeWalkerIntegrationTests.java @@ -48,7 +48,7 @@ void pullUpExclusiveChildResourcesToTestClass() { var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // - .isEqualTo(List.of(getReadWriteLock("a"), getReadWriteLock("b"))); + .isEqualTo(List.of(getLock(GLOBAL_READ), getReadWriteLock("a"), getReadWriteLock("b"))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); @@ -64,7 +64,7 @@ void setsForceExecutionModeForChildrenWithWriteLocksOnClass() { var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // - .isEqualTo(List.of(getReadWriteLock("a"))); + .isEqualTo(List.of(getLock(GLOBAL_READ), getReadWriteLock("a"))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); @@ -80,7 +80,7 @@ void doesntSetForceExecutionModeForChildrenWithReadLocksOnClass() { var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // - .isEqualTo(List.of(getReadLock("a"))); + .isEqualTo(List.of(getLock(GLOBAL_READ), getReadLock("a"))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); @@ -96,7 +96,7 @@ void setsForceExecutionModeForChildrenWithReadLocksOnClassAndWriteLockOnTest() { var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // - .isEqualTo(List.of(getReadWriteLock("a"))); + .isEqualTo(List.of(getLock(GLOBAL_READ), getReadWriteLock("a"))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); @@ -112,7 +112,7 @@ void doesntSetForceExecutionModeForChildrenWithReadLocksOnClassAndReadLockOnTest var testClassDescriptor = getOnlyElement(engineDescriptor.getChildren()); assertThat(advisor.getResourceLock(testClassDescriptor)).extracting(allLocks()) // - .isEqualTo(List.of(getReadLock("a"), getReadLock("b"))); + .isEqualTo(List.of(getLock(GLOBAL_READ), getReadLock("a"), getReadLock("b"))); assertThat(advisor.getForcedExecutionMode(testClassDescriptor)).isEmpty(); var testMethodDescriptor = getOnlyElement(testClassDescriptor.getChildren()); diff --git a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java index a7f5eec8d7bf..5facf032285f 100644 --- a/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java +++ b/platform-tests/src/test/java/org/junit/platform/engine/support/hierarchical/ParallelExecutionIntegrationTests.java @@ -243,6 +243,13 @@ void canRunTestsIsolatedFromEachOtherAcrossClasses() { assertThat(events.stream().filter(event(test(), finishedWithFailure())::matches)).isEmpty(); } + @RepeatedTest(10) + void canRunTestsIsolatedFromEachOtherAcrossClassesWithOtherResourceLocks() { + var events = executeConcurrently(4, IndependentClasses.B.class, IndependentClasses.C.class); + + assertThat(events.stream().filter(event(test(), finishedWithFailure())::matches)).isEmpty(); + } + @Isolated("testing") static class IsolatedTestCase { static AtomicInteger sharedResource; @@ -343,6 +350,19 @@ void b() throws Exception { storeAndBlockAndCheck(sharedResource, countDownLatch); } } + + @ResourceLock("other") + static class C { + @Test + void a() throws Exception { + storeAndBlockAndCheck(sharedResource, countDownLatch); + } + + @Test + void b() throws Exception { + storeAndBlockAndCheck(sharedResource, countDownLatch); + } + } } private List getEventsOfChildren(EngineExecutionResults results, TestDescriptor container) { From 0ba600e478c728cdb80c83dcbf554c08f7a0755c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 15 May 2021 10:35:24 +0200 Subject: [PATCH 0329/1433] Move #2423 to 5.7.2 --- .../docs/asciidoc/release-notes/release-notes-5.7.2.adoc | 6 ++++++ .../docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc index 44b8253af7fd..01858e3863b5 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc @@ -30,6 +30,12 @@ GitHub. * Test classes annotated with `@ResourceLock` no longer run in parallel with `@Isolated` ones. +==== New Features and Improvements + +* Improved `ExclusiveResource` handling: if a `Node` has only read locks and no read-write + locks, then descendants are not forced into `SAME_THREAD` execution and can run + concurrently. + [[release-notes-5.7.2-junit-vintage]] === JUnit Vintage diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc index bff82f016661..912bb36b1b95 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M1.adoc @@ -44,9 +44,6 @@ on GitHub. * Documented constant value of `ExclusiveResource.GLOBAL_KEY`. * Instances of `TestIdentifier` and `UniqueId` now retain less memory because they no longer store `String` representations of unique IDs. -* Improved `ExclusiveResource` handling: if a `Node` has only read locks and no read-write - locks, then descendants are not forced into `SAME_THREAD` execution and can run - concurrently. * Tools that make multiple calls to the `Launcher` API should now create a `LauncherSession` in order to allow for executing global setup and teardown code exactly once via the new `LauncherSessionListener` interface that can be registered via Java’s From 903df16c7f1c4cfb06671117acd4da16b3e4083e Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Sat, 15 May 2021 14:10:17 +0200 Subject: [PATCH 0330/1433] Release 5.7.2 --- README.md | 2 +- .../src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 166f0b7ad4e7..17219faed989 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This repository is the home of the next generation of JUnit, _JUnit 5_. ## Latest Releases -- General Availability (GA): [JUnit 5.7.1](https://github.com/junit-team/junit5/releases/tag/r5.7.1) (February 4, 2021) +- General Availability (GA): [JUnit 5.7.2](https://github.com/junit-team/junit5/releases/tag/r5.7.2) (May 15, 2021) - Preview (Milestone/Release Candidate): [JUnit 5.8.0-M1](https://github.com/junit-team/junit5/releases/tag/r5.8.0-M1) (February 11, 2021) ## Documentation diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc index 01858e3863b5..6c4ecffb1f23 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.7.2.adoc @@ -1,7 +1,7 @@ [[release-notes-5.7.2]] == 5.7.2 -*Date of Release:* ❓ +*Date of Release:* May 15, 2021 *Scope:* Bug fixes since 5.7.1 From a34ab1b94935dac19ba00660343f4a693fa0eeb9 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 18 May 2021 20:59:49 +0200 Subject: [PATCH 0331/1433] Upgradle to 7.0.2 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e5338d370bad..0f80bbf516ce 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 36db8934e343193509067a41fd8d0b75972125d3 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 26 May 2021 15:31:43 +0200 Subject: [PATCH 0332/1433] Use consistent naming for loggers --- .../jupiter/engine/execution/InvocationInterceptorChain.java | 4 ++-- .../launcher/core/CompositeTestExecutionListener.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java index b8b24aa1ca21..3f561ca57db2 100644 --- a/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java +++ b/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/execution/InvocationInterceptorChain.java @@ -114,7 +114,7 @@ public void skip() { private static class ValidatingInvocation implements Invocation { - private static final Logger LOG = LoggerFactory.getLogger(ValidatingInvocation.class); + private static final Logger logger = LoggerFactory.getLogger(ValidatingInvocation.class); private final AtomicBoolean invokedOrSkipped = new AtomicBoolean(); private final Invocation delegate; @@ -133,7 +133,7 @@ public T proceed() throws Throwable { @Override public void skip() { - LOG.debug(() -> "The invocation is skipped"); + logger.debug(() -> "The invocation is skipped"); markInvokedOrSkipped(); delegate.skip(); } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java index 41919c7fdcb4..7b7931f1425e 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/CompositeTestExecutionListener.java @@ -28,7 +28,7 @@ class CompositeTestExecutionListener implements TestExecutionListener { - private static final Logger LOGGER = LoggerFactory.getLogger(CompositeTestExecutionListener.class); + private static final Logger logger = LoggerFactory.getLogger(CompositeTestExecutionListener.class); private final List testExecutionListeners; private final List eagerTestExecutionListeners; @@ -96,7 +96,7 @@ private static void notifyEach(List listene } catch (Throwable throwable) { UnrecoverableExceptions.rethrowIfUnrecoverable(throwable); - LOGGER.warn(throwable, () -> String.format("TestExecutionListener [%s] threw exception for method: %s", + logger.warn(throwable, () -> String.format("TestExecutionListener [%s] threw exception for method: %s", listener.getClass().getName(), description.get())); } }); From 79cfec0d686799801e36337eb585ce30d93b5829 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 28 May 2021 09:21:09 +0200 Subject: [PATCH 0333/1433] Use actions/setup-java@v2 --- .github/workflows/codeql-analysis.yml | 7 +++--- .github/workflows/main.yml | 30 ++++++++++++++---------- .github/workflows/reproducible-build.yml | 10 ++++---- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 835adf22a476..e9cc12327a72 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -32,10 +32,11 @@ jobs: key: test-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | test-${{ runner.os }}-gradle- - - name: Setup JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 11 + uses: actions/setup-java@v2 with: - java-version: 11 + distribution: 'adopt' + java-version: '11' - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 87c440afe851..4a86bbbcd574 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -79,23 +79,26 @@ jobs: restore-keys: | test-${{ runner.os }}-maven- - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 8 + distribution: 'adopt' + java-version: '8' - name: Prepare JDK8 env var shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 16 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 16 + distribution: 'adopt' + java-version: '16' - name: Prepare JDK16 env var shell: bash run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 11 + distribution: 'adopt' + java-version: '11' - name: Test shell: bash run: | @@ -128,23 +131,26 @@ jobs: restore-keys: | test-${{ runner.os }}-maven- - name: Set up JDK 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 8 + distribution: 'adopt' + java-version: '8' - name: Prepare JDK8 env var shell: bash run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 16 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 16 + distribution: 'adopt' + java-version: '16' - name: Prepare JDK16 env var shell: bash run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 11 + distribution: 'adopt' + java-version: '11' - name: 'Test' run: | ./gradlew --version diff --git a/.github/workflows/reproducible-build.yml b/.github/workflows/reproducible-build.yml index f9c60055c82a..e74632fe7d7b 100644 --- a/.github/workflows/reproducible-build.yml +++ b/.github/workflows/reproducible-build.yml @@ -30,16 +30,18 @@ jobs: restore-keys: | assemble-${{ runner.os }}-gradle- - name: Set up JDK 16 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 16 + distribution: 'adopt' + java-version: '16' - name: Prepare JDK16 env var shell: bash run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: - java-version: 11 + distribution: 'adopt' + java-version: '11' - name: Build and compare checksums shell: bash run: | From 470e9d6d87858e9da0c84dd34af0cd327b1fd5ea Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 28 May 2021 10:38:31 +0200 Subject: [PATCH 0334/1433] Stop using custom Docker image (#2629) Use sormuras/download-jdk@v1 to download EA JDK instead. --- .github/workflows/cross-version.yml | 28 +++++++++++++++- .github/workflows/main.yml | 50 +++++++++++++++++++++++++++-- gradle.properties | 2 +- 3 files changed, 75 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 3f7e2bb69581..d24ce34fdc11 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -21,7 +21,6 @@ jobs: jdk: [17] name: "OpenJDK ${{ matrix.jdk }}" runs-on: ubuntu-latest - container: "ghcr.io/junit-team/build:${{ matrix.jdk }}" steps: - uses: actions/checkout@v2 with: @@ -42,6 +41,33 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '8' + - name: Prepare JDK8 env var + shell: bash + run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV + - name: 'Download JDK ${{ matrix.jdk }}' + id: download-jdk + uses: sormuras/download-jdk@v1 + with: + feature: '${{ matrix.jdk }}' + - name: 'Set up JDK ${{ matrix.jdk }}' + uses: actions/setup-java@v2 + with: + distribution: 'jdkfile' + java-version: '${{ steps.download-jdk.outputs.version }}' + jdkFile: '${{ steps.download-jdk.outputs.file }}' + - name: 'Prepare JDK${{ matrix.jdk }} env var' + shell: bash + run: echo "JDK${{ matrix.jdk }}=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' - name: Test env: ORG_GRADLE_PROJECT_enableTestDistribution: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a86bbbcd574..57a94b5e2f77 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,6 @@ jobs: linux: name: Linux runs-on: ubuntu-latest - container: ghcr.io/junit-team/build steps: - uses: actions/checkout@v2 with: @@ -40,6 +39,27 @@ jobs: key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | test-${{ runner.os }}-maven- + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '8' + - name: Prepare JDK8 env var + shell: bash + run: echo "JDK8=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 16 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '16' + - name: Prepare JDK16 env var + shell: bash + run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' - name: Test and coverage env: ORG_GRADLE_PROJECT_enableTestDistribution: true @@ -161,7 +181,6 @@ jobs: name: Publish Snapshot Artifacts needs: linux runs-on: ubuntu-latest - container: ghcr.io/junit-team/build if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && (startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main') steps: - uses: actions/checkout@v2 @@ -176,6 +195,19 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- + - name: Set up JDK 16 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '16' + - name: Prepare JDK16 env var + shell: bash + run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' - name: Publish env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} @@ -188,7 +220,6 @@ jobs: name: Update Snapshot Documentation needs: linux runs-on: ubuntu-latest - container: ghcr.io/junit-team/build if: github.event_name == 'push' && github.repository == 'junit-team/junit5' && github.ref == 'refs/heads/main' steps: - uses: actions/checkout@v2 @@ -203,6 +234,19 @@ jobs: key: assemble-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle.properties', 'gradle/**', 'buildSrc/src/main/**') }} restore-keys: | assemble-${{ runner.os }}-gradle- + - name: Set up JDK 16 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '16' + - name: Prepare JDK16 env var + shell: bash + run: echo "JDK16=$JAVA_HOME" >> $GITHUB_ENV + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '11' - name: Upload Documentation env: GRGIT_USER: ${{ secrets.GH_TOKEN }} diff --git a/gradle.properties b/gradle.properties index 83439302e974..77f353304411 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ defaultBuiltBy = JUnit Team org.gradle.jvmargs=-Xmx1g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError org.gradle.caching=true org.gradle.parallel=true -org.gradle.java.installations.fromEnv=JDK8,JDK16 +org.gradle.java.installations.fromEnv=JDK8,JDK16,JDK17 # Test Distribution gradle.internal.testdistribution.writeTraceFile=true From b295940c832ebb17e4b2e486267c2a04747dcd8a Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Fri, 28 May 2021 17:39:25 +0200 Subject: [PATCH 0335/1433] Upload JaCoCo reports --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57a94b5e2f77..070e485bc294 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -72,6 +72,11 @@ jobs: with: name: Test Distribution trace files path: '**/build/test-results/*/trace.json' + - name: Upload JaCoCo reports + uses: actions/upload-artifact@v2 + with: + name: JaCoCo reports + path: 'build/reports/jacoco/jacocoRootReport/**' - name: Upload to Codecov.io uses: codecov/codecov-action@v1 From a34d435f7bd2c8bbb5e30cc8ad72371df2404451 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 25 May 2021 15:04:08 +0200 Subject: [PATCH 0336/1433] Introduce a Unique ID tracking TestExecutionListener This commit introduces UniqueIdTrackingListener which is a TestExecutionListener that tracks the unique IDs of all tests that were executed during the TestPlan and generates a file containing the unique IDs. The generated file can be used to rerun those tests -- for example, in order to run the same set of tests executed on the JVM subsequently within a GraalVM native image. See the Javadoc for UniqueIdTrackingListener for configuration options and details. Closes #2619 --- build.gradle.kts | 1 + .../src/docs/asciidoc/link-attributes.adoc | 1 + .../release-notes/release-notes-5.8.0-M2.adoc | 6 +- .../listeners/UniqueIdTrackingListener.java | 223 +++++++++++++++ ...it.platform.launcher.TestExecutionListener | 1 + ...queIdTrackingListenerIntegrationTests.java | 254 ++++++++++++++++++ .../UniqueIdTrackingListenerUnitTests.java | 113 ++++++++ .../uidtracking/gradle/groovy/build.gradle | 1 + .../groovy/sub-project/sub-project.gradle | 1 + .../gradle/kotlin/build.gradle.kts | 1 + .../kotlin/sub-project/sub-project.gradle.kts | 1 + .../listeners/uidtracking/maven/pom.xml | 1 + .../projects/standalone/expected-err.txt | 2 +- 13 files changed, 604 insertions(+), 2 deletions(-) create mode 100644 junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java create mode 100644 junit-platform-launcher/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener create mode 100644 platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerIntegrationTests.java create mode 100644 platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerUnitTests.java create mode 100644 platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/build.gradle create mode 100644 platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/sub-project/sub-project.gradle create mode 100644 platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/build.gradle.kts create mode 100644 platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/sub-project/sub-project.gradle.kts create mode 100644 platform-tests/src/test/resources/listeners/uidtracking/maven/pom.xml diff --git a/build.gradle.kts b/build.gradle.kts index e2ffbe4960e3..983fba7ea17b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -170,6 +170,7 @@ subprojects { } kotlin { + targetExclude("**/src/test/resources/**") ktlint(libs.versions.ktlint.get()) licenseHeaderFile(headerFile) trimTrailingWhitespace() diff --git a/documentation/src/docs/asciidoc/link-attributes.adoc b/documentation/src/docs/asciidoc/link-attributes.adoc index 297c2bab8441..68d61bc1bbd1 100644 --- a/documentation/src/docs/asciidoc/link-attributes.adoc +++ b/documentation/src/docs/asciidoc/link-attributes.adoc @@ -39,6 +39,7 @@ endif::[] :SummaryGeneratingListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/listeners/SummaryGeneratingListener.html[SummaryGeneratingListener] :TestExecutionListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/TestExecutionListener.html[TestExecutionListener] :TestPlan: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/TestPlan.html[TestPlan] +:UniqueIdTrackingListener: {javadoc-root}/org.junit.platform.launcher/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.html[UniqueIdTrackingListener] // Platform Reporting :LegacyXmlReportGeneratingListener: {javadoc-root}/org.junit.platform.reporting/org/junit/platform/reporting/legacy/xml/LegacyXmlReportGeneratingListener.html[LegacyXmlReportGeneratingListener] // Platform Runner diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc index 9f73ac01adcf..8ba703254d23 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc @@ -23,7 +23,11 @@ on GitHub. ==== New Features and Improvements -* ❓ +* New `UniqueIdTrackingListener` which is a `TestExecutionListener` that tracks the unique + IDs of all tests that were executed during the `TestPlan` and generates a file + containing the unique IDs. The generated file can be used to rerun those tests -- for + example, in order to run the same set of tests executed on the JVM subsequently within a + GraalVM native image. See the Javadoc for `{UniqueIdTrackingListener}` for details. [[release-notes-5.8.0-M2-junit-jupiter]] diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java new file mode 100644 index 000000000000..7e6a921b5dc4 --- /dev/null +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java @@ -0,0 +1,223 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.listeners; + +import static org.apiguardian.api.API.Status.EXPERIMENTAL; + +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; + +import org.apiguardian.api.API; +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; +import org.junit.platform.commons.util.StringUtils; +import org.junit.platform.engine.TestExecutionResult; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.TestIdentifier; +import org.junit.platform.launcher.TestPlan; + +/** + * {@code UniqueIdTrackingListener} is a {@link TestExecutionListener} that tracks + * the {@linkplain TestIdentifier#getUniqueId() unique IDs} of all + * {@linkplain TestIdentifier#isTest() tests} that were + * {@linkplain #executionFinished executed} during the execution of the + * {@link TestPlan} and generates a file containing the unique IDs once execution + * of the {@code TestPlan} has {@linkplain #testPlanExecutionFinished(TestPlan) + * finished}. + * + *

    Tests are tracked regardless of their {@link TestExecutionResult}, and the + * unique IDs are written to the output file, one ID per line, encoding using UTF-8. + * + *

    The output file can be used to execute the same set of tests again without + * having to query the user configuration for the test plan and without having to + * perform test discovery again. This can be useful for test environments such as + * within a native image — for example, a GraalVM native image — in + * order to rerun the exact same tests from a standard JVM test run within a + * native image. + * + *

    Configuration and Defaults

    + * + *

    The {@code OUTPUT_DIR} is the directory in which this listener generates + * the output file (the {@code OUTPUT_FILE}). The exact path of the generated file + * is {@code OUTPUT_DIR}/{@code OUTPUT_FILE}. + * + *

    The name of the {@code OUTPUT_FILE} defaults to {@link #DEFAULT_FILE_NAME}, + * but a custom file name can be configured via the {@link #OUTPUT_FILE_PROPERTY_NAME} + * JVM system property. + * + *

    The {@code OUTPUT_DIR} can be set to a custom directory via the + * {@link #OUTPUT_DIR_PROPERTY_NAME} JVM system property. Otherwise the following + * algorithm is used to select a default output directory. + * + *

      + *
    • If the current working directory of the Java process contains a file named + * {@code pom.xml}, the output directory will be {@code ./target}, following the + * conventions of Maven.
    • + *
    • If the current working directory of the Java process contains a file with + * the extension {@code .gradle} or {@code .gradle.kts}, the output directory + * will be {@code ./build}, following the conventions of Gradle.
    • + *
    • Otherwise, the current working directory of the Java process will be used + * as the output directory.
    • + *
    + * + *

    For example, in a project using Gradle as the build tool, the file generated + * by this listener would be {@code ./build/junit-platform-unique-test-ids.txt} + * by default. + * + * @since 1.8 + */ +@API(status = EXPERIMENTAL, since = "1.8") +public class UniqueIdTrackingListener implements TestExecutionListener { + + /** + * Property name used to enable the {@code UniqueIdTrackingListener}: {@value} + * + *

    The {@code UniqueIdTrackingListener} is registered automatically via + * Java's {@link java.util.ServiceLoader} mechanism but disabled by default. + * + *

    Set the value of this property to {@code true} to enable this listener. + */ + public static final String LISTENER_ENABLED_PROPERTY_NAME = "junit.platform.listeners.uid.tracking.enabled"; + + /** + * Property name used to set the path to the output directory for the file + * generated by the {@code UniqueIdTrackingListener}: {@value} + * + *

    For details on the default output directory, see the + * {@linkplain UniqueIdTrackingListener class-level Javadoc}. + */ + public static final String OUTPUT_DIR_PROPERTY_NAME = "junit.platform.listeners.uid.tracking.output.dir"; + + /** + * Property name used to set the name of the file generated by the + * {@code UniqueIdTrackingListener}: {@value} + * + *

    Defaults to {@link #DEFAULT_FILE_NAME}. + */ + public static final String OUTPUT_FILE_PROPERTY_NAME = "junit.platform.listeners.uid.tracking.output.file"; + + /** + * The default name of the file generated by the {@code UniqueIdTrackingListener}: {@value} + * + * @see #OUTPUT_FILE_PROPERTY_NAME + */ + public static final String DEFAULT_FILE_NAME = "junit-platform-unique-test-ids.txt"; + + private final Logger logger = LoggerFactory.getLogger(UniqueIdTrackingListener.class); + + private final List uniqueIds = new ArrayList<>(); + + private final boolean enabled; + + public UniqueIdTrackingListener() { + this.enabled = Boolean.getBoolean(LISTENER_ENABLED_PROPERTY_NAME); + } + + @Override + public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { + if (this.enabled && testIdentifier.isTest()) { + this.uniqueIds.add(testIdentifier.getUniqueId()); + } + } + + @Override + public void testPlanExecutionFinished(TestPlan testPlan) { + if (this.enabled) { + Path outputFile; + try { + outputFile = getOutputFile(); + } + catch (IOException ex) { + logger.error(ex, () -> "Failed to create output file"); + // Abort since we cannot generate the file. + return; + } + + logger.debug(() -> "Writing unique IDs to output file " + outputFile.toAbsolutePath()); + try (PrintWriter writer = new PrintWriter(Files.newBufferedWriter(outputFile, StandardCharsets.UTF_8))) { + this.uniqueIds.forEach(writer::println); + writer.flush(); + } + catch (IOException ex) { + logger.error(ex, () -> "Failed to write unique IDs to output file " + outputFile.toAbsolutePath()); + } + } + } + + private Path getOutputFile() throws IOException { + String filename = System.getProperty(OUTPUT_FILE_PROPERTY_NAME, DEFAULT_FILE_NAME); + Path outputFile = getOutputDir().resolve(filename); + + if (Files.exists(outputFile)) { + Files.delete(outputFile); + } + + Files.createFile(outputFile); + + return outputFile; + } + + Path getOutputDir() throws IOException { + Path cwd = currentWorkingDir(); + Path outputDir; + + String customDir = System.getProperty(OUTPUT_DIR_PROPERTY_NAME); + if (StringUtils.isNotBlank(customDir)) { + outputDir = cwd.resolve(customDir); + } + else if (Files.exists(cwd.resolve("pom.xml"))) { + outputDir = cwd.resolve("target"); + } + else if (containsFilesWithExtensions(cwd, ".gradle", ".gradle.kts")) { + outputDir = cwd.resolve("build"); + } + else { + outputDir = cwd; + } + + if (!Files.exists(outputDir)) { + Files.createDirectories(outputDir); + } + + return outputDir; + } + + /** + * Get the current working directory. + *

    Package private for testing purposes. + */ + Path currentWorkingDir() { + return Paths.get("."); + } + + /** + * Determine if the supplied directory contains files with any of the + * supplied extensions. + */ + private boolean containsFilesWithExtensions(Path dir, String... extensions) throws IOException { + return Files.find(dir, 1, // + (path, basicFileAttributes) -> { + for (String extension : extensions) { + if (path.getFileName().toString().endsWith(extension)) { + return true; + } + } + return false; + }).findFirst().isPresent(); + } + +} diff --git a/junit-platform-launcher/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener b/junit-platform-launcher/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener new file mode 100644 index 000000000000..85f17ac249d5 --- /dev/null +++ b/junit-platform-launcher/src/main/resources/META-INF/services/org.junit.platform.launcher.TestExecutionListener @@ -0,0 +1 @@ +org.junit.platform.launcher.listeners.UniqueIdTrackingListener diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerIntegrationTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerIntegrationTests.java new file mode 100644 index 000000000000..4853697367df --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerIntegrationTests.java @@ -0,0 +1,254 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.listeners; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assumptions.assumeTrue; +import static org.junit.jupiter.api.DynamicTest.dynamicTest; +import static org.junit.platform.commons.util.FunctionUtils.where; +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; +import static org.junit.platform.launcher.EngineFilter.includeEngines; +import static org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder.request; +import static org.junit.platform.launcher.listeners.UniqueIdTrackingListener.DEFAULT_FILE_NAME; +import static org.junit.platform.launcher.listeners.UniqueIdTrackingListener.LISTENER_ENABLED_PROPERTY_NAME; +import static org.junit.platform.launcher.listeners.UniqueIdTrackingListener.OUTPUT_DIR_PROPERTY_NAME; +import static org.junit.platform.launcher.listeners.UniqueIdTrackingListener.OUTPUT_FILE_PROPERTY_NAME; +import static org.junit.platform.testkit.engine.Event.byTestDescriptor; +import static org.junit.platform.testkit.engine.EventConditions.abortedWithReason; +import static org.junit.platform.testkit.engine.EventConditions.event; +import static org.junit.platform.testkit.engine.EventConditions.finishedSuccessfully; +import static org.junit.platform.testkit.engine.EventConditions.finishedWithFailure; +import static org.junit.platform.testkit.engine.EventConditions.test; +import static org.junit.platform.testkit.engine.TestExecutionResultConditions.instanceOf; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.ServiceLoader; +import java.util.stream.Stream; + +import org.assertj.core.api.Condition; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestFactory; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.TestExecutionResult; +import org.junit.platform.engine.discovery.ClassSelector; +import org.junit.platform.launcher.LauncherDiscoveryRequest; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.TestIdentifier; +import org.junit.platform.launcher.core.LauncherFactory; +import org.junit.platform.testkit.engine.EngineTestKit; +import org.junit.platform.testkit.engine.Event; +import org.opentest4j.AssertionFailedError; +import org.opentest4j.TestAbortedException; + +/** + * Integration tests for the {@link UniqueIdTrackingListener}. + * + * @since 1.8 + */ +class UniqueIdTrackingListenerIntegrationTests { + + private static final String passingTest = "[engine:junit-jupiter]/[class:org.junit.platform.launcher.listeners.UniqueIdTrackingListenerIntegrationTests$TestCase1]/[method:passingTest()]"; + private static final String abortedTest = "[engine:junit-jupiter]/[class:org.junit.platform.launcher.listeners.UniqueIdTrackingListenerIntegrationTests$TestCase1]/[method:abortedTest()]"; + private static final String failingTest = "[engine:junit-jupiter]/[class:org.junit.platform.launcher.listeners.UniqueIdTrackingListenerIntegrationTests$TestCase1]/[method:failingTest()]"; + private static final String dynamicTest1 = "[engine:junit-jupiter]/[class:org.junit.platform.launcher.listeners.UniqueIdTrackingListenerIntegrationTests$TestCase1]/[test-factory:dynamicTests()]/[dynamic-test:#1]"; + private static final String dynamicTest2 = "[engine:junit-jupiter]/[class:org.junit.platform.launcher.listeners.UniqueIdTrackingListenerIntegrationTests$TestCase1]/[test-factory:dynamicTests()]/[dynamic-test:#2]"; + private static final String test1 = "[engine:junit-jupiter]/[class:org.junit.platform.launcher.listeners.UniqueIdTrackingListenerIntegrationTests$TestCase2]/[method:test1()]"; + private static final String test2 = "[engine:junit-jupiter]/[class:org.junit.platform.launcher.listeners.UniqueIdTrackingListenerIntegrationTests$TestCase2]/[method:test2()]"; + + private static final String[] expectedUniqueIds = { passingTest, abortedTest, failingTest, dynamicTest1, + dynamicTest2, test1, test2 }; + + @BeforeEach + @AfterEach + void clearSystemProperties() { + System.clearProperty(LISTENER_ENABLED_PROPERTY_NAME); + System.clearProperty(OUTPUT_DIR_PROPERTY_NAME); + System.clearProperty(OUTPUT_FILE_PROPERTY_NAME); + } + + @Test + void confirmExpectedUniqueIdsViaEngineTestKit() { + // @formatter:off + EngineTestKit.engine("junit-jupiter") + .selectors(selectClasses()) + .execute() + .testEvents() + .assertStatistics(stats -> stats.started(7).skipped(1).aborted(1).succeeded(5).failed(1)) + .assertEventsMatchLoosely( + event(test(uniqueId(passingTest)), finishedSuccessfully()), + event(test(uniqueId(abortedTest)), abortedWithReason(instanceOf(TestAbortedException.class))), + event(test(uniqueId(failingTest)), finishedWithFailure(instanceOf(AssertionFailedError.class))), + event(test(uniqueId(dynamicTest1)), finishedSuccessfully()), + event(test(uniqueId(dynamicTest2)), finishedSuccessfully()), + event(test(uniqueId(test1)), finishedSuccessfully()), + event(test(uniqueId(test2)), finishedSuccessfully()) + ); + // @formatter:on + } + + @Test + void listenerIsRegisteredButDisabledByDefault() throws Exception { + long numListenersRegistered = ServiceLoader.load(TestExecutionListener.class).stream()// + .filter(provider -> UniqueIdTrackingListener.class.equals(provider.type()))// + .count(); + assertThat(numListenersRegistered).isEqualTo(1); + + Path path = Paths.get("build", DEFAULT_FILE_NAME); + Files.deleteIfExists(path); + + try { + List actualUniqueIds = executeTests(); + + // Sanity check using the results of our local TestExecutionListener + assertThat(actualUniqueIds).containsExactlyInAnyOrder(expectedUniqueIds); + + // Check that file was not generated by the UniqueIdTrackingListener + assertThat(path).doesNotExist(); + } + finally { + Files.deleteIfExists(path); + } + } + + @Test + void verifyUniqueIdsAreTrackedWithDefaults() throws Exception { + Path path = Paths.get("build", DEFAULT_FILE_NAME); + verifyUniqueIdsAreTracked(path); + } + + @Test + void verifyUniqueIdsAreTrackedWithCustomOutputFile() throws Exception { + String customFilename = "test_ids.txt"; + System.setProperty(OUTPUT_FILE_PROPERTY_NAME, customFilename); + + Path path = Paths.get("build", customFilename); + verifyUniqueIdsAreTracked(path); + } + + @Test + void verifyUniqueIdsAreTrackedWithCustomOutputDir() throws Exception { + String customDir = "build/UniqueIdTrackingListenerIntegrationTests"; + System.setProperty(OUTPUT_DIR_PROPERTY_NAME, customDir); + + Path path = Paths.get(customDir, DEFAULT_FILE_NAME); + verifyUniqueIdsAreTracked(path); + } + + @Test + void verifyUniqueIdsAreTrackedWithCustomOutputFileAndCustomOutputDir() throws Exception { + String customFilename = "test_ids.txt"; + String customDir = "build/UniqueIdTrackingListenerIntegrationTests"; + System.setProperty(OUTPUT_DIR_PROPERTY_NAME, customDir); + System.setProperty(OUTPUT_FILE_PROPERTY_NAME, customFilename); + + Path path = Paths.get(customDir, customFilename); + verifyUniqueIdsAreTracked(path); + } + + private void verifyUniqueIdsAreTracked(Path path) throws IOException { + enableListener(); + Files.deleteIfExists(path); + try { + List actualUniqueIds = executeTests(); + + // Sanity check using the results of our local TestExecutionListener + assertThat(actualUniqueIds).containsExactlyInAnyOrder(expectedUniqueIds); + + // Check contents of the file generated by the UniqueIdTrackingListener + assertThat(Files.readAllLines(path)).containsExactlyInAnyOrder(expectedUniqueIds); + } + finally { + Files.deleteIfExists(path); + } + } + + private static void enableListener() { + System.setProperty(LISTENER_ENABLED_PROPERTY_NAME, "true"); + } + + private static Condition uniqueId(String uniqueId) { + return new Condition<>( + byTestDescriptor(where(TestDescriptor::getUniqueId, uid -> uid.toString().equals(uniqueId))), + "descriptor with uniqueId '%s'", uniqueId); + } + + private static List executeTests() { + List uniqueIds = new ArrayList<>(); + LauncherDiscoveryRequest request = request()// + .selectors(selectClasses())// + .filters(includeEngines("junit-jupiter")).build(); + LauncherFactory.create().execute(request, new TestExecutionListener() { + @Override + public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { + if (testIdentifier.isTest()) { + uniqueIds.add(testIdentifier.getUniqueId()); + } + } + }); + return uniqueIds; + } + + private static ClassSelector[] selectClasses() { + return new ClassSelector[] { selectClass(TestCase1.class), selectClass(TestCase2.class) }; + } + + // ------------------------------------------------------------------------- + + static class TestCase1 { + + @Test + void passingTest() { + } + + @Test + @Disabled("testing") + void disabledTest() { + } + + @Test + void abortedTest() { + assumeTrue(false); + } + + @Test + void failingTest() { + fail(); + } + + @TestFactory + Stream dynamicTests() { + return Stream.of("cat", "dog").map(text -> dynamicTest(text, () -> assertEquals(3, text.length()))); + } + } + + static class TestCase2 { + + @Test + void test1() { + } + + @Test + void test2() { + } + } + +} diff --git a/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerUnitTests.java b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerUnitTests.java new file mode 100644 index 000000000000..a04ba7251156 --- /dev/null +++ b/platform-tests/src/test/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListenerUnitTests.java @@ -0,0 +1,113 @@ +/* + * Copyright 2015-2021 the original author or authors. + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v2.0 which + * accompanies this distribution and is available at + * + * https://www.eclipse.org/legal/epl-v20.html + */ + +package org.junit.platform.launcher.listeners; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.platform.launcher.listeners.UniqueIdTrackingListener.OUTPUT_DIR_PROPERTY_NAME; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; + +/** + * Unit tests for the {@link UniqueIdTrackingListener}. + * + * @since 1.8 + */ +class UniqueIdTrackingListenerUnitTests { + + @Test + void getOutputDirUsesCustomOutputDir() throws Exception { + try { + String customDir = "build/UniqueIdTrackingListenerIntegrationTests"; + System.setProperty(OUTPUT_DIR_PROPERTY_NAME, customDir); + + UniqueIdTrackingListener listener = new UniqueIdTrackingListener(); + Path outputDir = listener.getOutputDir(); + assertThat(Files.isSameFile(Paths.get(customDir), outputDir)).isTrue(); + assertThat(outputDir).exists(); + } + finally { + System.clearProperty(OUTPUT_DIR_PROPERTY_NAME); + } + } + + @Test + void getOutputDirFallsBackToCurrentWorkingDir() throws Exception { + String cwd = "src/test/resources/listeners/uidtracking"; + + UniqueIdTrackingListener listener = new UniqueIdTrackingListener() { + @Override + Path currentWorkingDir() { + return Paths.get(cwd); + } + }; + Path outputDir = listener.getOutputDir(); + assertThat(Files.isSameFile(Paths.get(cwd), outputDir)).isTrue(); + assertThat(outputDir).exists(); + } + + @Test + void getOutputDirDetectsMavenPom() throws Exception { + String cwd = "src/test/resources/listeners/uidtracking/maven"; + String expected = "target"; + + assertOutputDirIsDetected(cwd, expected); + } + + @Test + void getOutputDirDetectsGradleGroovyDefaultBuildScript() throws Exception { + String cwd = "src/test/resources/listeners/uidtracking/gradle/groovy"; + String expected = "build"; + + assertOutputDirIsDetected(cwd, expected); + } + + @Test + void getOutputDirDetectsGradleGroovyCustomBuildScript() throws Exception { + String cwd = "src/test/resources/listeners/uidtracking/gradle/groovy/sub-project"; + String expected = "build"; + + assertOutputDirIsDetected(cwd, expected); + } + + @Test + void getOutputDirDetectsGradleKotlinDefaultBuildScript() throws Exception { + String cwd = "src/test/resources/listeners/uidtracking/gradle/kotlin"; + String expected = "build"; + + assertOutputDirIsDetected(cwd, expected); + } + + @Test + void getOutputDirDetectsGradleKotlinCustomBuildScript() throws Exception { + String cwd = "src/test/resources/listeners/uidtracking/gradle/kotlin/sub-project"; + String expected = "build"; + + assertOutputDirIsDetected(cwd, expected); + } + + private void assertOutputDirIsDetected(String cwd, String expected) throws IOException { + UniqueIdTrackingListener listener = new UniqueIdTrackingListener() { + @Override + Path currentWorkingDir() { + return Paths.get(cwd); + } + }; + Path outputDir = listener.getOutputDir(); + assertThat(Files.isSameFile(Paths.get(cwd, expected), outputDir)).isTrue(); + assertThat(outputDir).exists(); + } + +} diff --git a/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/build.gradle b/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/build.gradle new file mode 100644 index 000000000000..a4185e83967b --- /dev/null +++ b/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/build.gradle @@ -0,0 +1 @@ +// This file is used in tests for the UniqueIdTrackingListener diff --git a/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/sub-project/sub-project.gradle b/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/sub-project/sub-project.gradle new file mode 100644 index 000000000000..a4185e83967b --- /dev/null +++ b/platform-tests/src/test/resources/listeners/uidtracking/gradle/groovy/sub-project/sub-project.gradle @@ -0,0 +1 @@ +// This file is used in tests for the UniqueIdTrackingListener diff --git a/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/build.gradle.kts b/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/build.gradle.kts new file mode 100644 index 000000000000..a4185e83967b --- /dev/null +++ b/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/build.gradle.kts @@ -0,0 +1 @@ +// This file is used in tests for the UniqueIdTrackingListener diff --git a/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/sub-project/sub-project.gradle.kts b/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/sub-project/sub-project.gradle.kts new file mode 100644 index 000000000000..a4185e83967b --- /dev/null +++ b/platform-tests/src/test/resources/listeners/uidtracking/gradle/kotlin/sub-project/sub-project.gradle.kts @@ -0,0 +1 @@ +// This file is used in tests for the UniqueIdTrackingListener diff --git a/platform-tests/src/test/resources/listeners/uidtracking/maven/pom.xml b/platform-tests/src/test/resources/listeners/uidtracking/maven/pom.xml new file mode 100644 index 000000000000..1a462ec9525d --- /dev/null +++ b/platform-tests/src/test/resources/listeners/uidtracking/maven/pom.xml @@ -0,0 +1 @@ + diff --git a/platform-tooling-support-tests/projects/standalone/expected-err.txt b/platform-tooling-support-tests/projects/standalone/expected-err.txt index d49887b2d69b..ae1258c81b77 100644 --- a/platform-tooling-support-tests/projects/standalone/expected-err.txt +++ b/platform-tooling-support-tests/projects/standalone/expected-err.txt @@ -5,6 +5,6 @@ .+ org.junit.platform.launcher.core.ServiceLoaderRegistry load .+ Loaded LauncherDiscoveryListener instances: .. .+ org.junit.platform.launcher.core.ServiceLoaderRegistry load -.+ Loaded TestExecutionListener instances: .. +.+ Loaded TestExecutionListener instances: .+ .+ org.junit.platform.launcher.core.ServiceLoaderRegistry load .+ Loaded LauncherSessionListener instances: .. From b0498e8aca80df059dc9b62589df08bbd501ff2c Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 1 Jun 2021 22:07:14 +0200 Subject: [PATCH 0337/1433] Make UniqueIdTrackingListenerIntegrationTests work with TD --- platform-tests/platform-tests.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index 7d275f267040..a47012c46d29 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -1,3 +1,4 @@ +import org.gradle.api.tasks.PathSensitivity.NONE import org.gradle.api.tasks.PathSensitivity.RELATIVE plugins { @@ -58,7 +59,9 @@ tasks { jvmArgs("-Xmx1g") } test { + // Additional inputs for remote execution with Test Distribution inputs.dir("src/test/resources").withPathSensitivity(RELATIVE) + inputs.file(buildFile).withPathSensitivity(NONE) // for UniqueIdTrackingListenerIntegrationTests } test_4_12 { useJUnitPlatform { From 0d8be3763f86d51948224a06ca09521471afb746 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 1 Jun 2021 22:07:41 +0200 Subject: [PATCH 0338/1433] Update dependencies --- gradle/libs.versions.toml | 10 +++++----- platform-tests/platform-tests.gradle.kts | 12 ++++++------ settings.gradle.kts | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b68cb9b131a2..8514172c2e66 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ asciidoctor-pdf = "1.5.3" assertj = "3.19.0" checkstyle = "8.36.2" jacoco = "0.8.7" -jmh = "1.29" +jmh = "1.32" junit4 = "4.13.2" junit4Osgi = "4.13.2_1" junit4Min = "4.12" @@ -15,12 +15,12 @@ surefire = "2.22.2" [libraries] apiguardian = { module = "org.apiguardian:apiguardian-api", version.ref = "apiguardian" } -archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.18.0" } +archunit = { module = "com.tngtech.archunit:archunit-junit5", version = "0.19.0" } assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } bartholdy = { module = "de.sormuras:bartholdy", version = "0.2.3" } bnd = { module = "biz.aQute.bnd:biz.aQute.bndlib", version = "5.3.0" } -classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.104" } -commons-io = { module = "commons-io:commons-io", version = "2.8.0" } +classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.106" } +commons-io = { module = "commons-io:commons-io", version = "2.9.0" } groovy3 = { module = "org.codehaus.groovy:groovy", version = "3.0.8" } groovy2-bom = { module = "org.codehaus.groovy:groovy-bom", version = "2.5.14" } jfrunit = { module = "com.github.gunnarmorling:jfrunit", version = "main-SNAPSHOT" } @@ -31,7 +31,7 @@ junit4 = { module = "junit:junit", version = { strictly = "[4.12,)", prefer = "4 kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.4.3" } log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } log4j-jul = { module = "org.apache.logging.log4j:log4j-jul", version.ref = "log4j" } -mockito = { module = "org.mockito:mockito-junit-jupiter", version = "3.9.0" } +mockito = { module = "org.mockito:mockito-junit-jupiter", version = "3.10.0" } opentest4j = { module = "org.opentest4j:opentest4j", version.ref = "opentest4j" } picocli = { module = "info.picocli:picocli", version = "4.6.1" } slf4j-julBinding = { module = "org.slf4j:slf4j-jdk14", version = "1.7.30" } diff --git a/platform-tests/platform-tests.gradle.kts b/platform-tests/platform-tests.gradle.kts index a47012c46d29..4f530f4e6963 100644 --- a/platform-tests/platform-tests.gradle.kts +++ b/platform-tests/platform-tests.gradle.kts @@ -5,7 +5,7 @@ plugins { `java-library-conventions` `junit4-compatibility` `testing-conventions` - id("me.champeau.gradle.jmh") + id("me.champeau.jmh") } dependencies { @@ -43,12 +43,12 @@ dependencies { } jmh { - jmhVersion = libs.versions.jmh.get() + jmhVersion.set(libs.versions.jmh) - duplicateClassesStrategy = DuplicatesStrategy.WARN - fork = 1 - warmupIterations = 1 - iterations = 5 + duplicateClassesStrategy.set(DuplicatesStrategy.WARN) + fork.set(1) + warmupIterations.set(1) + iterations.set(5) } tasks { diff --git a/settings.gradle.kts b/settings.gradle.kts index 76b7b010e2e0..c8acdde3d0eb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,18 +2,18 @@ import com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionW pluginManagement { plugins { - id("com.gradle.enterprise") version "3.6.1" + id("com.gradle.enterprise") version "3.6.2" id("com.gradle.enterprise.test-distribution") version "2.0.3" id("com.gradle.common-custom-user-data-gradle-plugin") version "1.3" id("net.nemerosa.versioning") version "2.14.0" - id("com.github.ben-manes.versions") version "0.38.0" - id("com.diffplug.spotless") version "5.12.4" + id("com.github.ben-manes.versions") version "0.39.0" + id("com.diffplug.spotless") version "5.12.5" id("org.ajoberstar.git-publish") version "3.0.0" kotlin("jvm") version "1.5.0" // Check if workaround in documentation.gradle.kts can be removed when upgrading id("org.asciidoctor.jvm.convert") version "3.3.2" id("org.asciidoctor.jvm.pdf") version "3.3.2" - id("me.champeau.gradle.jmh") version "0.5.3" + id("me.champeau.jmh") version "0.6.5" id("io.spring.nohttp") version "0.0.8" id("io.github.gradle-nexus.publish-plugin") version "1.1.0" } From 9604d8eeafff81c4ca90fece1b0e5e446597c74a Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 1 Jun 2021 16:16:23 +0200 Subject: [PATCH 0339/1433] Provide access to ConfigurationParameters via the TestPlan Prior to this commit, a TestExecutionListener did not have access to JUnit Platform configuration parameters. This meant that a TestExecutionListener could only be configured via JVM system properties or some other mechanism outside standard JUnit Platform features. This commit introduces a new getConfigurationParameters() method in the TestPlan which allows a TestExecutionListener to access access the ConfigurationParameters via the TestPlan supplied to the testPlanExecutionStarted(TestPlan) and testPlanExecutionFinished(TestPlan) callback methods. This commit also refactors UniqueIdTrackingListener to retrieve its configuration from ConfigurationParameters instead of relying solely on JVM system properties. Closes #2631 --- .../release-notes/release-notes-5.8.0-M2.adoc | 5 ++ .../asciidoc/user-guide/launcher-api.adoc | 16 +++++- .../asciidoc/user-guide/running-tests.adoc | 4 +- .../engine/ConfigurationParameters.java | 4 ++ .../launcher/TestExecutionListener.java | 7 +++ .../org/junit/platform/launcher/TestPlan.java | 27 ++++++++-- .../launcher/core/InternalTestPlan.java | 5 +- .../listeners/UniqueIdTrackingListener.java | 30 ++++++----- .../platform/launcher/TestPlanTests.java | 11 ++-- .../CompositeTestExecutionListenerTests.java | 7 ++- .../core/ExecutionListenerAdapterTests.java | 4 +- .../listeners/SummaryGenerationTests.java | 4 +- ...queIdTrackingListenerIntegrationTests.java | 45 ++++++---------- .../UniqueIdTrackingListenerUnitTests.java | 52 +++++++++---------- .../legacy/LegacyReportingUtilsTests.java | 6 ++- ...egacyXmlReportGeneratingListenerTests.java | 8 +-- .../legacy/xml/XmlReportDataTests.java | 11 ++-- .../legacy/xml/XmlReportWriterTests.java | 22 ++++---- .../runner/JUnitPlatformRunnerTests.java | 15 ++++-- 19 files changed, 178 insertions(+), 105 deletions(-) diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc index 8ba703254d23..bd7d93c2bf85 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.0-M2.adoc @@ -23,6 +23,11 @@ on GitHub. ==== New Features and Improvements +* New `getConfigurationParameters()` method in the `TestPlan` which allows a + `TestExecutionListener` to access + <<../user-guide/index.adoc#running-tests-config-params, configuration parameters>>. See + <<../user-guide/index.adoc#launcher-api-listeners-config, Configuring an Execution + Listener>> for details. * New `UniqueIdTrackingListener` which is a `TestExecutionListener` that tracks the unique IDs of all tests that were executed during the `TestPlan` and generates a file containing the unique IDs. The generated file can be used to rerun those tests -- for diff --git a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc index 04a1566bd12b..164541c5cf8c 100644 --- a/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc +++ b/documentation/src/docs/asciidoc/user-guide/launcher-api.adoc @@ -120,7 +120,7 @@ declared within the `/META-INF/services/org.junit.platform.launcher.PostDiscover file is loaded and applied automatically. [[launcher-api-launcher-session-listeners-custom]] -==== Plugging in your own Launcher Sessions Listeners +==== Plugging in your own Launcher Session Listeners Registered implementations of `{LauncherSessionListener}` are notified when a `{LauncherSession}` is opened, i.e. before a `{Launcher}` first discovers and executes @@ -161,6 +161,20 @@ For example, an `example.CustomTestExecutionListener` class implementing `/META-INF/services/org.junit.platform.launcher.TestExecutionListener` file is loaded and registered automatically. +[[launcher-api-listeners-config]] +==== Configuring an Execution Listener + +When a `{TestExecutionListener}` is registered programmatically via the `{Launcher}` API, +the listener may provide programmatic ways for it to be configured -- for example, via its +constructor, setter methods, etc. However, when a `TestExecutionListener` is registered +automatically via Java's `ServiceLoader` mechanism (see +<>), there is no way for the user to directly configure the +listener. In such cases, the author of a `TestExecutionListener` may choose to make the +listener configurable via <>. The +listener can then access the configuration parameters via the `TestPlan` supplied to the +`testPlanExecutionStarted(TestPlan)` and `testPlanExecutionFinished(TestPlan)` callback +methods. See the `{UniqueIdTrackingListener}` for an example. + [[launcher-api-listeners-custom-deactivation]] ==== Deactivating Execution Listeners diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index 9adaf6895044..c386605599b0 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -699,8 +699,8 @@ infrastructure. In addition to instructing the platform which test classes and test engines to include, which packages to scan, etc., it is sometimes necessary to provide additional custom -configuration parameters that are specific to a particular test engine or registered -extension. For example, the JUnit Jupiter `TestEngine` supports _configuration +configuration parameters that are specific to a particular test engine, listener, or +registered extension. For example, the JUnit Jupiter `TestEngine` supports _configuration parameters_ for the following use cases. - <> diff --git a/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java b/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java index 5110f4536d0a..e7fa8419af76 100644 --- a/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java +++ b/junit-platform-engine/src/main/java/org/junit/platform/engine/ConfigurationParameters.java @@ -26,6 +26,10 @@ *

    For example, the JUnit Jupiter engine uses a configuration parameter to * enable IDEs and build tools to deactivate conditional test execution. * + *

    As of JUnit Platform 1.8, configuration parameters are also made available to + * implementations of the {@link org.junit.platform.launcher.TestExecutionListener} + * API via the {@link org.junit.platform.launcher.TestPlan}. + * * @see TestEngine * @see EngineDiscoveryRequest * @see ExecutionRequest diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java index b0505e9e213a..e502dd3f439c 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestExecutionListener.java @@ -39,6 +39,13 @@ * Jupiter engines comply with this contract, there is no way to guarantee this for * third-party engines. * + *

    As of JUnit Platform 1.8, a {@code TestExecutionListener} can access + * {@linkplain org.junit.platform.engine.ConfigurationParameters configuration + * parameters} via the {@link TestPlan#getConfigurationParameters() + * getConfigurationParameters()} method in the {@code TestPlan} supplied to + * {@link #testPlanExecutionStarted(TestPlan)} and + * {@link #testPlanExecutionFinished(TestPlan)}. + * * @since 1.0 * @see Launcher * @see TestPlan diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java index 9e268224b134..617bdf6a24c9 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/TestPlan.java @@ -15,6 +15,7 @@ import static java.util.Collections.unmodifiableSet; import static org.apiguardian.api.API.Status.DEPRECATED; import static org.apiguardian.api.API.Status.INTERNAL; +import static org.apiguardian.api.API.Status.MAINTAINED; import static org.apiguardian.api.API.Status.STABLE; import java.util.Collection; @@ -28,6 +29,7 @@ import org.apiguardian.api.API; import org.junit.platform.commons.PreconditionViolationException; import org.junit.platform.commons.util.Preconditions; +import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.TestDescriptor.Visitor; import org.junit.platform.engine.UniqueId; @@ -66,6 +68,8 @@ public class TestPlan { private final boolean containsTests; + private final ConfigurationParameters configurationParameters; + /** * Construct a new {@code TestPlan} from the supplied collection of * {@link TestDescriptor TestDescriptors}. @@ -75,20 +79,26 @@ public class TestPlan { * * @param engineDescriptors the engine test descriptors from which the test * plan should be created; never {@code null} + * @param configurationParameters the {@code ConfigurationParameters} for + * this test plan; never {@code null} * @return a new test plan */ @API(status = INTERNAL, since = "1.0") - public static TestPlan from(Collection engineDescriptors) { + public static TestPlan from(Collection engineDescriptors, + ConfigurationParameters configurationParameters) { Preconditions.notNull(engineDescriptors, "Cannot create TestPlan from a null collection of TestDescriptors"); - TestPlan testPlan = new TestPlan(engineDescriptors.stream().anyMatch(TestDescriptor::containsTests)); + Preconditions.notNull(configurationParameters, "Cannot create TestPlan from null ConfigurationParameters"); + TestPlan testPlan = new TestPlan(engineDescriptors.stream().anyMatch(TestDescriptor::containsTests), + configurationParameters); Visitor visitor = descriptor -> testPlan.add(TestIdentifier.from(descriptor)); engineDescriptors.forEach(engineDescriptor -> engineDescriptor.accept(visitor)); return testPlan; } @API(status = INTERNAL, since = "1.4") - protected TestPlan(boolean containsTests) { + protected TestPlan(boolean containsTests, ConfigurationParameters configurationParameters) { this.containsTests = containsTests; + this.configurationParameters = configurationParameters; } /** @@ -222,4 +232,15 @@ public boolean containsTests() { return containsTests; } + /** + * Get the {@link ConfigurationParameters} for this test plan. + * + * @return the configuration parameters; never {@code null} + * @since 1.8 + */ + @API(status = MAINTAINED, since = "1.8") + public ConfigurationParameters getConfigurationParameters() { + return this.configurationParameters; + } + } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java index 559d603e885e..5f9c6a574183 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/InternalTestPlan.java @@ -34,12 +34,13 @@ class InternalTestPlan extends TestPlan { private final TestPlan delegate; static InternalTestPlan from(LauncherDiscoveryResult discoveryResult) { - TestPlan delegate = TestPlan.from(discoveryResult.getEngineTestDescriptors()); + TestPlan delegate = TestPlan.from(discoveryResult.getEngineTestDescriptors(), + discoveryResult.getConfigurationParameters()); return new InternalTestPlan(discoveryResult, delegate); } private InternalTestPlan(LauncherDiscoveryResult discoveryResult, TestPlan delegate) { - super(delegate.containsTests()); + super(delegate.containsTests(), delegate.getConfigurationParameters()); this.discoveryResult = discoveryResult; this.delegate = delegate; } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java index 7e6a921b5dc4..81afea40a43b 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/listeners/UniqueIdTrackingListener.java @@ -25,6 +25,7 @@ import org.junit.platform.commons.logging.Logger; import org.junit.platform.commons.logging.LoggerFactory; import org.junit.platform.commons.util.StringUtils; +import org.junit.platform.engine.ConfigurationParameters; import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.launcher.TestExecutionListener; import org.junit.platform.launcher.TestIdentifier; @@ -56,11 +57,11 @@ * is {@code OUTPUT_DIR}/{@code OUTPUT_FILE}. * *

    The name of the {@code OUTPUT_FILE} defaults to {@link #DEFAULT_FILE_NAME}, - * but a custom file name can be configured via the {@link #OUTPUT_FILE_PROPERTY_NAME} - * JVM system property. + * but a custom file name can be set via the {@link #OUTPUT_FILE_PROPERTY_NAME} + * configuration property. * *

    The {@code OUTPUT_DIR} can be set to a custom directory via the - * {@link #OUTPUT_DIR_PROPERTY_NAME} JVM system property. Otherwise the following + * {@link #OUTPUT_DIR_PROPERTY_NAME} configuration property. Otherwise the following * algorithm is used to select a default output directory. * *