Search in sources :

Example 1 with JCAServerTransactionHeaderReader

use of com.arjuna.ats.internal.jta.tools.osb.mbean.jts.JCAServerTransactionHeaderReader in project narayana by jbosstm.

the class NewTypeTest method testInstrumentNewType.

@Test
public void testInstrumentNewType() throws MBeanException {
    OSBTypeHandler osbTypeHandler = new OSBTypeHandler(true, "com.arjuna.ats.internal.jta.tools.osb.mbean.jts.ArjunaTransactionImpleWrapper", "com.arjuna.ats.internal.jta.tools.osb.mbean.jts.JTSActionBean", "StateManager/BasicAction/TwoPhaseCoordinator/ArjunaTransactionImple/ServerTransaction/JCA", JCAServerTransactionHeaderReader.class.getName());
    JCAServerTransactionHeaderReader headerStateReader = (JCAServerTransactionHeaderReader) osbTypeHandler.getHeaderStateReader();
    // , new XidImple(new Uid()))
    RecoveringSubordinateServerTransaction txn = new RecoveringSubordinateServerTransaction(new Uid());
    ObjStoreBrowser osb = createObjStoreBrowser(false);
    osb.registerHandler(osbTypeHandler);
    generatedHeuristicHazard(txn);
    osb.probe();
    UidWrapper w = osb.findUid(txn.get_uid());
    assertNotNull(w);
    assertTrue(headerStateReader.isWasInvoked());
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) JCAServerTransactionHeaderReader(com.arjuna.ats.internal.jta.tools.osb.mbean.jts.JCAServerTransactionHeaderReader) OSBTypeHandler(com.arjuna.ats.arjuna.tools.osb.mbean.OSBTypeHandler) UidWrapper(com.arjuna.ats.arjuna.tools.osb.mbean.UidWrapper) ObjStoreBrowser(com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser) Test(org.junit.Test)

Aggregations

Uid (com.arjuna.ats.arjuna.common.Uid)1 OSBTypeHandler (com.arjuna.ats.arjuna.tools.osb.mbean.OSBTypeHandler)1 ObjStoreBrowser (com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser)1 UidWrapper (com.arjuna.ats.arjuna.tools.osb.mbean.UidWrapper)1 JCAServerTransactionHeaderReader (com.arjuna.ats.internal.jta.tools.osb.mbean.jts.JCAServerTransactionHeaderReader)1 Test (org.junit.Test)1