@Test(priority = 2)
public void testRetrieve() {

  GroupBy groupBy = new GroupBy("TIER,HOSTNAME,CLUSTER");
  Filter filter = new Filter("hostname="+tuple1.getHostname());
  AuditDBHelper helper = new AuditDBHelper(
      ClientConfig.loadFromClasspath(AuditDBConstants.FEEDER_CONF_FILE));
  Set<Tuple> tupleSet = helper.retrieve(toDate, fromDate, filter, groupBy);
  Assert.assertEquals(1, tupleSet.size());
  Iterator<Tuple> tupleSetIter = tupleSet.iterator();
  Assert.assertTrue(tupleSetIter.hasNext());
  Tuple returnedTuple = tupleSetIter.next();
  Assert.assertEquals(tuple1.getHostname(), returnedTuple.getHostname());
  Assert.assertEquals(tuple1.getTier(), returnedTuple.getTier());
  Assert.assertEquals(null, returnedTuple.getTopic());
  Assert.assertEquals(tuple1.getSent() + tuple2.getSent() + tuple3.getSent(),
      returnedTuple.getSent());
  for (LatencyColumns latencyColumns : LatencyColumns.values()) {
    Long val1 = tuple1.getLatencyCountMap().get(latencyColumns);
    if (val1 == null)
      val1 = 0l;
    Long val2 = tuple2.getLatencyCountMap().get(latencyColumns);
    if (val2 == null)
      val2 = 0l;
    Long val3 = tuple3.getLatencyCountMap().get(latencyColumns);
    if (val3 == null)
      val3 = 0l;
    Long val4 = returnedTuple.getLatencyCountMap().get(latencyColumns);
    if (val4 == null)
      val4 = 0l;
    Long valx = val1 + val2 + val3;
    Assert.assertEquals(valx, val4);
  }
  Assert.assertEquals((Long) (tuple1.getLostCount() + tuple2.getLostCount() +
      tuple3.getLostCount()), returnedTuple.getLostCount());
  filter = new Filter(null);
  tupleSet = helper.retrieve(toDate, fromDate, filter, groupBy);
  Assert.assertEquals(2, tupleSet.size());
}