Class ArtifactPaths

java.lang.Object
io.klib.swtbot.support.ArtifactPaths

public final class ArtifactPaths extends Object
Creates isolated run/test directories and reserves unique PNG artifact paths.
  • Constructor Details

    • ArtifactPaths

      public ArtifactPaths(Path root, String testId) throws IOException
      Creates a new run directory below the normalized absolute output root. Test identifiers are sanitized and limited to 80 characters.
      Parameters:
      root - writable output root; created if absent
      testId - non-null test identifier
      Throws:
      IOException - if directories cannot be created or the root is not writable
      NullPointerException - if an argument is null
  • Method Details

    • directory

      public Path directory()
      Returns this run's test directory.
      Returns:
      the absolute directory dedicated to this run and test
    • allocate

      public Path allocate(String checkpoint, String mode) throws IOException
      Reserves a unique empty file, not a completed screenshot.
      Parameters:
      checkpoint - non-null checkpoint name, sanitized and bounded
      mode - non-null mode label, sanitized and bounded
      Returns:
      path to a newly created empty PNG file within directory()
      Throws:
      IOException - if the file cannot be created
      NullPointerException - if a name is null