Class ExternalResourceSupport

java.lang.Object
org.junit.jupiter.migrationsupport.rules.ExternalResourceSupport
All Implemented Interfaces:
AfterEachCallback, BeforeEachCallback, Extension

@API(status=DEPRECATED, since="6.0") @Deprecated(since="6.0", forRemoval=true) public class ExternalResourceSupport extends Object implements BeforeEachCallback, AfterEachCallback
Deprecated, for removal: This API element is subject to removal in a future version.
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:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Callback that is invoked after an individual test and any user-defined teardown methods for that test have been executed.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Callback that is invoked before an individual test and any user-defined setup methods for that test have been executed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExternalResourceSupport

      public ExternalResourceSupport()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • beforeEach

      public void beforeEach(ExtensionContext context) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: BeforeEachCallback
      Callback that is invoked before an individual test and any user-defined setup methods for that test have been executed.
      Specified by:
      beforeEach in interface BeforeEachCallback
      Parameters:
      context - the current extension context; never null
      Throws:
      Exception
    • afterEach

      public void afterEach(ExtensionContext context) throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: AfterEachCallback
      Callback that is invoked after an individual test and any user-defined teardown methods for that test have been executed.
      Specified by:
      afterEach in interface AfterEachCallback
      Parameters:
      context - the current extension context; never null
      Throws:
      Exception