Search in sources :

Example 1 with CacheJndiTmFactory

use of org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory in project ignite by apache.

the class CacheJndiTmFactorySelfTest method testFactoryException.

/**
     * @throws Exception If failed.
     */
public void testFactoryException() throws Exception {
    final CacheJndiTmFactory f = new CacheJndiTmFactory("wrongJndiName", NOT_TM_JNDI_NAME, "wrongJndiName2");
    GridTestUtils.assertThrows(log, new Callable<TransactionManager>() {

        @Override
        public TransactionManager call() throws Exception {
            return f.create();
        }
    }, IgniteException.class, "Failed to lookup TM by");
}
Also used : TransactionManager(javax.transaction.TransactionManager) CacheJndiTmFactory(org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory) HeuristicRollbackException(javax.transaction.HeuristicRollbackException) IgniteException(org.apache.ignite.IgniteException) InvalidTransactionException(javax.transaction.InvalidTransactionException) NotSupportedException(javax.transaction.NotSupportedException) SystemException(javax.transaction.SystemException) RollbackException(javax.transaction.RollbackException) HeuristicMixedException(javax.transaction.HeuristicMixedException)

Example 2 with CacheJndiTmFactory

use of org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory in project ignite by apache.

the class CacheJndiTmFactorySelfTest method testFactory.

/**
     * @throws Exception If failed.
     */
public void testFactory() throws Exception {
    CacheJndiTmFactory f = new CacheJndiTmFactory("wrongJndiName", NOT_TM_JNDI_NAME, TM_JNDI_NAME2, TM_JNDI_NAME);
    TransactionManager mgr = f.create();
    assertNotNull(mgr);
    assertTrue("Mgr: " + mgr, mgr instanceof TestTransactionManager2);
}
Also used : TransactionManager(javax.transaction.TransactionManager) CacheJndiTmFactory(org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory)

Aggregations

TransactionManager (javax.transaction.TransactionManager)2 CacheJndiTmFactory (org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory)2 HeuristicMixedException (javax.transaction.HeuristicMixedException)1 HeuristicRollbackException (javax.transaction.HeuristicRollbackException)1 InvalidTransactionException (javax.transaction.InvalidTransactionException)1 NotSupportedException (javax.transaction.NotSupportedException)1 RollbackException (javax.transaction.RollbackException)1 SystemException (javax.transaction.SystemException)1 IgniteException (org.apache.ignite.IgniteException)1