Package it.tidalwave.util.test
Class BaseTestHelper.TestResource
- java.lang.Object
-
- it.tidalwave.util.test.BaseTestHelper.TestResource
-
- Enclosing class:
- BaseTestHelper
public final class BaseTestHelper.TestResource extends java.lang.ObjectA manipulator of a pair of (actual file, expected file).
-
-
Constructor Summary
Constructors Constructor Description TestResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertActualFileContentSameAsExpected()Assert that the content of the actual file are the same as the expected file.java.lang.StringreadStringFromResource()Reads the content from the resource file as a single string.voidwriteToActualFile(byte[] bytes)Writes the given bytes to the actual file.voidwriteToActualFile(java.lang.Iterable<java.lang.String> strings)Writes the given strings to the actual file.voidwriteToActualFile(java.lang.String... strings)Writes the given strings to the actual file.
-
-
-
Method Detail
-
assertActualFileContentSameAsExpected
public void assertActualFileContentSameAsExpected() throws java.io.IOExceptionAssert that the content of the actual file are the same as the expected file.- Throws:
java.io.IOException- in case of error
-
writeToActualFile
public void writeToActualFile(@Nonnull java.lang.String... strings) throws java.io.IOExceptionWrites the given strings to the actual file.- Parameters:
strings- the strings- Throws:
java.io.IOException- in case of error
-
writeToActualFile
public void writeToActualFile(@Nonnull java.lang.Iterable<java.lang.String> strings) throws java.io.IOExceptionWrites the given strings to the actual file.- Parameters:
strings- the strings- Throws:
java.io.IOException- in case of error
-
writeToActualFile
public void writeToActualFile(@Nonnull byte[] bytes) throws java.io.IOExceptionWrites the given bytes to the actual file.- Parameters:
bytes- the bytes- Throws:
java.io.IOException- in case of error
-
readStringFromResource
@Nonnull public java.lang.String readStringFromResource() throws java.io.IOExceptionReads the content from the resource file as a single string.- Returns:
- the string
- Throws:
java.io.IOException- in case of error
-
-