ResourceSupport provides static utility methods for common tasks
dealing with resources; for example, scanning for resources on the class path
or module path.
TestEngine and extension
authors are encouraged to use these supported methods in order to align with
the behavior of the JUnit Platform.
AnnotationSupport, ClassSupport, ModifierSupport, ReflectionSupport
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static List | Returns: an immutable list of all such resources found; nevernull
but potentially emptythe URI for the classpath root in which to scan; never
root, ResourceFilter nullthe resource type filter; never resourceFilter)nullFind all resources in the supplied classpath |
| public static List | Returns: an immutable list of all such resources found; nevernull
but potentially emptythe name of the module to scan; never moduleName, ResourceFilter null or
emptythe resource type filter; never resourceFilter)nullFind all resources in the supplied |
| public static List | Returns: an immutable list of all such classes found; nevernull
but potentially emptythe name of the base package in which to start
scanning; must not be basePackageName, ResourceFilter null and must be valid in terms of Java
syntaxthe resource type filter; never resourceFilter)nullFind all resources in the supplied |
| public static Stream | Returns: a stream of all such classes found; nevernull
but potentially emptythe URI for the classpath root in which to scan; never
root, ResourceFilter nullthe resource type filter; never resourceFilter)nullFind all resources in the supplied classpath |
| public static Stream | Returns: a stream of all such resources found; nevernull
but potentially emptythe name of the module to scan; never moduleName, ResourceFilter null or
emptythe resource type filter; never resourceFilter)nullFind all resources in the supplied |
| public static Stream | Returns: a stream of all such resources found; nevernull
but potentially emptythe name of the base package in which to start
scanning; must not be basePackageName, ResourceFilter null and must be valid in terms of Java
syntaxthe resource type filter; never resourceFilter)nullFind all resources in the supplied |
| public static Try | Returns: a successfulTry containing the set of loaded resources
(potentially empty) or a failed Try containing the exception in
case a failure occurred while trying to list resources; never
nullthe name of the resource to load; never
classpathResourceName)null or blankTry to get the resources for the supplied classpath resource name. |
| public static Try | Returns: a successfulTry containing the set of loaded resources
(potentially empty) or a failed Try containing the exception in
case a failure occurred while trying to list resources; never
nullthe name of the resource to load; never
classpathResourceName, ClassLoader null or blankthe classLoader)ClassLoader to use; never nullTry to load the resources for the supplied classpath
resource name, using the supplied |
| ResourceSupport | back to summary |
|---|---|
| private ResourceSupport() | |
| findAllResourcesInClasspathRoot | back to summary |
|---|---|
| public static List Find all resources in the supplied classpath The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
| |
| findAllResourcesInModule | back to summary |
|---|---|
| public static List Find all resources in the supplied The module-path scanning algorithm searches recursively in all packages contained in the module.
| |
| findAllResourcesInPackage | back to summary |
|---|---|
| public static List Find all resources in the supplied The classpath scanning algorithm searches recursively in subpackages beginning within the supplied base package. The resulting list may include identically named resources from different classpath roots.
| |
| streamAllResourcesInClasspathRoot | back to summary |
|---|---|
| public static Stream Find all resources in the supplied classpath The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.
| |
| streamAllResourcesInModule | back to summary |
|---|---|
| public static Stream Find all resources in the supplied The module-path scanning algorithm searches recursively in all packages contained in the module.
| |
| streamAllResourcesInPackage | back to summary |
|---|---|
| public static Stream Find all resources in the supplied The classpath scanning algorithm searches recursively in subpackages beginning within the supplied base package. The resulting stream may include identically named resources from different classpath roots.
| |
| tryToGetResources | back to summary |
|---|---|
| public static Try Try to get the resources for the supplied classpath resource name. The name of a classpath resource must follow the semantics
for resource paths as defined in If the supplied classpath resource name is prefixed with a slash
(
| |
| tryToGetResources | back to summary |
|---|---|
| public static Try Try to load the resources for the supplied classpath
resource name, using the supplied The name of a classpath resource must follow the semantics
for resource paths as defined in If the supplied classpath resource name is prefixed with a slash
(
| |