<commit_before>[[release-notes-5.0.0-m4]]
=== 5.0.0-M4

*Date of Release:* April 1, 2017

*Scope:* Fourth milestone release of JUnit 5 with a focus on test templates, repeated
tests, and parameterized tests.

For a complete list of all _closed_ issues and pull requests for this release, consult the
link:{junit5-repo}+/milestone/7?closed=1+[5.0 M4] milestone page in the JUnit repository
on GitHub.


[[release-notes-5.0.0-m4-junit-platform]]
==== JUnit Platform

===== Bug Fixes

* The JUnit Platform Gradle plugin now adds its dependencies with a fixed version (same as the plugin
  version) instead of a dynamic versioning scheme (was `1.+`) by default to ensure reproducible
  builds.
* The JUnit Platform Gradle plugin now explicitly applies the Gradle built-in `java` plugin as
  it has an implicit dependency on it being applied.
* All `findMethods()` implementations in `ReflectionUtils` no longer return synthetic methods.
  Shadowed https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2[override-equal]
  methods are also no longer included in the results.
* Introduced `getLegacyReportingName()` in `TestIdentifier` and `TestDescriptor`. This
  allows the JUnit Platform Gradle Plugin and the Surefire Provider to resolve the class
  and method names through `getLegacyReportingName()` instead of using the source location.
* JAR files that contain spaces in their paths (`%20`) are now properly decoded before being
  used in classpath scanning routines.
* Updated `findNestedClasses()` in `ReflectionUtils` so that searches for nested classes also
  return inherited nested classes (regardless of whether they are static or not).

===== Deprecations and Breaking Changes

* All _test suite_ annotations from the `org.junit.platform.runner` package have been
  moved to the `org.junit.platform.suite.api` package in the new `junit-platform-suite-api`
  module. This includes annotations such as `@SelectClasses`, `@SelectPackages`, etc.
* Removed deprecated `selectNames()` name-based discovery selector from
  `DiscoverySelectors` in favor of the dedicated `selectPackage(String)`,
  `selectClass(String)`, and `selectMethod(String)` methods.
* `ClassNameFilter.includeClassNamePattern` was removed; please use
  `ClassNameFilter.includeClassNamePatterns` instead.
* `@IncludeClassNamePattern` has been removed; please use `@IncludeClassNamePatterns` instead.
* The `--hide-details` option of the `ConsoleLauncher` is deprecated; use `--details none` instead.
* The ZIP distribution containing the console launcher is no longer provided. It has been replaced
  by an executable standalone JAR distribution. For details, see the "New Features" section below.
* The `MethodSortOrder` enum in `ReflectionUtils` has been renamed to `HierarchyTraversalMode`. Those
  affected should now use `ReflectionSupport` instead of `ReflectionUtils`.
* The method `execute(LauncherDiscoveryRequest launcherDiscoveryRequest)` in `Launcher` has been
  deprecated and will be removed in milestone M5. Instead use the following new method that registers
  supplied ``TestExecutionListener``s in addition to already registered listeners but only for the
  supplied `LauncherDiscoveryRequest`:
  `execute(LauncherDiscoveryRequest launcherDiscoveryRequest, TestExecutionListener... listeners)`

===== New Features and Improvements

* Custom `TestExecutionListener` implementations can now be registered automatically via
  Java's `ServiceLoader` mechanism.
* New `getGroupId()`, `getArtifactId()`, and `getVersion()` default methods in the
  `TestEngine` API for debugging and reporting purposes. By default, package attributes
  (i.e., typically from JAR manifest attributes) are used to determine the artifact ID
  and version; whereas, the group ID is empty by default. Consult the Javadoc for
  `{TestEngine}` for details.
* Logging information for discovered test engines has been enhanced to include the group
  ID, artifact ID, and version of each test engine if available via the `getGroupId()`,
  `getArtifactId()`, and `getVersion()` methods.
* The `--scan-classpath` option of the `ConsoleLauncher` now allows to scan JAR files for tests
  when they are supplied as explicit arguments (see <<running-tests-console-launcher-options>>).
* The new `--details <Details>` option of the `ConsoleLauncher` now allows to select an output
  details mode for when tests are executed. Use one of: `none`, `flat`, `tree` or `verbose`. If
  `none` is selected, then only the summary and test failures are shown (see
  <<running-tests-console-launcher-options>>).
* The new `--details-theme <Theme>` option of the `ConsoleLauncher` now allows to select a
  theme for when tests are executed and printed as a tree. Use one of: `ascii` or `unicode`
  (see <<running-tests-console-launcher-options>>).
* An executable `junit-platform-console-standalone-{platform-version}.jar` artifact containing
  the Jupiter and Vintage test engines with all dependencies is generated by the default build
  process, stored in `junit-platform-console-standalone/build/libs`, and published to
  https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone[Maven Central].
  It provides hassle-free usage of JUnit 5 in projects that manually manage their dependencies
  similar to the
  https://github.com/junit-team/junit4/wiki/Download-and-Install#plain-old-jar[plain-old JAR]
  known from JUnit 4.
* New `--exclude-classname` (`--N`) option added to the `ConsoleLauncher` accepting a regular
  expression to exclude those classes whose fully qualified names match. When this option is
  repeated, all patterns will be combined using OR semantics.
* New JUnit Platform support package `org.junit.platform.commons.support` that contains
  _maintained_ utility methods for annotation, reflection, and classpath scanning tasks.
  `TestEngine` and `Extension` authors are encouraged to use these supported methods
  in order to align with the behavior of the JUnit Platform.
* Squashed logic behind `TestDescriptor.isTest()` and `TestDescriptor.isContainer()` from two
  independent `boolean` properties into a single enumeration, namely `TestDescriptor.Type`. See
  next bullet point for details.
* Introduced `TestDescriptor.Type` enumeration with `TestDescriptor.getType()` accessor defining
  all possible descriptor types. `TestDescriptor.isTest()` and `TestDescriptor.isContainer()`
  now delegate to `TestDescriptor.Type` constants.
* Introduced `TestDescriptor.prune()` and `TestDescriptor.pruneTree()` which allow engine authors
  to customize what happens when pruning is triggered by the JUnit Platform.
* `TestIdentifier` now uses the new `TestDescriptor.Type` enumeration to store the
  underlying type. It can be retrieved via the new `TestIdentifier.getType()` method.
  Furthermore, `TestIdentifier.isTest()` and `TestIdentifier.isContainer()` now delegate
  to `TestDescriptor.Type` constants.


[[release-notes-5.0.0-m4-junit-jupiter]]
==== JUnit Jupiter

===== Bug Fixes

* Fixed bug that prevented discovery of two or more methods in the same class when
  selected via a method selector.
* `@Nested` non-static test classes are now detected when declared in super classes.
* The correct execution order of overridden `@BeforeEach` and `@AfterEach` methods is now
  enforced when declared at multiple levels within a class hierarchy. It's now always
  `super.before`, `this.before`, `this.test`, `this.after`, and `super.after`, even if
  the compiler adds synthetic methods.
* ``TestExecutionExceptionHandler``s are now invoked in the opposite order in which they
  were registered, analogous to all other "_after_" extensions.

===== Deprecations and Breaking Changes

* Removed deprecated `Assertions.expectThrows()` method in favor of `Assertions.assertThrows()`.
* ``ExtensionContext.Namespace``s composed of the same parts but in a different order are no longer considered
  equal to each other.

===== New Features and Improvements

* First-class support for _repeated tests_ via the new `@RepeatedTest` annotation and
  `RepetitionInfo` API. See <<writing-tests-repeated-tests>> for details.
* `Assertions.assertThrows()` now uses canonical names for exception types when
  generating assertion failure messages.
* ``TestInstancePostProcessor``s registered on test methods are now invoked.
* New variants of `Assertions.fail`: `Assertions.fail(Throwable cause)` and
  `Assertions.fail(String message, Throwable cause)`.
* New `Assertions.assertLinesMatch()` comparing lists of strings, featuring `Object::equals`
  and regular expression checks. `assertLinesMatch()` also provides a fast-forward mechanism
  to skip lines that are expected to change in each invocation -- for example, duration,
  timestamps, stack traces, etc. Consult the JavaDoc for `{Assertions}` for details.
* Extensions can now be registered automatically via Java's `ServiceLoader` mechanism.
  See <<extensions-registration-automatic>>.


[[release-notes-5.0.0-m4-junit-vintage]]
==== JUnit Vintage

===== Bug Fixes

* Fixed bug that caused only the last failure of a test to be reported. For example, when using the
  `ErrorCollector` rule, only the last failed check was reported. Now, all failures are reported
  using an `org.opentest4j.MultipleFailuresError`.<commit_msg>Mention parameterized tests and test templates in release notes<commit_after>[[release-notes-5.0.0-m4]]
=== 5.0.0-M4

*Date of Release:* April 1, 2017

*Scope:* Fourth milestone release of JUnit 5 with a focus on test templates, repeated
tests, and parameterized tests.

For a complete list of all _closed_ issues and pull requests for this release, consult the
link:{junit5-repo}+/milestone/7?closed=1+[5.0 M4] milestone page in the JUnit repository
on GitHub.


[[release-notes-5.0.0-m4-junit-platform]]
==== JUnit Platform

===== Bug Fixes

* The JUnit Platform Gradle plugin now adds its dependencies with a fixed version (same as the plugin
  version) instead of a dynamic versioning scheme (was `1.+`) by default to ensure reproducible
  builds.
* The JUnit Platform Gradle plugin now explicitly applies the Gradle built-in `java` plugin as
  it has an implicit dependency on it being applied.
* All `findMethods()` implementations in `ReflectionUtils` no longer return synthetic methods.
  Shadowed https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.4.2[override-equal]
  methods are also no longer included in the results.
* Introduced `getLegacyReportingName()` in `TestIdentifier` and `TestDescriptor`. This
  allows the JUnit Platform Gradle Plugin and the Surefire Provider to resolve the class
  and method names through `getLegacyReportingName()` instead of using the source location.
* JAR files that contain spaces in their paths (`%20`) are now properly decoded before being
  used in classpath scanning routines.
* Updated `findNestedClasses()` in `ReflectionUtils` so that searches for nested classes also
  return inherited nested classes (regardless of whether they are static or not).

===== Deprecations and Breaking Changes

* All _test suite_ annotations from the `org.junit.platform.runner` package have been
  moved to the `org.junit.platform.suite.api` package in the new `junit-platform-suite-api`
  module. This includes annotations such as `@SelectClasses`, `@SelectPackages`, etc.
* Removed deprecated `selectNames()` name-based discovery selector from
  `DiscoverySelectors` in favor of the dedicated `selectPackage(String)`,
  `selectClass(String)`, and `selectMethod(String)` methods.
* `ClassNameFilter.includeClassNamePattern` was removed; please use
  `ClassNameFilter.includeClassNamePatterns` instead.
* `@IncludeClassNamePattern` has been removed; please use `@IncludeClassNamePatterns` instead.
* The `--hide-details` option of the `ConsoleLauncher` is deprecated; use `--details none` instead.
* The ZIP distribution containing the console launcher is no longer provided. It has been replaced
  by an executable standalone JAR distribution. For details, see the "New Features" section below.
* The `MethodSortOrder` enum in `ReflectionUtils` has been renamed to `HierarchyTraversalMode`. Those
  affected should now use `ReflectionSupport` instead of `ReflectionUtils`.
* The method `execute(LauncherDiscoveryRequest launcherDiscoveryRequest)` in `Launcher` has been
  deprecated and will be removed in milestone M5. Instead use the following new method that registers
  supplied ``TestExecutionListener``s in addition to already registered listeners but only for the
  supplied `LauncherDiscoveryRequest`:
  `execute(LauncherDiscoveryRequest launcherDiscoveryRequest, TestExecutionListener... listeners)`

===== New Features and Improvements

* Custom `TestExecutionListener` implementations can now be registered automatically via
  Java's `ServiceLoader` mechanism.
* New `getGroupId()`, `getArtifactId()`, and `getVersion()` default methods in the
  `TestEngine` API for debugging and reporting purposes. By default, package attributes
  (i.e., typically from JAR manifest attributes) are used to determine the artifact ID
  and version; whereas, the group ID is empty by default. Consult the Javadoc for
  `{TestEngine}` for details.
* Logging information for discovered test engines has been enhanced to include the group
  ID, artifact ID, and version of each test engine if available via the `getGroupId()`,
  `getArtifactId()`, and `getVersion()` methods.
* The `--scan-classpath` option of the `ConsoleLauncher` now allows to scan JAR files for tests
  when they are supplied as explicit arguments (see <<running-tests-console-launcher-options>>).
* The new `--details <Details>` option of the `ConsoleLauncher` now allows to select an output
  details mode for when tests are executed. Use one of: `none`, `flat`, `tree` or `verbose`. If
  `none` is selected, then only the summary and test failures are shown (see
  <<running-tests-console-launcher-options>>).
* The new `--details-theme <Theme>` option of the `ConsoleLauncher` now allows to select a
  theme for when tests are executed and printed as a tree. Use one of: `ascii` or `unicode`
  (see <<running-tests-console-launcher-options>>).
* An executable `junit-platform-console-standalone-{platform-version}.jar` artifact containing
  the Jupiter and Vintage test engines with all dependencies is generated by the default build
  process, stored in `junit-platform-console-standalone/build/libs`, and published to
  https://repo1.maven.org/maven2/org/junit/platform/junit-platform-console-standalone[Maven Central].
  It provides hassle-free usage of JUnit 5 in projects that manually manage their dependencies
  similar to the
  https://github.com/junit-team/junit4/wiki/Download-and-Install#plain-old-jar[plain-old JAR]
  known from JUnit 4.
* New `--exclude-classname` (`--N`) option added to the `ConsoleLauncher` accepting a regular
  expression to exclude those classes whose fully qualified names match. When this option is
  repeated, all patterns will be combined using OR semantics.
* New JUnit Platform support package `org.junit.platform.commons.support` that contains
  _maintained_ utility methods for annotation, reflection, and classpath scanning tasks.
  `TestEngine` and `Extension` authors are encouraged to use these supported methods
  in order to align with the behavior of the JUnit Platform.
* Squashed logic behind `TestDescriptor.isTest()` and `TestDescriptor.isContainer()` from two
  independent `boolean` properties into a single enumeration, namely `TestDescriptor.Type`. See
  next bullet point for details.
* Introduced `TestDescriptor.Type` enumeration with `TestDescriptor.getType()` accessor defining
  all possible descriptor types. `TestDescriptor.isTest()` and `TestDescriptor.isContainer()`
  now delegate to `TestDescriptor.Type` constants.
* Introduced `TestDescriptor.prune()` and `TestDescriptor.pruneTree()` which allow engine authors
  to customize what happens when pruning is triggered by the JUnit Platform.
* `TestIdentifier` now uses the new `TestDescriptor.Type` enumeration to store the
  underlying type. It can be retrieved via the new `TestIdentifier.getType()` method.
  Furthermore, `TestIdentifier.isTest()` and `TestIdentifier.isContainer()` now delegate
  to `TestDescriptor.Type` constants.


[[release-notes-5.0.0-m4-junit-jupiter]]
==== JUnit Jupiter

===== Bug Fixes

* Fixed bug that prevented discovery of two or more methods in the same class when
  selected via a method selector.
* `@Nested` non-static test classes are now detected when declared in super classes.
* The correct execution order of overridden `@BeforeEach` and `@AfterEach` methods is now
  enforced when declared at multiple levels within a class hierarchy. It's now always
  `super.before`, `this.before`, `this.test`, `this.after`, and `super.after`, even if
  the compiler adds synthetic methods.
* ``TestExecutionExceptionHandler``s are now invoked in the opposite order in which they
  were registered, analogous to all other "_after_" extensions.

===== Deprecations and Breaking Changes

* Removed deprecated `Assertions.expectThrows()` method in favor of `Assertions.assertThrows()`.
* ``ExtensionContext.Namespace``s composed of the same parts but in a different order are no longer considered
  equal to each other.

===== New Features and Improvements

* First-class support for _parameterized tests_ via the new `@ParameterizedTest` annotation.
  See <<writing-tests-parameterized-tests>> for details.
* First-class support for _repeated tests_ via the new `@RepeatedTest` annotation and
  `RepetitionInfo` API. See <<writing-tests-repeated-tests>> for details.
* Introduce `@TestTemplate` annotation and accompanying extension point
  `TestTemplateInvocationContextProvider`.
* `Assertions.assertThrows()` now uses canonical names for exception types when
  generating assertion failure messages.
* ``TestInstancePostProcessor``s registered on test methods are now invoked.
* New variants of `Assertions.fail`: `Assertions.fail(Throwable cause)` and
  `Assertions.fail(String message, Throwable cause)`.
* New `Assertions.assertLinesMatch()` comparing lists of strings, featuring `Object::equals`
  and regular expression checks. `assertLinesMatch()` also provides a fast-forward mechanism
  to skip lines that are expected to change in each invocation -- for example, duration,
  timestamps, stack traces, etc. Consult the JavaDoc for `{Assertions}` for details.
* Extensions can now be registered automatically via Java's `ServiceLoader` mechanism.
  See <<extensions-registration-automatic>>.


[[release-notes-5.0.0-m4-junit-vintage]]
==== JUnit Vintage

===== Bug Fixes

* Fixed bug that caused only the last failure of a test to be reported. For example, when using the
  `ErrorCollector` rule, only the last failed check was reported. Now, all failures are reported
  using an `org.opentest4j.MultipleFailuresError`.
{'fraction_non_alphanumeric': 0.08572033673955631, 'fraction_numerical': 0.004976968285063801, 'mean_word_length': 5.124513618677042, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3017327', 'n_tokens_mistral': 5035, 'n_tokens_neox': 4803, 'n_words': 2155}