use of indi.mybatis.flying.pojo.condition.LoginLogSource2Condition in project mybatis.flying by limeng32.
the class AccountTest2 method testCondition.
/**
* 测试insert功能(有乐观锁)
*/
@Test
@DatabaseSetups({ @DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/accountTest2/testCondition.datasource.xml"), @DatabaseSetup(connection = "dataSource2", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/accountTest2/testCondition.datasource2.xml") })
@ExpectedDatabases({ @ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/accountTest2/testCondition.datasource.result.xml"), @ExpectedDatabase(connection = "dataSource2", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/accountTest2/testCondition.datasource2.result.xml") })
@DatabaseTearDowns({ @DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/accountTest2/testCondition.datasource.result.xml"), @DatabaseTearDown(connection = "dataSource2", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/accountTest2/testCondition.datasource2.result.xml") })
public void testCondition() {
LoginLog_Condition lc1 = new LoginLog_Condition();
lc1.setIpLikeFilter("5");
int i1 = loginLogService.count(lc1);
Assert.assertEquals(1, i1);
LoginLogSource2Condition lc2 = new LoginLogSource2Condition();
lc2.setIpLikeFilter("2");
int i2 = loginLogSource2Service.count(lc2);
Assert.assertEquals(1, i2);
}
use of indi.mybatis.flying.pojo.condition.LoginLogSource2Condition in project mybatis.flying by limeng32.
the class OrTest method testOrMashup.
/* 一个在缓存状态下或逻辑查询的测试用例 */
/* 需要同时涉及同库外键和跨库外键 */
@Test
@DatabaseSetups({ @DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/orTest/testOrMashup.dataSource1.xml"), @DatabaseSetup(connection = "dataSource2", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/orTest/testOrMashup.dataSource2.xml") })
@ExpectedDatabases({ @ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT_UNORDERED, value = "/indi/mybatis/flying/test/orTest/testOrMashup.dataSource1.result.xml"), @ExpectedDatabase(connection = "dataSource2", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT_UNORDERED, value = "/indi/mybatis/flying/test/orTest/testOrMashup.dataSource2.result.xml") })
@DatabaseTearDowns({ @DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/orTest/testOrMashup.dataSource1.result.xml"), @DatabaseTearDown(connection = "dataSource2", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/orTest/testOrMashup.dataSource2.result.xml") })
public void testOrMashup() {
LoginLogSource2Condition l2c = new LoginLogSource2Condition();
l2c.setAccountEqualsOr2(1L, 2L, "23453");
int i1 = loginLogSource2Service.count(l2c);
Assert.assertEquals(3, i1);
LoginLogSource2Condition l2c2 = new LoginLogSource2Condition();
l2c2.setAccountEqualsOr3(1L, 2L, "23453", "d4");
Detail2_ d2c = new Detail2_();
d2c.setLoginLogSource2(l2c2);
int i2 = detail2Service.count(d2c);
Assert.assertEquals(4, i2);
}
use of indi.mybatis.flying.pojo.condition.LoginLogSource2Condition in project mybatis.flying by limeng32.
the class OrTest method testOr7.
/* 一个dbAssociationTypeHandler型外键的或逻辑测试用例 */
@Test
@DatabaseSetup(connection = "dataSource2", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/orTest/testOr7.datasource2.xml")
@ExpectedDatabase(connection = "dataSource2", assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/orTest/testOr7.datasource2.result.xml")
@DatabaseTearDown(connection = "dataSource2", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/orTest/testOr7.datasource2.result.xml")
public void testOr7() {
LoginLogSource2Condition loginLogSource2 = new LoginLogSource2Condition();
loginLogSource2.setAccountEqualsOr(1L, 2L);
int i = loginLogSource2Service.count(loginLogSource2);
Assert.assertEquals(4, i);
}
Aggregations