Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/test/mock
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31015/input/javasrc/biz/xsoftware/test/mock
Modified Files:
TestMockCreator.java TestOrderedCalls.java
Log Message:
take a guess at the new mocklib3 api.
Index: TestMockCreator.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/test/mock/TestMockCreator.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestMockCreator.java 10 Sep 2006 18:25:48 -0000 1.1
--- TestMockCreator.java 10 Sep 2006 18:35:13 -0000 1.2
***************
*** 95,99 ****
MockObject car = MockObjectFactory.createMock(Car.class);
! factory.addReturnValue("createCar", car);
//now we would normally tweak code on the subsystem which
--- 95,99 ----
MockObject car = MockObjectFactory.createMock(Car.class);
! factory.addReturnValue(car, "createCar", null);
//now we would normally tweak code on the subsystem which
***************
*** 108,112 ****
public void testThrowCheckedException() throws Exception {
MockObject mockList = MockObjectFactory.createMock(ListenerOne.class);
! mockList.addThrowException("callMeSecond", new IOException("test throwing IOException"));
ListenerOne l = (ListenerOne)mockList;
--- 108,112 ----
public void testThrowCheckedException() throws Exception {
MockObject mockList = MockObjectFactory.createMock(ListenerOne.class);
! mockList.addThrowException(new IOException("test throwing IOException"), "callMeSecond", null);
ListenerOne l = (ListenerOne)mockList;
***************
*** 153,157 ****
MockObject mock = MockObjectFactory.createMock(Identical.class);
! mock.setDefaultReturnValue("doThat", new byte[] {4});
Identical ident = (Identical)mock;
--- 153,157 ----
MockObject mock = MockObjectFactory.createMock(Identical.class);
! mock.setDefaultReturnValue(new byte[] {4}, "doThat", null);
Identical ident = (Identical)mock;
***************
*** 167,173 ****
{
MockObject mock = MockObjectFactory.createMock(Identical.class);
! mock.addReturnValue("doThat", new byte[] {3});
! mock.setDefaultReturnValue("doThat", new byte[] {4});
! mock.addReturnValue("doThat", new byte[] {5});
Identical ident = (Identical)mock;
--- 167,173 ----
{
MockObject mock = MockObjectFactory.createMock(Identical.class);
! mock.addReturnValue(new byte[] {3}, "doThat", null);
! mock.setDefaultReturnValue(new byte[] {4}, "doThat", null);
! mock.addReturnValue(new byte[] {5}, "doThat", null);
Identical ident = (Identical)mock;
***************
*** 197,201 ****
FactoryInterface factory = (FactoryInterface)mock;
! mock.addReturnValue("createCar", new CarImpl());
Car car = factory.createCar("id");
--- 197,201 ----
FactoryInterface factory = (FactoryInterface)mock;
! mock.addReturnValue(new CarImpl(), "createCar", null);
Car car = factory.createCar("id");
***************
*** 221,225 ****
Car car = (Car)mock;
try {
! mock.addReturnValue("getWheelCount", new Long(56));
car.getWheelCount();
fail("should have thrown exception");
--- 221,225 ----
Car car = (Car)mock;
try {
! mock.addReturnValue(new Long(56), "getWheelCount", null);
car.getWheelCount();
fail("should have thrown exception");
***************
*** 243,247 ****
Car car = (Car)mock;
! mock.addReturnValue("getWheelCount", new Integer(5));
car.getWheelCount();
--- 243,247 ----
Car car = (Car)mock;
! mock.addReturnValue(new Integer(5), "getWheelCount", null);
car.getWheelCount();
***************
*** 252,256 ****
MockObject mock = MockObjectFactory.createMock(Identical.class);
! mock.addBehavior("doThat", new OldBehavior());
Identical ident = (Identical)mock;
--- 252,256 ----
MockObject mock = MockObjectFactory.createMock(Identical.class);
! mock.addBehavior(new OldBehavior(), "doThat", null);
Identical ident = (Identical)mock;
Index: TestOrderedCalls.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/test/mock/TestOrderedCalls.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestOrderedCalls.java 10 Sep 2006 18:25:48 -0000 1.1
--- TestOrderedCalls.java 10 Sep 2006 18:35:13 -0000 1.2
***************
*** 120,124 ****
RuntimeException e = new IllegalStateException("Test for robustness");
! one.addThrowException(MockOne.FIRST, e);
try {
--- 120,124 ----
RuntimeException e = new IllegalStateException("Test for robustness");
! one.addThrowException(e, MockOne.FIRST, null);
try {
|