コード例 #1
0
 @Test(expected = RuntimeException.class)
 public void testRemoveNotExists() throws Exception {
   Role role = new Role();
   role.setId(4);
   role.setName("role5");
   roleDao.remove(role);
 }
コード例 #2
0
 @Test
 @ExpectedDatabase(
     table = "Role",
     value = "/dataset/role/afterRemove.xml",
     assertionMode = DatabaseAssertionMode.NON_STRICT)
 public void testRemove() throws Exception {
   roleDao.remove(roles[1]);
 }
コード例 #3
0
 @Test
 @DatabaseSetup("/dataset/role/empty.xml")
 @ExpectedDatabase(
     table = "Role",
     value = "/dataset/role/afterCreate.xml",
     assertionMode = DatabaseAssertionMode.NON_STRICT)
 public void testCreate() throws Exception {
   roleDao.create(roles[1]);
 }
コード例 #4
0
  @Test
  @ExpectedDatabase(
      table = "Role",
      value = "/dataset/role/afterUpdate.xml",
      assertionMode = DatabaseAssertionMode.NON_STRICT)
  public void testUpdate() throws Exception {
    Role role = roles[2];
    role.setName("role55");

    roleDao.update(role);
  }
コード例 #5
0
 @Test(expected = IllegalArgumentException.class)
 public void testRemoveWithNull() {
   roleDao.remove(null);
 }
コード例 #6
0
 @Test(expected = IllegalArgumentException.class)
 public void testUpdateWithNull() {
   roleDao.update(null);
 }
コード例 #7
0
 @Test(expected = RuntimeException.class)
 public void testCreateExists() throws Exception {
   roleDao.create(roles[0]);
 }
コード例 #8
0
 @Test
 public void testFindByName() {
   Role role = roleDao.findByName(roles[2].getName());
   Assert.assertEquals("Roles must equals", roles[2], role);
 }