Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/test/mock
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20712/input/javasrc/biz/xsoftware/test/mock
Modified Files:
TestMockCreator.java
Added Files:
ExtendedCar.java
Log Message:
test overloaded method and get exception messages working.
--- NEW FILE: ExtendedCar.java ---
/**
* Copyright (C) 2006 Carrier Access, Corp.
*/
package biz.xsoftware.test.mock;
/**
*/
public interface ExtendedCar extends Car
{
public int getWheelCount(String s);
}
Index: TestMockCreator.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/test/mock/TestMockCreator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TestMockCreator.java 13 Sep 2006 03:09:00 -0000 1.6
--- TestMockCreator.java 14 Sep 2006 22:36:53 -0000 1.7
***************
*** 273,276 ****
--- 273,296 ----
}
+ // public void testTemp() {
+ // MockObject mock = MockObjectFactory.createMock(ChannelManagerService.class);
+ // int value = 5;
+ // mock.addReturnValue("getWheelCount", value);
+ //
+ // ExtendedCar car = (ExtendedCar)mock;
+ // int wheelCount = car.getWheelCount();
+ // assertEquals(value, wheelCount);
+ // }
+
+ public void testOverloadedMethod() {
+ MockObject mock = MockObjectFactory.createMock(ExtendedCar.class);
+ int value = 5;
+ try {
+ mock.addReturnValue("getWheelCount", value);
+ fail("should have thrown exception");
+ } catch(IllegalArgumentException e) {
+ }
+ }
+
public void testAddRemoveIgnore()
{
|