Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv6575/src/core/com/mockobjects/dynamic
Added Files:
AbstractCallableCollection.java
Removed Files:
CallCollection.java
Log Message:
Renamed CallCollection to AbstractCallableCollection
--- NEW FILE: AbstractCallableCollection.java ---
package com.mockobjects.dynamic;
import junit.framework.AssertionFailedError;
abstract public class AbstractCallableCollection implements CallableCollection {
abstract public String getDescription();
abstract public Object call(ActiveCall call) throws Throwable;
public boolean matches(ActiveCall activeCall) {
throw new AssertionFailedError("matches() operation not supported in CallCollection");
}
public void reset() {
expectedCalls.clear();
matchingCalls.clear();
}
public void addExpect(Callable call) {
this.expectedCalls.add(call);
}
public void addMatch(Callable call) {
this.matchingCalls.add(call);
}
public void verify() {
expectedCalls.verify();
}
protected CallableList expectedCalls = new CallableList();
protected CallableList matchingCalls = new CallableList();
protected AssertionFailedError createUnexpectedCallError(ActiveCall call) {
StringBuffer buf = new StringBuffer();
buf.append("Unexpected call: ");
buf.append(call.toString());
buf.append("\n");
buf.append("Expected ");
buf.append(getDescription());
return new AssertionFailedError(buf.toString());
}
protected Callable findMatchingCall(ActiveCall call) throws AssertionFailedError {
Callable foundCall = matchingCalls.firstMatchingCall(call);
if (foundCall == null) {
throw createUnexpectedCallError(call);
}
return foundCall;
}
}
--- CallCollection.java DELETED ---
|