Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock
In directory sc8-pr-cvs16:/tmp/cvs-serv9806/input/javasrc/biz/xsoftware/mock
Modified Files:
CloningBehavior.java Behavior.java
Log Message:
fix documentation.
Index: Behavior.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/Behavior.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Behavior.java 14 May 2007 14:26:14 -0000 1.5
--- Behavior.java 15 May 2007 22:36:43 -0000 1.6
***************
*** 2,15 ****
/**
! * A way of providing snippets of code to be run when a method is called. If you want
! * to pass in a Behavior implementation for </br></br>
*
* public int doSomethingCool(int i, String s, long l);
*
! * </br></br>
* then your Behavior class must define the same exact method and that method will be
* called in your Behavior implementation when the mockobject's doSomethingCool method
* is called. You must also return the same value as the doSomethingCool method which
! * in this case is an int.
*/
public interface Behavior {
--- 2,15 ----
/**
! * <p>A way of providing snippets of code to be run when a method is called. If you want
! * to pass in a Behavior implementation for </p>
*
* public int doSomethingCool(int i, String s, long l);
*
! * <p>
* then your Behavior class must define the same exact method and that method will be
* called in your Behavior implementation when the mockobject's doSomethingCool method
* is called. You must also return the same value as the doSomethingCool method which
! * in this case is an int.</p>
*/
public interface Behavior {
Index: CloningBehavior.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/CloningBehavior.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CloningBehavior.java 14 May 2007 14:26:14 -0000 1.1
--- CloningBehavior.java 15 May 2007 22:36:42 -0000 1.2
***************
*** 2,20 ****
/**
! * The same exact thing as the Behavior method except a cloning method must be supplied to.
* Sometimes the Behavior method will make modifications to the passed in parameter methods.
* The cloning method allows the mockobject to take a snapshot of the parameters passed into
* the method before they are modified. Then the test can still verify later the correct
! * parameters were passed in. So, if you are mocking a method
! * </br></br>
* public int doSomethingCool(Map map, int i, long l);
! * </br></br>
* Then you must have a cloning method of the form
! * </br></br>
* public Object[] doSomethingCoolClone(Map map, int i, long l);
! * </br></br>
* Notice that you probably only need to clone the Map and would need to return an object
* array of all the parameters as so... new Object[] { clonedMap, i, l);
! *
* @author dhiller
*
--- 2,20 ----
/**
! * <p>The same exact thing as the Behavior method except a cloning method must be supplied to.
* Sometimes the Behavior method will make modifications to the passed in parameter methods.
* The cloning method allows the mockobject to take a snapshot of the parameters passed into
* the method before they are modified. Then the test can still verify later the correct
! * parameters were passed in. So, if you are mocking a method</p>
! *
* public int doSomethingCool(Map map, int i, long l);
! * <p>
* Then you must have a cloning method of the form
! * </p>
* public Object[] doSomethingCoolClone(Map map, int i, long l);
! * <p>
* Notice that you probably only need to clone the Map and would need to return an object
* array of all the parameters as so... new Object[] { clonedMap, i, l);
! * </p>
* @author dhiller
*
|