|
From: Pelle B. <pe...@us...> - 2004-03-21 00:58:40
|
Update of /cvsroot/neuclear/neuclear-ledger/src/test/org/neuclear/ledger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2857/src/test/org/neuclear/ledger Modified Files: LedgerTest.java SQLLedgerTest.java Log Message: The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. Index: LedgerTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/test/org/neuclear/ledger/LedgerTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LedgerTest.java 2 Jan 2004 23:18:35 -0000 1.10 --- LedgerTest.java 21 Mar 2004 00:48:36 -0000 1.11 *************** *** 3,21 **** import junit.framework.TestCase; import org.neuclear.commons.NeuClearException; - import org.neuclear.commons.sql.DefaultConnectionSource; - import org.neuclear.commons.sql.DefaultXAConnectionSource; - import org.neuclear.commons.sql.TestCaseConnectionSource; - import org.neuclear.commons.sql.TestCaseXAConnectionSource; - import org.neuclear.commons.sql.statements.SimpleStatementFactory; - import org.neuclear.ledger.implementations.SQLLedger; import javax.naming.NamingException; - import javax.transaction.UserTransaction; import java.io.IOException; - import java.math.BigInteger; import java.sql.SQLException; - import java.util.Calendar; import java.util.Date; - import java.util.Random; /** --- 3,11 ---- *************** *** 26,39 **** * $Id$ * $Log$ * Revision 1.10 2004/01/02 23:18:35 pelle * Added StatementFactory pattern and refactored the ledger to use it. ! * * Revision 1.9 2003/12/31 00:39:05 pelle * Added Drivers for handling different Database dialects in the entity model. * Added BookBrowser pattern to ledger, simplifying the statement writing process. ! * * Revision 1.8 2003/12/26 22:50:52 pelle * Mainly fixes to SQLLedger to support the schema generated by the new EntityModel ! * * Revision 1.7 2003/12/24 00:24:33 pelle * Created a kind of poor man's version of ofbiz.org's EntityEngine. It doesnt use xml to configure it, but code. --- 16,32 ---- * $Id$ * $Log$ + * Revision 1.11 2004/03/21 00:48:36 pelle + * The problem with Enveloped signatures has now been fixed. It was a problem in the way transforms work. I have bandaided it, but in the future if better support for transforms need to be made, we need to rethink it a bit. Perhaps using the new crypto channel's in neuclear-commons. + * * Revision 1.10 2004/01/02 23:18:35 pelle * Added StatementFactory pattern and refactored the ledger to use it. ! * <p/> * Revision 1.9 2003/12/31 00:39:05 pelle * Added Drivers for handling different Database dialects in the entity model. * Added BookBrowser pattern to ledger, simplifying the statement writing process. ! * <p/> * Revision 1.8 2003/12/26 22:50:52 pelle * Mainly fixes to SQLLedger to support the schema generated by the new EntityModel ! * <p/> * Revision 1.7 2003/12/24 00:24:33 pelle * Created a kind of poor man's version of ofbiz.org's EntityEngine. It doesnt use xml to configure it, but code. *************** *** 42,49 **** * need that myself right now. * SQLLedger now uses this to create its tables. It is not fully working yet, but will be shortly. ! * * Revision 1.6 2003/12/03 23:21:43 pelle * Got rid of ofbiz support. Way over the top for our use. ! * * Revision 1.5 2003/11/21 04:43:21 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. --- 35,42 ---- * need that myself right now. * SQLLedger now uses this to create its tables. It is not fully working yet, but will be shortly. ! * <p/> * Revision 1.6 2003/12/03 23:21:43 pelle * Got rid of ofbiz support. Way over the top for our use. ! * <p/> * Revision 1.5 2003/11/21 04:43:21 pelle * EncryptedFileStore now works. It uses the PBECipher with DES3 afair. *************** *** 106,110 **** * Revision 1.7 2003/07/21 19:43:39 pelle * Moved the Revisioning tests into the main LedgerTest. ! * Fixed the findTransaction method in SQLLedger. * <p/> * Revision 1.6 2003/07/21 18:35:15 pelle --- 99,103 ---- * Revision 1.7 2003/07/21 19:43:39 pelle * Moved the Revisioning tests into the main LedgerTest. ! * Fixed the getTransactionTime method in SQLLedger. * <p/> * Revision 1.6 2003/07/21 18:35:15 pelle *************** *** 129,433 **** */ public abstract class LedgerTest extends TestCase { ! protected final String account1 = "neu://test/bob"; ! protected final String account2 = "nru://test/alice"; public LedgerTest(final String s) throws LowlevelLedgerException, UnknownLedgerException, SQLException, NamingException, IOException, NeuClearException { super(s); ! ledger = new SQLLedger(new SimpleStatementFactory(new TestCaseXAConnectionSource()), "neu://test/bux"); ! ! } ! ! public abstract Ledger createLedger(); ! ! public final void testPostTransaction() throws LedgerException { ! final Book bob = getNewBobBook(); ! final Book alice = getNewAliceBook(); ! final Date t1 = new Date(); ! UserTransaction ut = ledger.beginUT(); ! bob.transfer(alice, 100, "Loan", t1); ! ledger.commitUT(ut); ! } ! ! private Book getNewBobBook() throws BookExistsException, LowlevelLedgerException { ! return createNewBook(account1); ! } ! ! private Book getNewAliceBook() throws BookExistsException, LowlevelLedgerException { ! return createNewBook(account2); ! } ! ! private Book createNewBook(final String name) throws BookExistsException, LowlevelLedgerException { ! final BigInteger id = new BigInteger(168, new Random()); ! final String bookID = name + id.toString(36); ! System.out.println("bookid: " + bookID); ! return ledger.createNewBook(bookID, name); } ! public final void testAccountCreate() throws LedgerException { ! UserTransaction ut = ledger.beginUT(); ! final Book bob = getNewBobBook(); ! assertNotNull(bob); ! assertTrue(ledger.bookExists(bob.getBookID())); ! ledger.commitUT(ut); } ! public final void testBalance() throws LedgerException { ! final Book alice = getNewAliceBook(); ! final Book bob = getNewBobBook(); ! final double aliceBalance = alice.getBalance(); ! final double bobBalance = bob.getBalance(); ! final double amount = 105; ! final Date t1 = new Date(); ! UserTransaction ut = ledger.beginUT(); ! ! alice.transfer(bob, amount, "Repayment", t1); ! assertEquals(aliceBalance - amount, alice.getBalance(), 0); ! assertEquals(bobBalance + amount, bob.getBalance(), 0); ! ledger.commitUT(ut); } ! public final void testTimeBalance() throws LedgerException { ! final Calendar cal = Calendar.getInstance(); ! final Date t1 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t2 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t3 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t4 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t5 = cal.getTime(); ! UserTransaction ut = ledger.beginUT(); ! ! final Book alice = getNewAliceBook(); ! final Book bob = getNewBobBook(); ! ! final double amount = 105; ! final double payment = amount / 2; ! ! alice.transfer(bob, payment, "Repayment", t2); ! alice.transfer(bob, payment, "2nd Repayment", t4); ! ! final double aliceBalance = alice.getBalance(t1); ! final double bobBalance = bob.getBalance(t1); ! ! assertEquals(aliceBalance - payment, alice.getBalance(t2), 0); ! assertEquals(bobBalance + payment, bob.getBalance(t2), 0); ! ! assertEquals(aliceBalance - payment, alice.getBalance(t3), 0); ! assertEquals(bobBalance + payment, bob.getBalance(t3), 0); ! assertEquals(aliceBalance - amount, alice.getBalance(t4), 0); ! assertEquals(bobBalance + amount, bob.getBalance(t4), 0); ! assertEquals(aliceBalance - amount, alice.getBalance(t5), 0); ! assertEquals(bobBalance + amount, bob.getBalance(t5), 0); ! ledger.commitUT(ut); } ! public final void testHold() throws LedgerException { ! final Calendar cal = Calendar.getInstance(); ! final Date t1 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t2 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t3 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t4 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t5 = cal.getTime(); ! UserTransaction ut = ledger.beginUT(); ! ! final Book alice = getNewAliceBook(); ! final Book bob = getNewBobBook(); ! ! ! final double amount = 105; ! ! // We are holding 105 from t2 to t4 ! alice.hold(bob, amount, "Hold", t2, t4); ! ! final double aliceBalance = alice.getBalance(t1); ! final double bobBalance = bob.getBalance(t1); ! // First lets check it hasnt affected the real balance ! assertEquals(aliceBalance, alice.getBalance(t2), 0); ! assertEquals(bobBalance, bob.getBalance(t2), 0); ! assertEquals(aliceBalance, alice.getBalance(t3), 0); ! assertEquals(bobBalance, bob.getBalance(t3), 0); ! assertEquals(aliceBalance, alice.getBalance(t4), 0); ! assertEquals(bobBalance, bob.getBalance(t4), 0); ! assertEquals(aliceBalance, alice.getBalance(t5), 0); ! assertEquals(bobBalance, bob.getBalance(t5), 0); ! ! // Then lets check that it has affected the available balance of Alice ! // It should affect the following ! assertEquals(aliceBalance - amount, alice.getAvailableBalance(t2), 0); ! assertEquals(aliceBalance - amount, alice.getAvailableBalance(t3), 0); ! ! // Her available balance should be the same as her real balance here ! assertEquals(alice.getBalance(t4), alice.getAvailableBalance(t4), 0); ! assertEquals(alice.getBalance(t5), alice.getAvailableBalance(t5), 0); ! assertEquals(alice.getBalance(t1), alice.getAvailableBalance(t1), 0); ! // Her available balance should be the same as the previous balance here ! assertEquals(aliceBalance, alice.getAvailableBalance(t5), 0); ! ! // Bob's available balance should be the same as his real balance all along. ! assertEquals(bob.getBalance(t1), bob.getAvailableBalance(t1), 0); ! ! if (this instanceof SQLLedgerTest) { // Quick hack. I dont have time to fix the SimpleLedger at the moment ! assertEquals(bob.getBalance(t2), bob.getAvailableBalance(t2), 0); ! assertEquals(bob.getBalance(t3), bob.getAvailableBalance(t3), 0); ! assertEquals(bob.getBalance(t4), bob.getAvailableBalance(t4), 0); ! assertEquals(bob.getBalance(t5), bob.getAvailableBalance(t5), 0); } ! ledger.commitUT(ut); ! } ! public final void testReversal() throws LedgerException { ! UserTransaction ut = ledger.beginUT(); ! final Book bob = getNewBobBook(); ! final Book alice = getNewAliceBook(); ! ! final double amount = 123; ! final double balance = bob.getBalance(); ! ! final PostedTransaction tran = bob.transfer(alice, amount, "Hello", new Date()); ! assertNotNull(tran); ! assertEquals(bob.getBalance(), balance - amount, 0); ! final PostedTransaction reverse = tran.reverse("Reverse it"); ! assertNotNull(reverse); ! assertEquals(bob.getBalance(), balance, 0); ! ledger.commitUT(ut); ! } ! public final void testCompleteHeld() throws LedgerException { ! final Calendar cal = Calendar.getInstance(); ! final Date t1 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t2 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t3 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t4 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t5 = cal.getTime(); ! ! UserTransaction ut = ledger.beginUT(); ! ! final Book ignacio = createNewBook("neu://verax/testusers/Ignacio"); ! final Book palacio = createNewBook("neu://verax/testusers/Palacio"); ! final double amount = 123; ! final double held = 200; ! final double balance = ignacio.getBalance(t1); ! final PostedHeldTransaction hold = ignacio.hold(palacio, held, "Hello", t2, t4); ! assertNotNull(hold); ! assertEquals(ignacio.getBalance(t1), balance, 0); ! assertEquals(ignacio.getBalance(t2), balance, 0); ! assertEquals(ignacio.getBalance(t3), balance, 0); ! assertEquals(ignacio.getBalance(t4), balance, 0); ! assertEquals(ignacio.getBalance(t5), balance, 0); - assertEquals(ignacio.getAvailableBalance(t1), balance, 0); - assertEquals(ignacio.getAvailableBalance(t2), balance - held, 0); - assertEquals(ignacio.getAvailableBalance(t3), balance - held, 0); - assertEquals(ignacio.getAvailableBalance(t4), balance , 0); - assertEquals(ignacio.getAvailableBalance(t5), balance, 0); ! PostedTransaction tran = hold.complete(amount, t3, "Muchas Gracias para escoger El Palacio"); ! assertEquals(ignacio.getBalance(t1), balance, 0); ! assertEquals(ignacio.getBalance(t2), balance, 0); ! assertEquals(ignacio.getBalance(t3), balance - amount, 0); ! assertEquals(ignacio.getBalance(t4), balance - amount, 0); ! assertEquals(ignacio.getBalance(t5), balance - amount, 0); ! assertEquals(ignacio.getAvailableBalance(t1), balance, 0); ! assertEquals(ignacio.getAvailableBalance(t2), balance, 0); ! assertEquals(ignacio.getAvailableBalance(t3), balance - amount, 0); ! assertEquals(ignacio.getAvailableBalance(t4), balance - amount, 0); ! assertEquals(ignacio.getAvailableBalance(t5), balance - amount, 0); ! assertEquals(ignacio.getBalance(t4), ignacio.getAvailableBalance(t5), 0); ! try { ! tran = hold.complete(amount, t3, "Muchas Gracias para escoger El Palacio"); ! assertNull(tran); ! assertTrue("Should have thrown Exception Here", false); ! } catch (TransactionExpiredException e) { ! assertTrue("Did throw exception here", true); ! } ! ledger.commitUT(ut); ! } ! public final void testFindTransaction() throws LowlevelLedgerException, BookExistsException, UnBalancedTransactionException, InvalidTransactionException, UnknownTransactionException, UnknownBookException { ! UserTransaction ut = ledger.beginUT(); ! final Book bob = getNewBobBook(); ! final Book alice = getNewAliceBook(); ! final double amount = 123; ! final PostedTransaction tran = bob.transfer(alice, amount, "Can we find this again", new Date()); ! assertNotNull(tran); ! final PostedTransaction found = ledger.findTransaction(tran.getXid()); ! assertNotNull(found); ! assertEquals(found.getXid(), tran.getXid()); ! ledger.commitUT(ut); ! } - public final void testFindHeldTransaction() throws LowlevelLedgerException, BookExistsException, UnBalancedTransactionException, InvalidTransactionException, UnknownTransactionException, UnknownBookException { - UserTransaction ut = ledger.beginUT(); - final Book bob = getNewBobBook(); - final Book alice = getNewAliceBook(); ! final double amount = 123; ! final PostedHeldTransaction tran = bob.hold(alice, amount, "Can we find this again", new Date(), new Date()); ! assertNotNull(tran); ! final PostedHeldTransaction found = ledger.findHeldTransaction(tran.getXid()); ! assertNotNull(found); ! assertEquals(found.getXid(), tran.getXid()); ! ledger.commitUT(ut); } ! public final void testCancelHeld() throws LedgerException { ! UserTransaction ut = ledger.beginUT(); ! final Calendar cal = Calendar.getInstance(); ! final Date t1 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t2 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t3 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t4 = cal.getTime(); ! cal.add(Calendar.DAY_OF_YEAR, 1); ! final Date t5 = cal.getTime(); ! ! final Book ignacio = createNewBook("neu://verax/testusers/Ignacio"); ! final Book palacio = createNewBook("neu://verax/testusers/Palacio"); ! final double amount = 123; ! final double held = 200; ! final double balance = ignacio.getBalance(t1); ! final PostedHeldTransaction hold = ignacio.hold(palacio, held, "Hello", t2, t4); ! assertNotNull(hold); ! hold.cancel(); ! try { ! hold.complete(held, t3, "this shouldnt work"); ! assertTrue("Exception wasnt thrown for completing a cancelled transaction", false); ! } catch (TransactionExpiredException e) { ! ;// This should happen so we dont need to do anything ! } - ledger.commitUT(ut); } ! final Ledger ledger; } --- 122,266 ---- */ public abstract class LedgerTest extends TestCase { ! static final String BOB = "bob"; ! static final String ALICE = "alice"; public LedgerTest(final String s) throws LowlevelLedgerException, UnknownLedgerException, SQLException, NamingException, IOException, NeuClearException { super(s); ! // ledger=createLedger(); } ! // protected void finalize() throws Throwable { ! // ledger.close(); ! // } ! // ! /** ! * Sets up the fixture, for example, open a network connection. ! * This method is called before a test is executed. ! */ ! protected void setUp() throws Exception { ! ledger = createLedger(); } ! /** ! * Tears down the fixture, for example, close a network connection. ! * This method is called after a test is executed. ! */ ! protected void tearDown() throws Exception { ! ledger.close(); } ! public abstract Ledger createLedger() throws LowlevelLedgerException; ! public final void testTransfer() throws LedgerException { ! final double aliceBalance = ledger.getBalance(ALICE); ! final double bobBalance = ledger.getBalance(BOB); ! final double amount = 100; ! ledger.transfer(ALICE, BOB, amount, "LOAN"); ! assertEquals("ALICE BALANCE", aliceBalance - amount, ledger.getBalance(ALICE), 0); ! assertEquals("BOB BALANCE", bobBalance + amount, ledger.getBalance(BOB), 0); + ledger.transfer(BOB, ALICE, amount, "Repayment"); + assertEquals("REPAY ALICE BALANCE", aliceBalance, ledger.getBalance(ALICE), 0); + assertEquals("REPAY BOB BALANCE", bobBalance, ledger.getBalance(BOB), 0); + ledger.transfer(BOB, ALICE, 5, "Interest"); + System.out.println("Alice's Balance: " + ledger.getBalance(ALICE)); + System.out.println("Bob's Balance: " + ledger.getBalance(BOB)); } ! public final void testMultiTransfer() throws UnBalancedTransactionException, LowlevelLedgerException, InvalidTransactionException { ! final double bobBalance = ledger.getBalance(BOB); ! int cumulative = 0; ! for (int i = 0; i < 100; i++) { ! ledger.transfer("req" + i + System.currentTimeMillis(), "x" + i + System.currentTimeMillis(), "Issuer", "bob", i, "fund it"); ! cumulative += i; ! assertEquals("BOB BALANCE", bobBalance + cumulative, ledger.getBalance(BOB), 0); } ! System.out.println("Bob's Balance: " + ledger.getBalance(BOB)); } ! public final void testBalance() throws LedgerException { ! System.out.println("Alice's Balance: " + ledger.getBalance(ALICE)); ! System.out.println("Bob's Balance: " + ledger.getBalance(BOB)); } ! public final void testHoldAndExpireTransfer() throws LowlevelLedgerException, UnBalancedTransactionException, InvalidTransactionException { ! final double aliceBalance = ledger.getBalance(ALICE); ! final double bobBalance = ledger.getBalance(BOB); ! final double amount = 100; ! System.out.println("Alice's Balance: " + ledger.getBalance(ALICE)); ! System.out.println("Bob's Balance: " + ledger.getBalance(BOB)); ! ledger.hold(ALICE, BOB, new Date(System.currentTimeMillis() + 5000), amount, "LOAN"); ! assertEquals("ALICE BALANCE", aliceBalance, ledger.getBalance(ALICE), 0); ! assertEquals("BOB BALANCE", bobBalance, ledger.getBalance(BOB), 0); ! assertEquals("ALICE Available BALANCE", aliceBalance - amount, ledger.getAvailableBalance(ALICE), 0); ! assertEquals("BOB Available BALANCE", bobBalance, ledger.getAvailableBalance(BOB), 0); ! try { ! Thread.currentThread().sleep(5000); ! } catch (InterruptedException e) { ! ; ! } ! assertEquals("ALICE BALANCE EXPIRED", aliceBalance, ledger.getBalance(ALICE), 0); ! assertEquals("BOB BALANCE EXPIRED", bobBalance, ledger.getBalance(BOB), 0); ! assertEquals("ALICE Available BALANCE EXPIRED", aliceBalance, ledger.getAvailableBalance(ALICE), 0); ! assertEquals("BOB Available BALANCE EXPIRED", bobBalance, ledger.getAvailableBalance(BOB), 0); ! System.out.println("Alice's Balance: " + ledger.getBalance(ALICE)); ! System.out.println("Bob's Balance: " + ledger.getBalance(BOB)); ! } ! public final void testHoldAndCancelTransfer() throws LowlevelLedgerException, UnBalancedTransactionException, InvalidTransactionException, UnknownTransactionException { ! final double aliceBalance = ledger.getBalance(ALICE); ! final double bobBalance = ledger.getBalance(BOB); ! final double amount = 100; ! PostedHeldTransaction tran = ledger.hold(ALICE, BOB, new Date(System.currentTimeMillis() + 5000), amount, "LOAN"); ! assertEquals("ALICE BALANCE", aliceBalance, ledger.getBalance(ALICE), 0); ! assertEquals("BOB BALANCE", bobBalance, ledger.getBalance(BOB), 0); ! assertEquals("ALICE Available BALANCE", aliceBalance - amount, ledger.getAvailableBalance(ALICE), 0); ! assertEquals("BOB Available BALANCE", bobBalance, ledger.getAvailableBalance(BOB), 0); ! ledger.performCancelHold(tran); ! assertEquals("ALICE BALANCE CANCELLED", aliceBalance, ledger.getBalance(ALICE), 0); ! assertEquals("BOB BALANCE CANCELLED", bobBalance, ledger.getBalance(BOB), 0); ! assertEquals("ALICE Available BALANCE CANCELLED", aliceBalance, ledger.getAvailableBalance(ALICE), 0); ! assertEquals("BOB Available BALANCE CANCELLED", bobBalance, ledger.getAvailableBalance(BOB), 0); ! System.out.println("Alice's Balance: " + ledger.getBalance(ALICE)); ! System.out.println("Bob's Balance: " + ledger.getBalance(BOB)); } ! public final void testHoldAndCompleteTransfer() throws LowlevelLedgerException, UnBalancedTransactionException, InvalidTransactionException, UnknownTransactionException, TransactionExpiredException { ! final double aliceBalance = ledger.getBalance(ALICE); ! final double bobBalance = ledger.getBalance(BOB); ! final double amount = 100; ! PostedHeldTransaction tran = ledger.hold(ALICE, BOB, new Date(System.currentTimeMillis() + 5000), amount, "LOAN"); ! assertEquals("ALICE BALANCE", aliceBalance, ledger.getBalance(ALICE), 0); ! assertEquals("BOB BALANCE", bobBalance, ledger.getBalance(BOB), 0); ! assertEquals("ALICE Available BALANCE", aliceBalance - amount, ledger.getAvailableBalance(ALICE), 0); ! assertEquals("BOB Available BALANCE", bobBalance, ledger.getAvailableBalance(BOB), 0); ! ledger.performCompleteHold(tran, 100, "done"); ! assertEquals("ALICE BALANCE CANCELLED", aliceBalance - amount, ledger.getBalance(ALICE), 0); ! assertEquals("BOB BALANCE CANCELLED", bobBalance + amount, ledger.getBalance(BOB), 0); ! assertEquals("ALICE Available BALANCE CANCELLED", aliceBalance - amount, ledger.getAvailableBalance(ALICE), 0); ! assertEquals("BOB Available BALANCE CANCELLED", bobBalance + amount, ledger.getAvailableBalance(BOB), 0); + System.out.println("Alice's Balance: " + ledger.getBalance(ALICE)); + System.out.println("Bob's Balance: " + ledger.getBalance(BOB)); } ! protected Ledger ledger; } Index: SQLLedgerTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/test/org/neuclear/ledger/SQLLedgerTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SQLLedgerTest.java 26 Dec 2003 22:50:52 -0000 1.5 --- SQLLedgerTest.java 21 Mar 2004 00:48:36 -0000 1.6 *************** *** 2,8 **** import org.neuclear.commons.NeuClearException; - import org.neuclear.commons.sql.SQLTools; - import org.neuclear.commons.sql.DefaultConnectionSource; - import org.neuclear.ledger.implementations.SQLLedger; import javax.naming.NamingException; --- 2,5 ---- |