[Mockobject-checkins] mockobject2/input/javasrc/biz/xsoftware/mock MockSuperclass.java,1.7,1.8
Brought to you by:
fastdragon
From: Dean H. <dea...@us...> - 2004-12-18 15:31:24
|
Update of /cvsroot/mockobject/mockobject2/input/javasrc/biz/xsoftware/mock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20852/input/javasrc/biz/xsoftware/mock Modified Files: MockSuperclass.java Log Message: added more info when failure occurs. Index: MockSuperclass.java =================================================================== RCS file: /cvsroot/mockobject/mockobject2/input/javasrc/biz/xsoftware/mock/MockSuperclass.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MockSuperclass.java 8 Dec 2004 18:38:13 -0000 1.7 --- MockSuperclass.java 18 Dec 2004 15:31:12 -0000 1.8 *************** *** 4,7 **** --- 4,8 ---- import java.io.StringWriter; import java.util.ArrayList; + import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; *************** *** 312,316 **** String reason = putTogetherReason(methods, ignorables, methodsCalledList, "extra method(s)="+leftOver+"\n"); reason += getHowMethodWasCalled(leftOver.getMethods()[0]); ! throw new ExpectFailedException("There was a method called after your expected methods.\n"+reason, cleanup(retVal, i) , ExpectFailedException.UNEXPECTED_CALL_AFTER); } --- 313,320 ---- String reason = putTogetherReason(methods, ignorables, methodsCalledList, "extra method(s)="+leftOver+"\n"); reason += getHowMethodWasCalled(leftOver.getMethods()[0]); ! CalledMethod[] calledOnes = new CalledMethod[retVal.length+1]; ! System.arraycopy(retVal, 0, calledOnes, 0, retVal.length); ! calledOnes[retVal.length] = leftOver.getMethods()[0]; ! throw new ExpectFailedException("There was a method called after your expected methods.\n"+reason, calledOnes , ExpectFailedException.UNEXPECTED_CALL_AFTER); } |