Package de.unkrig.commons.junit4
Class AssertRegex
- java.lang.Object
-
- de.unkrig.commons.junit4.AssertRegex
-
public final class AssertRegex extends Object
Utility methods related to JUNIT andjava.util.regex.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidassertFind(String expectedRegex, String actual)Fails unless the expectedRegex can be found at least once in the actual string.static voidassertFind(String message, String expectedRegex, String actual)Fails with the given message unless the expectedRegex can be found at least once in the actual string.static voidassertMatches(String expectedRegex, String actual)Fails unless the actual string matches the given expectedRegex.static voidassertMatches(String message, String expectedRegex, String actual)Fails with the given message unless the actual string matches the given expectedRegex.static voidassertMatches(String message, List<String> actuals, String... expectedRegexes)Fails unless each of the actuals matches the respective regex.static voidassertMatches(String message, List<String> expectedRegexes, List<String> actuals)Fails with the given message unless each of the actuals matches the respective regex.static voidassertMatches(List<String> actuals, String... expectedRegexes)Fails unless each of the actuals matches the respective regex.static voidassertMatches(List<String> expectedRegexes, List<String> actuals)Fails unless each of the actuals matches the respective regex.
-
-
-
Method Detail
-
assertMatches
public static void assertMatches(String expectedRegex, String actual)
Fails unless the actual string matches the given expectedRegex.
-
assertMatches
public static void assertMatches(@Nullable String message, String expectedRegex, String actual)Fails with the given message unless the actual string matches the given expectedRegex.
-
assertMatches
public static void assertMatches(List<String> actuals, String... expectedRegexes)
Fails unless each of the actuals matches the respective regex.
-
assertMatches
public static void assertMatches(String message, List<String> actuals, String... expectedRegexes)
Fails unless each of the actuals matches the respective regex.
-
assertMatches
public static void assertMatches(List<String> expectedRegexes, List<String> actuals)
Fails unless each of the actuals matches the respective regex.
-
assertMatches
public static void assertMatches(@Nullable String message, List<String> expectedRegexes, List<String> actuals)Fails with the given message unless each of the actuals matches the respective regex.
-
assertFind
public static void assertFind(String expectedRegex, String actual)
Fails unless the expectedRegex can be found at least once in the actual string.
-
-