01: /**
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */package com.tc.config.schema.dynamic;
04:
05: /**
06: * Unit test for {@link ConfigItemListener}.
07: */
08: public class MockConfigItemListener implements ConfigItemListener {
09:
10: private int numValueChangeds;
11: private Object lastOldValue;
12: private Object lastNewValue;
13:
14: public MockConfigItemListener() {
15: reset();
16: }
17:
18: public void reset() {
19: this .numValueChangeds = 0;
20: this .lastOldValue = null;
21: this .lastNewValue = null;
22: }
23:
24: public void valueChanged(Object oldValue, Object newValue) {
25: ++this .numValueChangeds;
26: this .lastOldValue = oldValue;
27: this .lastNewValue = newValue;
28: }
29:
30: public Object getLastNewValue() {
31: return lastNewValue;
32: }
33:
34: public Object getLastOldValue() {
35: return lastOldValue;
36: }
37:
38: public int getNumValueChangeds() {
39: return numValueChangeds;
40: }
41:
42: }
|