new AllTestsReportGenerator(this.log);
AllConvsReportGenerator allConvGen =
new AllConvsReportGenerator(this.log);
AllErrorReportGenerator allErrGen =
new AllErrorReportGenerator(this.log);
GraphReportGenerator origGraphGen =
new GraphReportGenerator(this.log);
AnnotatedGraphReportGenerator graphGen =
new AnnotatedGraphReportGenerator(this.log);
ReadMeReportGenerator readmeGen =
new ReadMeReportGenerator(this.log);
/*
* execute the tests, and provide the results to the
* report generators
*/
System.out.println("Executing tests...");
ConverterTester2 ct = new ConverterTester2(log);
if (testAllConvs) {
ct.execute(convRefs,
new ReportGenerator[]
{allGen, allConvGen, allErrGen,
graphGen, origGraphGen, readmeGen},
cContext, bContext,
new HopFilter(numHops));
} else {
ct.execute(convRefs,
new ReportGenerator[]
{allGen, allConvGen, allErrGen,
graphGen, origGraphGen, readmeGen},
cContext, bContext,
new ConvAndHopFilter(selectedConvName, numHops));
}
/*
* report generators have now been supplied with the test
* results, and their reports can now be extracted.
*/
System.out.println("Returning reports...");
//return readme report
ReadMeReport readmeReport = readmeGen.getReadMe();
File readmeFile = readmeReport.getReportFile();
Data readMeData = createReportData(readmeFile,
readmeReport.getName(), null);
addReturn(readMeData);
//return all converters report
AllConvsReport allConvReport =
allConvGen.getAllConvsReport();
File allConvReportFile = allConvReport.getReport();
Data allConvReportData =
createReportData(allConvReportFile,
allConvReport.getName(),
null);
addReturn(allConvReportData);
ConvReport[] convReports =
allConvReport.getConverterReports();
for (int ii = 0; ii < convReports.length; ii++) {
ConvReport convReport = convReports[ii];
File convReportFile = convReport.getReport();
Data convReportData =
createReportData(convReportFile,
convReport.getName(), allConvReportData);
addReturn(convReportData);
TestReport[] trs = convReport.getTestReports();
addFilePasses(trs, convReportData);
}
//return all tests report
AllTestsReport allReport = allGen.getAllTestsReport();
File allReportFile = allReport.getAllTestsReport();
Data allReportData = createReportData(allReportFile,
allReport.getName() , null);
addReturn(allReportData);
TestReport[] sTestReports =
allReport.getSuccessfulTestReports();
addFilePasses(sTestReports, allReportData);
TestReport[] ppTestReports =
allReport.getPartialSuccessTestReports();
addFilePasses(ppTestReports, allReportData);
TestReport[] fTestReports =
allReport.getFailedTestReports();
addFilePasses(fTestReports, allReportData);
//return all errors report
AllErrorReport allErrorReport =
allErrGen.getAllErrorsReport();
File allErrReportFile = allErrorReport.getReportFile();
Data allErrReport = createReportData(allErrReportFile,
allErrorReport.getName(), null);
addReturn(allErrReport);
//return annotated graph report
File graphReportFile = graphGen.getGraphReport();
Data graphReport = createReportData(graphReportFile,
"Annotated Converter Graph", null,
"file:text/nwb", DataProperty.NETWORK_TYPE);
addReturn(graphReport);
//return original graph report
File origGraphReportFile = origGraphGen.getGraphReport();
Data origGraphReport = createReportData(
origGraphReportFile,
"Original Converter Graph", null,
"file:text/nwb", DataProperty.NETWORK_TYPE);
addReturn(origGraphReport);