Search in sources :

Example 1 with PooledConnection

use of io.micronaut.jms.pool.PooledConnection in project micronaut-jms by micronaut-projects.

the class CustomBrokerSpec method testCustomBroker.

@Test
void testCustomBroker() throws JMSException {
    JMSConnectionPool connectionPool = applicationContext.getBean(JMSConnectionPool.class, Qualifiers.byName(CONNECTION_FACTORY_BEAN_NAME));
    Connection connection = connectionPool.createConnection();
    assertTrue(connection instanceof PooledConnection);
    Connection realConnection = ((PooledConnection) connection).get();
    assertTrue(realConnection instanceof XAConnection);
}
Also used : JMSConnectionPool(io.micronaut.jms.pool.JMSConnectionPool) PooledConnection(io.micronaut.jms.pool.PooledConnection) Connection(javax.jms.Connection) XAConnection(javax.jms.XAConnection) PooledConnection(io.micronaut.jms.pool.PooledConnection) XAConnection(javax.jms.XAConnection) Test(org.junit.jupiter.api.Test)

Aggregations

JMSConnectionPool (io.micronaut.jms.pool.JMSConnectionPool)1 PooledConnection (io.micronaut.jms.pool.PooledConnection)1 Connection (javax.jms.Connection)1 XAConnection (javax.jms.XAConnection)1 Test (org.junit.jupiter.api.Test)1