Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9115/input/javasrc/biz/xsoftware/mock2
Modified Files:
Messages.java MockObject.java
Log Message:
Missing returns on expect or ignore are reported to the user. Incorrect return types fail and are reported. Fixed some bugs with MockObject.verify().
Index: MockObject.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock2/MockObject.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** MockObject.java 2 May 2006 23:26:34 -0000 1.6
--- MockObject.java 5 May 2006 15:29:23 -0000 1.7
***************
*** 19,22 ****
--- 19,23 ----
*/
public CalledMethod expect(String methodName, Class... vargs);
+ public CalledMethod expect(String methodName);
/**
***************
*** 33,38 ****
* is called
*/
! public CalledMethod expect(Object returnValue, String methodName,
! Class... vargs);
/**
--- 34,38 ----
* is called
*/
! public CalledMethod expect(Object returnValue, String methodName, Class... vargs);
/**
***************
*** 49,54 ****
* is called
*/
! public CalledMethod expect(String methodName, Throwable throwable,
! Class... vargs);
/**
--- 49,53 ----
* is called
*/
! public CalledMethod expect(String methodName, Throwable throwable, Class... vargs);
/**
***************
*** 66,71 ****
* @throws NoSuchMethodException
*/
! public CalledMethod expect(String methodName, Behavior behavior,
! Class... params);
/***************************************************************************
--- 65,69 ----
* @throws NoSuchMethodException
*/
! public CalledMethod expect(String methodName, Behavior behavior, Class... params);
/***************************************************************************
***************
*** 101,106 ****
* is called
*/
! public CalledMethod expect(Object returnValue, String methodName,
! long timeout, Class... vargs);
/**
--- 99,103 ----
* is called
*/
! public CalledMethod expect(Object returnValue, String methodName, long timeout, Class... vargs);
/**
***************
*** 119,124 ****
* is called
*/
! public CalledMethod expect(String methodName, Throwable throwable,
! long timeout, Class... vargs);
/**
--- 116,120 ----
* is called
*/
! public CalledMethod expect(String methodName, Throwable throwable, long timeout, Class... vargs);
/**
***************
*** 138,143 ****
* @throws NoSuchMethodException
*/
! public CalledMethod expect(String methodName, Behavior behavior,
! long timeout, Class... params) ;
/**
--- 134,138 ----
* @throws NoSuchMethodException
*/
! public CalledMethod expect(String methodName, Behavior behavior, long timeout, Class... params) ;
/**
***************
*** 157,160 ****
--- 152,156 ----
*/
public void addIgnoredMethod(String methodName, Class... vargs);
+ public void addIgnoredMethod(String methodName);
/**
***************
*** 191,196 ****
* the optional parameter types of the method calls
*/
! public void setDefaultReturnValue(Object returnValue, String methodName,
! Class... vargs);
/**
--- 187,191 ----
* the optional parameter types of the method calls
*/
! public void setDefaultReturnValue(Object returnValue, String methodName, Class... vargs);
/**
Index: Messages.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock2/Messages.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Messages.java 2 May 2006 23:26:34 -0000 1.6
--- Messages.java 5 May 2006 15:29:23 -0000 1.7
***************
*** 7,14 ****
public static final String METHOD_NAME_CANT_BE_NULL="method name can not be null, please provide a method name";
public static final String VERIFY_NOT_CALLED =
! "MockObject.verify() must be called before accessing and of the methods on CalledMethod object";
public static final String METHOD_CAN_NOT_ACCESS="Mocklib can not retrive the method you defined in your "+
! "Behavior Implementation class, Please make sure the method is accessable";
public static final String TOO_MANY_METHODS_CALLED="Unexpected method called";
public static final String ORDER_EXCEPTION="methods called or methods expected is in wrong order";
}
--- 7,15 ----
public static final String METHOD_NAME_CANT_BE_NULL="method name can not be null, please provide a method name";
public static final String VERIFY_NOT_CALLED =
! "MockObject.verify() must be called before accessing any of the methods on CalledMethod object";
public static final String METHOD_CAN_NOT_ACCESS="Mocklib can not retrive the method you defined in your "+
! "Behavior implementation class, please make sure the method is accessable";
public static final String TOO_MANY_METHODS_CALLED="Unexpected method called";
public static final String ORDER_EXCEPTION="methods called or methods expected is in wrong order";
+ public static final String EXPECTED_METHOD_NOT_CALLED = "One or more methods you expected were not called";
}
|