use of com.hp.mwtests.ts.txoj.common.resources.AtomicObject in project narayana by jbosstm.
the class RecoveryTest method testAbort.
@Test
public void testAbort() throws Exception {
AtomicAction A = new AtomicAction();
A.begin();
AtomicObject obj = new AtomicObject();
OutputObjectState os = new OutputObjectState();
Uid u = new Uid();
assertTrue(obj.save_state(os, ObjectType.ANDPERSISTENT));
assertTrue(StoreManager.getParticipantStore().write_uncommitted(u, obj.type(), os));
MyRecoveredTO rto = new MyRecoveredTO(u, obj.type(), StoreManager.getParticipantStore());
A.abort();
rto.replay();
}
use of com.hp.mwtests.ts.txoj.common.resources.AtomicObject in project narayana by jbosstm.
the class AtomicTest method run.
@Test
public void run() {
AtomicObject foo = new AtomicObject();
Uid u = foo.get_uid();
AtomicAction A = new AtomicAction();
try {
A.begin();
foo.set(2);
A.commit();
int finalVal = foo.get();
assertEquals(2, finalVal);
foo = new AtomicObject(u);
A = new AtomicAction();
A.begin();
foo.set(4);
A.commit();
finalVal = foo.get();
assertEquals(4, finalVal);
} catch (TestException e) {
A.abort();
fail("AtomicObject exception raised.");
}
}
Aggregations