@Test public void whenAppBuckFileRemovedThenRebuildFails() throws IOException, InterruptedException { AssumeAndroidPlatform.assumeSdkIsAvailable(); final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "file_watching", tmp); workspace.setUp(); ProcessResult result = workspace.runBuckdCommand("build", "app"); result.assertSuccess(); String fileName = "apps/myapp/BUCK"; Files.delete(workspace.getPath(fileName)); workspace.runBuckdCommand("build", "app").assertFailure(); }
@Test public void whenBuckBuiltTwiceLogIsPresent() throws IOException, InterruptedException { AssumeAndroidPlatform.assumeSdkIsAvailable(); final ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "file_watching", tmp); workspace.setUp(); workspace.runBuckdCommand("build", "//java/com/example/activity:activity").assertSuccess(); Path buildLogFile = workspace.getPath("buck-out/bin/build.log"); assertTrue(Files.isRegularFile(buildLogFile)); Files.delete(buildLogFile); ProcessResult rebuild = workspace.runBuckdCommand("build", "//java/com/example/activity:activity"); rebuild.assertSuccess(); buildLogFile = workspace.getPath("buck-out/bin/build.log"); assertTrue(Files.isRegularFile(buildLogFile)); }