/** Test if the modification of an entity has been correctly done */
 @Test
 public void testUpdateMaintenance() {
   noneMaintenance.setName("Very full");
   maintenanceDAO.updateMaintenance(noneMaintenance);
   assertEquals("Very full", maintenanceDAO.findById(noneMaintenanceId).getName());
 }
 /**
  * Test the deletion of an {@link Maintenance}. We check that the deleted {@link Maintenance}
  * can't be found.
  */
 @Test
 public void testDeleteMaintenance() {
   maintenanceDAO.deleteMaintenance(noneMaintenance);
   assertNull(maintenanceDAO.findById(noneMaintenanceId));
 }
 /** Test if an {@link Maintenance} can be found by his ID */
 @Test
 public void testFindById() {
   assertEquals(fullMaintenance, maintenanceDAO.findById(fullMaintenanceId));
 }
Ejemplo n.º 4
0
 /** {@inheritDoc} */
 @Override
 public void setAsText(String text) {
   setValue((text == null) ? null : maintenanceDAO.findById(Long.parseLong(text)));
 }