public final class CommonsTestingMatchers extends Object
| Modifier | Constructor and Description |
|---|---|
private |
CommonsTestingMatchers()
Hidden for pure static class.
|
| Modifier and Type | Method and Description |
|---|---|
static Matcher<Integer> |
closeTo(int operand,
int error)
Creates matcher to check if an integer is close to expected.
|
static Matcher<Long> |
closeTo(long operand,
long error)
Creates matcher to check if an long is close to expected.
|
static <T extends ApplicationException> |
hasExitCode(ExitCode expectedExitCode)
Creates a matcher to test if a
ApplicationException has a particular exit code. |
static <T extends ApplicationException> |
hasExitCode(int expectedExitCode)
Creates a matcher to test if a
ApplicationException has a particular exit code. |
static Matcher<Throwable> |
hasMessage(Matcher<? super String> messageTextMatcher)
Creates a matcher to test if a
Throwable has a particular message. |
private CommonsTestingMatchers()
public static Matcher<Integer> closeTo(int operand, int error)
operand - the expected value of matching doubleserror - the delta (+/-) within which matches will be allowednull, always new instanceIntegerIsCloseTopublic static Matcher<Long> closeTo(long operand, long error)
operand - the expected value of matching doubleserror - the delta (+/-) within which matches will be allowednull, always new instanceLongIsCloseTopublic static Matcher<Throwable> hasMessage(Matcher<? super String> messageTextMatcher)
Throwable has a particular message.messageTextMatcher - matcher for actual message., not null.null, always new instanceHasMessagepublic static <T extends ApplicationException> Matcher<T> hasExitCode(ExitCode expectedExitCode)
ApplicationException has a particular exit code.T - type of matched exceptionexpectedExitCode - must not be nullnull, always new instanceApplicationExceptionCodeMatcherpublic static <T extends ApplicationException> Matcher<T> hasExitCode(int expectedExitCode)
ApplicationException has a particular exit code.T - type of matched exceptionexpectedExitCode - any intnull, always new instanceApplicationExceptionCodeMatcherCopyright © 2014 Sven Strittmatter. All Rights Reserved.