public class IsEventFrom extends TypeSafeDiagnosingMatcher<java.util.EventObject>
Constructor and Description |
---|
IsEventFrom(java.lang.Class<?> eventClass,
java.lang.Object source) |
Modifier and Type | Method and Description |
---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
static Matcher<java.util.EventObject> |
eventFrom(java.lang.Class<? extends java.util.EventObject> eventClass,
java.lang.Object source)
Creates a matcher of
EventObject that matches any object
derived from eventClass announced by source. |
static Matcher<java.util.EventObject> |
eventFrom(java.lang.Object source)
Creates a matcher of
EventObject that matches any EventObject
announced by source. |
boolean |
matchesSafely(java.util.EventObject item,
Description mismatchDescription)
Subclasses should implement this.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public IsEventFrom(java.lang.Class<?> eventClass, java.lang.Object source)
public boolean matchesSafely(java.util.EventObject item, Description mismatchDescription)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<java.util.EventObject>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.public static Matcher<java.util.EventObject> eventFrom(java.lang.Class<? extends java.util.EventObject> eventClass, java.lang.Object source)
EventObject
that matches any object
derived from eventClass announced by source.
For example:
assertThat(myEvent, is(eventFrom(PropertyChangeEvent.class, myBean)))
eventClass
- the class of the event to match onsource
- the source of the eventpublic static Matcher<java.util.EventObject> eventFrom(java.lang.Object source)
EventObject
that matches any EventObject
announced by source.
For example:
assertThat(myEvent, is(eventFrom(myBean)))
source
- the source of the event