Search in sources :

Example 1 with FactoryList

use of com.arjuna.ats.internal.jts.interposition.FactoryList in project narayana by jbosstm.

the class FactoryListUnitTest method test.

@SuppressWarnings("static-access")
@Test
public void test() throws Exception {
    FactoryList factory = new FactoryList();
    factory.removeDefault();
    try {
        assertNull(factory.recreate(null, FactoryList.DEFAULT_ID));
        fail();
    } catch (final INVALID_TRANSACTION ex) {
    } catch (final Throwable ex) {
        fail();
    }
    FactoryList.remove(Arjuna.restrictedXID());
    TransactionFactoryImple imple = new TransactionFactoryImple("test");
    ControlImple tx = imple.createLocal(1000);
    PropagationContext ctx = tx.get_coordinator().get_txcontext();
    Control cont = FactoryList.recreate(ctx, Arjuna.XID());
    assertTrue(Utility.getUid(cont).equals(tx.get_uid()));
}
Also used : Control(org.omg.CosTransactions.Control) PropagationContext(org.omg.CosTransactions.PropagationContext) INVALID_TRANSACTION(org.omg.CORBA.INVALID_TRANSACTION) TransactionFactoryImple(com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple) FactoryList(com.arjuna.ats.internal.jts.interposition.FactoryList) ControlImple(com.arjuna.ats.internal.jts.orbspecific.ControlImple) Test(org.junit.Test)

Aggregations

FactoryList (com.arjuna.ats.internal.jts.interposition.FactoryList)1 ControlImple (com.arjuna.ats.internal.jts.orbspecific.ControlImple)1 TransactionFactoryImple (com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple)1 Test (org.junit.Test)1 INVALID_TRANSACTION (org.omg.CORBA.INVALID_TRANSACTION)1 Control (org.omg.CosTransactions.Control)1 PropagationContext (org.omg.CosTransactions.PropagationContext)1