Jta { public static TransactionManager getTransactionManager() { synchronized (initLock) { if (!Jta.frozen) { throw new IllegalStateException("JTA configuration must be frozen before retrieving TransactionManager from this class."); } } return Jta.transactionManager; } private  Jta(); static void configure(TransactionManager transactionManager, UserTransaction userTransaction); static void reset(); static boolean isFrozen(); static boolean isEnabled(); static TransactionManager getTransactionManager(); static UserTransaction getUserTransaction();  }
@Test public void testGetTransactionManager() throws Exception { Jta.configure(transactionManager, userTransaction); assertTrue(Jta.isFrozen()); assertSame(transactionManager, Jta.getTransactionManager()); }