Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mockobjects.beans
Class MockPropertyChangeListener  view MockPropertyChangeListener download MockPropertyChangeListener.java

java.lang.Object
  extended bycom.mockobjects.MockObject
      extended bycom.mockobjects.beans.MockPropertyChangeListener
All Implemented Interfaces:
java.util.EventListener, java.beans.PropertyChangeListener, com.mockobjects.Verifiable

public class MockPropertyChangeListener
extends com.mockobjects.MockObject
implements java.beans.PropertyChangeListener

Mock object for a PropertyChangeListener. This mock object can be used in verifying the event propagation mechanism of beans. You can set the information you expect from a PropertyChangeEvent as well as the number of events. If you expect more than one event, only the actual values of the last event are stored.


Field Summary
protected  com.mockobjects.ExpectationCounter eventCount
           
protected  com.mockobjects.ExpectationValue newValue
           
protected  com.mockobjects.ExpectationValue oldValue
           
protected  com.mockobjects.ExpectationValue propertyName
           
 
Constructor Summary
MockPropertyChangeListener()
           
MockPropertyChangeListener(java.lang.String name)
           
 
Method Summary
 void propertyChange(java.beans.PropertyChangeEvent event)
          Fired after a Bean's property has changed.
 void setExpectedEventCount(int expectedEventCount)
           
 void setExpectedNewValue(java.lang.Object expectedNewValue)
           
 void setExpectedOldValue(java.lang.Object expectedOldValue)
           
 void setExpectedPropertyName(java.lang.String expectedPropertyName)
           
 
Methods inherited from class com.mockobjects.MockObject
assertEquals, assertEquals, assertTrue, fail, notImplemented, notYetImplemented, notYetImplemented, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyName

protected com.mockobjects.ExpectationValue propertyName

oldValue

protected com.mockobjects.ExpectationValue oldValue

newValue

protected com.mockobjects.ExpectationValue newValue

eventCount

protected com.mockobjects.ExpectationCounter eventCount
Constructor Detail

MockPropertyChangeListener

public MockPropertyChangeListener(java.lang.String name)

MockPropertyChangeListener

public MockPropertyChangeListener()
Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Description copied from interface: java.beans.PropertyChangeListener
Fired after a Bean's property has changed.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

setExpectedNewValue

public void setExpectedNewValue(java.lang.Object expectedNewValue)

setExpectedOldValue

public void setExpectedOldValue(java.lang.Object expectedOldValue)

setExpectedEventCount

public void setExpectedEventCount(int expectedEventCount)

setExpectedPropertyName

public void setExpectedPropertyName(java.lang.String expectedPropertyName)