use of com.hp.mwtests.ts.txoj.common.resources.RecoverableObject in project narayana by jbosstm.
the class PerformanceTest2 method recoverableTest.
@Test
public void recoverableTest() {
long iters = 1000;
RecoverableObject foo = new RecoverableObject();
AtomicAction A = null;
long t1 = System.currentTimeMillis();
for (int c = 0; c < iters; c++) {
A = new AtomicAction();
A.begin();
foo.set(2);
A.commit();
}
reportThroughput("recoverableTest", iters, t1);
}
use of com.hp.mwtests.ts.txoj.common.resources.RecoverableObject in project narayana by jbosstm.
the class PerformanceTest1 method recoverableTest.
@Test
public void recoverableTest() {
long iters = 4;
RecoverableObject foo = new RecoverableObject();
AtomicAction A = new AtomicAction();
long t1 = System.currentTimeMillis();
A.begin();
for (int c = 0; c < iters; c++) {
foo.set(2);
}
A.commit();
reportThroughput("recoverableTest", iters, t1);
}
use of com.hp.mwtests.ts.txoj.common.resources.RecoverableObject in project narayana by jbosstm.
the class RecoverableTest method test.
@Test
public void test() {
RecoverableObject foo = new RecoverableObject();
AtomicAction A = new AtomicAction();
A.begin();
foo.set(2);
assertEquals(2, foo.get());
A.abort();
assertEquals(0, foo.get());
AtomicAction B = new AtomicAction();
B.begin();
foo.set(4);
assertEquals(4, foo.get());
B.commit();
assertEquals(4, foo.get());
}
Aggregations