Class ClasspathResourceSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.ClasspathResourceSource
-
- All Implemented Interfaces:
Serializable,TestSource
@API(status=STABLE, since="1.0") public class ClasspathResourceSource extends Object implements TestSource
Classpath resource basedTestSourcewith an optional position.- Since:
- 1.0
- See Also:
ClasspathResourceSelector, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static ClasspathResourceSourcefrom(String classpathResourceName)Create a newClasspathResourceSourceusing the supplied classpath resource name.static ClasspathResourceSourcefrom(String classpathResourceName, FilePosition filePosition)Create a newClasspathResourceSourceusing the supplied classpath resource name andFilePosition.StringgetClasspathResourceName()Get the name of the source classpath resource.Optional<FilePosition>getPosition()Get theFilePosition, if available.inthashCode()StringtoString()
-
-
-
Method Detail
-
from
public static ClasspathResourceSource from(String classpathResourceName)
Create a newClasspathResourceSourceusing the supplied classpath resource name.The name of a classpath resource must follow the semantics for resource paths as defined in
ClassLoader.getResource(String).If the supplied classpath resource name is prefixed with a slash (
/), the slash will be removed.- Parameters:
classpathResourceName- the name of the classpath resource; nevernullor blank- See Also:
ClassLoader.getResource(String),ClassLoader.getResourceAsStream(String),ClassLoader.getResources(String)
-
from
public static ClasspathResourceSource from(String classpathResourceName, FilePosition filePosition)
Create a newClasspathResourceSourceusing the supplied classpath resource name andFilePosition.The name of a classpath resource must follow the semantics for resource paths as defined in
ClassLoader.getResource(String).If the supplied classpath resource name is prefixed with a slash (
/), the slash will be removed.- Parameters:
classpathResourceName- the name of the classpath resource; nevernullor blankfilePosition- the position in the classpath resource; may benull
-
getClasspathResourceName
public String getClasspathResourceName()
Get the name of the source classpath resource.The name of a classpath resource follows the semantics for resource paths as defined in
ClassLoader.getResource(String).
-
getPosition
public final Optional<FilePosition> getPosition()
Get theFilePosition, if available.
-
-