use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditAliasCommandIntegrationTest method testBuckAliasList.
@Test
public void testBuckAliasList() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "alias", tmp);
workspace.setUp();
ProcessResult result = workspace.runBuckCommand("audit", "alias", "--list");
result.assertSuccess();
// Remove trailing newline from stdout before passing to Splitter.
String stdout = result.getStdout();
assertTrue(stdout.endsWith("\n"));
stdout = stdout.substring(0, stdout.length() - 1);
List<String> aliases = Splitter.on('\n').splitToList(stdout);
assertEquals("Aliases that appear in both .buckconfig and .buckconfig.local should appear only once.", 3, aliases.size());
assertEquals(ImmutableSet.of("foo", "bar", "bar_ex"), ImmutableSet.copyOf(aliases));
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditDependenciesCommandIntegrationTest method testJSONOutput.
@Test
public void testJSONOutput() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
workspace.setUp();
// Print all of the inputs to the rule.
ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "--json", "//example:one");
result.assertSuccess();
assertEquals(workspace.getFileContents("stdout-one.json"), result.getStdout());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditDependenciesCommandIntegrationTest method testTestsThatArentNecessarilyIncludedInOriginalParseAreIncludedInOutput.
@Test
public void testTestsThatArentNecessarilyIncludedInOriginalParseAreIncludedInOutput() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
workspace.setUp();
// Print all of the inputs to the rule.
ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "--include-tests", "--transitive", "//lib/lib1:lib1");
result.assertSuccess();
assertEquals(workspace.getFileContents("stdout-lib1-transitive-tests"), result.getStdout());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditDependenciesCommandIntegrationTest method testThatJSONOutputWithMultipleInputsIsGroupedByInput.
@Test
public void testThatJSONOutputWithMultipleInputsIsGroupedByInput() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
workspace.setUp();
// Print all of the inputs to the rule.
ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "--json", "//example:two", "//example:three");
result.assertSuccess();
assertEquals(workspace.getFileContents("stdout-two-three.json"), result.getStdout());
}
use of com.facebook.buck.testutil.integration.ProjectWorkspace.ProcessResult in project buck by facebook.
the class AuditDependenciesCommandIntegrationTest method testThatTransitiveJSONOutputWithMultipleInputsIsGroupedByInput.
@Test
public void testThatTransitiveJSONOutputWithMultipleInputsIsGroupedByInput() throws IOException {
ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "audit_dependencies", tmp);
workspace.setUp();
// Print all of the inputs to the rule.
ProcessResult result = workspace.runBuckCommand("audit", "dependencies", "--transitive", "--json", "//example:one", "//example:two", "//example:three");
result.assertSuccess();
assertEquals(workspace.getFileContents("stdout-one-two-three-transitive.json"), result.getStdout());
}
Aggregations