Fix sonar build issues 97/112097/1
authorkrishnaa96 <krishna.moorthy6@wipro.com>
Thu, 3 Sep 2020 11:05:58 +0000 (16:35 +0530)
committerkrishnaa96 <krishna.moorthy6@wipro.com>
Thu, 3 Sep 2020 11:05:58 +0000 (16:35 +0530)
Issue-ID: OPTFRA-815
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: Ia72deeb281ec70c9508a02d60a5370301715422e

cmso-sonar/docker/integration/ete_test.sh
cmso-sonar/src/test/java/org/onap/optf/cmso/it/ItFullIntegrationTest.java

index aff605e..09ad69e 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/bash
+set -x
 docker-compose up >up.txt 2>&1 &
 
 ### Wait for robot to finish
index aa3779a..9beafd9 100644 (file)
@@ -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();