Search in sources :

Example 1 with IntermediateStep

use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.

the class IntermediateStepParseFilterLinesTest method testMixed.

@Test
public void testMixed() throws IntegrationException, ExecutableFailedException {
    IntermediateStep intermediateStep = new IntermediateStepParseFilterLines(".*maven_coordinates=.*");
    List<String> input = Arrays.asList(NAME_LINE, TAGS_LINE_MIXED);
    List<String> output = intermediateStep.process(input);
    assertEquals(1, output.size());
    assertEquals(TAGS_LINE_MIXED, output.get(0));
}
Also used : IntermediateStepParseFilterLines(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseFilterLines) IntermediateStep(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep) Test(org.junit.jupiter.api.Test)

Example 2 with IntermediateStep

use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.

the class IntermediateStepParseFilterLinesTest method testMavenCoordinateOnly.

@Test
public void testMavenCoordinateOnly() throws IntegrationException, ExecutableFailedException {
    IntermediateStep intermediateStep = new IntermediateStepParseFilterLines(".*maven_coordinates=.*");
    List<String> input = Arrays.asList(NAME_LINE, TAGS_LINE_MAVEN_COORDINATES);
    List<String> output = intermediateStep.process(input);
    assertEquals(1, output.size());
    assertEquals(TAGS_LINE_MAVEN_COORDINATES, output.get(0));
}
Also used : IntermediateStepParseFilterLines(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseFilterLines) IntermediateStep(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep) Test(org.junit.jupiter.api.Test)

Example 3 with IntermediateStep

use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.

the class IntermediateStepParseReplaceInEachLineTest method testRemoveLeadingAtSignMixedTags.

@Test
public void testRemoveLeadingAtSignMixedTags() throws IntegrationException, ExecutableFailedException {
    List<String> input = Arrays.asList("  tags = [\"__SOME_OTHER_TAG__\", \"maven_coordinates=com.company.thing:thing-common-client:2.100.0\"],", "  tags = [\"maven_coordinates=com.google.code.findbugs:jsr305:3.0.2\"],");
    IntermediateStep intermediateStep1 = new IntermediateStepParseReplaceInEachLine(".*\"maven_coordinates=", "");
    IntermediateStep intermediateStep2 = new IntermediateStepParseReplaceInEachLine("\".*", "");
    List<String> intermediate = intermediateStep1.process(input);
    List<String> output = intermediateStep2.process(intermediate);
    assertEquals(2, output.size());
    assertEquals("com.company.thing:thing-common-client:2.100.0", output.get(0));
    assertEquals("com.google.code.findbugs:jsr305:3.0.2", output.get(1));
}
Also used : IntermediateStepParseReplaceInEachLine(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseReplaceInEachLine) IntermediateStep(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep) Test(org.junit.jupiter.api.Test)

Example 4 with IntermediateStep

use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.

the class IntermediateStepParseReplaceInEachLineTest method testRemoveLeadingAtSign.

@Test
public void testRemoveLeadingAtSign() throws IntegrationException, ExecutableFailedException {
    List<String> input = Arrays.asList("@org_apache_commons_commons_io//jar:jar", "@com_google_guava_guava//jar:jar");
    IntermediateStep intermediateStep = new IntermediateStepParseReplaceInEachLine("^@", "");
    List<String> output = intermediateStep.process(input);
    assertEquals(2, output.size());
    assertEquals("org_apache_commons_commons_io//jar:jar", output.get(0));
    assertEquals("com_google_guava_guava//jar:jar", output.get(1));
}
Also used : IntermediateStepParseReplaceInEachLine(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseReplaceInEachLine) IntermediateStep(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep) Test(org.junit.jupiter.api.Test)

Example 5 with IntermediateStep

use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.

the class IntermediateStepParseSplitEachEachTest method test.

@Test
public void test() throws IntegrationException, ExecutableFailedException {
    IntermediateStep intermediateStepSplitEach = new IntermediateStepParseSplitEach("\\s+");
    List<String> input = Arrays.asList("@org_apache_commons_commons_io//jar:jar\n@com_google_guava_guava//jar:jar");
    List<String> output = intermediateStepSplitEach.process(input);
    assertEquals(2, output.size());
    assertEquals("@org_apache_commons_commons_io//jar:jar", output.get(0));
    assertEquals("@com_google_guava_guava//jar:jar", output.get(1));
}
Also used : IntermediateStep(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep) IntermediateStepParseSplitEach(com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseSplitEach) Test(org.junit.jupiter.api.Test)

Aggregations

IntermediateStep (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep)11 Test (org.junit.jupiter.api.Test)11 IntermediateStepParseReplaceInEachLine (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseReplaceInEachLine)5 IntermediateStepParseFilterLines (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseFilterLines)3 ExecutableTarget (com.synopsys.integration.detectable.ExecutableTarget)1 DetectableExecutableRunner (com.synopsys.integration.detectable.detectable.executable.DetectableExecutableRunner)1 BazelCommandExecutor (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.BazelCommandExecutor)1 BazelVariableSubstitutor (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.BazelVariableSubstitutor)1 IntermediateStepExecuteBazelOnEachLine (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepExecuteBazelOnEachLine)1 IntermediateStepParseSplitEach (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseSplitEach)1 IntermediateStepParseValuesFromXml (com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStepParseValuesFromXml)1 Executable (com.synopsys.integration.executable.Executable)1 ExecutableOutput (com.synopsys.integration.executable.ExecutableOutput)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1