< prev index next >

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

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


 431         mif = files;
 432     }
 433 
 434     /**
 435      * Returns array of File objects that were sources for Report Converter tool
 436      * or empty array if Report Converter was not used.
 437      *
 438      * @return array of source files
 439      */
 440     public File[] getMergingFiles() {
 441         return mif;
 442     }
 443 
 444     /**
 445      * Give Map for data exchange between custom reports during the same report
 446      * session. Can be used for sharing intermediate results between reports for
 447      * optimization.
 448      *
 449      * @return Map for data exchange
 450      */
 451     public Map getExchangeData() {
 452         if (exchangeData == null) {
 453             exchangeData = new HashMap();
 454         }
 455         return exchangeData;
 456     }
 457 
 458     void setupSortedResults() {
 459         if (sortedResults != null) {
 460             return;
 461         }
 462         TestResultTable resultTable = ip.getWorkDirectory().getTestResultTable();
 463         File[] initFiles = getInitialFiles();
 464         sortedResults = new TreeSet[Status.NUM_STATES];
 465         for (int i = 0; i < sortedResults.length; i++) {
 466             sortedResults[i] = new TreeSet<>(new TestResultsByNameComparator());
 467         }
 468         Iterator iter;
 469         try {
 470             TestFilter[] fs = null;
 471             // Note: settings.filter should not really be null, modernized clients
 472             //   of this class should set the filter before asking for a report.
 473             if (filter == null) {
 474                 fs = new TestFilter[0];
 475             } else {
 476                 fs = new TestFilter[]{filter};
 477             }
 478             iter = ((initFiles == null) ? resultTable.getIterator(fs) : resultTable.getIterator(initFiles, fs));
 479         } catch (TestResultTable.Fault f) {
 480             throw new JavaTestError(ReportSettings.i18n.getString("result.testResult.err"));
 481         }
 482         for (; iter.hasNext();) {
 483             TestResult tr = (TestResult) (iter.next());
 484             Status s = tr.getStatus();
 485             TreeSet<TestResult> list = sortedResults[s == null ? Status.NOT_RUN : s.getType()];
 486             list.add(tr);
 487         }
 488     }
 489 
 490     private static class TestResultsByNameComparator implements Comparator<TestResult> {
 491 
 492         @Override
 493         public int compare(TestResult tr1, TestResult tr2) {
 494             return tr1.getTestName().compareTo(tr2.getTestName());
 495         }
 496     }
 497 
 498     void setupKfl() {
 499         if (kflSorter != null) {
 500             return;
 501         }
 502         setupSortedResults();
 503         KnownFailuresList kfl = getInterview().getKnownFailuresList();


 513         return kflSorter;
 514     }
 515 
 516     TreeSet<TestResult>[] getSortedResults() {
 517         return sortedResults;
 518     }
 519 
 520     public void setCustomReports(List<CustomReport> customReportCollection) {
 521         customReports = customReportCollection;
 522     }
 523 
 524     public List<CustomReport> getCustomReports() {
 525         return customReports;
 526     }
 527 
 528     private TreeSet<TestResult>[] sortedResults;
 529     private KflSorter kflSorter;
 530     File xmlReportFile = null;
 531     File tmpXmlReportFile = null;
 532     private File[] mif = new File[0];
 533     private HashMap exchangeData;
 534     private InterviewParameters ip;
 535 
 536     private List<CustomReport> customReports = Collections.emptyList();
 537 
 538     TestFilter filter;
 539     // default (legacy) values provided
 540     boolean genHtml = true; // generate HTML?
 541     // generate HTML?
 542     boolean genPlain = true; // generate summary.txt?
 543     // generate summary.txt?
 544     boolean genCof = false; // generate cof.xml?
 545     // generate cof.xml?
 546     boolean genXml = false; // generate summary.xml?
 547     // generate summary.xml?
 548     private boolean genCofTestCases = true;
 549     boolean genConfig = true; // generate config section
 550     // generate config section
 551     boolean genQl = true;
 552     boolean genEnv = true;
 553     boolean genStd = true;


 431         mif = files;
 432     }
 433 
 434     /**
 435      * Returns array of File objects that were sources for Report Converter tool
 436      * or empty array if Report Converter was not used.
 437      *
 438      * @return array of source files
 439      */
 440     public File[] getMergingFiles() {
 441         return mif;
 442     }
 443 
 444     /**
 445      * Give Map for data exchange between custom reports during the same report
 446      * session. Can be used for sharing intermediate results between reports for
 447      * optimization.
 448      *
 449      * @return Map for data exchange
 450      */
 451     public Map<?, ?> getExchangeData() {
 452         if (exchangeData == null) {
 453             exchangeData = new HashMap<>();
 454         }
 455         return exchangeData;
 456     }
 457 
 458     void setupSortedResults() {
 459         if (sortedResults != null) {
 460             return;
 461         }
 462         TestResultTable resultTable = ip.getWorkDirectory().getTestResultTable();
 463         File[] initFiles = getInitialFiles();
 464         sortedResults = new TreeSet[Status.NUM_STATES];
 465         for (int i = 0; i < sortedResults.length; i++) {
 466             sortedResults[i] = new TreeSet<>(new TestResultsByNameComparator());
 467         }
 468         Iterator<TestResult> iter;
 469         try {
 470             TestFilter[] fs = null;
 471             // Note: settings.filter should not really be null, modernized clients
 472             //   of this class should set the filter before asking for a report.
 473             if (filter == null) {
 474                 fs = new TestFilter[0];
 475             } else {
 476                 fs = new TestFilter[]{filter};
 477             }
 478             iter = ((initFiles == null) ? resultTable.getIterator(fs) : resultTable.getIterator(initFiles, fs));
 479         } catch (TestResultTable.Fault f) {
 480             throw new JavaTestError(ReportSettings.i18n.getString("result.testResult.err"));
 481         }
 482         for (; iter.hasNext();) {
 483             TestResult tr = (iter.next());
 484             Status s = tr.getStatus();
 485             TreeSet<TestResult> list = sortedResults[s == null ? Status.NOT_RUN : s.getType()];
 486             list.add(tr);
 487         }
 488     }
 489 
 490     private static class TestResultsByNameComparator implements Comparator<TestResult> {
 491 
 492         @Override
 493         public int compare(TestResult tr1, TestResult tr2) {
 494             return tr1.getTestName().compareTo(tr2.getTestName());
 495         }
 496     }
 497 
 498     void setupKfl() {
 499         if (kflSorter != null) {
 500             return;
 501         }
 502         setupSortedResults();
 503         KnownFailuresList kfl = getInterview().getKnownFailuresList();


 513         return kflSorter;
 514     }
 515 
 516     TreeSet<TestResult>[] getSortedResults() {
 517         return sortedResults;
 518     }
 519 
 520     public void setCustomReports(List<CustomReport> customReportCollection) {
 521         customReports = customReportCollection;
 522     }
 523 
 524     public List<CustomReport> getCustomReports() {
 525         return customReports;
 526     }
 527 
 528     private TreeSet<TestResult>[] sortedResults;
 529     private KflSorter kflSorter;
 530     File xmlReportFile = null;
 531     File tmpXmlReportFile = null;
 532     private File[] mif = new File[0];
 533     private HashMap<?, ?> exchangeData;
 534     private InterviewParameters ip;
 535 
 536     private List<CustomReport> customReports = Collections.emptyList();
 537 
 538     TestFilter filter;
 539     // default (legacy) values provided
 540     boolean genHtml = true; // generate HTML?
 541     // generate HTML?
 542     boolean genPlain = true; // generate summary.txt?
 543     // generate summary.txt?
 544     boolean genCof = false; // generate cof.xml?
 545     // generate cof.xml?
 546     boolean genXml = false; // generate summary.xml?
 547     // generate summary.xml?
 548     private boolean genCofTestCases = true;
 549     boolean genConfig = true; // generate config section
 550     // generate config section
 551     boolean genQl = true;
 552     boolean genEnv = true;
 553     boolean genStd = true;
< prev index next >