Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv24696/input/javasrc/biz/xsoftware/mock
Modified Files:
MockObject.java
Log Message:
Added CalledMethod[] expect(String method, int times), which allows a method to be expected a number of times...
Index: MockObject.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/MockObject.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** MockObject.java 15 Nov 2006 16:54:43 -0000 1.9
--- MockObject.java 15 Nov 2006 17:12:39 -0000 1.10
***************
*** 17,21 ****
public static String NONE = "No method should have been called";
/**
! * Field used to expect any method so expectCall returns as soon as
* any method is called.
*/
--- 17,21 ----
public static String NONE = "No method should have been called";
/**
! * Field used to expect any method so expect returns as soon as
* any method is called.
*/
***************
*** 47,50 ****
--- 47,63 ----
/**
+ * Waits for a methods to be called a specific number of times.
+ * If any of the methods, this method throws
+ * an exception which will fail the test case. For each method,
+ * this will wait WAIT_TIME milliseconds for each method to be called.
+ * If the method is not called within this period, an exception will
+ * be thrown saying 'method' was not called within timeout period.
+ * @param method
+ * @param times is the number of times the methods is expected to be called
+ * @return An array or arrays of params that were passed to the methods called
+ */
+ public CalledMethod[] expect(String method, int times);
+
+ /**
* Set the DefaultReturnValue for a 'method'
* @param method The method name to set the default return value for
|