@Test
public void wrongGradleVersion() throws Exception {

  // Wrong gradle
  createTempFile(DOT_GRADLE);
  String output =
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* Where:\n" +
    "Build file '" + sourceFilePath  +"' line: 24\n" +
    "\n" +
    "* What went wrong:\n" +
    "A problem occurred evaluating project ':MyApplication'.\n" +
    "> Gradle version 1.8 is required. Current version is 1.7. If using the gradle wrapper, try editing the distributionUrl in /some/path/gradle.properties to gradle-1.8-all.zip\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: 4.467 secs";
  assertEquals("0: Error:A problem occurred evaluating project ':MyApplication'.\n" +
               // TODO: Link to the gradle.properties file directly!
               // However, we have an import hyperlink helper to do it automatically, so may not be necessary
               "> Gradle version 1.8 is required. Current version is 1.7. If using the gradle wrapper, try editing the distributionUrl in /some/path/gradle.properties to gradle-1.8-all.zip\n" +
               "\t" + sourceFilePath + ":24:1\n" +
               "1: Info:BUILD FAILED\n" +
               "2: Info:Total time: 4.467 secs\n",
               toString(parser.parseGradleOutput(output)));
  sourceFile.delete();
}