use of com.worksmobile.Assignment.Domain.BoardHistoryDTO in project Assignment by WMPeople.
the class VersionManagementService method findAncestorHaveAnotherChild.
public NodePtrDTO findAncestorHaveAnotherChild(NodePtrDTO curPtrDTO) {
List<BoardHistoryDTO> children;
do {
BoardHistoryDTO boardHistoryDTO = boardHistoryMapper.getHistory(curPtrDTO);
curPtrDTO = boardHistoryDTO.getParentPtrAndRoot();
children = boardHistoryMapper.getChildren(curPtrDTO);
} while (children.size() != 1);
return curPtrDTO;
}
use of com.worksmobile.Assignment.Domain.BoardHistoryDTO in project Assignment by WMPeople.
the class BoardHistoryMapperTest method testGetFileCount.
@Test
public void testGetFileCount() {
BoardHistoryDTO boardHistoryDTO = null;
boardHistoryDTO = boardHistoryMapper.getHistory(defaultNodePtrDTO);
if (boardHistoryDTO == null) {
boardHistoryMapper.createHistory(defaultHistoryDTO);
boardHistoryDTO = boardHistoryMapper.getHistory(defaultNodePtrDTO);
}
assertNotNull(boardHistoryDTO);
int file_id = boardHistoryDTO.getFile_id();
int fileCount = boardHistoryMapper.getFileCount(file_id);
assertEquals(1, fileCount);
}
use of com.worksmobile.Assignment.Domain.BoardHistoryDTO in project Assignment by WMPeople.
the class BoardHistoryMapperTest method testGetHistory.
@Test
public void testGetHistory() {
BoardHistoryDTO historyDTO = null;
historyDTO = boardHistoryMapper.getHistory(defaultNodePtrDTO);
if (historyDTO == null) {
boardHistoryMapper.createHistory(defaultHistoryDTO);
}
historyDTO = boardHistoryMapper.getHistory(defaultNodePtrDTO);
assertNotNull(historyDTO);
}
use of com.worksmobile.Assignment.Domain.BoardHistoryDTO in project Assignment by WMPeople.
the class BoardHistoryMapperTest method testCreateHistory.
@Test
public void testCreateHistory() throws IOException {
BoardDTO article = new BoardDTO();
article.setBoard_id(defaultNodePtrDTO.getBoard_id());
article.setSubject("testInsert");
article.setContent("testContent");
BoardHistoryDTO createdHistoryDTO = new BoardHistoryDTO(article, defaultNodePtrDTO, BoardHistoryDTO.STATUS_CREATED);
createdHistoryDTO.setHistory_content(Compress.compressArticleContent(article));
BoardHistoryDTO check = boardHistoryMapper.getHistory(defaultNodePtrDTO);
if (check != null) {
boardHistoryMapper.deleteHistory(defaultNodePtrDTO);
}
int createdCnt = boardHistoryMapper.createHistory(createdHistoryDTO);
assertEquals(1, createdCnt);
BoardHistoryDTO insertedDTO = null;
insertedDTO = boardHistoryMapper.getHistory(createdHistoryDTO);
Utils.assertConvertToJsonObject(createdHistoryDTO, insertedDTO);
}
use of com.worksmobile.Assignment.Domain.BoardHistoryDTO in project Assignment by WMPeople.
the class BoardHistoryMapperTest method testDeleteSpecificOne.
@Test
public void testDeleteSpecificOne() {
boardHistoryDTO = createBoardHistoryIfNotExists();
boardMapper.boardDelete(defaultNodePtrDTO.toMap());
int deletedColCnt = boardHistoryMapper.deleteHistory(defaultNodePtrDTO);
assertEquals(1, deletedColCnt);
BoardHistoryDTO deletedHistoryDTO = null;
deletedHistoryDTO = boardHistoryMapper.getHistory(defaultNodePtrDTO);
assertNull(deletedHistoryDTO);
}
Aggregations