public class TestAccount
extends junit.framework.TestCase
Modifier and Type | Class and Description |
---|---|
static class |
TestAccount.Account
An implementation of a bank account data type used to test state-based
validation.
|
static class |
TestAccount.TxAccount
A transactional view of an
TestAccount.Account . |
Constructor and Description |
---|
TestAccount() |
TestAccount(String arg0) |
Modifier and Type | Method and Description |
---|---|
void |
test_Schedule01()
Runs a schedule and verifies the intermediate and stable states for an
TestAccount.Account . |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
public TestAccount()
public TestAccount(String arg0)
arg0
- public void test_Schedule01()
Runs a schedule and verifies the intermediate and stable states for an
TestAccount.Account
.
The schedule is from page 101 of http://www.cs.brown.edu/~mph/Herlihy90a/p96-herlihy.pdf. This schedule interleaves two transactions, P and Q. There is an initial balance of $0. There is a $5 credit on P followed by a $6 credit on Q. P then validates and commits (validation occurs during the commit protocol), with a resulting stable balance of $5. A $10 debit is then made on Q and Q validates and commits (again, validation is part of the commit). The final stable balance is $1.
a Credit($5)/Ok( ) P a Credit($6)/Ok( ) Q a Commit P a Debit($lO)/Ok( ) Q a Commit Q
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.