Skip to content

Commit

Permalink
Deprecate @UseTechnicalNames
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sbrannen committed Sep 19, 2021
1 parent 49e1901 commit 155a25f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions documentation/src/docs/asciidoc/user-guide/running-tests.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
<<junit-platform-suite-engine>> 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.
====
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
}

0 comments on commit 155a25f

Please sign in to comment.