Skip to content

Commit

Permalink
HHH-16497 Deprecate JUnit 4 testing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere authored and beikov committed Apr 25, 2023
1 parent 20842f8 commit 9ba296e
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 0 deletions.
Expand Up @@ -17,8 +17,18 @@
* except this annotation need not be attached to a static method
*
* @author Steve Ebersole
* @deprecated Use JUnit 5 along with one of the Hibernate ORM's class-level test annotations
* ({@link org.hibernate.testing.orm.junit.BaseUnitTest},
* {@link org.hibernate.testing.orm.junit.SessionFactory},
* {@link org.hibernate.testing.orm.junit.Jpa},
* {@link org.hibernate.testing.orm.junit.SessionFactoryFunctionalTesting},
* {@link org.hibernate.testing.orm.junit.ServiceRegistryFunctionalTesting}, ...)
* and {@link org.junit.jupiter.api.AfterAll}.
* Alternatively to the Hibernate ORM test annotations,
* you can use {@code @TestInstance(TestInstance.Lifecycle.PER_CLASS)} directly on your test.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Deprecated(forRemoval = true)
public @interface AfterClassOnce {
}
Expand Up @@ -17,8 +17,18 @@
* except this annotation need not be attached to a static method
*
* @author Steve Ebersole
* @deprecated Use JUnit 5 along with one of the Hibernate ORM's class-level test annotations
* ({@link org.hibernate.testing.orm.junit.BaseUnitTest},
* {@link org.hibernate.testing.orm.junit.SessionFactory},
* {@link org.hibernate.testing.orm.junit.Jpa},
* {@link org.hibernate.testing.orm.junit.SessionFactoryFunctionalTesting},
* {@link org.hibernate.testing.orm.junit.ServiceRegistryFunctionalTesting}, ...)
* and {@link org.junit.jupiter.api.BeforeAll}.
* Alternatively to the Hibernate ORM test annotations,
* you can use {@code @TestInstance(TestInstance.Lifecycle.PER_CLASS)} directly on your test.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Deprecated(forRemoval = true)
public @interface BeforeClassOnce {
}
Expand Up @@ -16,9 +16,11 @@
*
* @author Hardy Ferentschik
* @author Steve Ebersole
* @deprecated Use JUnit 5 and {@link org.hibernate.testing.orm.junit.FailureExpected} instead.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Deprecated(forRemoval = true)
public @interface FailureExpected {
String VALIDATE_FAILURE_EXPECTED = "hibernate.test.validatefailureexpected";

Expand Down
Expand Up @@ -15,8 +15,10 @@
* Annotation used to identify a method as a callback to be executed whenever a {@link FailureExpected} is handled.
*
* @author Steve Ebersole
* @deprecated No replacement with JUnit 5 at the moment.
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.METHOD )
@Deprecated(forRemoval = true)
public @interface OnExpectedFailure {
}
Expand Up @@ -15,8 +15,10 @@
* Annotation used to identify a method as a callback to be executed on test failures.
*
* @author Steve Ebersole
* @deprecated No replacement with JUnit 5 at the moment.
*/
@Retention( RetentionPolicy.RUNTIME )
@Target( ElementType.METHOD )
@Deprecated(forRemoval = true)
public @interface OnFailure {
}
Expand Up @@ -21,10 +21,12 @@
* @see RequiresDialects
*
* @author Hardy Ferentschik
* @deprecated Use JUnit 5 and {@link org.hibernate.testing.orm.junit.RequiresDialect} instead.
*/
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(RequiresDialects.class)
@Deprecated(forRemoval = true)
public @interface RequiresDialect {
/**
* The dialects against which to run the test
Expand Down
Expand Up @@ -16,9 +16,11 @@
* specified feature.
*
* @author Hardy Ferentschik
* @deprecated Use JUnit 5 and {@link org.hibernate.testing.orm.junit.RequiresDialectFeature} instead.
*/
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Deprecated(forRemoval = true)
public @interface RequiresDialectFeature {
/**
* @return Class which checks the necessary dialect feature
Expand Down
Expand Up @@ -16,9 +16,11 @@
* Useful when test needs to be run against more than one dialect because of a different reason.
*
* @author Lukasz Antoniak
* @deprecated Use JUnit 5 and {@link org.hibernate.testing.orm.junit.RequiresDialects} instead.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Deprecated(forRemoval = true)
public @interface RequiresDialects {
RequiresDialect[] value();
}
Expand Up @@ -15,9 +15,12 @@
* An annotation, used in combination with {@link Matcher}, to determine when/if tests should be skipped.
*
* @author Steve Ebersole
* @deprecated Use JUnit 5 and {@link org.junit.jupiter.api.condition.DisabledOnOs}
* or {@link org.junit.jupiter.api.condition.DisabledIf}.
*/
@Retention( RetentionPolicy.RUNTIME )
@Target({ ElementType.METHOD, ElementType.TYPE })
@Deprecated(forRemoval = true)
public @interface Skip {
/**
* The condition which causes a skip
Expand Down
Expand Up @@ -22,10 +22,12 @@
*
* @author Hardy Ferentschik
* @author Steve Ebersole
* @deprecated Use JUnit 5 and {@link org.hibernate.testing.orm.junit.SkipForDialect} instead.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Repeatable(SkipForDialects.class)
@Deprecated(forRemoval = true)
public @interface SkipForDialect {
/**
* The dialects against which to skip the test
Expand Down
Expand Up @@ -16,9 +16,11 @@
* Useful when more than one dialect needs to be skipped because of a different reason.
*
* @author Lukasz Antoniak
* @deprecated Use JUnit 5 and {@link org.hibernate.testing.orm.junit.SkipForDialectGroup} instead.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Deprecated(forRemoval = true)
public @interface SkipForDialects {
SkipForDialect[] value();
}
Expand Up @@ -15,9 +15,11 @@
* A documentation annotation for notating what JIRA issue is being tested.
*
* @author Steve Ebersole
* @deprecated Use {@link org.hibernate.testing.orm.junit.JiraKey} instead.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Deprecated(forRemoval = true)
public @interface TestForIssue {
/**
* The key of a JIRA issue tested.
Expand Down

0 comments on commit 9ba296e

Please sign in to comment.