- All Implemented Interfaces:
- java.beans.PropertyChangeListener, java.util.EventListener
public class PropertyChangeListenerHelper
extends java.lang.Object
implements java.beans.PropertyChangeListener
Listens for PropertyChangeEvents and remembers last one. Useful for
Unit testing purposes. Recommended usage: instantiate one of these
for each state variable in the class being tested and add them as
PropertyChangeListeners for those specific events. To test whether
a state transition is being correctly fired, invoke a 'do' method
directly (contrary to "normal" operation) and check whether the
lastEvent is non-null (if property is to be changed) or null (if
property is not to be fired). The newValue and oldValue of the lastEvent
could also be checked.
- Author:
- ahbuss