aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2020-09-03 16:35:58 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2020-09-03 16:35:58 +0530
commitb484b6374bf294b37e27991357ca641b175665a7 (patch)
treea5a36252ced4133be5880c7ffdbc2f6ab0dcf225
parent72b0cd6f2e8ef130ad97407ae19459c3efb7d16d (diff)
Fix sonar build issues
Issue-ID: OPTFRA-815 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: Ia72deeb281ec70c9508a02d60a5370301715422e
-rwxr-xr-xcmso-sonar/docker/integration/ete_test.sh1
-rw-r--r--cmso-sonar/src/test/java/org/onap/optf/cmso/it/ItFullIntegrationTest.java18
2 files changed, 14 insertions, 5 deletions
diff --git a/cmso-sonar/docker/integration/ete_test.sh b/cmso-sonar/docker/integration/ete_test.sh
index aff605e..09ad69e 100755
--- a/cmso-sonar/docker/integration/ete_test.sh
+++ b/cmso-sonar/docker/integration/ete_test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+set -x
docker-compose up >up.txt 2>&1 &
### Wait for robot to finish
diff --git a/cmso-sonar/src/test/java/org/onap/optf/cmso/it/ItFullIntegrationTest.java b/cmso-sonar/src/test/java/org/onap/optf/cmso/it/ItFullIntegrationTest.java
index aa3779a..9beafd9 100644
--- a/cmso-sonar/src/test/java/org/onap/optf/cmso/it/ItFullIntegrationTest.java
+++ b/cmso-sonar/src/test/java/org/onap/optf/cmso/it/ItFullIntegrationTest.java
@@ -18,6 +18,8 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -39,12 +41,18 @@ public class ItFullIntegrationTest {
Process process = null;
try {
ProcessBuilder processBuilder = buildCommand();
+ processBuilder = processBuilder.redirectErrorStream(true);
process = processBuilder.start();
- // debug.debug("engine command=" + commandString);
- String stdout = IOUtils.toString(process.getInputStream(), "UTF-8");
- String stderr = IOUtils.toString(process.getErrorStream(), "UTF-8");
- System.out.println("stdout=" + stdout);
- System.out.println("stderr=" + stderr);
+ try (var reader = new BufferedReader(
+ new InputStreamReader(process.getInputStream()))) {
+
+ String line;
+
+ while ((line = reader.readLine()) != null) {
+ System.out.println(line);
+ }
+
+ }
copyJacocoFiles();
copyClassFiles();
copyForSonar();