use of com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction in project narayana by jbosstm.
the class ServerTransactionUnitTest method testOnePhaseCommit.
@Test
public void testOnePhaseCommit() throws Exception {
ServerTransaction sc = new ServerTransaction(new Uid(), null);
sc.doCommit(true);
}
use of com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction in project narayana by jbosstm.
the class ServerTransactionUnitTest method testPrepareCommit.
@Test
public void testPrepareCommit() throws Exception {
ServerTransaction sc = new ServerTransaction(new Uid(), null);
sc.register_synchronization(new demosync(false).getReference());
sc.doBeforeCompletion();
assertEquals(sc.doPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
assertEquals(sc.doPhase2Commit(), TwoPhaseOutcome.FINISH_OK);
sc.doAfterCompletion(Status.StatusCommitted);
}
use of com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction in project narayana by jbosstm.
the class ServerTransactionUnitTest method test.
@Test
public void test() throws Exception {
ServerTransaction sc = new ServerTransaction(new Uid(), null);
assertTrue(sc.type() != null);
assertTrue(ServerTransaction.typeName() != null);
assertTrue(sc.getSavingUid().notEquals(Uid.nullUid()));
OutputObjectState os = new OutputObjectState();
assertTrue(sc.save_state(os, ObjectType.ANDPERSISTENT));
InputObjectState is = new InputObjectState(os);
assertTrue(sc.restore_state(is, ObjectType.ANDPERSISTENT));
sc.setRecoveryCoordinator(null);
}
use of com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction in project narayana by jbosstm.
the class ServerTransactionUnitTest method testRollback.
@Test
public void testRollback() throws Exception {
ServerTransaction sc = new ServerTransaction(new Uid(), null);
sc.rollback();
}
use of com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction in project narayana by jbosstm.
the class ServerSynchronizationUnitTest method test.
@Test
public void test() throws Exception {
ServerTransaction sc = new ServerTransaction(new Uid(), null);
ServerSynchronization sync = new ServerSynchronization(sc);
sync.before_completion();
sync.after_completion(Status.StatusCommitted);
assertTrue(sync.getSynchronization() != null);
sync.destroy();
}
Aggregations