@Test
public void testFindByDate() {

  calendar.clear();
  calendar.set(2014, Calendar.JANUARY, 1);
  // on or after 1/1/2014
  List<AlertHistoryEntity> history = m_dao.findAll(m_cluster.getClusterId(),
      calendar.getTime(), null);
  assertNotNull(history);
  assertEquals(50, history.size());
  // on or before 1/1/2014
  history = m_dao.findAll(m_cluster.getClusterId(), null, calendar.getTime());
  assertNotNull(history);
  assertEquals(1, history.size());
  // between 1/5 and 1/10
  calendar.set(2014, Calendar.JANUARY, 5);
  Date startDate = calendar.getTime();
  calendar.set(2014, Calendar.JANUARY, 10);
  Date endDate = calendar.getTime();
  history = m_dao.findAll(m_cluster.getClusterId(), startDate, endDate);
  assertNotNull(history);
  assertEquals(6, history.size());
  // after 3/1
  calendar.set(2014, Calendar.MARCH, 5);
  history = m_dao.findAll(m_cluster.getClusterId(), calendar.getTime(), null);
  assertNotNull(history);
  assertEquals(0, history.size());
  history = m_dao.findAll(m_cluster.getClusterId(), endDate, startDate);
  assertNotNull(history);
  assertEquals(0, history.size());
}