@Test
 public void simpleFirehoseReadingTest() throws IOException {
   Assert.assertEquals(MAX_SHARD_NUMBER.longValue(), segmentSet.size());
   Integer rowcount = 0;
   try (final IngestSegmentFirehose firehose =
       (IngestSegmentFirehose) factory.connect(rowParser)) {
     while (firehose.hasMore()) {
       InputRow row = firehose.nextRow();
       Assert.assertArrayEquals(new String[] {DIM_NAME}, row.getDimensions().toArray());
       Assert.assertArrayEquals(new String[] {DIM_VALUE}, row.getDimension(DIM_NAME).toArray());
       Assert.assertEquals(METRIC_LONG_VALUE.longValue(), row.getLongMetric(METRIC_LONG_NAME));
       Assert.assertEquals(
           METRIC_FLOAT_VALUE, row.getFloatMetric(METRIC_FLOAT_NAME), METRIC_FLOAT_VALUE * 0.0001);
       ++rowcount;
     }
   }
   Assert.assertEquals((int) MAX_SHARD_NUMBER * MAX_ROWS, (int) rowcount);
 }
 @Test
 public void sanityTest() {
   Assert.assertEquals(DATA_SOURCE_NAME, factory.getDataSource());
   if (factory.getDimensions() != null) {
     Assert.assertArrayEquals(new String[] {DIM_NAME}, factory.getDimensions().toArray());
   }
   Assert.assertEquals(FOREVER, factory.getInterval());
   if (factory.getMetrics() != null) {
     Assert.assertEquals(
         ImmutableSet.of(METRIC_LONG_NAME, METRIC_FLOAT_NAME),
         ImmutableSet.copyOf(factory.getMetrics()));
   }
 }