|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.test.DummyPropertyListener
public class DummyPropertyListener
Dummy test property change listener for unit tests. Used to see if a particular property change is heard from a source.
Example use:
MyJavaBean bean = new MyJavaBean (); DummyPropertyListener listener = new DummyPropertyListener (); bean.addPropertyChangeListener (listener); bean.setProperty ("name", newValue); assertTrue (listener.heardIt ("name")); listener.reset ();
Field Summary | |
---|---|
static String |
EMPTY_STRING
|
Constructor Summary | |
---|---|
DummyPropertyListener()
|
Method Summary | |
---|---|
PropertyChangeEvent |
getEvent()
Returns the last event heard by the listener. |
String |
getPropertyName()
Returns either an empty string or the name of the last property the change event of which was heard. |
boolean |
heardIt(String name)
Replies true if a property change event of the name property was heard. |
void |
propertyChange(PropertyChangeEvent evt)
Invoked when a bean being listened to fires a property change event. |
void |
reset()
Resets the listener so it is ready to hear new events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EMPTY_STRING
Constructor Detail |
---|
public DummyPropertyListener()
Method Detail |
---|
public boolean heardIt(String name)
name
- The name of the property we want to know was fired.
public String getPropertyName()
NB If reset()
has been called, the value returned will be
an empty string.
public PropertyChangeEvent getEvent()
public void reset()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |