Skip to content

Commit

Permalink
add the ability to verify property changes durring tests using the Pr…
Browse files Browse the repository at this point in the history
…opertyChangeListenerScaffold.
  • Loading branch information
pabender committed Oct 6, 2018
1 parent ed9b55c commit 2578fc6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions java/test/jmri/util/PropertyChangeListenerScaffold.java
Expand Up @@ -14,10 +14,14 @@ public class PropertyChangeListenerScaffold implements PropertyChangeListener {

private boolean propertyChanged;
private int callCount;
private String lastChange;
private Object lastValue;

public PropertyChangeListenerScaffold() {
propertyChanged = false;
callCount = 0;
lastChange = "";
lastValue = null;
}

public void resetPropertyChanged(){
Expand All @@ -33,7 +37,17 @@ public int getCallCount(){
return callCount;
}

public String getLastProperty(){
return lastChange;
}

public Object getLastValue(){
return lastValue;
}

public void onChange(String property, Object newValue){
lastChange = property;
lastValue = newValue;
}

@Override
Expand Down

0 comments on commit 2578fc6

Please sign in to comment.