protected void postSubmit() throws Exception {
compareResultsByLinesInMemory(EXPECTED, resultPath);
// Test accumulator results
System.out.println("Accumulator results:");
JobExecutionResult res = getJobExecutionResult();
System.out.println(AccumulatorHelper.getResultsFormated(res.getAllAccumulatorResults()));
Assert.assertEquals(new Integer(3), (Integer) res.getAccumulatorResult("num-lines"));
Assert.assertEquals(new Double(NUM_SUBTASKS), (Double)res.getAccumulatorResult("open-close-counter"));
// Test histogram (words per line distribution)
Map<Integer, Integer> dist = Maps.newHashMap();
dist.put(1, 1); dist.put(2, 2); dist.put(3, 3);
Assert.assertEquals(dist, res.getAccumulatorResult("words-per-line"));
// Test distinct words (custom accumulator)
Set<StringRecord> distinctWords = Sets.newHashSet();
distinctWords.add(new StringRecord("one"));
distinctWords.add(new StringRecord("two"));
distinctWords.add(new StringRecord("three"));
Assert.assertEquals(distinctWords, res.getAccumulatorResult("distinct-words"));
}