Source:
public void runTest( ITestInvocationListener listener, RunUtil rUtil, File jarFile, String key, String testFileName) { TestDescription testDesc = new TestDescription(this.getClass().getSimpleName(), testFileName); listener.testStarted(testDesc, System.currentTimeMillis()); String testId = UUID.randomUUID().toString(); CommandResult cmndRes = rUtil.runTimedCmd(6000000, getCommand(jarFile, testFileName, testId, key)); CLog.i( "===========================STD logs for " + testId + " starts===========================\n"); CLog.i(cmndRes.getStdout()); CLog.i( "===========================STD logs for " + testId + " ends===========================\n"); CLog.i( "===========================ERR logs for " + testId + " starts===========================\n"); CLog.i(cmndRes.getStderr()); CLog.i( "===========================ERR logs for " + testId + " ends===========================\n"); File resultsFile = new File( Paths.get( baseFilePath, OUTPUT_RELATIVE_PATH, testId, RESULTS_RELATIVE_PATH, "action_execution_result") .toString()); if (resultsFile.exists()) { String content = fetchJsonContent(resultsFile.getAbsolutePath()); try { JSONObject result = new JSONObject(content); List<String> errors = new ArrayList<>(); errors = parseResult(errors, result); if (!errors.isEmpty()) { listener.testFailed(testDesc, errors.get(0)); CLog.i("Test %s failed due to following errors: \n", testDesc.getTestName()); for (String error : errors) { CLog.i(error + "\n"); } } } catch (JSONException e) { CLog.e(e); } String testResultFileName = testFileName + "_action_execution_result"; InputStreamSource iSSource = new FileInputStreamSource(resultsFile); listener.testLog(testResultFileName, LogDataType.TEXT, iSSource); iSSource.close(); } listener.testEnded(testDesc, System.currentTimeMillis(), new HashMap<String, String>()); }

Target:
public void runTest( ITestInvocationListener listener, RunUtil rUtil, File jarFile, String key, String testFileName) { TestDescription testDesc = new TestDescription(this.getClass().getSimpleName(), testFileName); listener.testStarted(testDesc, System.currentTimeMillis()); String testId = UUID.randomUUID().toString(); CommandResult cmndRes = rUtil.runTimedCmd(testTimeout, getCommand(jarFile, testFileName, testId, key)); logInfo(testId, "STD", cmndRes.getStdout()); logInfo(testId, "ERR", cmndRes.getStderr()); File resultsFile = new File( Paths.get( baseFilePath, OUTPUT_RELATIVE_PATH, testId, RESULTS_RELATIVE_PATH, "action_execution_result") .toString()); if (resultsFile.exists()) { try { String content = FileUtil.readStringFromFile(resultsFile); JSONObject result = new JSONObject(content); List<String> errors = new ArrayList<>(); errors = parseResult(errors, result); if (!errors.isEmpty()) { listener.testFailed(testDesc, errors.get(0)); CLog.i("Test %s failed due to following errors: \n", testDesc.getTestName()); for (String error : errors) { CLog.i(error + "\n"); } } } catch (IOException | JSONException e) { CLog.e(e); } String testResultFileName = testFileName + "_action_execution_result"; try (InputStreamSource iSSource = new FileInputStreamSource(resultsFile)) { listener.testLog(testResultFileName, LogDataType.TEXT, iSSource); } } listener.testEnded(testDesc, System.currentTimeMillis(), new HashMap<String, String>()); }