Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20889/javasrc/biz/xsoftware/test/mock2
Modified Files:
Tag: branchForOffice
TestMockCreator.java
Log Message:
this may clear things up for Jay. Commit the code so we can talk over it. Also added a test case for him that we talked about. Go over that also.
Index: TestMockCreator.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2/Attic/TestMockCreator.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** TestMockCreator.java 18 Jan 2006 09:45:09 -0000 1.1.2.7
--- TestMockCreator.java 5 Feb 2006 12:35:43 -0000 1.1.2.8
***************
*** 28,34 ****
CalledMethod method=m.expect(methodName);
! assertEquals("the methodName should be the same",methodName,method.getMethodName());
! assertEquals("params should equal", param, method.getParameters()[0]);
! assertEquals("param count should be 1", 1, method.getParameters().length);
}
--- 28,55 ----
CalledMethod method=m.expect(methodName);
! try {
! method.getParameters();
! fail("Since verify was not called, CalledMethod methods should not work");
! } catch(IllegalStateException e) {
! }
! //assertEquals("the methodName should be the same",methodName,method.getMethodName());
! //assertEquals("params should equal", param, method.getParameters()[0]);
! //assertEquals("param count should be 1", 1, method.getParameters().length);
! }
!
! public void testNoVerifyCalled() throws Exception {
! MockObject m = MockObjectFactory.createMock(ListenerOne.class);
! ListenerOne l=(ListenerOne)m;
!
! String methodName1 = "callMeFirst";
! String methodName2="callMeSecond";
! CalledMethod callMeFirst =m.expect(methodName1);
! CalledMethod callMeSecond=m.expect(methodName2);
!
! try {
! callMeFirst.getParameters();
! fail("The method was not called yet and verify() was not called, so above should throw exceptoin");
! } catch(IllegalStateException e) {
! }
}
***************
*** 50,54 ****
assertEquals("the methodName should be the same",methodName1,callMeFirst.getMethodName());
! assertEquals("params should equal", param, callMeFirst.getParameters()[0]);
assertEquals("param count should be 1", 1, callMeFirst.getParameters().length);
--- 71,76 ----
assertEquals("the methodName should be the same",methodName1,callMeFirst.getMethodName());
! Object[] array = callMeFirst.getParameters();
! assertEquals("params should equal", param, array[0]);
assertEquals("param count should be 1", 1, callMeFirst.getParameters().length);
|