Package org.apache.rat.testhelpers
Class TextUtils
java.lang.Object
org.apache.rat.testhelpers.TextUtils
Utilities to assert text appears or does not appear in text.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertPatternInTarget(String pattern, String target) Deprecated.use assertThat(target).containsPattern(pattern)static voidassertPatternNotInTarget(String pattern, String target) Deprecated.use assertThat(target).doesNotContainPattern(pattern)static booleanisMatching(String pattern, String target) Deprecated.use assertThat(target).matches(pattern)static StringRead given file as UTF-8.
-
Field Details
-
EMPTY
An empty list of strings.
-
-
Constructor Details
-
TextUtils
public TextUtils()
-
-
Method Details
-
assertPatternInTarget
Deprecated.use assertThat(target).containsPattern(pattern)Asserts a regular expression pattern is in a given string.- Parameters:
pattern- the pattern to match.target- the string to match.
-
assertPatternNotInTarget
Deprecated.use assertThat(target).doesNotContainPattern(pattern)Asserts a regular expression pattern is not in a string.- Parameters:
pattern- the pattern to match.target- the string to match.
-
isMatching
Deprecated.use assertThat(target).matches(pattern)Determines if a regular expression pattern is in a string.- Parameters:
pattern- the pattern to match.target- the string to match.- Returns:
trueif a regular expression pattern is in a string.
-
readFile
Read given file as UTF-8.- Parameters:
f- File to read from.- Returns:
- contents of the file as UTF-8.
- Throws:
IOException- in case of I/O-errors.
-