- java.lang.Object
-
- org.junit.platform.engine.discovery.FileSelector
-
- All Implemented Interfaces:
DiscoverySelector
@API(status=STABLE, since="1.0") public class FileSelector extends java.lang.Object implements DiscoverySelector
ADiscoverySelector
that selects a file so thatTestEngines
can discover tests or containers based on files in the file system.- Since:
- 1.0
- See Also:
DiscoverySelectors.selectFile(String)
,DiscoverySelectors.selectFile(File)
,DirectorySelector
,getFile()
,getPath()
,getRawPath()
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
path
private FilePosition
position
-
Constructor Summary
Constructors Constructor Description FileSelector(java.lang.String path, FilePosition position)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.io.File
getFile()
Get the selected file as aFile
.java.nio.file.Path
getPath()
Get the selected file as aPath
using the defaultFileSystem
.java.util.Optional<FilePosition>
getPosition()
Get the selected position within the file as aFilePosition
.java.lang.String
getRawPath()
Get the selected file as a raw path.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
path
private final java.lang.String path
-
position
private final FilePosition position
-
-
Constructor Detail
-
FileSelector
FileSelector(java.lang.String path, FilePosition position)
-
-
Method Detail
-
getFile
public java.io.File getFile()
Get the selected file as aFile
.- See Also:
getPath()
,getRawPath()
-
getPath
public java.nio.file.Path getPath()
Get the selected file as aPath
using the defaultFileSystem
.- See Also:
getFile()
,getRawPath()
-
getRawPath
public java.lang.String getRawPath()
Get the selected file as a raw path.
-
getPosition
public java.util.Optional<FilePosition> getPosition()
Get the selected position within the file as aFilePosition
.
-
equals
@API(status=STABLE, since="1.3") public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
- Since:
- 1.3
-
hashCode
@API(status=STABLE, since="1.3") public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
- Since:
- 1.3
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-