public String stepName(int step) throws Exception { if (step < 0 || step >= steps.size()) throw new Exception("LogFile#stepName: step index " + step + " does not exist"); return steps.get(step).getId(); }
public boolean hasStep(String stepname) { for (int i=0; i<size(); i++) { if (stepname.equals(steps.get(i).getId())) return true; } return false; }
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); } }
TestStepLogContentDTO testStepLogContentDTO = logFileContentDTO.getTestStepLog(i); stepResult.section = section; stepResult.stepName = testStepLogContentDTO.getId(); stepResult.status = testStepLogContentDTO.getStatus(); stepResult.transaction = testStepLogContentDTO.getTransaction();
private void addStep(String stepName, TestStepLogContentDTO stepContent, SectionOverviewDTO sectionOverview) { StepOverviewDTO stepOverview = new StepOverviewDTO(); stepOverview.setName(stepContent.getId()); stepOverview.setPass(stepContent.isSuccess()); stepOverview.setExpectedSuccess(stepContent.isExpectedSuccess()); stepOverview.setDetails(stepContent.getDetails()); stepOverview.addErrors(stepContent.getSoapFaults()); stepOverview.addErrors(stepContent.getErrors()); stepOverview.addErrors(stepContent.getAssertionErrors()); stepOverview.setTransaction(stepContent.getTransaction()); // NOTE: This makes an assumption that only one transaction is allowed per step. sectionOverview.addStep(stepName, stepOverview); }
static public TestLogs build(LogMapDTO logMapDTO) throws Exception { TestLogs logs = new TestLogs(); for (LogMapItemDTO item : logMapDTO.getItems()) { LogFileContentDTO logFile = item.getLog(); for (TestStepLogContentDTO stepLog : logFile.getStepLogs()) { TestLog testLog = new TestLog(); String stepName = stepLog.getId(); logs.logs.add(testLog); testLog.stepName = stepName; testLog.endpoint = stepLog.getEndpoint(); testLog.inHeader = formatXmlToHtml(stepLog.getInHeader()); testLog.inputMetadata = formatXmlToHtml(stepLog.getInputMetadata()); testLog.outHeader = formatXmlToHtml(stepLog.getOutHeader()); testLog.result = formatXmlToHtml(stepLog.getResult()); testLog.status = stepLog.getStatus(); testLog.assignedIds = stepLog.getAssignedIds(); testLog.assignedUids = stepLog.getAssignedUids(); testLog.errors = listAsString(stepLog.getErrors()); testLog.log = formatXmlToHtml(stepLog.getRoot()); } } return logs; }
res.add("Status: " + ((stepLog.isSuccess()) ? "Pass" : "Fail"), stepLog.isSuccess()); res.add("Section: " + testLog.getTestAttribute() + " Step: " + stepLog.getId()); res.add("Endpoint: " + stepLog.getEndpoint());