public boolean hasFatalError() { return getFatalError() != null; }
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); }
public List<String> getSoapFaults(int index) throws XdsInternalException { return getTestStepLog(index).getSoapFaults(); }
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"); } }
private SectionOverviewDTO addSection(String sectionName, LogFileContentDTO logFileContentDTO) { SectionOverviewDTO sectionOverview = new SectionOverviewDTO(); sectionOverview.setName(sectionName); if (logFileContentDTO == null) { sectionOverview.setRun(false); testOverview.addSection(sectionOverview); return sectionOverview; } sectionOverview.setTls(logFileContentDTO.isTls()); sectionOverview.setPass(logFileContentDTO.isSuccess()); sectionOverview.setHl7Time(logFileContentDTO.getHl7Time()); sectionOverview.setSite(logFileContentDTO.getSiteName()); for (String stepName : logFileContentDTO.getStepMap().keySet()) { TestStepLogContentDTO stepContent = logFileContentDTO.getStepLog(stepName); addStep(stepName, stepContent, sectionOverview); } testOverview.addSection(sectionOverview); return sectionOverview; }
LogFileContentDTO logFileContentDTO = testLogDetails.sectionLogMapDTO.get(section); if (logFileContentDTO == null) { logFileContentDTO = new LogFileContentDTO(); logFileContentDTO.setHasRun(false); } else { logFileContentDTO.setHasRun(true); goals.setGoals(sectionDef.getStep(stepName).getGoals()); stepDTO.setStepGoalsDTO(goals); TestStepLogContentDTO existingStepLog = logFileContentDTO.getStepLog(stepName); if (existingStepLog == null) logFileContentDTO.addStep(stepName, stepDTO); else existingStepLog.setStepGoalsDTO(goals); sectionOverview.setRun(logFileContentDTO.isRun()); if (!sectionOverview.isPass()) testOverview.setPass(false);
continue; if (testLog.hasFatalError()) { res.add("Section: " + testLog.getTestAttribute()); res.add(testLog.getFatalError(), false); continue; for (TestStepLogContentDTO stepLog : testLog.getStepLogs()) { res.add("Status: " + ((stepLog.isSuccess()) ? "Pass" : "Fail"), stepLog.isSuccess()); res.add("Section: " + testLog.getTestAttribute() + " Step: " + stepLog.getId()); res.add("Endpoint: " + stepLog.getEndpoint());
continue; LogFileContentDTO logFileContentDTO = testLogDetails.sectionLogMapDTO.get(section); for (int i = 0; i < logFileContentDTO.size(); i++) { StepResult stepResult = new StepResult(); result.stepResults.add(stepResult); try { TestStepLogContentDTO testStepLogContentDTO = logFileContentDTO.getTestStepLog(i); stepResult.section = section; stepResult.stepName = testStepLogContentDTO.getId();
private void parseTestSteps() throws Exception { // steps = new ArrayList<TestStepLogContentDTO>(); // stepMap = new HashMap<String, TestStepLogContentDTO>(); testStepsEle = XmlUtil.childrenWithLocalName(log, "TestStep"); for (OMElement step : testStepsEle) { TestStepLogContentDTO stepLog = new TestStepLogContentBuilder(step).build(); c.getSteps().add(stepLog); c.getStepMap().put(stepLog.getId(), stepLog); } }
public boolean isTls(String sectionName) { LogFileContentDTO sectionDTO = logFileContent.get(sectionName); if (sectionDTO != null) return sectionDTO.isTls(); return false; }
public boolean hasStep(String stepname) { for (int i=0; i<size(); i++) { if (stepname.equals(steps.get(i).getId())) return true; } return false; }
/** * 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; }
TestStepLogContentDTO testStepLogContentDTO = logFileContentDTO.getStepLog(useReport.step); if (testStepLogContentDTO == null) throw new XdsInternalException("UseReportManager#resolve: cannot find Report for " + useReport.getURI() + "\n");
public List<SectionGoalsDTO> getGoals() { List<SectionGoalsDTO> goals = new ArrayList<SectionGoalsDTO>(); for (String sectionName : sectionNames) { goals.add(sectionLogs.get(sectionName).getGoals()); } return goals; }
public void add(String sectionName, LogFileContentDTO log) { logFileContent.put(sectionName, log); items.add(new LogMapItemDTO(sectionName, log)); if (log.isTls()) tls = true; }
public List<String> getAssertionErrors(int index) throws XdsInternalException { return getTestStepLog(index).getAssertionErrors(); }