@Test public void testSolve()
    throws IOException, SkylineStoreException, SolverException,
    ResourceEstimatorException, DataFieldNotFoundException, ParseException {

  parseLog("src/test/resources/lp/tpch_q12.txt");
  RecurrenceId recurrenceId = new RecurrenceId("tpch_q12", "*");
  final Map<RecurrenceId, List<ResourceSkyline>> jobHistory =
      skylineStore.getHistory(recurrenceId);
  solver = createSolver();
  RLESparseResourceAllocation result = solver.solve(jobHistory);
  String file = "src/test/resources/lp/answer.txt";
  Reader fileReader = new InputStreamReader(new FileInputStream(file),
      Charset.forName("UTF-8"));
  BufferedReader bufferedReader = new BufferedReader(fileReader);
  String line = bufferedReader.readLine();
  Configuration config = new Configuration();
  config.addResource(new org.apache.hadoop.fs.Path(
      ResourceEstimatorConfiguration.CONFIG_FILE));
  int timeInterval =
      config.getInt(ResourceEstimatorConfiguration.TIME_INTERVAL_KEY, 5);
  final long containerMemAlloc =
      jobHistory.entrySet().iterator().next().getValue().get(0)
          .getContainerSpec().getMemorySize();
  int count = 0;
  int numContainer = 0;
  while (line != null) {
    numContainer =
        (int) (result.getCapacityAtTime(count * timeInterval).getMemorySize()
            / containerMemAlloc);
    assertEquals(Integer.parseInt(line), numContainer,
        0.1 * Integer.parseInt(line));
    line = bufferedReader.readLine();
    count++;
  }
  fileReader.close();
  bufferedReader.close();
}