Skip to content

Commit 155a25f

Browse files
committed
Deprecate @UseTechnicalNames
The JUnitPlatform runner was deprecated in 5.8.0. This commit deprecates the @UseTechnicalNames annotation, since @UseTechnicalNames is only used by the JUnitPlatform runner. Closes #2720
1 parent 49e1901 commit 155a25f

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

documentation/src/docs/asciidoc/release-notes/release-notes-5.8.1.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ GitHub.
1919

2020
==== Deprecations and Breaking Changes
2121

22-
* ❓
22+
* `@UseTechnicalNames` has been deprecated in favor of the new `@Suite` support which does
23+
not require the use of technical names. See the warning in
24+
<<../user-guide/index.adoc#running-tests-junit-platform-runner, Using JUnit 4 to run the
25+
JUnit Platform>> for details.
2326

2427
==== New Features and Improvements
2528

documentation/src/docs/asciidoc/user-guide/running-tests.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,8 @@ In addition, the introduction of `@Suite` support provided by the
617617
`junit-platform-suite-engine` module makes the `JUnitPlatform` runner obsolete. See
618618
<<junit-platform-suite-engine>> for details.
619619
620-
The `JUnitPlatform` runner has therefore been deprecated in JUnit Platform 1.8 and will be
621-
removed in JUnit Platform 2.0.
620+
The `JUnitPlatform` runner and `@UseTechnicalNames` annotation have therefore been
621+
deprecated in JUnit Platform 1.8 and will be removed in JUnit Platform 2.0.
622622
623623
If you are using the `JUnitPlatform` runner, please migrate to the `@Suite` support.
624624
====

junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatform.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import org.junit.platform.suite.api.SelectUris;
4848
import org.junit.platform.suite.api.Suite;
4949
import org.junit.platform.suite.api.SuiteDisplayName;
50-
import org.junit.platform.suite.api.UseTechnicalNames;
5150
import org.junit.platform.suite.commons.SuiteLauncherDiscoveryRequestBuilder;
5251
import org.junit.runner.Description;
5352
import org.junit.runner.Runner;
@@ -104,7 +103,7 @@
104103
* @see IncludeTags
105104
* @see ExcludeTags
106105
* @see SuiteDisplayName
107-
* @see UseTechnicalNames
106+
* @see org.junit.platform.suite.api.UseTechnicalNames UseTechnicalNames
108107
* @see ConfigurationParameter
109108
* @deprecated since 1.8, in favor of the {@link Suite @Suite} support provided by
110109
* the {@code junit-platform-suite-engine} module; to be removed in JUnit Platform 2.0

junit-platform-runner/src/main/java/org/junit/platform/runner/JUnitPlatformTestTree.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.junit.platform.launcher.TestIdentifier;
3131
import org.junit.platform.launcher.TestPlan;
3232
import org.junit.platform.suite.api.SuiteDisplayName;
33-
import org.junit.platform.suite.api.UseTechnicalNames;
3433
import org.junit.runner.Description;
3534
import org.junit.runner.manipulation.Filter;
3635

@@ -54,8 +53,9 @@ public TestPlan getTestPlan() {
5453
return testPlan;
5554
}
5655

56+
@SuppressWarnings("deprecation")
5757
private static boolean useTechnicalNames(Class<?> testClass) {
58-
return testClass.isAnnotationPresent(UseTechnicalNames.class);
58+
return testClass.isAnnotationPresent(org.junit.platform.suite.api.UseTechnicalNames.class);
5959
}
6060

6161
Description getSuiteDescription() {

junit-platform-suite-api/src/main/java/org/junit/platform/suite/api/UseTechnicalNames.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
package org.junit.platform.suite.api;
1212

13-
import static org.apiguardian.api.API.Status.MAINTAINED;
13+
import static org.apiguardian.api.API.Status.DEPRECATED;
1414

1515
import java.lang.annotation.Documented;
1616
import java.lang.annotation.ElementType;
@@ -43,11 +43,14 @@
4343
*
4444
* @since 1.0
4545
* @see org.junit.platform.runner.JUnitPlatform
46+
* @deprecated since 1.8, in favor of the {@link Suite @Suite} support provided by
47+
* the {@code junit-platform-suite-engine} module; to be removed in JUnit Platform 2.0
4648
*/
4749
@Retention(RetentionPolicy.RUNTIME)
4850
@Target(ElementType.TYPE)
4951
@Inherited
5052
@Documented
51-
@API(status = MAINTAINED, since = "1.0")
53+
@API(status = DEPRECATED, since = "1.8")
54+
@Deprecated
5255
public @interface UseTechnicalNames {
5356
}

0 commit comments

Comments
 (0)