Class PackageContainerGroupAssert

  • Constructor Details

  • Method Details

    • allFilesExist

      Assert that all given files exist.
      Parameters:
      paths - paths to check for.
      Returns:
      this object for further call chaining.
      Throws:
      AssertionError - if the container group is null, or if any of the files do not exist.
      NullPointerException - if any of the paths are null.
      IllegalArgumentException - if no fragments are provided.
    • allFilesExist

      Assert that all given files exist.
      Parameters:
      paths - paths to check for.
      Returns:
      this object for further call chaining.
      Throws:
      AssertionError - if the container group is null, or if any of the files do not exist.
      NullPointerException - if any of the paths are null.
    • classLoader

      Get assertions to perform on the class loader associated with this container group.
      Returns:
      the assertions to perform.
      Throws:
      AssertionError - if the container group is null.
    • fileDoesNotExist

      Assert that the given file does not exist.
      
         // Using platform-specific separators.
         assertions.fileDoesNotExist("foo/bar/baz.txt")...;
      
         // Letting JCT infer the correct path separators to use (recommended).
         assertions.fileDoesNotExist("foo", "bar", "baz.txt");
       
      Parameters:
      fragments - any additional parts of the path.
      Returns:
      this assertion object for further assertions.
      Throws:
      AssertionError - if the file exists, or if the container group is null.
      NullPointerException - if any of the fragments are null.
      IllegalArgumentException - if no fragments are provided.
    • fileExists

      public AbstractPathAssert<?> fileExists(String... fragments)
      Assert that the given file exists.
      
         // Letting JCT infer the correct path separators to use (recommended).
         assertions.fileExists("foo", "bar", "baz.txt");
      
         // Using platform-specific separators (more likely to produce unexpected results).
         assertions.fileExists("foo/bar/baz.txt")...;
       

      If the file does not exist, then this object will attempt to find the closest matches and list them in an error message along with the assertion error.

      Parameters:
      fragments - parts of the path.
      Returns:
      assertions to perform on the path of the file that exists.
      Throws:
      AssertionError - if the file does not exist, or if the container group is null.
      NullPointerException - if any of the fragments are null.
      IllegalArgumentException - if no fragments are provided.