Class BaseTestHelper.TestResource

java.lang.Object
it.tidalwave.util.test.BaseTestHelper.TestResource
Enclosing class:
BaseTestHelper

public final class BaseTestHelper.TestResource extends Object
A manipulator of a pair of (actual file, expected file).
  • Constructor Details

    • TestResource

      public TestResource()
  • Method Details

    • assertActualFileContentSameAsExpected

      public void assertActualFileContentSameAsExpected() throws IOException
      Assert that the content of the actual file are the same as the expected file.
      Throws:
      IOException - in case of error
    • writeToActualFile

      public void writeToActualFile(@Nonnull String... strings) throws IOException
      Writes the given strings to the actual file.
      Parameters:
      strings - the strings
      Throws:
      IOException - in case of error
    • writeToActualFile

      public void writeToActualFile(@Nonnull Iterable<String> strings) throws IOException
      Writes the given strings to the actual file.
      Parameters:
      strings - the strings
      Throws:
      IOException - in case of error
    • writeToActualFile

      public void writeToActualFile(@Nonnull byte[] bytes) throws IOException
      Writes the given bytes to the actual file.
      Parameters:
      bytes - the bytes
      Throws:
      IOException - in case of error
    • readStringFromResource

      @Nonnull public String readStringFromResource() throws IOException
      Reads the content from the resource file as a single string.
      Returns:
      the string
      Throws:
      IOException - in case of error