Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv393/input/javasrc/biz/xsoftware/test/mock2
Modified Files:
FakeSystem.java ListenerOne.java TestMockCreator.java
Log Message:
checkin for reintall eclipse
Index: FakeSystem.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2/FakeSystem.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FakeSystem.java 21 Mar 2006 09:25:33 -0000 1.4
--- FakeSystem.java 25 Mar 2006 08:17:25 -0000 1.5
***************
*** 31,33 ****
--- 31,37 ----
return retVal;
}
+
+ public String getId(){
+ return "ID";
+ }
}
Index: ListenerOne.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2/ListenerOne.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ListenerOne.java 20 Mar 2006 15:01:20 -0000 1.5
--- ListenerOne.java 25 Mar 2006 08:17:25 -0000 1.6
***************
*** 20,23 ****
--- 20,27 ----
public void callMeSecond(String s) throws IOException;
+
+ public void callMeLast(String s);
+
+ public FakeSystem getFakeSystem();
public String callWithRetVal(String s);
Index: TestMockCreator.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/test/mock2/TestMockCreator.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** TestMockCreator.java 21 Mar 2006 15:01:27 -0000 1.12
--- TestMockCreator.java 25 Mar 2006 08:17:25 -0000 1.13
***************
*** 257,260 ****
--- 257,304 ----
assertEquals(100, answer);
}
+
+ public void testIgnoreMethod(){
+ MockObject m=MockObjectFactory.createMock(ListenerOne.class);
+ ListenerOne l=(ListenerOne)m;
+
+ int param1=4;
+ String param2="someParam";
+
+ String methodName1="callMeFirst";
+ String methodName2="callMeLast";
+
+
+ m.addIgnoreMethod(methodName1);
+ CalledMethod callWithRetVal=m.expect(methodName1);
+ CalledMethod callMeLast=m.expect(methodName2);
+ m.removeIgnoreMethod(methodName1);
+ CalledMethod backCall=m.expect(methodName1);
+
+ l.callMeFirst(param1);
+ l.callMeLast(param2);
+ l.callMeFirst(param1);
+
+ m.verify();
+
+ }
+
+
+ public void testSetDefaultRetVal(){
+ MockObject m1=MockObjectFactory.createMock(ListenerOne.class);
+ ListenerOne l=(ListenerOne)m1;
+
+ FakeSystem fm=new FakeSystem();
+
+
+ String methodName1="getFake";
+ m1.setDefaultReturnValue(new FakeSystem(),methodName1);
+ CalledMethod getFake=m1.expect(methodName1);
+
+ FakeSystem fs=l.getFakeSystem();
+ fs.getId();
+
+
+
+ }
// private static byte[] cloneBytes(byte[] data) {
|