Update of /cvsroot/mocklib/mocklib/input/javasrc/biz/xsoftware/examples/basic
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv16469/input/javasrc/biz/xsoftware/examples/basic
Modified Files:
TestExample.java PurchaseException.java
Log Message:
clean up mocklib 1. It is not 1.4 compatible and is pretty much the final mocklib1
Index: TestExample.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib/input/javasrc/biz/xsoftware/examples/basic/TestExample.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestExample.java 7 May 2005 18:26:17 -0000 1.1
--- TestExample.java 10 Sep 2006 18:01:12 -0000 1.2
***************
*** 35,39 ****
* @see junit.framework.TestCase#setUp()
*/
! public void setUp() {
mockCreditSvc = MockObjectFactory.createMock(CreditAuthorizationSvc.class);
mockGiftSvc = MockObjectFactory.createMock(GiftCardAccountSvc.class);
--- 35,39 ----
* @see junit.framework.TestCase#setUp()
*/
! public void setUp() {
mockCreditSvc = MockObjectFactory.createMock(CreditAuthorizationSvc.class);
mockGiftSvc = MockObjectFactory.createMock(GiftCardAccountSvc.class);
***************
*** 57,61 ****
sysUnderTest.purchase("itemA", user, amount);
! Object[] paramsToAuthorize = mockCreditSvc.expectCall("authorize").getAllParams();
assertEquals("User should be the same", user, paramsToAuthorize[0]);
assertEquals("Amount should have been the same", new Double(amount), paramsToAuthorize[1]);
--- 57,61 ----
sysUnderTest.purchase("itemA", user, amount);
! Object[] paramsToAuthorize = mockCreditSvc.expect("authorize").getAllParams();
assertEquals("User should be the same", user, paramsToAuthorize[0]);
assertEquals("Amount should have been the same", new Double(amount), paramsToAuthorize[1]);
***************
*** 105,112 ****
//in a failure case. Also could have made takeMoney ignored instead so
//we didn't test the takeMoney and just tested returnMoney.
! String[] calls = new String[2];
! calls[0] = "takeMoney";
! calls[1] = "returnMoney";
! CalledMethod[] methods = mockCreditSvc.expectOrderedCalls(calls);
CalledMethod takeMoney = methods[0];
assertEquals("Took from correct user", user, takeMoney.getParameter(0));
--- 105,109 ----
//in a failure case. Also could have made takeMoney ignored instead so
//we didn't test the takeMoney and just tested returnMoney.
! CalledMethod[] methods = mockCreditSvc.expect(new String[] {"takeMoney", "returnMoney"});
CalledMethod takeMoney = methods[0];
assertEquals("Took from correct user", user, takeMoney.getParameter(0));
Index: PurchaseException.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib/input/javasrc/biz/xsoftware/examples/basic/PurchaseException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PurchaseException.java 7 May 2005 18:26:17 -0000 1.1
--- PurchaseException.java 10 Sep 2006 18:01:12 -0000 1.2
***************
*** 15,18 ****
--- 15,23 ----
/**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
* @param e
*/
|