Jta { public static boolean isEnabled() { synchronized (initLock) { return Jta.transactionManager != null; } } 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 testIsEnabled() throws Exception { assertFalse(Jta.isEnabled()); Jta.configure(transactionManager, userTransaction); assertTrue(Jta.isEnabled()); Jta.reset(); Jta.configure(null, null); assertFalse(Jta.isEnabled()); }