コード例 #1
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testSelect() {
   folderTool.addFolder("test1", null);
   folderTool.addFolder("test2", null);
   folderTool.addFolder("test3", null);
   List<FolderEntity> Folders = getDao().getFolderDao().select();
   assertEquals(3, Folders.size());
 }
コード例 #2
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testGetByParent() {
   FolderEntity root = folderTool.addFolder("root", null);
   folderTool.addFolder("title1", root.getId());
   folderTool.addFolder("title2", null);
   folderTool.addFolder("title3", root.getId());
   List<FolderEntity> list = getDao().getFolderDao().getByParent(root.getId());
   assertEquals(2, list.size());
 }
コード例 #3
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testResultList() {
   folderTool.addFolder("test1", null);
   folderTool.addFolder("test2", null);
   folderTool.addFolder("test3", null);
   List<FolderEntity> list = getDao().getFolderDao().select();
   FolderEntity Folder = new FolderEntity("test4");
   list.add(Folder);
   assertEquals(4, list.size());
 }
コード例 #4
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testGetByParentName() {
   FolderEntity root = folderTool.addFolder("root", null);
   folderTool.addFolder("title1", root.getId());
   folderTool.addFolder("title2", null);
   folderTool.addFolder("title3", root.getId());
   FolderEntity result = getDao().getFolderDao().getByParentName(root.getId(), "title1");
   assertNotNull(result);
   assertEquals("title1", result.getName());
   result = getDao().getFolderDao().getByParentName(root.getId(), "title3");
   assertNotNull(result);
   assertEquals("title3", result.getName());
   result = getDao().getFolderDao().getByParentName(root.getId(), "title2");
   assertNull(result);
 }
コード例 #5
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testSave() {
   folderTool.addFolder("test", null);
   List<FolderEntity> folders = getDao().getFolderDao().select();
   assertEquals(1, folders.size());
   FolderEntity folder1 = folders.get(0);
   assertEquals("test", folder1.getName());
 }
コード例 #6
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testUpdate() {
   FolderEntity folder = folderTool.addFolder("test", null);
   FolderEntity folder2 = getDao().getFolderDao().getById(folder.getId());
   folder2.setName("update");
   getDao().getFolderDao().save(folder2);
   FolderEntity folder3 = getDao().getFolderDao().getById(folder.getId());
   assertEquals("update", folder3.getName());
 }
コード例 #7
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testGetByPath() {
   FolderEntity root = folderTool.addFolder("/", null);
   FolderEntity t1 = folderTool.addFolder("t1", root.getId());
   folderTool.addFolder("t2", root.getId());
   FolderEntity s1 = folderTool.addFolder("s1", t1.getId());
   folderTool.addFolder("s2", t1.getId());
   FolderEntity m1 = folderTool.addFolder("m1", s1.getId());
   FolderEntity r = getDao().getFolderDao().getByPath("/");
   assertNotNull(r);
   assertEquals("/", r.getName());
   r = getDao().getFolderDao().getByPath("/t1");
   assertNotNull(r);
   assertEquals("t1", r.getName());
   r = getDao().getFolderDao().getByPath("/t2");
   assertNotNull(r);
   assertEquals("t2", r.getName());
   r = getDao().getFolderDao().getByPath("/t1/s1");
   assertNotNull(r);
   assertEquals("s1", r.getName());
   r = getDao().getFolderDao().getByPath("/t1/s2");
   assertNotNull(r);
   assertEquals("s2", r.getName());
   r = getDao().getFolderDao().getByPath("/t1/s1/m1");
   assertNotNull(r);
   assertEquals("m1", r.getName());
   r = getDao().getFolderDao().getByPath("/t1/s1/m1/f");
   assertNull(r);
   r = getDao().getFolderDao().getByPath("/t1s1/m1/f");
   assertNull(r);
   assertEquals("/t1", getDao().getFolderDao().getFolderPath(t1.getId()));
   assertEquals("/t1/s1/m1", getDao().getFolderDao().getFolderPath(m1.getId()));
 }
コード例 #8
0
ファイル: FolderDaoTest.java プロジェクト: smatsutska/vosao
 public void testGetById() {
   FolderEntity folder = folderTool.addFolder("test", null);
   FolderEntity folder2 = getDao().getFolderDao().getById(folder.getId());
   assertEquals(folder.getName(), folder2.getName());
 }