Program: 24939
Project: 24939
Buggy source:
/** 
 * Test of persist method, of class TaskHibernateDAO.
 */
@Test @Ignore public void testPersist() throws Exception {
  String title="String_Node_Str";
  String details="String_Node_Str";
  String documentationFile="String_Node_Str";
  byte inputType=1;
  Date startDate=new SimpleDateFormat("String_Node_Str").parse("String_Node_Str");
  Date endDate=null;
  short days=1;
  byte weeks=1;
  short months=1;
  Task task=new Task();
  task.setTitle(title);
  task.setDetails(details);
  task.setDoc(documentationFile);
  task.setInputType(inputType);
  task.setStartDate(startDate);
  task.setEndDate(endDate);
  task.setDays(days);
  task.setWeeks(weeks);
  task.setMonths(months);
  TaskDAO dao=(TaskDAO)PersistenceContext.getInstance().getBean("String_Node_Str");
  Task persistedTask=dao.persist(task);
  assertNotNull("String_Node_Str",persistedTask.getId());
  assertEquals("String_Node_Str",title,persistedTask.getTitle());
  assertEquals("String_Node_Str",details,persistedTask.getDetails());
  assertEquals("String_Node_Str",documentationFile,persistedTask.getDoc());
  assertEquals("String_Node_Str",inputType,persistedTask.getInputType());
  assertNull("String_Node_Str",persistedTask.getProblem());
  assertEquals("String_Node_Str",startDate,persistedTask.getStartDate());
  assertEquals("String_Node_Str",endDate,persistedTask.getEndDate());
  assertEquals("String_Node_Str",days,(short)persistedTask.getDays());
  assertEquals("String_Node_Str",weeks,(byte)persistedTask.getWeeks());
  assertEquals("String_Node_Str",months,(short)persistedTask.getMonths());
  PreparedStatement statement=null;
  ResultSet results=null;
  try {
    statement=connection.prepareStatement("String_Node_Str");
    statement.setLong(1,persistedTask.getId());
    results=statement.executeQuery();
    results.next();
    assertEquals("String_Node_Str",title,results.getString("String_Node_Str"));
    assertEquals("String_Node_Str",details,results.getString("String_Node_Str"));
    assertEquals("String_Node_Str",documentationFile,results.getString("String_Node_Str"));
    assertEquals("String_Node_Str",inputType,results.getByte("String_Node_Str"));
    assertEquals("String_Node_Str",startDate,results.getDate("String_Node_Str"));
    assertEquals("String_Node_Str",endDate,results.getDate("String_Node_Str"));
    assertEquals("String_Node_Str",days,results.getShort("String_Node_Str"));
    assertEquals("String_Node_Str",weeks,results.getByte("String_Node_Str"));
    assertEquals("String_Node_Str",months,results.getShort("String_Node_Str"));
  }
  finally {
    if (statement != null)     statement.close();
    if (results != null)     results.close();
  }
}

Fixed version (ground truth):
/** 
 * Test of persist method, of class TaskHibernateDAO.
 */
@Test public void testPersist() throws Exception {
  String title="String_Node_Str";
  String details="String_Node_Str";
  Date schTime=new SimpleDateFormat("String_Node_Str").parse("String_Node_Str");
  String doc="String_Node_Str";
  Task task=new Task();
  task.setTitle(title);
  task.setDetails(details);
  task.setSchTime(schTime);
  task.setDoc(doc);
  TaskDAO dao=(TaskDAO)TestPersistenceContext.getInstance().getBean("String_Node_Str");
  Task perTask=dao.persist(task);
  assertNotNull("String_Node_Str",perTask.getId());
  assertEquals("String_Node_Str",title,perTask.getTitle());
  assertEquals("String_Node_Str",details,perTask.getDetails());
  assertEquals("String_Node_Str",schTime,perTask.getSchTime());
  assertEquals("String_Node_Str",doc,perTask.getDoc());
  PreparedStatement stmt=connection.prepareStatement("String_Node_Str");
  stmt.setInt(1,perTask.getId());
  ResultSet results=stmt.executeQuery();
  assertTrue("String_Node_Str",results.next());
  assertEquals("String_Node_Str",title,results.getString("String_Node_Str"));
  assertEquals("String_Node_Str",details,results.getString("String_Node_Str"));
  assertEquals("String_Node_Str",schTime.getTime(),results.getTime("String_Node_Str").getTime());
  assertEquals("String_Node_Str",doc,results.getString("String_Node_Str"));
}