コード例 #1
0
 /**
  * Test the createMaintenance(Maintenance) method : the DAO must have an additionnal entity after
  * the creation
  */
 @Test
 public void testCreateMaintenance() {
   int count = (int) maintenanceDAO.count();
   Maintenance m = Maintenance.getMaintenance(Maintenance.TEST);
   maintenanceDAO.createMaintenance(m);
   assertEquals(count + 1, maintenanceDAO.count());
 }
コード例 #2
0
 @Override
 public void bootstrap() {
   if (maintenanceDAO.count() == 0) {
     maintenanceDAO.createMaintenance(Maintenance.getMaintenance(Maintenance.FULL));
     maintenanceDAO.createMaintenance(Maintenance.getMaintenance(Maintenance.TEST));
     maintenanceDAO.createMaintenance(Maintenance.getMaintenance(Maintenance.NONE));
   }
 }
コード例 #3
0
 /** Test the count() method */
 @Test
 public void testCount() {
   assertEquals(2, maintenanceDAO.count());
 }
コード例 #4
0
 /**
  * Test if the DAO have no more {@link Maintenance} entities after the call of deleteAll() method
  */
 @Test
 public void testDeleteAll() {
   maintenanceDAO.deleteAll();
   assertEquals(0, maintenanceDAO.count());
 }