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 based TestSource with an optional position.
Since:
1.0
See Also:
  • Method Details

    • from

      public static FileSource from(File file)
      Create a new FileSource using the supplied file.
      Parameters:
      file - the source file; must not be null
    • from

      public static FileSource from(File file, FilePosition filePosition)
      Create a new FileSource using the supplied file and filePosition.
      Parameters:
      file - the source file; must not be null
      filePosition - the position in the source file; may be null
    • getUri

      public final URI getUri()
      Get the URI for the source file.
      Specified by:
      getUri in interface UriSource
      Returns:
      the source URI; never null
    • getFile

      public final File getFile()
      Get the source file.
      Specified by:
      getFile in interface FileSystemSource
      Returns:
      the source file; never null
    • getPosition

      public final Optional<FilePosition> getPosition()
      Get the FilePosition, if available.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object