use of com.synopsys.integration.detect.battery.docker.util.DockerAssertions in project synopsys-detect by blackducksoftware.
the class SubProjectAggregateModeTest method subProjectAggregateModeSmokeTest.
// Once we're testing against Black Duck 2021.10+, we can verify that the correct project name/version
// was created in Black Duck. But that doesn't work yet (in Black Duck).
@Test
void subProjectAggregateModeSmokeTest() throws IOException, IntegrationException {
try (DetectDockerTestRunner test = new DetectDockerTestRunner("subproject-aggregate-mode", "detect-7.1.0:1.0.0")) {
test.withImageProvider(BuildDockerImageProvider.forDockerfilResourceNamed("Detect-7.1.0.dockerfile"));
BlackDuckTestConnection blackDuckTestConnection = BlackDuckTestConnection.fromEnvironment();
BlackDuckAssertions blackduckAssertions = blackDuckTestConnection.projectVersionAssertions("subproject-aggregate-mode-docker", "happy-path");
blackduckAssertions.emptyOnBlackDuck();
DetectCommandBuilder commandBuilder = new DetectCommandBuilder().defaults().defaultDirectories(test);
commandBuilder.connectToBlackDuck(blackDuckTestConnection);
commandBuilder.projectNameVersion(blackduckAssertions);
String bdioFilename = "testagg";
commandBuilder.property("detect.bdio.file.name", bdioFilename);
commandBuilder.property("detect.tools", "DETECTOR");
DockerAssertions dockerAssertions = test.run(commandBuilder);
dockerAssertions.successfulOperation("SubProject Aggregate");
dockerAssertions.bdioFiles(1);
dockerAssertions.bdioFileCreated(bdioFilename + ".bdio");
}
}
use of com.synopsys.integration.detect.battery.docker.util.DockerAssertions in project synopsys-detect by blackducksoftware.
the class ArchitectureTest method linuxHasArchitectureLog.
@Test
void linuxHasArchitectureLog() throws IOException {
try (DetectDockerTestRunner test = new DetectDockerTestRunner("detect-architecture", "empty-linux:1.0.0")) {
test.withImageProvider(BuildDockerImageProvider.forDockerfilResourceNamed("EmptyLinux.dockerfile"));
DetectCommandBuilder commandBuilder = DetectCommandBuilder.withOfflineDefaults().defaultDirectories(test);
commandBuilder.property(DetectProperties.DETECT_TOOLS, "NONE");
DockerAssertions dockerAssertions = test.run(commandBuilder);
dockerAssertions.logContains("You seem to be using amd64 architecture.");
}
}
use of com.synopsys.integration.detect.battery.docker.util.DockerAssertions in project synopsys-detect by blackducksoftware.
the class ProjectInspectorTests method dotnetProjectInspector.
@Test
void dotnetProjectInspector() throws IOException {
try (DetectDockerTestRunner test = new DetectDockerTestRunner("detect-dotnet-project-inspector", "detect-dotnet-five:1.0.1")) {
test.withImageProvider(BuildDockerImageProvider.forDockerfilResourceNamed("Dotnet5.dockerfile"));
DetectCommandBuilder commandBuilder = DetectCommandBuilder.withOfflineDefaults().defaultDirectories(test);
commandBuilder.property(DetectProperties.DETECT_TOOLS, "DETECTOR");
commandBuilder.property(DetectProperties.BLACKDUCK_OFFLINE_MODE, "true");
commandBuilder.property(DetectProperties.DETECT_BUILDLESS, "true");
commandBuilder.property(DetectProperties.DETECT_INCLUDED_DETECTOR_TYPES, DetectorType.NUGET.toString());
DockerAssertions dockerAssertions = test.run(commandBuilder);
dockerAssertions.successfulDetectorType("NUGET");
dockerAssertions.atLeastOneBdioFile();
dockerAssertions.logContains("NuGet Project Inspector");
}
}
use of com.synopsys.integration.detect.battery.docker.util.DockerAssertions in project synopsys-detect by blackducksoftware.
the class ProjectInspectorTests method mavenProjectInspectorLegacyIsTheDefault.
@Test
void mavenProjectInspectorLegacyIsTheDefault() throws IOException, InterruptedException {
try (DetectDockerTestRunner test = new DetectDockerTestRunner("detect-maven-project-inspector-legacy", "maven-simple:1.0.0")) {
test.withImageProvider(BuildDockerImageProvider.forDockerfilResourceNamed("SimpleMaven.dockerfile"));
DetectCommandBuilder commandBuilder = DetectCommandBuilder.withOfflineDefaults().defaultDirectories(test);
commandBuilder.property(DetectProperties.DETECT_TOOLS, "DETECTOR");
commandBuilder.property(DetectProperties.BLACKDUCK_OFFLINE_MODE, "true");
commandBuilder.property(DetectProperties.DETECT_BUILDLESS, "true");
commandBuilder.property(DetectProperties.DETECT_INCLUDED_DETECTOR_TYPES, DetectorType.MAVEN.toString());
DockerAssertions dockerAssertions = test.run(commandBuilder);
dockerAssertions.successfulDetectorType("MAVEN");
dockerAssertions.atLeastOneBdioFile();
dockerAssertions.logDoesNotContain("Maven Project Inspector");
dockerAssertions.logContains("Maven Pom Parse");
}
}
use of com.synopsys.integration.detect.battery.docker.util.DockerAssertions in project synopsys-detect by blackducksoftware.
the class Dotnet5Test method detectUsesDotnet5.
@Test
void detectUsesDotnet5() throws IOException {
try (DetectDockerTestRunner test = new DetectDockerTestRunner("detect-dotnet-five", "detect-dotnet-five:1.0.1")) {
test.withImageProvider(BuildDockerImageProvider.forDockerfilResourceNamed("Dotnet5.dockerfile"));
DetectCommandBuilder commandBuilder = DetectCommandBuilder.withOfflineDefaults().defaultDirectories(test);
commandBuilder.property(DetectProperties.DETECT_TOOLS, "DETECTOR");
commandBuilder.property(DetectProperties.BLACKDUCK_OFFLINE_MODE, "true");
DockerAssertions dockerAssertions = test.run(commandBuilder);
dockerAssertions.successfulDetectorType("NUGET");
dockerAssertions.atLeastOneBdioFile();
// Verify we are using the EXTERNAL artifactory to download the inspector.
dockerAssertions.logContainsPattern("https://sig-repo.synopsys.com/.*bds-integrations-release/com/synopsys/integration/detect-nuget-inspector/");
}
}
Aggregations