Search in sources :

Example 26 with Account_Condition

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

the class OrTest method testOr6.

/* 一个只有单独入参的或逻辑测试用例 */
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/orTest/testOr6.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/orTest/testOr6.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/orTest/testOr6.result.xml")
public void testOr6() {
    LoginLog_Condition lc = new LoginLog_Condition();
    lc.setAccount(new Account_Condition());
    lc.getAccount().setRole(new Role_Condition());
    ((Role_Condition) lc.getAccount().getRole()).setAccountNameEquals("ann");
    int i = loginLogService.count(lc);
    Assert.assertEquals(2, i);
    LoginLog_Condition lc2 = new LoginLog_Condition();
    lc2.setAccount(new Account_Condition());
    lc2.getAccount().setRole(new Role_Condition());
    ((Role_Condition) lc2.getAccount().getRole()).setNameEquals("admin");
    int i2 = loginLogService.count(lc2);
    Assert.assertEquals(4, i2);
}
Also used : Role_Condition(indi.mybatis.flying.pojo.condition.Role_Condition) LoginLog_Condition(indi.mybatis.flying.pojo.condition.LoginLog_Condition) Account_Condition(indi.mybatis.flying.pojo.condition.Account_Condition) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup) DatabaseTearDown(com.github.springtestdbunit.annotation.DatabaseTearDown)

Aggregations

DatabaseTearDown (com.github.springtestdbunit.annotation.DatabaseTearDown)26 Account_Condition (indi.mybatis.flying.pojo.condition.Account_Condition)26 Test (org.junit.Test)24 DatabaseSetup (com.github.springtestdbunit.annotation.DatabaseSetup)22 Account_ (indi.mybatis.flying.pojo.Account_)18 ExpectedDatabase (com.github.springtestdbunit.annotation.ExpectedDatabase)11 ArrayList (java.util.ArrayList)8 PageParam (indi.mybatis.flying.pagination.PageParam)6 LoginLog_Condition (indi.mybatis.flying.pojo.condition.LoginLog_Condition)6 LoginLog_ (indi.mybatis.flying.pojo.LoginLog_)5 IfProfileValue (org.springframework.test.annotation.IfProfileValue)5 Order (indi.mybatis.flying.pagination.Order)4 SortParam (indi.mybatis.flying.pagination.SortParam)4 Role_ (indi.mybatis.flying.pojo.Role_)4 Role_Condition (indi.mybatis.flying.pojo.condition.Role_Condition)4 Page (indi.mybatis.flying.pagination.Page)2 HashMap (java.util.HashMap)2 Account_Condition3 (indi.mybatis.flying.pojo.condition.Account_Condition3)1 LinkedList (java.util.LinkedList)1