@Test
public void javacError() throws Exception {

  // Javac error
  createTempXmlFile();
  String output =
    "Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0\n" +
    ":MyApplication:preBuild UP-TO-DATE\n" +
    ":MyApplication:preDebugBuild UP-TO-DATE\n" +
    ":MyApplication:preReleaseBuild UP-TO-DATE\n" +
    ":MyApplication:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE\n" +
    ":MyApplication:prepareDebugDependencies\n" +
    ":MyApplication:compileDebugAidl UP-TO-DATE\n" +
    ":MyApplication:compileDebugRenderscript UP-TO-DATE\n" +
    ":MyApplication:generateDebugBuildConfig UP-TO-DATE\n" +
    ":MyApplication:mergeDebugAssets UP-TO-DATE\n" +
    ":MyApplication:mergeDebugResources UP-TO-DATE\n" +
    ":MyApplication:processDebugManifest UP-TO-DATE\n" +
    ":MyApplication:processDebugResources UP-TO-DATE\n" +
    ":MyApplication:generateDebugSources UP-TO-DATE\n" +
    ":MyApplication:compileDebug\n" +
    "Ignoring platform 'android-1': build.prop is missing.\n" +
    sourceFilePath + ":12: not a statement\n" +
    "x        super.onCreate(savedInstanceState);\n" +
    "^\n" +
    sourceFilePath + ":12: ';' expected\n" +
    "x        super.onCreate(savedInstanceState);\n" +
    " ^\n" +
    "2 errors\n" +
    ":MyApplication:compileDebug FAILED\n" +
    "\n" +
    "FAILURE: Build failed with an exception.\n" +
    "\n" +
    "* What went wrong:\n" +
    "Execution failed for task ':MyApplication: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: 6.177 secs";
  assertEquals("0: Simple::MyApplication:preBuild UP-TO-DATE\n" +
               "1: Simple::MyApplication:preDebugBuild UP-TO-DATE\n" +
               "2: Simple::MyApplication:preReleaseBuild UP-TO-DATE\n" +
               "3: Simple::MyApplication:prepareComAndroidSupportAppcompatV71800Library UP-TO-DATE\n" +
               "4: Simple::MyApplication:prepareDebugDependencies\n" +
               "5: Simple::MyApplication:compileDebugAidl UP-TO-DATE\n" +
               "6: Simple::MyApplication:compileDebugRenderscript UP-TO-DATE\n" +
               "7: Simple::MyApplication:generateDebugBuildConfig UP-TO-DATE\n" +
               "8: Simple::MyApplication:mergeDebugAssets UP-TO-DATE\n" +
               "9: Simple::MyApplication:mergeDebugResources UP-TO-DATE\n" +
               "10: Simple::MyApplication:processDebugManifest UP-TO-DATE\n" +
               "11: Simple::MyApplication:processDebugResources UP-TO-DATE\n" +
               "12: Simple::MyApplication:generateDebugSources UP-TO-DATE\n" +
               "13: Simple::MyApplication:compileDebug\n" +
               "14: Simple:Ignoring platform 'android-1': build.prop is missing.\n" +
               "15: Error:not a statement\n" +
               "\t" + sourceFilePath + ":12:-1\n" +
               "16: Simple:x        super.onCreate(savedInstanceState);\n" +
               "17: Simple:^\n" +
               "18: Error:';' expected\n" +
               "\t" + sourceFilePath + ":12:-1\n" +
               "19: Simple: ^\n" +
               "20: Simple::MyApplication:compileDebug FAILED\n" +
               "21: Error:Execution failed for task ':MyApplication:compileDebug'.\n" +
               "> Compilation failed; see the compiler error output for details.\n" +
               "22: Info:BUILD FAILED\n" +
               "23: Info:Total time: 6.177 secs\n",
               toString(parser.parseGradleOutput(output)));
  sourceFile.delete();
}