Search in sources :

Example 1 with Account_Condition3

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

the class ConditionTest method testConditionHeadLike.

/**
 * 测试condition:headLike功能
 */
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/conditionTest/testConditionHeadLike.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/conditionTest/testConditionHeadLike.xml")
public void testConditionHeadLike() {
    Account_Condition ac = new Account_Condition();
    ac.setEmailHeadLike("ann");
    Collection<Account_> c = accountService.selectAll(ac);
    Account_[] accounts = c.toArray(new Account_[c.size()]);
    Assert.assertEquals(1, accounts.length);
    Assert.assertEquals("ann@live.cn2", accounts[0].getEmail());
    Account_Condition3 ac2 = new Account_Condition3();
    ac2.setEmailHeadLike("1");
    Collection<Account_> c2 = accountService.selectAll(ac2);
    Account_[] accounts2 = c2.toArray(new Account_[c2.size()]);
    Assert.assertEquals(1, accounts2.length);
    Assert.assertEquals("_ann@live.cn1", accounts2[0].getEmail());
}
Also used : Account_Condition(indi.mybatis.flying.pojo.condition.Account_Condition) Account_(indi.mybatis.flying.pojo.Account_) Account_Condition3(indi.mybatis.flying.pojo.condition.Account_Condition3) Test(org.junit.Test) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup) DatabaseTearDown(com.github.springtestdbunit.annotation.DatabaseTearDown)

Aggregations

DatabaseSetup (com.github.springtestdbunit.annotation.DatabaseSetup)1 DatabaseTearDown (com.github.springtestdbunit.annotation.DatabaseTearDown)1 Account_ (indi.mybatis.flying.pojo.Account_)1 Account_Condition (indi.mybatis.flying.pojo.condition.Account_Condition)1 Account_Condition3 (indi.mybatis.flying.pojo.condition.Account_Condition3)1 Test (org.junit.Test)1