@Test
public void testRoll()
    throws IOException, InterruptedException, NoopRecordException, CorruptEventException {

  log.shutdownWorker();
  Thread.sleep(1000);
  for (int i = 0; i < 1000; i++) {
    FlumeEvent eventIn = TestUtils.newPersistableEvent();
    long transactionID = ++this.transactionID;
    FlumeEventPointer eventPointer = log.put(transactionID, eventIn);
    // get is not transactional
    FlumeEvent eventOut = log.get(eventPointer);
    Assert.assertNotNull(eventOut);
    Assert.assertEquals(eventIn.getHeaders(), eventOut.getHeaders());
    Assert.assertArrayEquals(eventIn.getBody(), eventOut.getBody());
  }
  int logCount = 0;
  for (File dataDir : dataDirs) {
    for (File logFile : dataDir.listFiles()) {
      if (logFile.getName().startsWith("log-")) {
        logCount++;
      }
    }
  }
  // 93 (*2 for meta) files with TestLog.MAX_FILE_SIZE=1000
  Assert.assertEquals(186, logCount);
}