@Test
public void dom() throws Exception {

  createTempFile(".java");
  String output =
    // Came across this output on StackOverflow:
    "FAILURE: Build failed with an exception.\n" +
    "* What went wrong:\n" +
    "A problem occurred configuring project ':EpicMix'.\n" +
    "> Failed to notify project evaluation listener.\n" +
    "   > A problem occurred configuring project ':facebook'.\n" +
    "      > Failed to notify project evaluation listener.\n" +
    "         > java.lang.OutOfMemoryError: PermGen space" +
    "\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: 24.154 secs";
  assertEquals("0: Error:A problem occurred configuring project ':EpicMix'.\n" +
               "> Failed to notify project evaluation listener.\n" +
               "   > A problem occurred configuring project ':facebook'.\n" +
               "      > Failed to notify project evaluation listener.\n" +
               "         > java.lang.OutOfMemoryError: PermGen space\n" +
               "1: Info:BUILD FAILED\n" +
               "2: Info:Total time: 24.154 secs\n",
               toString(parser.parseGradleOutput(output)));
  String output2 =
    "To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: http://gradle.org/docs/1.7/userguide/gradle_daemon.html.\n" +
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* What went wrong:\n" +
    "A problem occurred configuring project ':MyNewApp'.\n" +
    "> Failed to notify project evaluation listener.\n" +
    "   > java.lang.OutOfMemoryError: Java heap space\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: 24.154 secs";
  assertEquals("0: Simple:To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: http://gradle.org/docs/1.7/userguide/gradle_daemon.html.\n" +
               "1: Error:A problem occurred configuring project ':MyNewApp'.\n" +
               "> Failed to notify project evaluation listener.\n" +
               "   > java.lang.OutOfMemoryError: Java heap space\n" +
               "2: Info:BUILD FAILED\n" +
               "3: Info:Total time: 24.154 secs\n",
               toString(parser.parseGradleOutput(output2)));
}