From b484b6374bf294b37e27991357ca641b175665a7 Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Thu, 3 Sep 2020 16:35:58 +0530 Subject: Fix sonar build issues Issue-ID: OPTFRA-815 Signed-off-by: krishnaa96 Change-Id: Ia72deeb281ec70c9508a02d60a5370301715422e --- cmso-sonar/docker/integration/ete_test.sh | 1 + .../org/onap/optf/cmso/it/ItFullIntegrationTest.java | 18 +++++++++++++----- 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(); -- cgit 1.2.3-korg