Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock2/impl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21376/input/javasrc/biz/xsoftware/mock2/impl
Modified Files:
Tag: branchForOffice
MockObjectSuperImpl.java
Log Message:
change implementation ,
Index: MockObjectSuperImpl.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock2/impl/MockObjectSuperImpl.java,v
retrieving revision 1.3.2.9
retrieving revision 1.3.2.10
diff -C2 -d -r1.3.2.9 -r1.3.2.10
*** MockObjectSuperImpl.java 22 Feb 2006 14:20:29 -0000 1.3.2.9
--- MockObjectSuperImpl.java 23 Feb 2006 11:06:46 -0000 1.3.2.10
***************
*** 100,109 ****
}
! public void verify() throws Exception{
if (methodsCalled.size() == 0) {
synchronized (this) {
! this.wait(DEFAULT_TIME_OUT);
}
--- 100,114 ----
}
! public void verify(){
if (methodsCalled.size() == 0) {
synchronized (this) {
! try {
! this.wait(DEFAULT_TIME_OUT);
! } catch (InterruptedException e) {
! // TODO Auto-generated catch block
! e.getMessage();
! }
}
***************
*** 115,125 ****
m.setParameters(calledMethod.getParameters());
! m.setStackTrace(calledMethod.getStackTrace());
!
! if(methodWithException.containsKey(m.getMethodName())){
! Throwable t=methodWithException.get(m.getMethodName());
! throw (Exception)t;
! }
!
}
--- 120,124 ----
m.setParameters(calledMethod.getParameters());
! m.setStackTrace(calledMethod.getStackTrace());
}
***************
*** 147,152 ****
}
! synchronized protected Object methodCalledImpl(String methodName,
! Object[] parameters) {
methodName = methodName.intern();
--- 146,151 ----
}
! protected Object methodCalledImpl(String methodName,
! Object[] parameters) throws Throwable{
methodName = methodName.intern();
***************
*** 167,172 ****
CalledMethod calledMethod = new CalledMethodImpl(methodName,
parameters, stackTrace);
-
methodsCalled.add(calledMethod);
return getReturnValue(methodName);
--- 166,176 ----
CalledMethod calledMethod = new CalledMethodImpl(methodName,
parameters, stackTrace);
methodsCalled.add(calledMethod);
+
+ if(methodWithException.containsKey(calledMethod.getMethodName())){
+ Throwable t=methodWithException.get(calledMethod.getMethodName());
+ throw t;
+ }
+
return getReturnValue(methodName);
|