result = getDao().getFolderDao().getByParentName(root.getId(), "title2");
assertNull(result);
}
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(