/**
   * Test method for {@link
   * net.bioclipse.brunn.daos.FolderDAO#save(net.bioclipse.brunn.pojos.Folder)}.
   */
  @Test
  public void testSave() {

    Folder folder = new Folder(tester, "folder", projects);
    getDAO().save(folder);

    session.flush();
    session.clear();

    Folder savedFolder = getDAO().getById(folder.getId());
    assertEquals(folder, savedFolder);
    assertNotSame(folder, savedFolder);
  }
  /** Test method for {@link net.bioclipse.brunn.daos.FolderDAO#getById(long)}. */
  @Test
  public void testGetById() {

    Folder folder = new Folder(tester, "folder", projects);
    Folder subFolder = new Folder(tester, "subFolder", folder);
    getDAO().save(folder);

    session.flush();
    session.clear();

    Folder savedFolder = getDAO().getById(folder.getId());
    Folder savedSubFolder = getDAO().getById(subFolder.getId());

    assertEquals(folder, savedFolder);
    assertEquals(subFolder, savedSubFolder);
    assertNotSame(folder, savedFolder);
    assertTrue(folder.getObjects().contains(subFolder));
  }
  @Test
  public void testDelete() {

    Folder folder = new Folder(tester, "folder", projects);
    assertFalse(folder.isDeleted());
    getDAO().save(folder);

    session.flush();
    session.clear();

    getDAO().delete(folder);

    session.flush();
    session.clear();

    Folder deleted = getDAO().getById(new Long(folder.getId()));
    assertTrue(deleted.isDeleted());
  }