Top Description Fields Constructors Methods
org.junit.jupiter.migrationsupport.rules

public Class ExternalResourceSupport

extends Object
implements BeforeEachCallback, AfterEachCallback
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.BeforeEachCallback
Annotations
@SuppressWarnings:removal
@API
status:DEPRECATED
since:6.0
@Deprecated
since:6.0
forRemoval:true
Static Imports
org.apiguardian.api.API.Status.DEPRECATED

Deprecated

for removal since 6.0.

Please use @AutoClose instead.

This Extension provides native support for subclasses of the ExternalResource rule from JUnit 4.

@Rule-annotated fields as well as methods are supported.

By using this class-level extension on a test class such ExternalResource implementations in legacy code bases can be left unchanged including the JUnit 4 rule import statements.

However, if you intend to develop a new extension for JUnit please use the new extension model of JUnit Jupiter instead of the rule-based model of JUnit 4.

Since
5.0
See Also
org.junit.rules.ExternalResource, org.junit.rules.TestRule, org.junit.Rule

Field Summary

Modifier and TypeField and Description
private final TestRuleSupport

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
afterEach(ExtensionContext context)

Implements org.junit.jupiter.api.extension.AfterEachCallback.afterEach.

Callback that is invoked after an individual test and any user-defined teardown methods for that test have been executed.

public void
beforeEach(ExtensionContext context)

Implements org.junit.jupiter.api.extension.BeforeEachCallback.beforeEach.

Callback that is invoked before an individual test and any user-defined setup methods for that test have been executed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

supportback to summary
private final TestRuleSupport support

Constructor Detail

ExternalResourceSupportback to summary
public ExternalResourceSupport()

Method Detail

afterEachback to summary
public void afterEach(ExtensionContext context) throws Exception

Implements org.junit.jupiter.api.extension.AfterEachCallback.afterEach.

Doc from org.junit.jupiter.api.extension.AfterEachCallback.afterEach.

Callback that is invoked after an individual test and any user-defined teardown methods for that test have been executed.

Annotations
@Override
beforeEachback to summary
public void beforeEach(ExtensionContext context) throws Exception

Implements org.junit.jupiter.api.extension.BeforeEachCallback.beforeEach.

Doc from org.junit.jupiter.api.extension.BeforeEachCallback.beforeEach.

Callback that is invoked before an individual test and any user-defined setup methods for that test have been executed.

Annotations
@Override