@Test public void testFinalizeTheReportCheckPropertySettingsWithoutApplicationVersion() { long elapsedTime = 100000L; Calendar cal = Calendar.getInstance(); NumberFormat nf = NumberFormat.getInstance(); nf.setMinimumFractionDigits(0); nf.setMaximumFractionDigits(0); int expectedMinuteDuration = 1; double expectedDuration = 100; underTest.finalizeTheReport(gSuite, allTestResults, null, elapsedTime, props); DateHelper dateHelper = new DateHelper(); verify(props).setProperty("Runned", String.valueOf(10)); verify(props).setProperty("Failed", String.valueOf(2)); verify(props).setProperty("Passed", String.valueOf(8)); verify(props).setProperty("TCdummy", String.valueOf(0)); verify(props).setProperty("TCnotapplicable", String.valueOf(0)); verify(props).setProperty("Time", "<b>" + expectedMinuteDuration + "</b> minutes and <b>" + nf.format(40.0) + "</b> seconds"); verify(props).setProperty("SecondsTime", "" + expectedDuration); verify(props).setProperty("DateTime", dateHelper.getShortStringFromDate(cal)); verify(props).setProperty("Version", "undetected"); verify(props).setProperty("TEID", "Unknown"); verify(props).setProperty("TCUsed", Integer.toString(5)); verify(props).setProperty("TCNumber", Integer.toString(0)); verify(props).setProperty("ResultURLHTML", ""); }
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())); 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")) { 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", ""); } }
ReportFinalizer { 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())); 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")) { 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", ""); } } }
ReportFinalizer { 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())); 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")) { 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", ""); } } ReportFinalizer(final Environment environment); }
ReportFinalizer { 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())); 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")) { 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", ""); } } ReportFinalizer(final Environment environment); void finalizeTheReport(final GenericListTestSuite gSuite, final AllTestResults allTestResults, final String applicationUnderTestVersion,
            final long elapsedTime, final Properties props); }
ReportFinalizer { 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())); 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")) { 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", ""); } } ReportFinalizer(final Environment environment); void finalizeTheReport(final GenericListTestSuite gSuite, final AllTestResults allTestResults, final String applicationUnderTestVersion,
            final long elapsedTime, final Properties props);  }