private void calcGoals() { SectionGoalsDTO goals = new SectionGoalsDTO(c.getTestAttribute()); for (String stepName : c.getStepMap().keySet()) { goals.stepGoalDTOs.add(c.getStepMap().get(stepName).getStepGoalsDTO()); } c.setSectionGoalsDTO(goals); }
private void parseTest() { try { c.setTestAttribute(XmlUtil.firstChildWithLocalName(log, "Test").getText()); if (c.getTestAttribute() == null) { c.setTest(null); c.setSection(null); } else { String[] parts = c.getTestAttribute().split("/"); if (parts.length == 2) { c.setTest(parts[0]); c.setSection(parts[1]); } else { c.setTest(c.getTestAttribute()); c.setSection(null); } } } catch (Exception e) { c.setTestAttribute("Unknown"); } }
/** * Return LogMapDTO, the collection of information from the log.xml files generated by * the running of one or more tests. * @return LogMapDTO * @throws Exception - No tests have been specified, no logs can be found, or the log files cannot * be parsed. */ public LogMapDTO getLogMap() throws Exception { LogMapDTO lm = new LogMapDTO(); if (testLogDetails == null) throw new Exception("Xdstest2#getLogMap: testSpecs is null"); for (TestLogDetails testSpec : testLogDetails) { for (String section : testSpec.getTestPlanLogs().keySet()) { LogFileContentDTO testLog = testSpec.getTestPlanLogs().get(section); if (testLog == null) { if (section.equals("THIS")) continue; throw new Exception("Xdstest2#getLogMap: cannot find testlog for section " + section); } lm.add(testLog.getTestAttribute(), testLog); } } return lm; }
res.add("Section: " + testLog.getTestAttribute()); res.add(testLog.getFatalError(), false); continue; res.add("Status: " + ((stepLog.isSuccess()) ? "Pass" : "Fail"), stepLog.isSuccess()); res.add("Section: " + testLog.getTestAttribute() + " Step: " + stepLog.getId()); res.add("Endpoint: " + stepLog.getEndpoint());