|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hamcrest.BaseMatcher<T> org.hamcrest.TypeSafeDiagnosingMatcher<java.util.EventObject> org.hamcrest.object.IsEventFrom
public class IsEventFrom
Tests if the value is an event announced by a specific object.
Constructor Summary | |
---|---|
IsEventFrom(java.lang.Class<?> eventClass,
java.lang.Object source)
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.hamcrest.TypeSafeDiagnosingMatcher |
---|
describeMismatch, matches |
Methods inherited from class org.hamcrest.BaseMatcher |
---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IsEventFrom(java.lang.Class<?> eventClass, java.lang.Object source)
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |