~pbeaman/akiban-persistit/dynamic-volumes

« back to all changes in this revision

Viewing changes to src/test/java/com/persistit/Bug974589Test.java

  • Committer: Peter Beaman
  • Date: 2013-04-29 21:18:24 UTC
  • mfrom: (374.37.18 stage)
  • Revision ID: pbeaman@akiban.com-20130429211824-ka4q0obrbg96hzu6
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
import org.junit.Test;
21
21
 
 
22
import com.persistit.Accumulator.SumAccumulator;
22
23
import com.persistit.exception.PersistitException;
23
24
import com.persistit.unit.UnitTestProperties;
24
25
 
47
48
             * Touch an Accumulator, then immediately checkpoint.
48
49
             */
49
50
            txn1.begin();
50
 
            Accumulator acc1 = ex1.getTree().getAccumulator(Accumulator.Type.SUM, 1);
51
 
            acc1.update(1, txn1);
 
51
            SumAccumulator acc1 = ex1.getTree().getSumAccumulator(1);
 
52
            acc1.add(1);
52
53
            txn1.commit();
53
54
            txn1.end();
54
55
            ex1 = null;
63
64
            Exchange ex2 = getExchange(_persistit);
64
65
            Transaction txn2 = ex2.getTransaction();
65
66
            txn2.begin();
66
 
            Accumulator acc2 = ex2.getTree().getAccumulator(Accumulator.Type.SUM, 1);
67
 
            assertEquals(loop, acc2.getSnapshotValue(txn2));
 
67
            SumAccumulator acc2 = ex2.getTree().getSumAccumulator(1);
 
68
            assertEquals(loop, acc2.getSnapshotValue());
68
69
            txn2.commit();
69
70
            txn2.end();
70
71
            System.out.printf("Iteration %,d completed\n", loop);