/** * @param report * @param previousReport * @return */ public static String createReportSummaryDetails(Report report, Report previousReport) { final StringBuilder builder = new StringBuilder(); builder.append(Messages.Testopia_Utils_Summary()); builder.append("<table border=\"1\">\n"); builder.append("<tr><th>"); builder.append("Test Case ID"); builder.append("</th><th>"); builder.append("Status"); builder.append("</th></tr>\n"); for (TestCaseWrapper tc : report.getTestCases()) { builder.append("<tr>\n"); builder.append("<td>" + tc.getId() + "</td>"); builder.append("<td>" + Utils.getExecutionStatusTextColored(tc.getStatusId()) + "</td>\n"); builder.append("</tr>\n"); } builder.append("</table>"); return builder.toString(); }
/** * Creates a Map (name, value) of environment variables for a Test Case. * * @param testCase test Case. * @return Map (name, value) of environment variables. */ public static Map<String, String> createEnvironmentVariables(TestCaseWrapper testCase) { Map<String, String> envVar = new HashMap<String, String>(); envVar.put(TESTOPIA_TESTCASE_ID_ENVVAR, "" + testCase.getId()); envVar.put(TESTOPIA_TESTCASE_SCRIPT_ENVVAR, "" + testCase.getScript()); envVar.put(TESTOPIA_TESTCASE_ALIAS_ENVVAR, "" + testCase.getAlias()); envVar.put(TESTOPIA_TESTCASE_ARGUMENTS_ENVVAR, "" + testCase.getArguments()); envVar.put(TESTOPIA_TESTCASE_REQUIREMENT_ENVVAR, "" + testCase.getRequirement()); envVar.put(TESTOPIA_TESTCASE_SORT_KEY_ENVVAR, "" + testCase.getSortKey()); envVar.put(TESTOPIA_TESTCASE_SUMMARY_ENVVAR, "" + testCase.getSummary()); envVar.put(TESTOPIA_TESTCASE_AUTHOR_ID_ENVVAR, "" + testCase.getAuthorId()); envVar.put(TESTOPIA_TESTCASE_CATEGORY_ID_ENVVAR, "" + testCase.getCategoryId()); envVar.put(TESTOPIA_TESTCASE_DEFAULT_TESTER_ID_ENVVAR, "" + testCase.getDefaultTesterId()); envVar.put(TESTOPIA_TESTCASE_PRIORITY_ID_ENVVAR, "" + testCase.getPriorityId()); envVar.put(TESTOPIA_TESTCASE_STATUS_ID_ENVVAR, "" + testCase.getStatusId()); envVar.put(TESTOPIA_TESTCASE_AUTOMATED_ENVVAR, "" + testCase.getAutomated()); envVar.put(TESTOPIA_TESTCASE_CREATION_DATE_ENVVAR, "" + testCase.getCreationDate()); envVar.put(TESTOPIA_TESTCASE_ESTIMATED_TIME_ENVVAR, "" + testCase.getEstimatedTime()); envVar.put(TESTOPIA_TESTCASE_RUN_ID_ENVVAR, "" + testCase.getRunId()); envVar.put(TESTOPIA_TESTCASE_BUILD_ID_ENVVAR, "" + testCase.getBuildId()); envVar.put(TESTOPIA_TESTCASE_ENV_ID_ENVVAR, "" + testCase.getEnvId()); TestRun testRun = testCase.getTestRun(); envVar.put(TESTOPIA_TESTRUN_ID_ENVVAR, "" + testRun.getId()); envVar.put(TESTOPIA_TESTRUN_BUILD_ENVVAR, "" + testRun.getBuild()); envVar.put(TESTOPIA_TESTRUN_ENVIRONMENT_ENVVAR, "" + testRun.getEnvironment()); envVar.put(TESTOPIA_TESTRUN_MANAGER_ENVVAR, "" + testRun.getManager()); envVar.put(TESTOPIA_TESTRUN_NOTES_ENVVAR, "" + testRun.getNotes()); envVar.put(TESTOPIA_TESTRUN_PRODUCT_VERSION_ENVVAR, "" + testRun.getProductVersion()); envVar.put(TESTOPIA_TESTRUN_SUMMARY_ENVVAR, "" + testRun.getSummary()); envVar.put(TESTOPIA_TESTRUN_CASES_ENVVAR, "" + testRun.getCases()); envVar.put(TESTOPIA_TESTRUN_PLAN_ID_ENVVAR, "" + testRun.getPlanId()); envVar.put(TESTOPIA_TESTRUN_PLAN_TEXT_VERSION_ENVVAR, "" + testRun.getPlanTextVersion()); envVar.put(TESTOPIA_TESTRUN_STATUS_ENVVAR, "" + testRun.getStatus()); envVar.put(TESTOPIA_TESTRUN_TARGET_COMPLETION_ENVVAR, "" + testRun.getTargetCompletion()); envVar.put(TESTOPIA_TESTRUN_PLAN_TARGET_PASS_ENVVAR, "" + testRun.getTargetPass()); return envVar; }