예제 #1
0
 @Test
 public void testRemove() throws Exception {
   Person person = new Person();
   person.setId(2L);
   bean.setPerson(person);
   log.debug("Here is the person.............." + person.getId());
   assertEquals("list", bean.delete());
   assertFalse(bean.hasErrors());
 }
예제 #2
0
  @Test
  public void testEdit() throws Exception {
    log.debug("testing edit...");
    bean.setId(1L);

    assertEquals("edit", bean.edit());
    assertNotNull(bean.getPerson());
    assertFalse(bean.hasErrors());
  }
예제 #3
0
  @Test
  public void testAdd() throws Exception {
    Person person = new Person();
    // set required fields
    person.setFirstName("firstName");
    person.setLastName("lastName");
    bean.setPerson(person);

    assertEquals("list", bean.save());
    assertFalse(bean.hasErrors());
  }
예제 #4
0
 @Override
 @Before
 public void onSetUp() {
   super.onSetUp();
   bean = new PersonForm();
   bean.setPersonManager(personManager);
 }
예제 #5
0
  @Test
  public void testSave() {
    bean.setId(1L);

    assertEquals("edit", bean.edit());
    assertNotNull(bean.getPerson());
    Person person = bean.getPerson();

    // update fields
    person.setFirstName("firstName");
    person.setLastName("lastName");
    bean.setPerson(person);

    assertEquals("edit", bean.save());
    assertFalse(bean.hasErrors());
  }