@Test
public void javac() throws Exception {

  createTempFile(".java");
  String output =
    sourceFilePath + ":70: <identifier> expected\n" +
    "x\n" +
    " ^\n" +
    sourceFilePath + ":71: <identifier> expected\n" +
    "    @Override\n" +
    "             ^\n" +
    "2 errors\n" +
    ":MyApp:compileDebug FAILED\n" +
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* What went wrong:\n" +
    "Execution failed for task ':MyApp:compileDebug'.\n" +
    "> Compilation failed; see the compiler error output for details.\n" +
    "\n" +
    "* Try:\n" +
    "Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\n" +
    "\n" +
    "BUILD FAILED\n" +
    "\n" +
    "Total time: 12.42 secs";
  assertEquals("0: Error:<identifier> expected\n" +
               "\t" + sourceFilePath + ":70:2\n" +
               "1: Error:<identifier> expected\n" +
               "\t" + sourceFilePath + ":71:14\n" +
               "2: Simple::MyApp:compileDebug FAILED\n" +
               "3: Error:Execution failed for task ':MyApp:compileDebug'.\n" +
               "> Compilation failed; see the compiler error output for details.\n" +
               "4: Info:BUILD FAILED\n" +
               "5: Info:Total time: 12.42 secs\n",
               toString(parser.parseGradleOutput(output)));
}