< prev index next >

src/com/sun/javatest/report/XMLReport.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

*** 142,162 **** private void writeResults(final XMLReportMaker maker, final ReportSettings sett) throws SAXException, JavaTestError, IOException { maker.sTestResults(); File[] initFiles = sett.getInitialFiles(); ! Iterator iter = null; TestResultTable resultTable = sett.getInterview().getWorkDirectory().getTestResultTable(); try { if (initFiles == null) { iter = resultTable.getIterator(new TestFilter[] {sett.getTestFilter()}); } else { iter = resultTable.getIterator(initFiles, new TestFilter[] {sett.getTestFilter()}); } for (; iter.hasNext(); ) { ! TestResult tr = (TestResult) (iter.next()); writeResult(maker, tr); } maker.eTestResults(); } catch (TestResultTable.Fault f) { throw new JavaTestError(i18n.getString("report.testResult.err"), f); --- 142,162 ---- private void writeResults(final XMLReportMaker maker, final ReportSettings sett) throws SAXException, JavaTestError, IOException { maker.sTestResults(); File[] initFiles = sett.getInitialFiles(); ! Iterator<TestResult> iter = null; TestResultTable resultTable = sett.getInterview().getWorkDirectory().getTestResultTable(); try { if (initFiles == null) { iter = resultTable.getIterator(new TestFilter[] {sett.getTestFilter()}); } else { iter = resultTable.getIterator(initFiles, new TestFilter[] {sett.getTestFilter()}); } for (; iter.hasNext(); ) { ! TestResult tr = (iter.next()); writeResult(maker, tr); } maker.eTestResults(); } catch (TestResultTable.Fault f) { throw new JavaTestError(i18n.getString("report.testResult.err"), f);
*** 201,231 **** private void writeResultProps(final XMLReportMaker maker, final TestResult testResult) throws SAXException, TestResult.Fault { String time = testResult.getProperty(TestResult.END); maker.sResultProps(time); ! Enumeration en = testResult.getPropertyNames(); while (en.hasMoreElements()) { ! String key = (String) en.nextElement(); String val = testResult.getProperty(key); if (!TestResult.END.equals(key)) { maker.makeProperty(key, val); } } maker.eResultProps(); } private void writeEnvironment(final XMLReportMaker maker, final TestResult testResult) throws SAXException { ! Iterator keysIt; try { ! Map m = testResult.getEnvironment(); keysIt = m.keySet().iterator(); maker.sTestEnvironment(); while (keysIt.hasNext()) { ! String key = (String) keysIt.next(); ! String val = (String) m.get(key); maker.makeProperty(key, val); } maker.eTestEnvironment(); } catch (TestResult.Fault e) { --- 201,231 ---- private void writeResultProps(final XMLReportMaker maker, final TestResult testResult) throws SAXException, TestResult.Fault { String time = testResult.getProperty(TestResult.END); maker.sResultProps(time); ! Enumeration<String> en = testResult.getPropertyNames(); while (en.hasMoreElements()) { ! String key = en.nextElement(); String val = testResult.getProperty(key); if (!TestResult.END.equals(key)) { maker.makeProperty(key, val); } } maker.eResultProps(); } private void writeEnvironment(final XMLReportMaker maker, final TestResult testResult) throws SAXException { ! Iterator<String> keysIt; try { ! Map<String, String> m = testResult.getEnvironment(); keysIt = m.keySet().iterator(); maker.sTestEnvironment(); while (keysIt.hasNext()) { ! String key = keysIt.next(); ! String val = m.get(key); maker.makeProperty(key, val); } maker.eTestEnvironment(); } catch (TestResult.Fault e) {
*** 294,305 **** } maker.sEnvironment(name, descr); TestEnvironment env = sett.getInterview().getEnv(); if (env != null) { ! for (Iterator i = env.elements().iterator(); i.hasNext(); ) { ! TestEnvironment.Element envElem = (TestEnvironment.Element) (i.next()); maker.makeProperty(envElem.getKey(), envElem.getValue()); } } maker.eEnvironment(); } --- 294,305 ---- } maker.sEnvironment(name, descr); TestEnvironment env = sett.getInterview().getEnv(); if (env != null) { ! for (Iterator<TestEnvironment.Element> i = env.elements().iterator(); i.hasNext(); ) { ! TestEnvironment.Element envElem = (i.next()); maker.makeProperty(envElem.getKey(), envElem.getValue()); } } maker.eEnvironment(); }
< prev index next >