JtaTransactionController extends JTATransactionController { @Override protected TransactionManager acquireTransactionManager() throws Exception { if (!Jta.isEnabled()) { throw new IllegalStateException("Attempting to use EclipseLink with JTA, but JTA is not configured properly" + "for this KRAD application!"); } return Jta.getTransactionManager(); }    }
@Test public void testAcquireTransactionManager() throws Exception { Jta.configure(transactionManager, userTransaction); try { assertTrue(Jta.isEnabled()); JtaTransactionController controller = new JtaTransactionController(); assertEquals(transactionManager, controller.acquireTransactionManager()); } finally { Jta.reset(); } }