Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic In directory sc8-pr-cvs1:/tmp/cvs-serv16193/src/core/com/mockobjects/dynamic Modified Files: Tag: DynamicMockExperiment CallBag.java CallMatch.java CallSequence.java Callable.java CallableAddable.java Log Message: - Moved reset() from Callable to CallableAddable as it was an error to put it in Callable - Removed superfluous comments - Fixed rest of classes to work with new reset() Index: CallBag.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/CallBag.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- CallBag.java 17 May 2003 18:55:23 -0000 1.1.2.5 +++ CallBag.java 18 May 2003 07:18:18 -0000 1.1.2.6 @@ -15,8 +15,7 @@ public CallBag() { } - public void reset() - { + public void reset() { expectedCalls.clear(); expectedMatches.clear(); } Index: CallMatch.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/CallMatch.java,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- CallMatch.java 5 May 2003 22:44:33 -0000 1.1.2.6 +++ CallMatch.java 18 May 2003 07:18:18 -0000 1.1.2.7 @@ -1,6 +1,3 @@ -/* - * Created on 04-Apr-2003 - */ package com.mockobjects.dynamic; import junit.framework.Assert; Index: CallSequence.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/CallSequence.java,v retrieving revision 1.4.2.7 retrieving revision 1.4.2.8 diff -u -r1.4.2.7 -r1.4.2.8 --- CallSequence.java 17 Apr 2003 16:17:30 -0000 1.4.2.7 +++ CallSequence.java 18 May 2003 07:18:18 -0000 1.4.2.8 @@ -1,6 +1,3 @@ -/* - * Created on 14-Apr-2003 - */ package com.mockobjects.dynamic; import java.util.ArrayList; @@ -14,10 +11,12 @@ private CallBag matchedCalls = new CallBag(); int callIndex = 0; - public CallSequence() { - - } - + public void reset() + { + this.expectedCalls.clear(); + this.matchedCalls.reset(); + } + public Object call(Mock mock, String methodName, Object[] args) throws Throwable { if (expectedCalls.size() == 0) throw new AssertionFailedError("no methods defined on mock, received: " + DynamicUtil.methodToString(methodName, args)); if (callIndex == expectedCalls.size()) throw new AssertionFailedError("mock called too many times, received: " + DynamicUtil.methodToString(methodName, args)); Index: Callable.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/Callable.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- Callable.java 17 May 2003 18:55:23 -0000 1.1.2.3 +++ Callable.java 18 May 2003 07:18:18 -0000 1.1.2.4 @@ -6,9 +6,4 @@ String getDescription(); Object call( Mock mock, String methodName, Object[] args ) throws Throwable; boolean matches(String methodName, Object[] args); - - /** - * Resets all expected calls and expected matches. - */ - void reset(); } Index: CallableAddable.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Attic/CallableAddable.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- CallableAddable.java 17 Apr 2003 16:17:27 -0000 1.1.2.2 +++ CallableAddable.java 18 May 2003 07:18:18 -0000 1.1.2.3 @@ -1,9 +1,11 @@ -/* - * Created on 14-Apr-2003 - */ package com.mockobjects.dynamic; public interface CallableAddable extends Callable { void addExpect(Callable call); void addMatch(Callable call); + + /** + * Resets all expected calls and expected matches. + */ + void reset(); } |