@Test
public void testLogAggregationFileControllerFactory() throws Exception {

  enableFileControllers(ALL_FILE_CONTROLLERS, ALL_FILE_CONTROLLER_NAMES);
  LogAggregationFileControllerFactory factory =
      new LogAggregationFileControllerFactory(getConf());
  List<LogAggregationFileController> list =
      factory.getConfiguredLogAggregationFileControllerList();
  assertEquals("The expected number of LogAggregationFileController " +
      "is not 3!", 3, list.size());
  assertTrue("Test format is expected to be the first " +
      "LogAggregationFileController!", list.get(0) instanceof
      TestLogAggregationFileController);
  assertTrue("IFile format is expected to be the second " +
      "LogAggregationFileController!", list.get(1) instanceof
      LogAggregationIndexedFileController);
  assertTrue("TFile format is expected to be the first " +
      "LogAggregationFileController!", list.get(2) instanceof
      LogAggregationTFileController);
  assertTrue("Test format is expected to be used for writing!",
      factory.getFileControllerForWrite() instanceof
          TestLogAggregationFileController);
  verifyFileControllerInstance(factory,
      TestLogAggregationFileController.class);
}