Package org.junitpioneer.jupiter.resource


package org.junitpioneer.jupiter.resource
This package contains various classes pertaining to "resources": anything that needs to be injected into tests and which may need to be started up or torn down. A common example is a temporary directory.

Check out the following types for details on the "temporary directory" extension:

Check out the following types for details on resources in general:

  • Class
    Description
    @Dir is a shorthand for @New(TemporaryDirectory.class).
    @New is used to create a new resource.
     
    Resource is the common interface for "resources", as managed by ResourceFactory implementations.
     
    ResourceFactory is the common interface for "resource factories", which are responsible for creating Resources.
    @Shared is used to create a resource that is shared with multiple tests.
    Scope specifies how long a shared resource lives.
    TemporaryDirectory is a "resource factory" implementation that, combined with @New or @Shared, allows for the creation of temporary directories that can be used by individual tests or shared across multiple tests.