Search in sources :

Example 1 with TransactionBroker

use of org.apache.activemq.broker.TransactionBroker in project activemq-artemis by apache.

the class ActiveMQXAConnectionFactoryTest method assertTransactionGoneFromBroker.

private void assertTransactionGoneFromBroker(Xid tid) throws Exception {
    BrokerService broker = BrokerRegistry.getInstance().lookup("localhost");
    TransactionBroker transactionBroker = (TransactionBroker) broker.getBroker().getAdaptor(TransactionBroker.class);
    try {
        transactionBroker.getTransaction(null, new XATransactionId(tid), false);
        fail("expected exception on tx not found");
    } catch (XAException expectedOnNotFound) {
    }
}
Also used : XATransactionId(org.apache.activemq.command.XATransactionId) XAException(javax.transaction.xa.XAException) TransactionBroker(org.apache.activemq.broker.TransactionBroker) BrokerService(org.apache.activemq.broker.BrokerService)

Aggregations

XAException (javax.transaction.xa.XAException)1 BrokerService (org.apache.activemq.broker.BrokerService)1 TransactionBroker (org.apache.activemq.broker.TransactionBroker)1 XATransactionId (org.apache.activemq.command.XATransactionId)1