Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19153/input/javasrc/biz/xsoftware/test/mock2
Modified Files:
TestMockCreator.java
Log Message:
get dean's 2 test pass , add expectFailedException to mocklib2
Index: TestMockCreator.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2/TestMockCreator.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** TestMockCreator.java 5 Apr 2006 23:55:16 -0000 1.17
--- TestMockCreator.java 6 Apr 2006 15:25:06 -0000 1.18
***************
*** 120,124 ****
}
! public void xxxtestTwoMethodsWrongOrder() throws Exception {
MockObject m = MockObjectFactory.createMock(ListenerOne.class);
ListenerOne l = (ListenerOne) m;
--- 120,124 ----
}
! public void testTwoMethodsWrongOrder() throws Exception {
MockObject m = MockObjectFactory.createMock(ListenerOne.class);
ListenerOne l = (ListenerOne) m;
***************
*** 142,146 ****
}
! public void xxxtestTooManyMethodsCalled() throws Exception {
MockObject m = MockObjectFactory.createMock(ListenerOne.class);
ListenerOne l = (ListenerOne) m;
--- 142,146 ----
}
! public void testTooManyMethodsCalled() throws Exception {
MockObject m = MockObjectFactory.createMock(ListenerOne.class);
ListenerOne l = (ListenerOne) m;
***************
*** 155,158 ****
--- 155,159 ----
int var1 = 4;
l.callMeFirst(var1);
+
//this last one should make verify fail as we don't expect it
l.callMeFirst(var1);
***************
*** 318,323 ****
CalledMethod callMeFirst=m.expect(methodName1);
! m.addIgnoreMethod(methodName1);
! m.setDefaultReturnValue("retval",methodName1);
CalledMethod callMeLast=m.expect(methodName2);
CalledMethod callAgain=m.expect(methodName1);
--- 319,323 ----
CalledMethod callMeFirst=m.expect(methodName1);
!
CalledMethod callMeLast=m.expect(methodName2);
CalledMethod callAgain=m.expect(methodName1);
***************
*** 325,330 ****
CalledMethod callLastAgain=m.expect(methodName2);
CalledMethod callThirdTime=m.expect(methodName1);
!
l.callMeFirst(param1);
l.callMeLast(param2);
l.callMeFirst(param1);
--- 325,332 ----
CalledMethod callLastAgain=m.expect(methodName2);
CalledMethod callThirdTime=m.expect(methodName1);
!
l.callMeFirst(param1);
+ m.addIgnoreMethod(methodName1);
+ m.setDefaultReturnValue("retval",methodName1);
l.callMeLast(param2);
l.callMeFirst(param1);
***************
*** 332,337 ****
l.callMeFirst(param1);
!
! m.verify();
--- 334,343 ----
l.callMeFirst(param1);
! try{
! m.verify();
! }catch(RuntimeException e){
! fail("should fail if goes here");
!
! }
|