Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20088/input/javasrc/biz/xsoftware/mock
Modified Files:
MockObject.java
Log Message:
refactor mocklib3 a bit.
Index: MockObject.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/MockObject.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** MockObject.java 13 Sep 2006 03:09:00 -0000 1.7
--- MockObject.java 1 Oct 2006 03:18:47 -0000 1.8
***************
*** 53,64 ****
public void setDefaultReturnValue(String method, Object returnValue);
- /**
- * Set the DefaultReturnValue for a 'method'
- * @param method The method name to set the default return value for
- * @param returnValue
- * @param argTypes Optionally specify the type of parameters of the method
- */
- public void setDefaultReturnValue(String method, Object returnValue, Class... argTypes);
-
public void setDefaultBehavior(String method, Behavior b);
public void setDefaultBehavior(String method, Behavior b, Class ... argTypes);
--- 53,56 ----
***************
*** 84,109 ****
*/
public void addThrowException(String method, Throwable e);
-
- /**
- * Add an exception to throw when a method on the mockObject is called.
- * <br/<br/>
- * This can be called many times where each time it is called, the
- * exception is added to a queue. Each time 'method' is called, it
- * checks the queue, if empty, it does not throw an exception.
- * <br/<br/>
- * Should only pass the type of Throwable that the 'method'
- * can throw. If you pass IOException in for a method that
- * doesn't have a signature of 'throws IOException', then
- * one of the following exceptions will be thrown into
- * the sysUnderTest
- * <ol>
- * <li> UndeclaredThrowableException for MockObjects created with MockCreator</li>
- * <li> RuntimeException for Subclasses of MockSuperclass</li>
- * </ol>
- * @param method The method to throw the exception on when it is called.
- * @param e The exception to throw on method.
- * @param argTypes Optionally specify the type of parameters of the method
- */
- public void addThrowException(String method, Throwable e, Class... argTypes);
/**
--- 76,79 ----
***************
*** 121,140 ****
*/
public void addReturnValue(String method, Object o);
-
- /**
- * Add a return value to return when 'method' is called.
- * <br></br>
- * This can be called multiple times and each call will add
- * to a queue. When 'method' is called, it will return
- * the first value on the queue. If the queue is null,
- * 'method' will return the defaultvalue which is null unless
- * setDefaultReturnValue is called on MockObject.
- * <br></br>
- * Use Integer to return int, Long for long, etc.
- * @param method The method that when called returns first value on queue
- * @param o The object to return that is added to the queue
- * @param argTypes Optionally specify the type of parameters of the method
- */
- public void addReturnValue(String method, Object o, Class... argTypes);
public void addBehavior(String method, Behavior behavior);
--- 91,94 ----
***************
*** 150,162 ****
public void addIgnore(String method);
! /**
! * When calling expect, the MockObject will ignore the methods
! * in 'methods' variable so if one of the methods in this array is
! * called, it will not result in an exception.
! *
! * @param method The name of the method to ignore
! * @param argTypes Optionally specify the type of parameters of the method
! */
! public void addIgnore(String method, Class ... argTypes);
/**
--- 104,116 ----
public void addIgnore(String method);
! // /**
! // * When calling expect, the MockObject will ignore the methods
! // * in 'methods' variable so if one of the methods in this array is
! // * called, it will not result in an exception.
! // *
! // * @param method The name of the method to ignore
! // * @param argTypes Optionally specify the type of parameters of the method
! // */
! // public void addIgnore(String method, Class ... argTypes);
/**
***************
*** 167,177 ****
public void removeIgnore(String method);
! /**
! * Removes the method from the ignored methods set.
! *
! * @param method The name of the method to not ignore
! * @param argTypes Optionally specify the type of parameters of the method
! */
! public void removeIgnore(String method, Class ... argTypes);
public void setExpectTimeout(int timeout);
--- 121,131 ----
public void removeIgnore(String method);
! // /**
! // * Removes the method from the ignored methods set.
! // *
! // * @param method The name of the method to not ignore
! // * @param argTypes Optionally specify the type of parameters of the method
! // */
! // public void removeIgnore(String method, Class ... argTypes);
public void setExpectTimeout(int timeout);
|