From: <mwl...@us...> - 2007-08-22 18:29:00
|
Revision: 495 http://cishell.svn.sourceforge.net/cishell/?rev=495&view=rev Author: mwlinnem Date: 2007-08-22 11:28:57 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Removed unused code. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/AllTestsReportGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/readme/ReadMeReportGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllConvsReport.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllTestsReport.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvReport.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ReadMeReport.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/Report.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-08-22 18:28:57 UTC (rev 495) @@ -126,13 +126,11 @@ // convReportsList.add(convReport); // } -// String summary = "%" + avgChanceCorrect * 100 + " Correct"; - String summary = ""; ConvReport[] convReports = (ConvReport[]) convReportsList.toArray(new ConvReport[0]); this.allConvsReport = new AllConvsReport(reportFile, convReports, - "All Converters Report", summary); + "All Converters Report"); report.flush(); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-08-22 18:28:57 UTC (rev 495) @@ -90,9 +90,8 @@ TestReport[] testReports = (TestReport[]) testReportsList .toArray(new TestReport[0]); - String summary = ""; this.convReport = new ConvReport(reportFile, new TestReport[0], cr - .getNameNoPackageWithTrust(), summary); + .getNameNoPackageWithTrust()); report.println(""); report.flush(); reportOutStream.close(); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/AllTestsReportGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/AllTestsReportGenerator.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/AllTestsReportGenerator.java 2007-08-22 18:28:57 UTC (rev 495) @@ -109,14 +109,11 @@ failedTRReports.add(testReport); } -// String summary = "%" + percentCompletelyPassed * 100 + " Completely Passed"; - String summary = ""; this.allTestsReport = new AllTestsReport(reportFile, "All Test Reports", (TestReport[]) passedTRReports.toArray(new TestReport[0]), (TestReport[]) pPassedTRReports.toArray(new TestReport[0]), - (TestReport[]) failedTRReports.toArray(new TestReport[0]), - summary); + (TestReport[]) failedTRReports.toArray(new TestReport[0])); } catch (IOException e) { this.log.log(LogService.LOG_ERROR, "Unable to generate all tests report.", e); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/FilePassSubGenerator.java 2007-08-22 18:28:57 UTC (rev 495) @@ -42,9 +42,7 @@ writeReport(report, fpr); - String summary = ""; - this.filePassReport = new FilePassReport(reportFile, fpr.getName(), - summary); + this.filePassReport = new FilePassReport(reportFile, fpr.getName()); } catch (IOException e) { this.log.log(LogService.LOG_ERROR, Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java 2007-08-22 18:28:57 UTC (rev 495) @@ -119,15 +119,10 @@ failedFPReports.add(filePassReport); } - -// String summary = "%" + percentSuccessful + " Successful"; - String summary = ""; + //TODO: remove file pass reports this.testReport = new TestReport(reportFile, tr.getNameWithSuccess(), new FilePassReport[0], - new FilePassReport[0], -// (FilePassReport[]) successfulFPReports.toArray(new FilePassReport[0]), -// (FilePassReport[]) failedFPReports.toArray(new FilePassReport[0]), - summary); + new FilePassReport[0]); } catch (IOException e) { Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/readme/ReadMeReportGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/readme/ReadMeReportGenerator.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/readme/ReadMeReportGenerator.java 2007-08-22 18:28:57 UTC (rev 495) @@ -21,7 +21,7 @@ "ReportREADME.txt"; File readmeFile = new File(readmePath); - this.readme = new ReadMeReport(readmeFile, "README", ""); + this.readme = new ReadMeReport(readmeFile, "README"); } public ReadMeReport getReadMe() { Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllConvsReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllConvsReport.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllConvsReport.java 2007-08-22 18:28:57 UTC (rev 495) @@ -7,13 +7,11 @@ private File report; private ConvReport[] convReports; private String name; - private String summary; - public AllConvsReport (File report, ConvReport[] convReports, String name, String summary) { + public AllConvsReport (File report, ConvReport[] convReports, String name) { this.report = report; this.convReports = convReports; this.name = name; - this.summary = summary; } public String getName() { return this.name; @@ -26,9 +24,4 @@ public ConvReport[] getConverterReports() { return this.convReports; } - - public String getShortSummary() { - return this.summary; - } - } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllTestsReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllTestsReport.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/AllTestsReport.java 2007-08-22 18:28:57 UTC (rev 495) @@ -11,19 +11,16 @@ private TestReport[] failedTestReports; private String name; - private String summary; public AllTestsReport(File allTestsReport, String name, TestReport[] successfulTestReports, TestReport[] partialSuccessTestReports, - TestReport[] failedTestReports, - String summary) { + TestReport[] failedTestReports) { this.allTestsReport = allTestsReport; this.name = name; this.successfulTestReports = successfulTestReports; this.partialSuccessTestReports = partialSuccessTestReports; this.failedTestReports = failedTestReports; - this.summary = summary; } public File getAllTestsReport() { @@ -45,8 +42,4 @@ public String getName() { return this.name; } - - public String getShortSummary() { - return this.summary; - } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvReport.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ConvReport.java 2007-08-22 18:28:57 UTC (rev 495) @@ -7,13 +7,11 @@ private File report; private TestReport[] trs; private String name; - private String summary; - public ConvReport (File report, TestReport[] trs, String name, String summary) { + public ConvReport (File report, TestReport[] trs, String name) { this.report = report; this.trs = trs; this.name = name; - this.summary = summary; } public String getName() { return this.name; @@ -26,8 +24,4 @@ public TestReport[] getTestReports() { return this.trs; } - - public String getShortSummary() { - return this.summary; - } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/FilePassReport.java 2007-08-22 18:28:57 UTC (rev 495) @@ -7,12 +7,10 @@ private File filePassReport; private String name; - private String summary; - public FilePassReport (File filePassReport, String name, String summary) { + public FilePassReport (File filePassReport, String name) { this.filePassReport = filePassReport; this.name = name; - this.summary = summary; } public File getFilePassReport() { @@ -22,8 +20,4 @@ public String getName() { return this.name; } - - public String getShortSummary() { - return this.summary; - } } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ReadMeReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ReadMeReport.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/ReadMeReport.java 2007-08-22 18:28:57 UTC (rev 495) @@ -7,20 +7,14 @@ private File file; private String name; - private String summary; - public ReadMeReport(File file, String name, String summary) { + public ReadMeReport(File file, String name) { this.file = file; this.name = name; - this.summary = summary; } public String getName() { return this.name; } - - public String getShortSummary() { - return this.summary; - } public File getReportFile() { return this.file; Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/Report.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/Report.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/Report.java 2007-08-22 18:28:57 UTC (rev 495) @@ -2,6 +2,4 @@ public interface Report { public String getName(); - - public String getShortSummary(); } Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java 2007-08-22 18:20:40 UTC (rev 494) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/reports/TestReport.java 2007-08-22 18:28:57 UTC (rev 495) @@ -10,15 +10,13 @@ private FilePassReport[] failedFilePassReports; private String name; - private String summary; public TestReport(File testReport, String name, FilePassReport[] successfulFilePassReports, - FilePassReport[] failedFilePassReports, String summary) { + FilePassReport[] failedFilePassReports) { this.testReport = testReport; this.name = name; this.successfulFilePassReports = successfulFilePassReports; this.failedFilePassReports = failedFilePassReports; - this.summary = summary; } public File getTestReport() { @@ -36,8 +34,4 @@ public String getName() { return this.name; } - - public String getShortSummary() { - return this.summary; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-08-30 19:09:03
|
Revision: 498 http://cishell.svn.sourceforge.net/cishell/?rev=498&view=rev Author: mwlinnem Date: 2007-08-30 12:08:56 -0700 (Thu, 30 Aug 2007) Log Message: ----------- Major refactoring. Many little changes. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java Added Paths: ----------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/ConvResultMaker.java Added: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/ConvResultMaker.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/ConvResultMaker.java (rev 0) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/ConvResultMaker.java 2007-08-30 19:08:56 UTC (rev 498) @@ -0,0 +1,335 @@ +package org.cishell.testing.convertertester.core.tester2.reportgen; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.cishell.testing.convertertester.core.converter.graph.Converter; +import org.cishell.testing.convertertester.core.converter.graph.ConverterPath; +import org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis.ChanceAtFault; +import org.cishell.testing.convertertester.core.tester2.reportgen.faultanalysis.ChanceAtFaultHeuristic; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.AllConvsResult; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.AllTestsResult; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.ConvResult; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.FilePassResult; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.TestResult; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.filepass.FilePassSuccess; + +public class ConvResultMaker { + + public static AllConvsResult generate(AllTestsResult atr, + Converter[] allConvs, ChanceAtFaultHeuristic faultHeuristic) { + + Converter[] trustedConvs = determineWhichAreTrusted(atr); + + System.out.println("*** # Trusted Convs: " + trustedConvs.length); + + Map convToTestsToPasses = associateConvsWithTestsAndPasses(atr, + allConvs, trustedConvs, + faultHeuristic); + ConvResult[] convResults = generateConvResults(convToTestsToPasses, + allConvs, trustedConvs); + +// addFaultInfo(convResults, trustedConvs, faultHeuristic); + + return new AllConvsResult(convResults); + + } + + /** + * Looks for tests where each file pass succeeded. We will assume that + * each converter involved in a test where all file passes succeeded is + * very likely to be correct. If one of these converters is involved + * in a file pass that fails at some later point, we will assume + * that that converter was not at fault, but was fed erroneous data + * by previous converters. + * @param atr the test results, which contain info on failure + * or success of each test. + * @return an array of the converters that are trusted + */ + private static Converter[] determineWhichAreTrusted(AllTestsResult atr) { + TestResult[] trs = atr.getTestResults(); + + List trustedConverters = new ArrayList(); + for (int ii = 0; ii < trs.length; ii++) { + TestResult tr = trs[ii]; + FilePassResult[] fprs = tr.getFilePassResults(); + + //check if all file passes were successes + + boolean trusted = true; + for (int jj = 0; jj < fprs.length; jj++) { + FilePassResult fpr = fprs[jj]; + if (! fpr.succeeded()) { + //not all were successes + trusted = false; + break; + } + } + + if (trusted && fprs.length > 0) { + //mark all converters involved as trusted. + + ConverterPath testConvs = tr.getTestConverters(); + for (int kk = 0; kk < testConvs.size(); kk++) { + Converter conv = testConvs.get(kk); + trustedConverters.add(conv); + } + } + } + + return (Converter[]) trustedConverters.toArray(new Converter[0]); + } + + + private static Map associateConvsWithTestsAndPasses(AllTestsResult atr, + Converter[] allConvs, Converter[] trustedConvs, + ChanceAtFaultHeuristic faultHeuristic) { + TestResult[] trs = atr.getTestResults(); + + //Map<Converter, Map<TestResult, List<FilePassResult>>> + Map convToTestsToPasses = new HashMap(); + initialize(convToTestsToPasses, allConvs); + + //for each test... + for (int ii = 0; ii < trs.length; ii++) { + TestResult tr = trs[ii]; + + FilePassResult[] fps = tr.getFilePassResults(); + //for each file pass... + for (int jj = 0; jj < fps.length; jj++) { + FilePassResult fp = fps[jj]; + + Converter[] convsInvolved = fp.getConvertersInvolved(); + + /* + * associate the file pass with the chance that each converter + * involved is at fault. + */ + + if (! fp.succeeded()) { + ChanceAtFault[] chanceAtFaults = faultHeuristic.determine(fp, + convsInvolved, trustedConvs); + for (int kk = 0; kk < chanceAtFaults.length; kk++) { + ChanceAtFault caf = chanceAtFaults[kk]; + fp.addChanceAtFault(caf); + } + } + + //for each converter involved... + for (int kk = 0; kk < convsInvolved.length; kk++) { + Converter conv = convsInvolved[kk]; + + /* + * associate the converter with the tests and + * file passes that involve it. + * + * (side-effects convToTestsToPasses) + */ + addPassResult(convToTestsToPasses, conv, + fp); + + } + } + } + + return convToTestsToPasses; + } + + private static ConvResult[] generateConvResults(Map convToTestsToPasses, + Converter[] allConvs, Converter[] trustedConvs) { + + ConvResult[] convResults = makeAndFillWithAssociatedTestsAndPasses( + convToTestsToPasses, allConvs, trustedConvs); + +// addFaultInfo(convResults, convToTestsToPasses, allConvs, trustedConvs, +// faultHeuristic); + + return convResults; + } + + private static ConvResult[] makeAndFillWithAssociatedTestsAndPasses( + Map convToTestsToPasses, Converter[] allConvs, + Converter[] trustedConvs) { + List convResults = new ArrayList(); + + List trustedConvList = Arrays.asList(trustedConvs); + // for every converter we know of... + for (int ii = 0; ii < allConvs.length; ii++) { + Converter conv = allConvs[ii]; + // get the associated test to passes map + Map testToPasses = (Map) convToTestsToPasses.get(conv); + + /* + * create converter result objects which contain information about + * which tests and file passes it is involved with, and whether it + * is trusted. + */ + + boolean isTrusted = trustedConvList.contains(conv); + + ConvResult convResult = new ConvResult(conv, isTrusted, + testToPasses); + + convResults.add(convResult); + } + // return the converter result objects + return (ConvResult[]) convResults.toArray(new ConvResult[0]); + } + + private static void addPassResult(Map convToTestsToPasses, Converter conv, + FilePassResult pass) { + + TestResult test = pass.getParent(); + + Map testToPasses = (Map) convToTestsToPasses.get(conv); + List passes; + + //if we already associated this test with the converter... + if (testToPasses != null) { + passes = (List) testToPasses.get(test); + if (passes == null) { + passes = new ArrayList(); + } + } else { //otherwise... + testToPasses = new HashMap(); + passes = new ArrayList(); + } + + passes.add(pass); + testToPasses.put(test, passes); + convToTestsToPasses.put(conv, testToPasses); + } + + /** + * Ensures that each converter is represented in the map, whether or not + * there are any test associated with it. + * @param convToTestsToPasses The map we side-effect + * @param allConvs an array of all the converters we know of + */ + private static void initialize(Map convToTestsToPasses, Converter[] allConvs) { + for (int ii = 0; ii < allConvs.length; ii++) { + Converter conv = allConvs[ii]; + + convToTestsToPasses.put(conv, new HashMap()); + } + } + +// private static addFaultInfo(AllTestsResult atr, ConvResult[] crs, +// Converter[] trustedConvs, ChanceAtFaultHeuristic faultHeuristic) { +// +// Map convToChanceAtFaults = new HashMap(); +// +// FilePassResult[] failFPRs = atr.getFailedFilePasses(); +// for (int ii = 0; ii < failFPRs.length; ii++) { +// FilePassResult failFPR = failFPRs[ii]; +// +// ChanceAtFault[] chanceAtFaultsForEachConv = getFaultInfo(failFPR, +// trustedConvs, trustedConvs); +// +// for (int jj = 0; jj < chanceAtFaultsForEachConv.length; jj++) { +// ChanceAtFault chanceAtFaultForAConv = +// chanceAtFaultsForEachConv[jj]; +// +// Converter conv = chanceAtFaultForAConv.getConverter(); +// +// addEntryToList(convToChanceAtFaults, conv, +// chanceAtFaultForAConv); +// +// } +// } +// +// for (int ii = 0; ii < crs.length; ii++) { +// ConvResult cr = crs[ii]; +// +// Converter c = cr.getConverter(); +// List chanceAtFaults = convToChanceAtFaults.get(c); +// +// if (chanceAtFaults != null) { +// +// Iterator faultIter = chanceAtFaults.iterator(); +// while (faultIter.hasNext()) { +// ChanceAtFault caf = (ChanceAtFault) faultIter.next(); +// +// cr. +// } +// } +// } +// +// +//// List convResults = new ArrayList(); +//// +//// List trustedConvList = Arrays.asList(trustedConvs); +//// //for every converter we know of... +//// for (int ii = 0; ii < allConvs.length; ii++) { +//// Converter conv = allConvs[ii]; +//// //get the associated test to passes map +//// Map testToPasses = (Map) convToTestsToPasses.get(conv); +//// +//// /* +//// * create converter result objects which contain +//// * information about which tests and file passes +//// * it is involved with, and whether it is trusted. +//// */ +//// +//// boolean isTrusted = trustedConvList.contains(conv); +//// +//// ConvResult convResult = new ConvResult(conv, isTrusted, +//// testToPasses); +//// +//// convResults.add(convResult); +//// +//// Set tests = testToPasses.keySet(); +//// Iterator testIter = tests.iterator(); +//// //for each test... +//// while (testIter.hasNext()) { +//// TestResult tr = (TestResult) testIter.next(); +//// List passes = (List) testToPasses.get(tr); +//// Iterator passIter = passes.iterator(); +//// //for each involved pass... +//// while (passIter.hasNext()) { +//// FilePassResult fpr = (FilePassResult) passIter.next(); +//// +//// if (! fpr.succeeded()) { +//// addFailInfo(fpr, trustedConvs, faultHeuristic); +//// } +//// } +//// } +//// } +// } + +// private static ChanceAtFault[] getFaultInfo(FilePassResult failFP, Converter[] trustedConverters, +// ChanceAtFaultHeuristic faultHeuristic) { +// Converter[] convsInvolvedInFailure = failFP.getConvertersInvolved(); +// ChanceAtFault[] chanceAtFaults = faultHeuristic.determine(failFP, +// convsInvolvedInFailure, trustedConverters); +// return chanceAtFaults; +// } + + /** + * For maps that associate an object to a list of objects, + * add the given value to the list associated with the key. + * + * Side-effects the map + * + * @param map + * @param key + * @param value + */ + private static void addEntryToList(Map map, Object key, Object value) { + List oldEntries = (List) map.get(key); + + if (oldEntries == null) { + //no entries so far + oldEntries = new ArrayList(); + } + + oldEntries.add(value); + + map.put(key, value); + } +} Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-08-30 19:07:57 UTC (rev 497) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-08-30 19:08:56 UTC (rev 498) @@ -106,8 +106,6 @@ report.println("Consult the Annotated Graph Report for details on why this"); report.println("may not be testable."); } - - List testReportsList = new ArrayList(); this.convReport = new ConvReport(reportFile, new TestReport[0], cr .getShortNameWithTrust()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2007-09-17 17:37:14
|
Revision: 528 http://cishell.svn.sourceforge.net/cishell/?rev=528&view=rev Author: mwlinnem Date: 2007-09-17 10:37:12 -0700 (Mon, 17 Sep 2007) Log Message: ----------- Not tested is now treated as a different category from not trusted. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-09-17 17:26:25 UTC (rev 527) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/AllConvsReportGenerator.java 2007-09-17 17:37:12 UTC (rev 528) @@ -105,13 +105,15 @@ for (int ii = 0; ii < trustedConvs.size(); ii++) { ConvResult cr = (ConvResult) trustedConvs.get(ii); - //add this converters name to all convs report - report.println(" " + cr.getShortName()); + if (cr.wasTested()) { + //add this converters name to all convs report + report.println(" " + cr.getShortName()); - //generate corresponding sub-report - this.convSubGen.generate(cr); - ConvReport convReport = this.convSubGen.getConvReport(); - convReportsList.add(convReport); + //generate corresponding sub-report + this.convSubGen.generate(cr); + ConvReport convReport = this.convSubGen.getConvReport(); + convReportsList.add(convReport); + } } report.println(""); @@ -119,14 +121,30 @@ for (int ii = 0; ii < nonTrustedConvs.size(); ii++) { ConvResult cr = (ConvResult) nonTrustedConvs.get(ii); - //add this converters name to all convs report - report.println(" " + cr.getShortName()); + if (cr.wasTested()) { + //add this converters name to all convs report + report.println(" " + cr.getShortName()); - //generate corresponding sub-report - this.convSubGen.generate(cr); - ConvReport convReport = this.convSubGen.getConvReport(); - convReportsList.add(convReport); + //generate corresponding sub-report + this.convSubGen.generate(cr); + ConvReport convReport = this.convSubGen.getConvReport(); + convReportsList.add(convReport); + } + } + + report.println(""); + + report.println("Untested Converters..."); + for (int ii = 0; ii < convResults.length; ii++) { + ConvResult cr = convResults[ii]; + if (! cr.wasTested()) { + report.println(" " + cr.getShortName()); + + this.convSubGen.generate(cr); + ConvReport convReport = this.convSubGen.getConvReport(); + convReportsList.add(convReport); + } } report.println(""); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-09-17 17:26:25 UTC (rev 527) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-09-17 17:37:12 UTC (rev 528) @@ -119,7 +119,7 @@ } this.convReport = new ConvReport(reportFile, new TestReport[0], - cr.getShortNameWithTrust()); + cr.getShortNameWithStatus()); report.println(""); report.flush(); Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java 2007-09-17 17:26:25 UTC (rev 527) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/ConvResult.java 2007-09-17 17:37:12 UTC (rev 528) @@ -169,9 +169,11 @@ return this.conv.getShortName(); } - public String getShortNameWithTrust() { + public String getShortNameWithStatus() { String nameNoPackageWithTrust = " - " + getShortName() ; - if (isTrusted()) { + if (! wasTested()) { + nameNoPackageWithTrust = "Not Tested" + nameNoPackageWithTrust; + } else if (isTrusted()) { nameNoPackageWithTrust = "Trusted" + nameNoPackageWithTrust; } else { nameNoPackageWithTrust = "Not Trusted" + nameNoPackageWithTrust; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |