Class FileSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.FileSource
-
- All Implemented Interfaces:
java.io.Serializable
,FileSystemSource
,UriSource
,TestSource
@API(status=STABLE, since="1.0") public class FileSource extends java.lang.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(java.lang.Object o)
static FileSource
from(java.io.File file)
Create a newFileSource
using the suppliedfile
.static FileSource
from(java.io.File file, FilePosition filePosition)
java.io.File
getFile()
Get the source file.java.util.Optional<FilePosition>
getPosition()
Get theFilePosition
, if available.java.net.URI
getUri()
Get theURI
for the source file.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
from
public static FileSource from(java.io.File file)
Create a newFileSource
using the suppliedfile
.- Parameters:
file
- the source file; must not benull
-
from
public static FileSource from(java.io.File file, FilePosition filePosition)
- Parameters:
file
- the source file; must not benull
filePosition
- the position in the source file; may benull
-
getUri
public final java.net.URI getUri()
Get theURI
for the source file.
-
getFile
public final java.io.File getFile()
Get the source file.- Specified by:
getFile
in interfaceFileSystemSource
- Returns:
- the source file; never
null
-
getPosition
public final java.util.Optional<FilePosition> getPosition()
Get theFilePosition
, if available.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-