public void addTestPlanLog(String section, LogFileContentDTO lf) throws XdsInternalException { if (sectionLogMapDTO == null) sectionLogMapDTO = new SectionLogMapDTO(testInstance); sectionLogMapDTO.put(section, lf); }
public void setPreviousSectionLogs(SectionLogMapDTO previousLogs) { previousSectionLogs = previousLogs; logger.debug(previousLogs.describe()); }
public String describe() { return "SectionLogMapDTO...\n" + reportsToString(); }
/** * 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; }
TestDefinition testDefinition = searchPath.getTestDefinition(testInstance.getId()); String section = tsec.section; SectionLogMapDTO sectionLogMapDTO = new SectionLogMapDTO(testConfig.testInstance); sectionLogMapDTOs.put(tsec, sectionLogMapDTO); sectionLogMapDTO.setTestInstance(testInstance); if (section != null && section.equals("THIS")) continue; if (config.verbose) logger.info("Loading log " + testlogFile); sectionLogMapDTO.put(section, new LogFileContentBuilder().build(testlogFile)); break;
public SectionLogMapDTO getPreviousSectionLogs() { if (previousSectionLogs == null) previousSectionLogs = new SectionLogMapDTO(testConfig.testInstance); return previousSectionLogs; }
public void selectSections(List<String> sectionNames) throws Exception { loadTestPlansFromSectionList(sectionNames); // will need to load all previous section logs for referencing List<File> previousLogFiles = getTestLogsForThisTest(testDefinition.getIndexFile(), sectionNames.get(0)); for (File f : previousLogFiles) { LogFileContentDTO lf = new LogFileContentBuilder().build(f); String sectionName = lf.getSection(); //System.out.println("\tLoading log for section " + sectionName); sectionLogMapDTO.put(sectionName, lf); } }
LogFileContentDTO logFileContentDTO = previousLogs.get(useReport.section); if (logFileContentDTO == null) { TestSection testSection = new TestSection(useReport.testInstance, useReport.section); SectionLogMapDTO sectionLogMapDTO = sectionLogMapDTOs.get(testSection); logFileContentDTO = sectionLogMapDTO.get(useReport.section);
public String toString() { return "[TestLogDetails: " + " area=" + area + "<br />testnum=" + testInstance + "<br />sections= " + testPlansToString() + "<br />logs= " + ((sectionLogMapDTO == null) ? "none" : sectionLogMapDTO.toString()) + "]"; }
public void put(String sectionName, LogFileContentDTO log) throws XdsInternalException { if (log == null) throw new XdsInternalException("Null log for section " + sectionName); if (sectionName == null) throw new XdsInternalException("SectionLogMapDTO#put - sectionName is null"); // /**TODO - KM add**/ // if(!sectionName.equals("THIS")) { // sectionName = sectionName + ":" + log.getTest(); // } sectionNames.add(sectionName); sectionLogs.put(sectionName, log); setSection(log.getReportDTOs(), sectionName); }
protected void reportManagerPostRun() throws XdsInternalException { SectionLogMapDTO sectionLogs = getPlan().getPreviousSectionLogs(); try { sectionLogs.remove("THIS"); } catch (Exception e) {} if ( ! step_failure ) { if (reportManager != null ) { //reportStepParameters(); reportManager.setXML(instruction_output); logger.info("Reporting run parameters: " + getPlan().getExtraLinkage()); reportManager.report(getPlan().getExtraLinkage()); reportManager.generate(); // report run parameters as Reports testLog.add_name_value(instruction_output, reportManager.toXML()); } } }
public void resetLogs() { sectionLogMapDTO = new SectionLogMapDTO(testInstance); }
sectionLogs.put("THIS", new LogFileContentBuilder().build(getPlan().getLog(), true /* incomplete is ok */)); } catch (Exception e) { e.printStackTrace();
List<String> sections = testDefinition.getSectionIndex(); for (String section : sections) { LogFileContentDTO logFileContentDTO = testLogDetails.sectionLogMapDTO.get(section); if (logFileContentDTO == null) { logFileContentDTO = new LogFileContentDTO(); } catch (Exception e) { if (testLogDetails.getTestPlanLogs().get("log.xml") != null) { LogFileContentDTO logFileContentDTO = testLogDetails.getTestPlanLogs().get("log.xml"); SectionOverviewDTO sectionOverview = addSection("", logFileContentDTO); if (!sectionOverview.isPass())
public TestLogDetails(TestDefinition testDefinition, TestInstance testInstance) throws Exception { this.testDefinition = testDefinition; this.testInstance = testInstance; areas = Installation.defaultAreas; // if (!testDefinition.isTest()) // throw new Exception("Test " + testDefinition.getId() + " does not exist"); sectionLogMapDTO = new SectionLogMapDTO(testInstance); testPlanFileMap = testDefinition.getTestPlans(); // logRepository = LogRepositoryFactory.getLogRepository(Installation.instance().testLogCache(), testInstance.getUser(), LogIdIOFormat.JAVA_SERIALIZATION, LogIdType.SPECIFIC_ID, testInstance); }
public String toString() { return ((testInstance != null) ? testInstance.toString() : "null") + reportsToString(); }
public TestLogDetails(TestDefinition testDefinition, TestInstance testInstance, String[] areas) throws Exception { this.testDefinition = testDefinition; this.testInstance = testInstance; this.areas = areas; if (!testDefinition.isTest()) throw new Exception("Test " + testDefinition.getId() + " does not exist - expected to find it at " + testDefinition.getTestDir().toString()); sectionLogMapDTO = new SectionLogMapDTO(testInstance); testPlanFileMap = testDefinition.getTestPlans(); }