Ejemplo n.º 1
0
  /** Ensures that finding by name works as expected. */
  @Test
  public void testGetByName() {
    Bookmark result = dao.getByName(existing_bookmark.getName());

    assertNotNull(result);
    assertEquals(existing_bookmark.getName(), result.getName());
  }
Ejemplo n.º 2
0
  /** Ensures that saving a bookmark works as expected. */
  @Test
  public void testSave() {
    dao.save(new_bookmark);

    Bookmark result = dao.getByName(new_bookmark.getName());

    assertNotNull(result);
  }
Ejemplo n.º 3
0
  /** Ensures that, if the supplied name is invalid, then no bookmark is returned. */
  @Test
  public void testGetByNameWithInvalidName() {
    Bookmark result = dao.getByName("thisnameisinvalid");

    assertNull(result);
  }