Class MessageCodeMatcher
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<org.faktorips.runtime.Message>
org.faktorips.testsupport.matchers.MessageMatcher
org.faktorips.testsupport.matchers.MessageCodeMatcher
- All Implemented Interfaces:
org.hamcrest.Matcher<org.faktorips.runtime.Message>,org.hamcrest.SelfDescribing
Matches a
Message if it's message code is the given
messageCode.-
Constructor Summary
ConstructorsConstructorDescriptionMessageCodeMatcher(String messageCode) MessageCodeMatcher(String messageCode, boolean expectMessage) MessageCodeMatcher(org.hamcrest.Matcher<String> messageCodeMatcher) MessageCodeMatcher(org.hamcrest.Matcher<String> messageCodeMatcher, boolean expectMessage) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddescribeMessageProperty(org.hamcrest.Description description) Adds the description of the property checked by this matcher to the given description.protected voiddescribeMismatchedProperty(org.faktorips.runtime.Message message, org.hamcrest.Description mismatchDescription) Adds the description of the given message's actual value of the property checked by this matcher to the given description.protected booleanmatchesSafely(org.faktorips.runtime.Message message) Methods inherited from class org.faktorips.testsupport.matchers.MessageMatcher
and, describeMismatchSafely, describeToMethods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matchesMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
Constructor Details
-
MessageCodeMatcher
- Parameters:
messageCode- the expected message code
-
MessageCodeMatcher
- Parameters:
messageCode- the expected message codeexpectMessage- whether a message is expected.trueif a message is expected,falseif no message with the given message code is expected (negates result).
-
MessageCodeMatcher
- Parameters:
messageCodeMatcher- aMatcherfor the message code
-
MessageCodeMatcher
- Parameters:
messageCodeMatcher- aMatcherfor the message codeexpectMessage- whether a message is expected.trueif a message is expected,falseif no message matched by the given message is expected (negates result).
-
-
Method Details
-
describeMessageProperty
protected void describeMessageProperty(org.hamcrest.Description description) Description copied from class:MessageMatcherAdds the description of the property checked by this matcher to the given description.- Specified by:
describeMessagePropertyin classMessageMatcher
-
describeMismatchedProperty
protected void describeMismatchedProperty(org.faktorips.runtime.Message message, org.hamcrest.Description mismatchDescription) Description copied from class:MessageMatcherAdds the description of the given message's actual value of the property checked by this matcher to the given description.- Specified by:
describeMismatchedPropertyin classMessageMatcher
-
matchesSafely
protected boolean matchesSafely(org.faktorips.runtime.Message message) - Specified by:
matchesSafelyin classorg.hamcrest.TypeSafeMatcher<org.faktorips.runtime.Message>
-