类org.springframework.test.context.transaction.BeforeTransaction源码实例Demo

下面列出了怎么用org.springframework.test.context.transaction.BeforeTransaction的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: OpenCue   文件: FrameDaoTests.java
@BeforeTransaction
public void create() {

    RenderHost host = RenderHost.newBuilder()
            .setName(HOST)
            .setBootTime(1192369572)
            .setFreeMcp(76020)
            .setFreeMem(53500)
            .setFreeSwap(20760)
            .setLoad(1)
            .setTotalMcp(195430)
            .setTotalMem(8173264)
            .setTotalSwap(20960)
            .setNimbyEnabled(false)
            .setNumProcs(1)
            .setCoresPerProc(100)
            .addAllTags(ImmutableList.of("mcore", "4core", "8g"))
            .setState(HardwareState.UP)
            .setFacility("spi")
            .putAttributes("freeGpu", "512")
            .putAttributes("totalGpu", "512")
            .build();

    hostManager.createHost(host);
}
 
源代码2 项目: OpenCue   文件: FrameDaoTests.java
@BeforeTransaction
public void create() {

    RenderHost host = RenderHost.newBuilder()
            .setName(HOST)
            .setBootTime(1192369572)
            .setFreeMcp(76020)
            .setFreeMem(53500)
            .setFreeSwap(20760)
            .setLoad(1)
            .setTotalMcp(195430)
            .setTotalMem(8173264)
            .setTotalSwap(20960)
            .setNimbyEnabled(false)
            .setNumProcs(1)
            .setCoresPerProc(100)
            .addAllTags(ImmutableList.of("mcore", "4core", "8g"))
            .setState(HardwareState.UP)
            .setFacility("spi")
            .putAttributes("freeGpu", "512")
            .putAttributes("totalGpu", "512")
            .build();

    hostManager.createHost(host);
}
 
@BeforeTransaction
void beforeTransaction() {
	assertInTransaction(false);
	this.inTransaction = true;
	BeforeAndAfterTransactionAnnotationTests.numBeforeTransactionCalls++;
	clearPersonTable(jdbcTemplate);
	assertEquals("Adding yoda", 1, addPerson(jdbcTemplate, YODA));
}
 
@BeforeTransaction
void beforeTransaction() {
	assertInTransaction(false);
	this.inTransaction = true;
	BeforeAndAfterTransactionAnnotationTests.numBeforeTransactionCalls++;
	clearPersonTable(jdbcTemplate);
	assertEquals("Adding yoda", 1, addPerson(jdbcTemplate, YODA));
}
 
源代码5 项目: apollo   文件: AdminServiceTransactionTest.java
@BeforeTransaction
public void verifyInitialDatabaseState() {
  for (App app : appRepository.findAll()) {
    System.out.println(app.getAppId());
  }
  Assert.assertEquals(0, appRepository.count());
  Assert.assertEquals(7, appNamespaceRepository.count());
  Assert.assertEquals(0, namespaceRepository.count());
  Assert.assertEquals(0, clusterRepository.count());
}
 
@BeforeTransaction
public void beforeTransaction() {
	assertInTransaction(false);
	this.inTransaction = true;
	BeforeAndAfterTransactionAnnotationTests.numBeforeTransactionCalls++;
	clearPersonTable(jdbcTemplate);
	assertEquals("Adding yoda", 1, addPerson(jdbcTemplate, YODA));
}
 
源代码7 项目: spring-boot-email-tools   文件: BaseRedisTest.java
@BeforeTransaction
public void assertBeforeTransaction() {
    if (nonNull(beforeTransactionAssertion)) {
        final RedisConnection connection = connectionFactory.getConnection();
        beforeTransactionAssertion.assertBeforeTransaction(connection);
        connection.close();
    }
}
 
源代码8 项目: sakai   文件: MessageBundleTest.java
@BeforeTransaction
public void beforeTransaction()  {
    localeEn = new Locale("en");
    localeFr = new Locale("fr");

    baseName = "basename";
    moduleName = "modulename";

    Assert.notNull(messageBundleService);
    resourceBundleEN = ResourceBundle.getBundle("org/sakaiproject/messagebundle/impl/test/bundle", localeEn);
    resourceBundleFr = ResourceBundle.getBundle("org/sakaiproject/messagebundle/impl/test/bundle", localeFr);

    messageBundleService.saveOrUpdate(baseName, moduleName, resourceBundleEN, localeEn);
    messageBundleService.saveOrUpdate(baseName, moduleName, resourceBundleFr, localeFr);
}
 
源代码9 项目: sakai   文件: MessageBundleTest.java
@BeforeTransaction
public void beforeTransaction()  {
    localeEn = new Locale("en");
    localeFr = new Locale("fr");

    baseName = "basename";
    moduleName = "modulename";

    Assert.notNull(messageBundleService);
    resourceBundleEN = ResourceBundle.getBundle("org/sakaiproject/messagebundle/impl/test/bundle", localeEn);
    resourceBundleFr = ResourceBundle.getBundle("org/sakaiproject/messagebundle/impl/test/bundle", localeFr);

    messageBundleService.saveOrUpdate(baseName, moduleName, resourceBundleEN, localeEn);
    messageBundleService.saveOrUpdate(baseName, moduleName, resourceBundleFr, localeFr);
}
 
@BeforeTransaction
public void beforeTransaction() {
	deleteFromTables("user");
	executeSqlScript("classpath:/org/springframework/test/context/jdbc/data.sql", false);
}
 
@BeforeTransaction
public void beforeTransaction() {
	deleteFromTables("user");
	executeSqlScript("classpath:/org/springframework/test/context/jdbc/data.sql", false);
}
 
@BeforeTransaction
void beforeTransaction() {
	assertNumRowsInPersonTable(1, "before a transactional test method");
	assertAddPerson(YODA);
}
 
@BeforeTransaction
void beforeTransaction() {
	assertNumRowsInPersonTable(1, "before a transactional test method");
	assertAddPerson(YODA);
}
 
@BeforeTransaction
void beforeTransaction() {
	fail("always failing beforeTransaction()");
}
 
@BeforeTransaction
@AfterTransaction
void checkInitialDatabaseState() {
	assertEquals(0, countRowsInTable("user"));
}
 
@BeforeTransaction
@AfterTransaction
void checkInitialDatabaseState() {
	assertEquals(0, countRowsInTable("user"));
}
 
@BeforeTransaction
public void beforeTransaction() {
	txManager1.clear();
	txManager2.clear();
}
 
@BeforeTransaction
public void beforeTransaction() {
	fail("always failing beforeTransaction()");
}
 
@BeforeTransaction
public void beforeTransaction() {
	txManager1.clear();
	txManager2.clear();
}
 
@BeforeTransaction
public void beforeTransaction() {
	txManager1.clear();
	txManager2.clear();
}
 
@BeforeTransaction
public void beforeTransaction() {
	txManager1.clear();
	txManager2.clear();
}
 
@BeforeTransaction
public void beforeTransaction() {
	txManager.clear();
}
 
@BeforeTransaction
public void beforeTransaction() {
	txManager1.clear();
	txManager2.clear();
}
 
@BeforeTransaction
public void beforeTransaction() {
	org.testng.Assert.fail("always failing beforeTransaction()");
}
 
@BeforeTransaction
public void beforeTransaction() {
	assertNumRowsInPersonTable(0, "before a transactional test method");
	assertAddPerson(YODA);
}
 
@BeforeTransaction
public void beforeTransaction() {
	fail("always failing beforeTransaction()");
}
 
@BeforeTransaction
public void beforeTransaction() {
	assertEquals("Verifying the number of rows in the person table before a transactional test method.",
			1, countRowsInPersonTable());
	assertEquals("Adding yoda", 1, addPerson(YODA));
}
 
@BeforeTransaction
public void beforeTransaction() {
	assertNumUsers(0);
}
 
@BeforeTransaction
@AfterTransaction
public void verifyPreAndPostTransactionDatabaseState() {
	assertNumUsers(0);
}
 
@BeforeTransaction
public void beforeTransaction() {
	deleteFromTables("user");
	executeSqlScript("classpath:/org/springframework/test/context/jdbc/data.sql", false);
}
 
 同包方法