Skip to content

Commit edc2606

Browse files
committed
Merge changes from 1.X.X to 2.0.0 as release 2.0.1
Signed-off-by: Rahul Krishna <[email protected]>
1 parent 2fa0cae commit edc2606

File tree

188 files changed

+15
-3679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+15
-3679
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=2.0.0
1+
version=2.0.1

src/test/java/com/ibm/cldk/CodeAnalyzerIntegrationTest.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ public class CodeAnalyzerIntegrationTest {
5252
"/opt/jars",
5353
BindMode.READ_WRITE)
5454
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("build/libs")), "/opt/jars")
55-
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications")), "/");
55+
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-corrupt-test")), "/test-applications/mvnw-corrupt-test")
56+
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-working-test")), "/test-applications/mvnw-working-test");
5657

5758
@Container
5859
static final GenericContainer<?> mavenContainer = new GenericContainer<>("maven:3.8.3-openjdk-17")
5960
.withCreateContainerCmdModifier(cmd -> cmd.withEntrypoint("sh"))
6061
.withCommand("-c", "while true; do sleep 1; done")
6162
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("build/libs")), "/opt/jars")
62-
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications")), "/");
63+
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-corrupt-test")), "/test-applications/mvnw-corrupt-test")
64+
.withCopyFileToContainer(MountableFile.forHostPath(Paths.get(System.getProperty("user.dir")).resolve("src/test/resources/test-applications/mvnw-working-test")), "/test-applications/mvnw-working-test");
6365

6466

6567
@BeforeAll
@@ -100,7 +102,8 @@ void shouldBeAbleToRunCodeAnalyzer() throws Exception {
100102

101103
Assertions.assertEquals(0, runCodeAnalyzerJar.getExitCode(),
102104
"Command should execute successfully");
103-
Assertions.assertFalse(runCodeAnalyzerJar.getStdout().isEmpty(), "Should have some output");
105+
Assertions.assertTrue(runCodeAnalyzerJar.getStdout().length() > 0,
106+
"Should have some output");
104107
}
105108

106109
@Test
@@ -126,19 +129,19 @@ void corruptMavenShouldProduceAnalysisArtifactsWhenMVNCommandIsInPath() throws I
126129
Assertions.assertTrue(runCodeAnalyzer.getStdout().contains("[ERROR]\tCannot run program \"/test-applications/mvnw-corrupt-test/mvnw\"") && runCodeAnalyzer.getStdout().contains("/mvn."));
127130
// We should correctly identify the build tool used in the mvn command from the system path.
128131
Assertions.assertTrue(runCodeAnalyzer.getStdout().contains("[INFO]\tBuilding the project using /usr/bin/mvn."));
129-
}
132+
}
130133

131134
@Test
132135
void corruptMavenShouldNotTerminateWithErrorWhenMavenIsNotPresentUnlessAnalysisLevel2() throws IOException, InterruptedException {
133136
// When analysis level 2, we should get a Runtime Exception
134137
var runCodeAnalyzer = container.execInContainer(
135-
"java",
136-
"-jar",
137-
String.format("/opt/jars/codeanalyzer-%s.jar", codeanalyzerVersion),
138-
"--input=/test-applications/mvnw-corrupt-test",
139-
"--output=/tmp/",
140-
"--analysis-level=2"
141-
);
138+
"java",
139+
"-jar",
140+
String.format("/opt/jars/codeanalyzer-%s.jar", codeanalyzerVersion),
141+
"--input=/test-applications/mvnw-corrupt-test",
142+
"--output=/tmp/",
143+
"--analysis-level=2"
144+
);
142145
Assertions.assertEquals(1, runCodeAnalyzer.getExitCode());
143146
Assertions.assertTrue(runCodeAnalyzer.getStderr().contains("java.lang.RuntimeException"));
144147
}
-4.12 KB
Binary file not shown.
-58.1 KB
Binary file not shown.
-4.12 KB
Binary file not shown.
-58.1 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)