File f = new File("/rootFile.txt", Directory.ROOT);
assertEquals("/rootFile.txt", f.getPath());
assertEquals("rootFile.txt", f.getName());
assertEquals(Directory.ROOT, f.getParentDirectory());
Directory d = new Directory("/home", Directory.ROOT);
assertEquals("/home", d.getPath());
assertEquals("home", d.getName());
assertEquals(Directory.ROOT, d.getParentDirectory());
save(f, Directory.ROOT, d);
File fLoaded = loadUnique("from File as f where f.path like '%txt'", File.class);
assertEquals(f, fLoaded);
assertEquals(f.getParentDirectory(), Directory.ROOT);
File dLoaded = loadUnique("from Directory as f where f.path like '/home'", File.class);
assertEquals(d, dLoaded);
assertEquals(Directory.ROOT, d.getParentDirectory());
Directory rLoaded = loadUnique("from Directory as f where f.path like '/'", Directory.class);
assertEquals(Directory.ROOT, rLoaded);
assertEquals(2, rLoaded.getContent().size());
assertTrue(rLoaded.getContent().contains(f));
assertTrue(rLoaded.getContent().contains(d));
}