@Test public void test(){ TransactionManager tm = new TransactionManagerImple(); int i = 0; final AtomicInteger x = new AtomicInteger(0);
@Test public void testDisallowed() throws SystemException, NotSupportedException, RollbackException { final LastOnePhaseResource firstResource = new LastOnePhaseResource() ; final LastOnePhaseResource secondResource = new LastOnePhaseResource() ; final TransactionManager tm = new TransactionManagerImple() ; tm.begin() ; try { final Transaction tx = tm.getTransaction() ; assertTrue("First resource enlisted", tx.enlistResource(firstResource)) ; assertFalse("Second resource enlisted", tx.enlistResource(secondResource)) ; } finally { tm.rollback() ; } } }
@Test public void testJBossTS() throws Exception { TransactionManagerImple tm = new TransactionManagerImple(); tm.begin(); EntityManager em = factory.createEntityManager();
@Test public void testAllowed() throws SystemException, NotSupportedException, RollbackException { final LastOnePhaseResource firstResource = new LastOnePhaseResource() ; final LastOnePhaseResource secondResource = new LastOnePhaseResource() ; final LastOnePhaseResource thirdResource = new LastOnePhaseResource() ; final TransactionManager tm = new TransactionManagerImple() ; tm.begin() ; try { final Transaction tx = tm.getTransaction() ; assertTrue("First resource enlisted", tx.enlistResource(firstResource)) ; assertTrue("Second resource enlisted", tx.enlistResource(secondResource)) ; assertTrue("Third resource enlisted", tx.enlistResource(thirdResource)) ; } finally { tm.rollback() ; } } }
@Test public void test () throws Exception { TransactionManagerImple tmi = new TransactionManagerImple(); assertEquals(tmi.getTransaction(), null); assertEquals(tmi.getObjectInstance(null, null, null, null), tmi); tmi.setTransactionTimeout(10); assertEquals(tmi.getTimeout(), 10); } }
TransactionManagerImple tm = new TransactionManagerImple();