in wilma-functionaltest/src/main/java/com/epam/gepard/common/helper/ReportFinalizer.java [57:101]
public void finalizeTheReport(final GenericListTestSuite gSuite, final AllTestResults allTestResults, final String applicationUnderTestVersion,
final long elapsedTime, final Properties props) {
Calendar cal;
cal = Calendar.getInstance();
double duration = elapsedTime / GepardConstants.ONE_SECOND_LENGTH.getConstant();
int minuteDuration = (int) Math.floor(duration / GepardConstants.ONE_MINUTE_IN_SECS.getConstant());
double secondDuration = duration - (minuteDuration * GepardConstants.ONE_MINUTE_IN_SECS.getConstant());
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(0);
nf.setMaximumFractionDigits(0);
DateHelper dateHelper = new DateHelper();
props.setProperty("Runned", String.valueOf(allTestResults.getRunned()));
props.setProperty("Failed", String.valueOf(allTestResults.getFailed()));
props.setProperty("Passed", String.valueOf(allTestResults.getPassed()));
props.setProperty("TCdummy", String.valueOf(allTestResults.getDummy()));
props.setProperty("TCnotapplicable", String.valueOf(allTestResults.getNotApplicable()));
props.setProperty("Time", "<b>" + minuteDuration + "</b> minutes and <b>" + nf.format(secondDuration) + "</b> seconds");
props.setProperty("SecondsTime", "" + duration);
props.setProperty("DateTime", dateHelper.getShortStringFromDate(cal));
String applicationVersion = applicationUnderTestVersion;
if (applicationVersion == null) {
applicationVersion = "undetected";
}
props.setProperty("Version", applicationVersion);
String teid = environment.getProperty(Environment.TEST_ENVIRONMENT_ID, "Unknown");
props.setProperty("TEID", teid);
props.setProperty("TCSrunned", String.valueOf(gSuite.getTestClassCount())); //TODO as gSuite won't be used, counting TCs should be arranged somehow
props.setProperty("TCUsed", Integer.toString(gSuite.getUsedTc()));
int tcNumber = 0;
Iterator<String> iterator = GenericListTestSuite.getTestClassIds().iterator();
while (iterator.hasNext()) {
String s = iterator.next();
if (s.endsWith("/0")) { //ignore multiplications in map
tcNumber += GenericListTestSuite.getTestClassExecutionData(s).getCountOfRuns();
}
}
props.setProperty("TCNumber", Integer.toString(tcNumber));
String resultUrl = environment.getProperty(Environment.GEPARD_PUBLIC_PATH) + "/" + environment.getProperty(Environment.GEPARD_PUBLIC_RESULT);
String resultUrlHtml = "Test Results will be available <a href=" + resultUrl + ">here.</a><br/>";
if (environment.getBooleanProperty(Environment.GEPARD_PUBLIC_ENABLED)) {
props.setProperty("ResultURLHTML", resultUrlHtml);
} else {
props.setProperty("ResultURLHTML", "");
}
}