System.err.println("Starting top-level action.");
A.begin();
A.add(new LastResourceRecord(opRes));
A.add(new ShutdownRecord(ShutdownRecord.FAIL_IN_PREPARE));
A.commit();
if (opRes.status() != OnePhase.COMMITTED)
{
System.err.println("Confirmed that one-phase record is last in prepare.");
A = new AtomicAction();
opRes = new OnePhase();
A.begin();
System.err.println("\nStarting new top-level action.");
A.add(new LastResourceRecord(opRes));
A.add(new ShutdownRecord(ShutdownRecord.FAIL_IN_COMMIT));
A.commit();
if (opRes.status() == OnePhase.COMMITTED)
{
System.err.println("Confirmed that one-phase record is first in commit.");
A = new AtomicAction();
A.begin();
A.add(new LastResourceRecord(new OnePhase()));
if (A.add(new LastResourceRecord(new OnePhase())) == AddOutcome.AR_DUPLICATE)
{
System.err.println("\nConfirmed that only one such resource can be added.");
assertSuccess();
}