org.springframework.test.context.transaction.BeforeTransaction Java Examples

The following examples show how to use org.springframework.test.context.transaction.BeforeTransaction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FrameDaoTests.java    From OpenCue with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #2
Source File: FrameDaoTests.java    From OpenCue with Apache License 2.0 6 votes vote down vote up
@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);
}
 
Example #3
Source File: AdminServiceTransactionTest.java    From apollo with Apache License 2.0 5 votes vote down vote up
@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());
}
 
Example #4
Source File: MessageBundleTest.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@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);
}
 
Example #5
Source File: BeforeAndAfterTransactionAnnotationTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	assertInTransaction(false);
	this.inTransaction = true;
	BeforeAndAfterTransactionAnnotationTests.numBeforeTransactionCalls++;
	clearPersonTable(jdbcTemplate);
	assertEquals("Adding yoda", 1, addPerson(jdbcTemplate, YODA));
}
 
Example #6
Source File: MessageBundleTest.java    From sakai with Educational Community License v2.0 5 votes vote down vote up
@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);
}
 
Example #7
Source File: BaseRedisTest.java    From spring-boot-email-tools with Apache License 2.0 5 votes vote down vote up
@BeforeTransaction
public void assertBeforeTransaction() {
    if (nonNull(beforeTransactionAssertion)) {
        final RedisConnection connection = connectionFactory.getConnection();
        beforeTransactionAssertion.assertBeforeTransaction(connection);
        connection.close();
    }
}
 
Example #8
Source File: BeforeAndAfterTransactionAnnotationTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@BeforeTransaction
void beforeTransaction() {
	assertInTransaction(false);
	this.inTransaction = true;
	BeforeAndAfterTransactionAnnotationTests.numBeforeTransactionCalls++;
	clearPersonTable(jdbcTemplate);
	assertEquals("Adding yoda", 1, addPerson(jdbcTemplate, YODA));
}
 
Example #9
Source File: BeforeAndAfterTransactionAnnotationTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@BeforeTransaction
void beforeTransaction() {
	assertInTransaction(false);
	this.inTransaction = true;
	BeforeAndAfterTransactionAnnotationTests.numBeforeTransactionCalls++;
	clearPersonTable(jdbcTemplate);
	assertEquals("Adding yoda", 1, addPerson(jdbcTemplate, YODA));
}
 
Example #10
Source File: AbstractTransactionalAnnotatedConfigClassTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	assertNumRowsInPersonTable(0, "before a transactional test method");
	assertAddPerson(YODA);
}
 
Example #11
Source File: ProgrammaticTxMgmtTestNGTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	deleteFromTables("user");
	executeSqlScript("classpath:/org/springframework/test/context/jdbc/data.sql", false);
}
 
Example #12
Source File: PopulatedSchemaTransactionalSqlScriptsTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
@AfterTransaction
public void verifyPreAndPostTransactionDatabaseState() {
	assertNumUsers(0);
}
 
Example #13
Source File: LookUpTxMgrByTypeAndQualifierAtMethodLevelTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	txManager1.clear();
	txManager2.clear();
}
 
Example #14
Source File: FailingBeforeAndAfterMethodsTestNGTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	org.testng.Assert.fail("always failing beforeTransaction()");
}
 
Example #15
Source File: LookUpTxMgrByTypeTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	txManager.clear();
}
 
Example #16
Source File: ConcreteTransactionalJUnit4SpringContextTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@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));
}
 
Example #17
Source File: AbstractShowcaseTest.java    From spring-data-examples with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void setupData() throws Exception {

	deleteFromTables("account", "customer");
	executeSqlScript("classpath:data.sql", false);
}
 
Example #18
Source File: ITransactionalUnitTest.java    From tutorials with MIT License 4 votes vote down vote up
@BeforeTransaction
default void beforeTransaction() {
    log.info("Opening transaction");
}
 
Example #19
Source File: LookUpTxMgrViaTransactionManagementConfigurerTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	txManager1.clear();
	txManager2.clear();
}
 
Example #20
Source File: ProgrammaticTxMgmtTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	deleteFromTables("user");
	executeSqlScript("classpath:/org/springframework/test/context/jdbc/data.sql", false);
}
 
Example #21
Source File: HostDaoTests.java    From OpenCue with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void clear() {
    jdbcTemplate.update(
        "DELETE FROM host WHERE str_name=?", TEST_HOST);
}
 
Example #22
Source File: HostDaoTests.java    From OpenCue with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void clear() {
    jdbcTemplate.update(
        "DELETE FROM host WHERE str_name=?", TEST_HOST);
}
 
Example #23
Source File: TestUserService.java    From Spring with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void checkDbInit() {
    long count = userService.countUsers();
    assertEquals(1, count);
}
 
Example #24
Source File: UserServiceTest.java    From Spring with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void checkDbInit() {
    long count = userService.countUsers();
    assertEquals(1, count);
}
 
Example #25
Source File: UserServiceTest.java    From Spring with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void checkDbInit() {
	long count = userService.countUsers();
	assertEquals(1, count);
}
 
Example #26
Source File: UserServiceTest.java    From Spring with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void checkDbInit() {
    long count = userService.countUsers();
    assertEquals(1, count);
}
 
Example #27
Source File: UserServiceTest.java    From Spring with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void checkDbInit(){
    int count = userService.countUsers();
    assertEquals(4, count);
}
 
Example #28
Source File: UserServiceTest.java    From Spring with Apache License 2.0 4 votes vote down vote up
@BeforeTransaction
public void checkDbInit() {
    int count = userService.countUsers();
    assertEquals(4, count);
}
 
Example #29
Source File: PopulatedSchemaTransactionalSqlScriptsTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@BeforeTransaction
@AfterTransaction
public void verifyPreAndPostTransactionDatabaseState() {
	assertNumUsers(0);
}
 
Example #30
Source File: IsolatedTransactionModeSqlScriptsTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@BeforeTransaction
public void beforeTransaction() {
	assertNumUsers(0);
}