Search in sources :

Example 1 with WorkspaceRule

use of com.synopsys.integration.detectable.detectables.bazel.WorkspaceRule in project synopsys-detect by blackducksoftware.

the class BazelWorkspaceFileParserTest method testMultipleRules.

@Test
void testMultipleRules() throws IOException {
    File workspaceFile = new File("src/test/resources/detectables/functional/bazel/WORKSPACE_multipleRules");
    List<String> workspaceFileLines = FileUtils.readLines(workspaceFile, StandardCharsets.UTF_8);
    BazelWorkspaceFileParser bazelWorkspaceFileParser = new BazelWorkspaceFileParser();
    Set<WorkspaceRule> rulesFound = bazelWorkspaceFileParser.parseWorkspaceRuleTypes(workspaceFileLines);
    assertEquals(Sets.newHashSet(WorkspaceRule.MAVEN_INSTALL, WorkspaceRule.HASKELL_CABAL_LIBRARY), rulesFound);
}
Also used : BazelWorkspaceFileParser(com.synopsys.integration.detectable.detectables.bazel.BazelWorkspaceFileParser) WorkspaceRule(com.synopsys.integration.detectable.detectables.bazel.WorkspaceRule) File(java.io.File) Test(org.junit.jupiter.api.Test)

Example 2 with WorkspaceRule

use of com.synopsys.integration.detectable.detectables.bazel.WorkspaceRule in project synopsys-detect by blackducksoftware.

the class WorkspaceRuleChooserTest method run.

private Set<WorkspaceRule> run(Set<WorkspaceRule> workspaceRulesFromProperty, Set<WorkspaceRule> parsedWorkspaceRules) throws IntegrationException {
    WorkspaceRuleChooser workspaceRuleChooser = new WorkspaceRuleChooser();
    Set<WorkspaceRule> chosenWorkspaceRules = workspaceRuleChooser.choose(parsedWorkspaceRules, workspaceRulesFromProperty);
    return chosenWorkspaceRules;
}
Also used : WorkspaceRuleChooser(com.synopsys.integration.detectable.detectables.bazel.pipeline.WorkspaceRuleChooser) WorkspaceRule(com.synopsys.integration.detectable.detectables.bazel.WorkspaceRule)

Aggregations

WorkspaceRule (com.synopsys.integration.detectable.detectables.bazel.WorkspaceRule)2 BazelWorkspaceFileParser (com.synopsys.integration.detectable.detectables.bazel.BazelWorkspaceFileParser)1 WorkspaceRuleChooser (com.synopsys.integration.detectable.detectables.bazel.pipeline.WorkspaceRuleChooser)1 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1