Search in sources :

Example 51 with Account_Condition

use of indi.mybatis.flying.pojo.condition.Account_Condition in project mybatis.flying by limeng32.

the class BatchProcessTest method testBatchUpdate8.

@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate8.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate8.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate8.xml")
public void testBatchUpdate8() {
    Account_Condition ac = new Account_Condition();
    ac.setEmail("ann@tom.com");
    ac.setNameTailLike("a");
    accountService.update(ac);
}
Also used : Account_Condition(indi.mybatis.flying.pojo.condition.Account_Condition) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup) DatabaseTearDown(com.github.springtestdbunit.annotation.DatabaseTearDown)

Example 52 with Account_Condition

use of indi.mybatis.flying.pojo.condition.Account_Condition in project mybatis.flying by limeng32.

the class BatchProcessTest method testBatchUpdatePersistent.

@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdatePersistent.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT_UNORDERED, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdatePersistent.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdatePersistent.xml")
public void testBatchUpdatePersistent() {
    Account_Condition ac = new Account_Condition();
    ac.setId(1L);
    ac.setName("a2");
    ac.setOpLock(1);
    ac.setActivated(false);
    accountService.updatePersistent(ac);
}
Also used : Account_Condition(indi.mybatis.flying.pojo.condition.Account_Condition) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup) DatabaseTearDown(com.github.springtestdbunit.annotation.DatabaseTearDown)

Example 53 with Account_Condition

use of indi.mybatis.flying.pojo.condition.Account_Condition in project mybatis.flying by limeng32.

the class BatchProcessTest method testBatchUpdate9.

@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate9.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate9.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate9.xml")
public void testBatchUpdate9() {
    Account_Condition ac = new Account_Condition();
    ac.setEmail("ann@tom.com");
    ac.setNameNotEqual("2a");
    accountService.update(ac);
}
Also used : Account_Condition(indi.mybatis.flying.pojo.condition.Account_Condition) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup) DatabaseTearDown(com.github.springtestdbunit.annotation.DatabaseTearDown)

Example 54 with Account_Condition

use of indi.mybatis.flying.pojo.condition.Account_Condition in project mybatis.flying by limeng32.

the class SelectOneTest method testSelectOne3.

/**
 * 测试selectOne3,缓存测试
 */
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne3.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne3.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne3.result.xml")
public void testSelectOne3() {
    Account_Condition ac = new Account_Condition();
    Account_ account1 = accountService.selectOne(ac);
    Assert.assertEquals("ann", account1.getName());
    ac.setEmail("ann@live.cn");
    ac.setLimiter(new PageParam(1, 8));
    ac.setSorter(new SortParam(new Order("id", Sequence.ASC), new Order("name", Sequence.DESC), new Order("id", Sequence.DESC)));
    Collection<Account_> accountC = accountService.selectAll(ac);
    Assert.assertEquals(2, accountC.size());
}
Also used : Order(indi.mybatis.flying.pagination.Order) Account_Condition(indi.mybatis.flying.pojo.condition.Account_Condition) Account_(indi.mybatis.flying.pojo.Account_) PageParam(indi.mybatis.flying.pagination.PageParam) SortParam(indi.mybatis.flying.pagination.SortParam) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup) DatabaseTearDown(com.github.springtestdbunit.annotation.DatabaseTearDown)

Aggregations

DatabaseTearDown (com.github.springtestdbunit.annotation.DatabaseTearDown)54 Account_Condition (indi.mybatis.flying.pojo.condition.Account_Condition)54 Test (org.junit.Test)50 DatabaseSetup (com.github.springtestdbunit.annotation.DatabaseSetup)46 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)44 ExpectedDatabase (com.github.springtestdbunit.annotation.ExpectedDatabase)37 Account_ (indi.mybatis.flying.pojo.Account_)28 ArrayList (java.util.ArrayList)12 PageParam (indi.mybatis.flying.pagination.PageParam)11 IfProfileValue (org.springframework.test.annotation.IfProfileValue)10 Role_ (indi.mybatis.flying.pojo.Role_)9 LoginLog_ (indi.mybatis.flying.pojo.LoginLog_)6 LoginLog_Condition (indi.mybatis.flying.pojo.condition.LoginLog_Condition)6 Order (indi.mybatis.flying.pagination.Order)5 SortParam (indi.mybatis.flying.pagination.SortParam)5 Page (indi.mybatis.flying.pagination.Page)4 Role_Condition (indi.mybatis.flying.pojo.condition.Role_Condition)4 HashMap (java.util.HashMap)4 Permission (indi.mybatis.flying.pojo.Permission)1 Account_Condition3 (indi.mybatis.flying.pojo.condition.Account_Condition3)1