예제 #1
0
 /** Test of update method, of class ClientHDao. */
 @Test
 public void testUpdate() {
   System.out.println("update");
   Audit c = dao.getAudit("1");
   c.setTypemodification("NAJAHI Soft");
   dao.update(c);
   assertEquals(c.getTypemodification(), "NAJAHI Soft");
 }
예제 #2
0
 /** Test of delete method, of class ClientHDao. */
 @Test
 public void testDelete() {
   System.out.println("delete");
   dao.delete("1");
   String sql = "SELECT * FROM audit";
   int numberOfRecords = dbConn.getNumberOfRecords(sql);
   assertEquals(numberOfRecords, 0);
 }
예제 #3
0
 /** Test of getAllClients method, of class ClientHDao. */
 @Test
 public void testGetAllAudits() {
   System.out.println("getAllAudits");
   int i = 0;
   List audits = dao.getAllAudit();
   assertEquals(audits.size(), 1);
   Audit c = (Audit) audits.get(i);
   assertEquals(c.getTypeoperation(), "XX");
 }
예제 #4
0
 /** Test of insert method, of class ClientHDao. */
 @Test
 public void testInsert() {
   System.out.println("insert");
   Audit c = new Audit();
   c.setIdaudit("2");
   c.setDateaudit(new Date(2000 - 1 - 1));
   c.setHeuraudit(200);
   c.setTypemodification("tt");
   c.setTypeoperation("ddd");
   c.setUserid("1");
   c.setUsername("ddd");
   dao.insert(c);
   String sql = "SELECT * FROM audit";
   int numberOfRecords = dbConn.getNumberOfRecords(sql);
   assertEquals(numberOfRecords, 2);
 }
예제 #5
0
 /** Test of getClient method, of class ClientHDao. */
 @Test
 public void testGetClient() {
   System.out.println("getAudit");
   Audit c = dao.getAudit("1");
   assertEquals(c.getTypeoperation(), "XX");
 }