diff --git a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.1.adoc b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.1.adoc index 494441237f53..5dac02309d22 100644 --- a/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.1.adoc +++ b/documentation/src/docs/asciidoc/release-notes/release-notes-5.8.1.adoc @@ -19,7 +19,10 @@ GitHub. ==== Deprecations and Breaking Changes -* ❓ +* `@UseTechnicalNames` has been deprecated in favor of the new `@Suite` support which does + not require the use of technical names. See the warning in + <<../user-guide/index.adoc#running-tests-junit-platform-runner, Using JUnit 4 to run the + JUnit Platform>> for details. ==== New Features and Improvements diff --git a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc index ca81e93082ee..f72a7bdd5d0a 100644 --- a/documentation/src/docs/asciidoc/user-guide/running-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/running-tests.adoc @@ -617,8 +617,8 @@ In addition, the introduction of `@Suite` support provided by the `junit-platform-suite-engine` module makes the `JUnitPlatform` runner obsolete. See <> for details. -The `JUnitPlatform` runner has therefore been deprecated in JUnit Platform 1.8 and will be -removed in JUnit Platform 2.0. +The `JUnitPlatform` runner and `@UseTechnicalNames` annotation have therefore been +deprecated in JUnit Platform 1.8 and will be removed in JUnit Platform 2.0. If you are using the `JUnitPlatform` runner, please migrate to the `@Suite` support. ==== 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 1a9823ad6643..c01f4ed55d2c 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 @@ -47,7 +47,6 @@ import org.junit.platform.suite.api.SelectUris; import org.junit.platform.suite.api.Suite; 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; @@ -104,7 +103,7 @@ * @see IncludeTags * @see ExcludeTags * @see SuiteDisplayName - * @see UseTechnicalNames + * @see org.junit.platform.suite.api.UseTechnicalNames UseTechnicalNames * @see ConfigurationParameter * @deprecated since 1.8, in favor of the {@link Suite @Suite} support provided by * the {@code junit-platform-suite-engine} module; to be removed in JUnit Platform 2.0 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 631dab46556a..dae56a23aad7 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 @@ -30,7 +30,6 @@ import org.junit.platform.launcher.TestIdentifier; import org.junit.platform.launcher.TestPlan; import org.junit.platform.suite.api.SuiteDisplayName; -import org.junit.platform.suite.api.UseTechnicalNames; import org.junit.runner.Description; import org.junit.runner.manipulation.Filter; @@ -54,8 +53,9 @@ public TestPlan getTestPlan() { return testPlan; } + @SuppressWarnings("deprecation") private static boolean useTechnicalNames(Class testClass) { - return testClass.isAnnotationPresent(UseTechnicalNames.class); + return testClass.isAnnotationPresent(org.junit.platform.suite.api.UseTechnicalNames.class); } Description getSuiteDescription() { 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 32ede2d0aa3a..cef0ab2cb37e 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 @@ -10,7 +10,7 @@ package org.junit.platform.suite.api; -import static org.apiguardian.api.API.Status.MAINTAINED; +import static org.apiguardian.api.API.Status.DEPRECATED; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; @@ -43,11 +43,14 @@ * * @since 1.0 * @see org.junit.platform.runner.JUnitPlatform + * @deprecated since 1.8, in favor of the {@link Suite @Suite} support provided by + * the {@code junit-platform-suite-engine} module; to be removed in JUnit Platform 2.0 */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Inherited @Documented -@API(status = MAINTAINED, since = "1.0") +@API(status = DEPRECATED, since = "1.8") +@Deprecated public @interface UseTechnicalNames { }