T - type of exception to match its codepublic final class ApplicationExceptionCodeMatcher<T extends ApplicationException> extends TypeSafeMatcher<T>
ApplicationException.getExitCode().| Modifier and Type | Field and Description |
|---|---|
private ExitCode |
expectedExitCode
May be
null. |
private int |
expectedExitCodeNumber
Exit code to verify against it.
|
| Modifier | Constructor and Description |
|---|---|
|
ApplicationExceptionCodeMatcher(ExitCode expectedExitCode)
Deprecated.
|
private |
ApplicationExceptionCodeMatcher(int expectedExitCode)
Dedicated constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
describeMismatchSafely(T item,
Description mismatch) |
void |
describeTo(Description description) |
(package private) ExitCode |
getExpectedExitCode()
Get the expected exit code as type.
|
(package private) int |
getExpectedExitCodeNumber()
Get the expected exit code as number.
|
static <T extends ApplicationException> |
hasExitCode(ExitCode expectedExitCode)
Static factory method.
|
static <T extends ApplicationException> |
hasExitCode(int expectedExitCode)
Static factory method.
|
protected boolean |
matchesSafely(T item) |
describeMismatch, matches_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringprivate final int expectedExitCodeNumber
private ExitCode expectedExitCode
null.@Deprecated public ApplicationExceptionCodeMatcher(ExitCode expectedExitCode)
CommonsTestingMatchers.hasExitCode(de.weltraumschaf.commons.system.ExitCode) insteadexpectedExitCode - must not be nullprivate ApplicationExceptionCodeMatcher(int expectedExitCode)
expectedExitCode - any intint getExpectedExitCodeNumber()
ExitCode getExpectedExitCode()
nullpublic void describeTo(Description description)
protected boolean matchesSafely(T item)
matchesSafely in class TypeSafeMatcher<T extends ApplicationException>protected void describeMismatchSafely(T item, Description mismatch)
describeMismatchSafely in class TypeSafeMatcher<T extends ApplicationException>public static <T extends ApplicationException> Matcher<T> hasExitCode(ExitCode expectedExitCode)
T - type of matched exceptionexpectedExitCode - code to match, must not be nullnull, always new instancepublic static <T extends ApplicationException> Matcher<T> hasExitCode(int expectedExitCode)
T - type of matched exceptionexpectedExitCode - code to match}null, always new instanceCopyright © 2014 Sven Strittmatter. All Rights Reserved.