|
From: Pelle B. <pe...@us...> - 2004-04-06 23:13:53
|
Update of /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/controllers/currency In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5261/src/test/org/neuclear/asset/controllers/currency Modified Files: CurrencyTests.java Added Files: PersistentCurrencyTests.java Log Message: Create new PersistentCurrencyTests TestCase for doing integration testing with various persistent ledgers. Index: CurrencyTests.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/controllers/currency/CurrencyTests.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CurrencyTests.java 6 Apr 2004 16:24:35 -0000 1.9 --- CurrencyTests.java 6 Apr 2004 23:01:01 -0000 1.10 *************** *** 36,48 **** * Time: 6:05:04 PM */ ! public final class CurrencyTests extends AbstractSigningTest { ! public CurrencyTests(final String s) throws LowlevelLedgerException, GeneralSecurityException, NeuClearException { super(s); asset = createTestAsset(); shoes = createShoeAsset(); agent = createTestExchangeAgent(); ! ledger = new SimpleLedger("test"); proc = new CurrencyController(ledger, asset, getSigner(), "neu://test/bux"); ! auditLedger = new SimpleLedger("auditor"); auditor = new Auditor(asset, auditLedger); } --- 36,52 ---- * Time: 6:05:04 PM */ ! public class CurrencyTests extends AbstractSigningTest { ! public CurrencyTests(final String s) throws GeneralSecurityException, LowlevelLedgerException, NeuClearException { ! this(s, new SimpleLedger("asset"), new SimpleLedger("test")); ! } ! ! public CurrencyTests(final String s, final Ledger assetLedger, final Ledger auditLedger) throws LowlevelLedgerException, GeneralSecurityException, NeuClearException { super(s); asset = createTestAsset(); shoes = createShoeAsset(); agent = createTestExchangeAgent(); ! ledger = assetLedger; proc = new CurrencyController(ledger, asset, getSigner(), "neu://test/bux"); ! this.auditLedger = auditLedger; auditor = new Auditor(asset, auditLedger); } *************** *** 143,147 **** assertAudit(getAlice().getName()); ! Builder builder = new ExchangeOrderBuilder(asset, agent, new Amount(20), new Date(System.currentTimeMillis() + 8000), new BidItem[]{new BidItem(shoes, new Amount(10))}, "give me shoes"); SignedNamedObject receipt = process(builder); assertNotNull(receipt); --- 147,151 ---- assertAudit(getAlice().getName()); ! Builder builder = new ExchangeOrderBuilder(asset, agent, new Amount(20), new Date(System.currentTimeMillis() + 10000), new BidItem[]{new BidItem(shoes, new Amount(10))}, "give me shoes"); SignedNamedObject receipt = process(builder); assertNotNull(receipt); --- NEW FILE: PersistentCurrencyTests.java --- package org.neuclear.asset.controllers.currency; import org.neuclear.commons.NeuClearException; import org.neuclear.ledger.LowlevelLedgerException; import org.neuclear.ledger.prevalent.PrevalentLedger; import org.neuclear.ledger.simple.SimpleLedger; import java.io.IOException; import java.security.GeneralSecurityException; /* NeuClear Distributed Transaction Clearing Platform (C) 2003 Pelle Braendgaard This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA $Id: PersistentCurrencyTests.java,v 1.1 2004/04/06 23:01:01 pelle Exp $ $Log: PersistentCurrencyTests.java,v $ Revision 1.1 2004/04/06 23:01:01 pelle Create new PersistentCurrencyTests TestCase for doing integration testing with various persistent ledgers. */ /** * User: pelleb * Date: Apr 6, 2004 * Time: 8:11:02 PM */ public class PersistentCurrencyTests extends CurrencyTests { public PersistentCurrencyTests(String s) throws GeneralSecurityException, LowlevelLedgerException, NeuClearException, IOException, ClassNotFoundException { super(s, new PrevalentLedger("asset", "target/test-data/pl"), new SimpleLedger("audit")); } } |