assertEquals(new Long(5),i);
//testing quantity of files
Long j = fSession.uniqueResult("select count(file) from VersionedFile as file", Long.class);
assertEquals(new Long(3),j);
//testing directory "layout/"
Directory testDir1 = fSession.uniqueResult("from Directory as dir where dir.path='/cvsroot/mozilla/layout'", Directory.class);
assertEquals("layout",testDir1.getName());
assertEquals(1,testDir1.getChildren().size());
assertEquals("", testDir1.getParentDirectory().getParentDirectory().getParentDirectory().getName());
//testing directory "layout/generic/"
Directory testDir2 = fSession.uniqueResult("from Directory as directory where directory.path ='/cvsroot/mozilla/layout/generic'", Directory.class);
assertEquals("generic",testDir2.getName());
assertEquals("layout",testDir2.getParentDirectory().getName());
assertEquals("/cvsroot/mozilla/layout",testDir2.getParentDirectory().getPath());
assertEquals(3,testDir2.getChildren().size());
List<String> expectedChildrenNames = new Vector<String>();
expectedChildrenNames.add("nsViewportFrame.cpp");
expectedChildrenNames.add("nsViewportFrame.h");
expectedChildrenNames.add("punct_marks.ccmap");
List<String> childrenNames = new Vector<String>();
for(File dir : testDir2.getChildren()){
childrenNames.add(dir.getName());
}
assertTrue(childrenNames.containsAll(expectedChildrenNames));
assertTrue(expectedChildrenNames.containsAll(childrenNames));
}