本文整理匯總了Java中org.unitils.database.util.TransactionMode類的典型用法代碼示例。如果您正苦於以下問題:Java TransactionMode類的具體用法?Java TransactionMode怎麽用?Java TransactionMode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
TransactionMode類屬於org.unitils.database.util包,在下文中一共展示了TransactionMode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testJdbc_Commit
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testJdbc_Commit() throws Exception {
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTestFindById(JdbcTest.class);
assertPersonRecordAvailable();
runTestPersist(JdbcTest.class);
assertPersonRecordAvailable();
}
示例2: testJdbc_Rollback
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testJdbc_Rollback() throws Exception {
setTransactionMode(TransactionMode.ROLLBACK);
Unitils.initSingletonInstance();
runTestFindById(JdbcTest.class);
assertPersonTableEmpty();
runTestPersist(JdbcTest.class);
assertPersonTableEmpty();
}
示例3: testHibernateJpa_Commit
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernateJpa_Commit() throws Exception {
setPersistenceProvider("hibernate");
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTestFindById(HibernateJpaTest.class);
assertPersonRecordAvailable();
runTestPersist(HibernateJpaTest.class);
assertPersonRecordAvailable();
runMappingTest(HibernateJpaTest.class);
}
示例4: testHibernateJpa_Rollback
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernateJpa_Rollback() throws Exception {
setPersistenceProvider("hibernate");
setTransactionMode(TransactionMode.ROLLBACK);
Unitils.initSingletonInstance();
runTestFindById(HibernateJpaTest.class);
assertPersonTableEmpty();
runTest(HibernateJpaTest.class, "testPersist");
assertPersonTableEmpty();
runMappingTest(HibernateJpaTest.class);
}
示例5: testToplinkJpa_Commit
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testToplinkJpa_Commit() throws Exception {
setPersistenceProvider("toplink");
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTestFindById(ToplinkJpaTest.class);
assertPersonRecordAvailable();
runTestPersist(ToplinkJpaTest.class);
assertPersonRecordAvailable();
// TODO is this needed?
JpaUnitils.getEntityManagerFactory().close();
}
示例6: testToplinkJpa_Rollback
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testToplinkJpa_Rollback() throws Exception {
setPersistenceProvider("toplink");
setTransactionMode(TransactionMode.ROLLBACK);
Unitils.initSingletonInstance();
runTestFindById(ToplinkJpaTest.class);
assertPersonTableEmpty();
runTestPersist(ToplinkJpaTest.class);
assertPersonTableEmpty();
JpaUnitils.getEntityManagerFactory().close();
}
示例7: testOpenJpa_Commit
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testOpenJpa_Commit() throws Exception {
setPersistenceProvider("openjpa");
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTestFindById(OpenJpaTest.class);
assertPersonRecordAvailable();
runTestPersist(OpenJpaTest.class);
assertPersonRecordAvailable();
}
示例8: testOpenJpa_Rollback
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testOpenJpa_Rollback() throws Exception {
setPersistenceProvider("openjpa");
setTransactionMode(TransactionMode.ROLLBACK);
Unitils.initSingletonInstance();
runTestFindById(OpenJpaTest.class);
assertPersonTableEmpty();
runTestPersist(OpenJpaTest.class);
assertPersonTableEmpty();
}
示例9: testHibernateJpaSpring_Commit
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernateJpaSpring_Commit() throws Exception {
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTestFindById(HibernateJpaSpringTest.class);
assertPersonRecordAvailable();
runTestPersist(HibernateJpaSpringTest.class);
assertPersonRecordAvailable();
}
示例10: testHibernateJpaSpring_Rollback
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernateJpaSpring_Rollback() throws Exception {
setTransactionMode(TransactionMode.ROLLBACK);
Unitils.initSingletonInstance();
runTestFindById(HibernateJpaSpringTest.class);
assertPersonTableEmpty();
runTestPersist(HibernateJpaSpringTest.class);
assertPersonTableEmpty();
}
示例11: testHibernate_Commit
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernate_Commit() throws Exception {
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTestFindById(HibernateJpaSpringTest.class);
assertPersonRecordAvailable();
runTestPersist(HibernateTest.class);
assertPersonRecordAvailable();
}
示例12: testHibernate_Rollback
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernate_Rollback() throws Exception {
setTransactionMode(TransactionMode.ROLLBACK);
Unitils.initSingletonInstance();
runTestFindById(HibernateJpaSpringTest.class);
assertPersonTableEmpty();
runTestPersist(HibernateTest.class);
assertPersonTableEmpty();
}
示例13: testHibernateSpring_Commit
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernateSpring_Commit() throws Exception {
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTestFindById(HibernateSpringTest.class);
assertPersonRecordAvailable();
runTestPersist(HibernateSpringTest.class);
assertPersonRecordAvailable();
}
示例14: testHibernateSpring_Rollback
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void testHibernateSpring_Rollback() throws Exception {
setTransactionMode(TransactionMode.ROLLBACK);
Unitils.initSingletonInstance();
runTestFindById(HibernateSpringTest.class);
assertPersonTableEmpty();
runTestPersist(HibernateSpringTest.class);
assertPersonTableEmpty();
}
示例15: noDataSourceCreatedWhenNotUsedWithTransactionsEnabled
import org.unitils.database.util.TransactionMode; //導入依賴的package包/類
@Test
public void noDataSourceCreatedWhenNotUsedWithTransactionsEnabled() throws Exception {
setWrongDatabasePassword();
setTransactionMode(TransactionMode.COMMIT);
Unitils.initSingletonInstance();
runTest(NoDatabaseTest.class, "testWhichDoesntNeedDatabase");
}