Java Code Examples for com.github.springtestdbunit.assertion.DatabaseAssertionMode#NON_STRICT

The following examples show how to use com.github.springtestdbunit.assertion.DatabaseAssertionMode#NON_STRICT . 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: WhiteListTest.java    From mybatis.flying with Apache License 2.0 6 votes vote down vote up
@Test
@DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListUpdate.xml")
@ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListUpdate.result.xml")
@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListUpdate.result.xml")
public void testWhiteListUpdate() {
	Account_ account = accountService.select(1);
	account.setName("bob");
	account.setEmail("[email protected]");
	account.setPassword("bbb");
	account.setStatus(StoryStatus_.p);
	account.setActivateValue("bv");
	Role_ role = new Role_();
	role.setId(2);
	account.setRole(role);
	Permission permission = new Permission();
	permission.setId(22);
	account.setPermission(permission);
	accountService.updateSimpleNoName(account);
}
 
Example 2
Source File: WhiteListTest.java    From mybatis.flying with Apache License 2.0 6 votes vote down vote up
@Test
@DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListInsertBatch.xml")
@ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListInsertBatch.result.xml")
@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListInsertBatch.result.xml")
public void testWhiteListInsertBatch() {
	Account_ account = new Account_();
	account.setName("name");
	account.setEmail("email");
	account.setPassword("aaa");
	Role_ role = new Role_();
	role.setId(11);
	account.setRole(role);
	Permission permission = new Permission();
	permission.setId(22);
	account.setPermission(permission);

	Collection<Account_> ac = new ArrayList<>();
	ac.add(account);
	accountService.insertBatchSimpleNoName(ac);
}
 
Example 3
Source File: OrTest.java    From mybatis.flying with Apache License 2.0 6 votes vote down vote up
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/orTest/testOr4.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/orTest/testOr4.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/orTest/testOr4.result.xml")
public void testOr4() {
	LoginLog_Condition lc = new LoginLog_Condition();
	Account_Condition ac = new Account_Condition();
	ac.setNameEqualsOrLoginlogIpEquals("ann", "bob", "c1");
	lc.setAccount(ac);
	int i1 = loginLogService.count(lc);
	Assert.assertEquals(5, i1);

	LoginLog_Condition lc2 = new LoginLog_Condition();
	lc2.setAccount(new Account_Condition());
	lc2.getAccount().setRole(new Role_Condition());
	((Role_Condition) (lc2.getAccount().getRole())).setNameEqualsOrAccountNameEquals("admin", "cal");
	int i2 = loginLogService.count(lc2);
	Assert.assertEquals(6, i2);
}
 
Example 4
Source File: SelectOneTest.java    From mybatis.flying with Apache License 2.0 6 votes vote down vote up
/** 测试selectOne2 */
@Test
@DatabaseSetup(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne2.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne2.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne2.result.xml")
public void testSelectOne2() {
	Account_ a1 = new Account_();
	a1.setName("ann");
	a1.setEmail("[email protected]");
	accountService.insert(a1);
	Account_ a2 = new Account_();
	a2.setName("ann");
	a2.setEmail("[email protected]");
	accountService.insert(a2);

	Account_Condition ac = new Account_Condition();
	ac.setLimiter(new PageParam(1, 2));
	ac.setSorter(new SortParam(new Order("id", Sequence.ASC)));
	ac.setName("ann");
	Account_ account = accountService.selectOne(ac);
	Assert.assertEquals("[email protected]", account.getEmail());
	Assert.assertNull(ac.getLimiter());
}
 
Example 5
Source File: IndexTest.java    From mybatis.flying with Apache License 2.0 6 votes vote down vote up
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/indexTest/testIndex.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/indexTest/testIndex.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/indexTest/testIndex.result.xml")
public void testIndex() {
	Account_ account = accountService.selectWithIndex(2);
	Assert.assertEquals("bob", account.getName());

	Account_ ac = new Account_();
	ac.setName("bob");
	Account_ account2 = accountService.selectOne(ac);
	Assert.assertEquals("[email protected]", account2.getEmail());

	Account_Condition ac2 = new Account_Condition();
	ac2.setNameNotEqual("carl");
	int c = accountService.count(ac2);
	Assert.assertEquals(2, c);
}
 
Example 6
Source File: BatchProcessTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchDelete2.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchDelete2.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchDelete2.xml")
public void testBatchDelete2() {
	Account_Condition ac = new Account_Condition();
	ac.setNameGreaterThan("b");
	accountService.delete(ac);
}
 
Example 7
Source File: BatchProcessTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate3.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate3.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate3.xml")
public void testBatchUpdate3() {
	Account_Condition ac = new Account_Condition();
	ac.setEmail("[email protected]");
	ac.setNameLessThan("c");
	accountService.update(ac);
}
 
Example 8
Source File: BatchProcessTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate.xml")
public void testBatchUpdate() {
	Account_Condition ac = new Account_Condition();
	ac.setEmail("[email protected]");
	ac.setActivated(false);

	ac.setNameEqual("ann");
	ac.setActivateValueEqual("aaa");

	accountService.update(ac);
}
 
Example 9
Source File: LoginLogTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
/** 测试insert功能(无乐观锁) */
@Test
@DatabaseSetup(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/loginLogTest/testInsert.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/loginLogTest/testInsert.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/loginLogTest/testInsert.xml")
public void testInsert() {
	LoginLog_ a = new LoginLog_();
	a.setId(1);
	a.setLoginIP("0.0.0.1");
	loginLogService.insert(a);
}
 
Example 10
Source File: CommentControllerIT.java    From JavaSpringMvcBlog with MIT License 5 votes vote down vote up
@Test
@ExpectedDatabase(value = "data-comment-added.xml", assertionMode = DatabaseAssertionMode.NON_STRICT)
@DatabaseTearDown(value = "data.xml", type = DatabaseOperation.TRUNCATE_TABLE) // to reset id sequence, otherwise other tests that insert comments will fail on ExpectedDatabase
public void shouldAddComment() throws Exception {
    mockMvc.perform(post("/posts/1/comments/create").with(userBob()).with(csrf())
            .contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .param("commentText", "new comment text"))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status", is("ok")));
}
 
Example 11
Source File: AccountTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
/** 测试delete功能 */
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/accountTest/testDelete.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/accountTest/testDelete.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/accountTest/testDelete.xml")
public void testDelete() {
	Account_ a = accountService.select(1);
	accountService.delete(a);
}
 
Example 12
Source File: PrefixTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@Test
@DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/prefixTest/testSelect3.xml")
@ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/prefixTest/testSelect3.result.xml")
@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/prefixTest/testSelect3.result.xml")
public void testSelect3() {
	Detail_ dc = new Detail_();
	dc.setName("d3");
	LoginLog_Condition lc = new LoginLog_Condition();
	lc.setIdNotEqual(102);
	dc.setLoginLog(lc);
	Collection<Detail_> detailC = detailService.selectAllPrefix(dc);
	System.out.println("11::" + JSONObject.toJSONString(detailC));
	Detail_[] details = detailC.toArray(new Detail_[detailC.size()]);

	Assert.assertEquals(203, details[0].getId().intValue());
	Assert.assertEquals(103, details[0].getLoginLog().getId().intValue());
	Assert.assertEquals("ip2_3", details[0].getLoginLog().getLoginIP2());
	Assert.assertEquals(3, details[0].getLoginLog().getAccount().getId().intValue());
	Assert.assertNull(details[0].getLoginLog().getAccount().getPassword());
	Assert.assertEquals(13, details[0].getLoginLog().getAccount().getRole().getId().intValue());
	Assert.assertEquals("role3", details[0].getLoginLog().getAccount().getRole().getName());
	Assert.assertEquals(113, details[0].getLoginLog().getAccount().getRoleDeputy().getId().intValue());
	Assert.assertEquals("roleDeputy3", details[0].getLoginLog().getAccount().getRoleDeputy().getName());

	Assert.assertEquals(204, details[1].getId().intValue());
	Assert.assertEquals(104, details[1].getLoginLog().getId().intValue());
	Assert.assertEquals("ip2_4", details[1].getLoginLog().getLoginIP2());
	Assert.assertEquals(4, details[1].getLoginLog().getAccount().getId().intValue());
	Assert.assertNull(details[1].getLoginLog().getAccount().getPassword());
	Assert.assertEquals(14, details[1].getLoginLog().getAccount().getRole().getId().intValue());
	Assert.assertEquals("role4", details[1].getLoginLog().getAccount().getRole().getName());
	Assert.assertEquals(114, details[1].getLoginLog().getAccount().getRoleDeputy().getId().intValue());
	Assert.assertEquals("roleDeputy4", details[1].getLoginLog().getAccount().getRoleDeputy().getName());
}
 
Example 13
Source File: CommentControllerIT.java    From JavaSpringMvcBlog with MIT License 5 votes vote down vote up
@Test
@ExpectedDatabase(value = "data-comment-added-and-marked-deleted.xml", assertionMode = DatabaseAssertionMode.NON_STRICT)
@DatabaseTearDown(value = "data.xml", type = DatabaseOperation.TRUNCATE_TABLE) // to reset id sequence, otherwise other tests that insert comments will fail on ExpectedDatabase
public void shouldDeleteComment() throws Exception {
    mockMvc.perform(post("/posts/1/comments/create").with(userBob()).with(csrf())
            .contentType(MediaType.APPLICATION_FORM_URLENCODED)
            .param("commentText", "new comment text"))
            .andExpect(status().isOk())
            .andExpect(jsonPath("$.status", is("ok")));

    mockMvc.perform(post("/posts/1/comments/4/delete").with(userBob()).with(csrf())
            .contentType(MediaType.APPLICATION_FORM_URLENCODED))
            .andExpect(status().isOk())
            .andExpect(content().string("ok"));
}
 
Example 14
Source File: BatchProcessTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchDelete3.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchDelete3.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchDelete3.xml")
public void testBatchDelete3() {
	Account_Condition ac = new Account_Condition();
	ac.setNameLike("a");
	accountService.delete(ac);
}
 
Example 15
Source File: CacheTest1.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@Test
@IfProfileValue(name = "CACHE", value = "true")
@ExpectedDatabase(connection = "dataSource1", assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/cacheTest/testSameInjection.result.xml")
@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/cacheTest/testSameInjection.result.xml")
public void testSameInjection() {
	Role_ r = new Role_(), r2 = new Role_();

	r.setId(1);
	r.setName("root");
	roleService.insert(r);

	r2.setId(2);
	r2.setName("deployer");
	roleService.insert(r2);

	Role_ role = roleService.select(1);
	Assert.assertEquals("root", role.getName());

	Map<String, Object> m = new HashMap<>(4);
	m.put("id", 1);
	m.put("name", "newRoot");
	roleService.updateDirect(m);

	Role_ role2 = roleService.select(1);
	Assert.assertEquals("root", role2.getName());

	Role_ role3 = roleService.selectEverything(1);
	Assert.assertEquals("newRoot", role3.getName());
}
 
Example 16
Source File: CacheTest1.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@IfProfileValue(name = "CACHE", value = "true")
@ExpectedDatabase(connection = "dataSource1", assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/cacheTest/testUpdateDirect.result.xml")
@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/cacheTest/testUpdateDirect.result.xml")
public void testUpdateDirect4() {
	Role_ r = new Role_();
	r.setId(1);
	r.setName("ann");
	roleService.insert(r);
	Account_ a = new Account_();
	a.setId(1L);
	a.setRole(r);
	a.setEmail("email");
	accountService.insert(a);

	Account_Condition ac = new Account_Condition();
	ac.setLimiter(new PageParam(1, 1));
	Collection<Account_> c = accountService.selectAll(ac);

	Map<String, Object> m = new HashMap<>(4);
	m.put("id", 1);
	m.put("name", "bob");
	roleService.updateDirect(m);

	Account_Condition ac2 = new Account_Condition();
	ac2.setLimiter(new PageParam(1, 1));
	Collection<Account_> c2 = accountService.selectAll(ac2);
	for (Account_ t : c2) {
		Assert.assertEquals("ann", t.getRole().getName());
	}
}
 
Example 17
Source File: BatchProcessTest.java    From mybatis.flying with Apache License 2.0 5 votes vote down vote up
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate5.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate5.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchUpdate5.xml")
public void testBatchUpdate5() {
	Account_Condition ac = new Account_Condition();
	ac.setEmail("[email protected]");
	ac.setNameGreaterThan("b");
	accountService.update(ac);
}
 
Example 18
Source File: DemoDBUnitTest.java    From training with MIT License 4 votes vote down vote up
@ExpectedDatabase(value = "expected.xml", assertionMode=DatabaseAssertionMode.NON_STRICT)
@Test
public void notificationTextIsExtractedAfterPersit() {
	notificationRepo.insertNotification("aaa");
}
 
Example 19
Source File: BatchProcessTest.java    From mybatis.flying with Apache License 2.0 4 votes vote down vote up
@Test
@DatabaseSetups({
		@DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchInsert.datasource.xml") })
@ExpectedDatabases({
		@ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchInsert.datasource.result.xml") })
@DatabaseTearDowns({
		@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/batchProcessTest/testBatchInsert.datasource.result.xml") })
public void testBatchInsert() {
	Collection<Account_> ac = new ArrayList<>();
	Role_ r1 = new Role_(), r2 = new Role_(), r3 = new Role_();
	r1.setId(1);
	r2.setId(2);
	r3.setId(3);
	Account_ a = new Account_();
	a.setId(1L);
	a.setName("ann");
	a.setEmail("[email protected]");
	a.setPassword("5a690d842935c51f26f473e025c1b97a");
	a.setActivated(true);
	a.setActivateValue("");
	a.setRole(r1);
	ac.add(a);

	Account_ a2 = new Account_();
	a2.setId(2L);
	a2.setName("bob");
	a2.setEmail("[email protected]");
	a2.setPassword("6a690d842935c51f26f473e025c1b97a");
	a2.setActivated(true);
	a2.setActivateValue("");
	a2.setRole(r2);
	ac.add(a2);

	Account_ a3 = new Account_();
	a3.setId(3L);
	a3.setName("carl");
	a3.setEmail("[email protected]");
	a3.setPassword("7a690d842935c51f26f473e025c1b97a");
	a3.setActivated(true);
	a3.setActivateValue("");
	a3.setRole(r3);
	ac.add(a3);
	accountService.insertBatch(ac);
	System.out.println(JSONObject.toJSONString(ac));

	Collection<Account_> ac2 = new ArrayList<>();
	try {
		accountService.insertBatch(ac2);
		// below code should never reach
		Assert.assertTrue(false);
	} catch (Exception e) {

	}
	System.out.println(JSONObject.toJSONString(ac2));
}
 
Example 20
Source File: AccountTypeHandlerTest.java    From mybatis.flying with Apache License 2.0 4 votes vote down vote up
@DatabaseSetups({
		@DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/accountTypeHandlerTest/testAccountTypeHandler.datasource.xml"),
		@DatabaseSetup(connection = "dataSource2", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/accountTypeHandlerTest/testAccountTypeHandler.datasource2.xml") })
@ExpectedDatabases({
		@ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/accountTypeHandlerTest/testAccountTypeHandler.datasource.result.xml"),
		@ExpectedDatabase(connection = "dataSource2", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/accountTypeHandlerTest/testAccountTypeHandler.datasource2.result.xml") })
@DatabaseTearDowns({
		@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/accountTypeHandlerTest/testAccountTypeHandler.datasource.result.xml"),
		@DatabaseTearDown(connection = "dataSource2", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/accountTypeHandlerTest/testAccountTypeHandler.datasource2.result.xml") })
public void testAccountTypeHandler() {
	LoginLogSource2 longinLogSource0 = loginLogSource2Service.selectWithoutAccount(22);
	Assert.assertNull(longinLogSource0.getAccount());

	LoginLogSource2 longinLogSource = loginLogSource2Service.select(22);
	Assert.assertNotNull(longinLogSource);
	Assert.assertNotNull(longinLogSource.getAccount());
	Assert.assertEquals("[email protected]", longinLogSource.getAccount().getEmail());

	Account_ ac = new Account_();
	ac.setId(1L);
	LoginLogSource2 l2c = new LoginLogSource2();
	l2c.setAccount(ac);
	Collection<LoginLogSource2> loginLogSource2C = loginLogSource2Service.selectAll(l2c);
	Assert.assertEquals(2, loginLogSource2C.size());
	for (LoginLogSource2 e : loginLogSource2C) {
		Assert.assertEquals("[email protected]", e.getAccount().getEmail());
	}

	LoginLogSource2 loginLogSource2 = loginLogSource2Service.select(24);
	Assert.assertNull(loginLogSource2.getAccount());

	LoginLogSource2 loginLogSource3 = loginLogSource2Service.select(25);
	Assert.assertNull(loginLogSource3.getAccount());

	Account_ ac2 = new Account_();
	ac2.setId(2L);
	LoginLogSource2 l2c2 = new LoginLogSource2();
	l2c2.setAccount(ac2);
	LoginLogSource2 loginLogSource4 = loginLogSource2Service.selectOne(l2c2);
	loginLogSource4 = loginLogSource2Service.selectOne(l2c2);
	loginLogSource4 = loginLogSource2Service.selectOne(l2c2);
	loginLogSource4 = loginLogSource2Service.selectOne(l2c2);
	loginLogSource4 = loginLogSource2Service.selectOne(l2c2);
	Assert.assertEquals("[email protected]", loginLogSource4.getAccount().getEmail());

	Account_ ac3 = new Account_();
	ac3.setId(1L);
	LoginLogSource2 l2c3 = new LoginLogSource2();
	l2c3.setAccount(ac3);
	l2c3.setLoginIP("ip1");
	int i = loginLogSource2Service.count(l2c3);
	Assert.assertEquals(1, i);

	Account_ account2 = accountService.select(2);
	loginLogSource2.setAccount(account2);
	loginLogSource2Service.update(loginLogSource2);

	loginLogSource4.setAccount(null);
	loginLogSource2Service.updatePersistent(loginLogSource4);

	Account_ account = accountService.select(1);
	loginLogSource2Service.loadAccount(account, new LoginLogSource2());
	Assert.assertEquals(2, account.getLoginLogSource2().size());
}