|
From: Pelle B. <pe...@us...> - 2004-03-31 23:23:02
|
Update of /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28687/src/java/org/neuclear/ledger/tests Modified Files: AbstractLedgerBrowserTest.java AbstractLedgerTest.java Log Message: Reworked the ID's of the transactions. The primary ID is now the request ID. Receipt ID's are optional and added using a separate set method. The various interactive passphrase agents now have shell methods for the new interactive approach. Index: AbstractLedgerTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/tests/AbstractLedgerTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractLedgerTest.java 25 Mar 2004 21:39:43 -0000 1.5 --- AbstractLedgerTest.java 31 Mar 2004 23:11:09 -0000 1.6 *************** *** 13,19 **** * $Id$ * $Log$ * Revision 1.5 2004/03/25 21:39:43 pelle * Modified expire tests a bit to eliminate one cause for an error ! * * Revision 1.4 2004/03/25 19:03:23 pelle * PostedTransaction and friend now verify the unpostedtransaction is balanced. --- 13,24 ---- * $Id$ * $Log$ + * Revision 1.6 2004/03/31 23:11:09 pelle + * Reworked the ID's of the transactions. The primary ID is now the request ID. + * Receipt ID's are optional and added using a separate set method. + * The various interactive passphrase agents now have shell methods for the new interactive approach. + * * Revision 1.5 2004/03/25 21:39:43 pelle * Modified expire tests a bit to eliminate one cause for an error ! * <p/> * Revision 1.4 2004/03/25 19:03:23 pelle * PostedTransaction and friend now verify the unpostedtransaction is balanced. *************** *** 227,231 **** int cumulative = 0; for (int i = 0; i < 100; i++) { ! ledger.transfer("req" + i + System.currentTimeMillis(), "x" + i + System.currentTimeMillis(), "Issuer", CAROL, i, "fund it"); cumulative += i; assertEquals("BOB BALANCE", bobBalance + cumulative, ledger.getBalance(CAROL), 0); --- 232,236 ---- int cumulative = 0; for (int i = 0; i < 100; i++) { ! ledger.transfer("req" + i + System.currentTimeMillis(), "Issuer", CAROL, i, "fund it"); cumulative += i; assertEquals("BOB BALANCE", bobBalance + cumulative, ledger.getBalance(CAROL), 0); *************** *** 353,356 **** --- 358,375 ---- } + public final void testSetReceiptId() throws LedgerException { + final double aliceBalance = ledger.getBalance(ALICE); + final double bobBalance = ledger.getBalance(BOB); + + PostedTransaction tran = ledger.transfer(ALICE, BOB, 100, "LOAN"); + assertNull(tran.getReceiptId()); + try { + ledger.setReceiptId(tran.getRequestId(), "1234"); + } catch (UnknownTransactionException e) { + assertTrue(true); + } + + } + public final void testNaiveBenchmark() throws UnBalancedTransactionException, LowlevelLedgerException, InvalidTransactionException { final int iterations = 100; Index: AbstractLedgerBrowserTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-ledger/src/java/org/neuclear/ledger/tests/AbstractLedgerBrowserTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractLedgerBrowserTest.java 29 Mar 2004 16:56:26 -0000 1.3 --- AbstractLedgerBrowserTest.java 31 Mar 2004 23:11:09 -0000 1.4 *************** *** 13,16 **** --- 13,21 ---- $Id$ $Log$ + Revision 1.4 2004/03/31 23:11:09 pelle + Reworked the ID's of the transactions. The primary ID is now the request ID. + Receipt ID's are optional and added using a separate set method. + The various interactive passphrase agents now have shell methods for the new interactive approach. + Revision 1.3 2004/03/29 16:56:26 pelle AbstractLedgerBrowserTest has been extended to test date ranges *************** *** 182,187 **** assertEquals("amount", amount, bb.getAmount(), 0); assertEquals("comment", "test" + total, bb.getComment()); ! assertNotNull("id", bb.getId()); ! assertNotNull("reqid", bb.getRequestId()); assertNotNull("valuetime", bb.getValuetime()); assertNull("expiry", bb.getExpirytime()); --- 187,191 ---- assertEquals("amount", amount, bb.getAmount(), 0); assertEquals("comment", "test" + total, bb.getComment()); ! assertNotNull("request", bb.getRequestId()); assertNotNull("valuetime", bb.getValuetime()); assertNull("expiry", bb.getExpirytime()); |