Class FileSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.FileSource
-
- All Implemented Interfaces:
Serializable
,FileSystemSource
,UriSource
,TestSource
@API(status=STABLE, since="1.0") public class FileSource extends Object implements FileSystemSource
File basedTestSource
with an optional position.- Since:
- 1.0
- See Also:
FileSelector
, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static FileSource
from(File file)
Create a newFileSource
using the suppliedfile
.static FileSource
from(File file, FilePosition filePosition)
File
getFile()
Get the source file.Optional<FilePosition>
getPosition()
Get theFilePosition
, if available.URI
getUri()
int
hashCode()
String
toString()
-
-
-
Method Detail
-
from
public static FileSource from(File file)
Create a newFileSource
using the suppliedfile
.- Parameters:
file
- the source file; must not benull
-
from
public static FileSource from(File file, FilePosition filePosition)
- Parameters:
file
- the source file; must not benull
filePosition
- the position in the source file; may benull
-
getUri
public final URI getUri()
-
getFile
public final File getFile()
Get the source file.- Specified by:
getFile
in interfaceFileSystemSource
- Returns:
- the source file; never
null
-
getPosition
public final Optional<FilePosition> getPosition()
Get theFilePosition
, if available.
-
-