From: <mwl...@us...> - 2007-08-16 22:13:39
|
Revision: 480 http://cishell.svn.sourceforge.net/cishell/?rev=480&view=rev Author: mwlinnem Date: 2007-08-16 15:13:37 -0700 (Thu, 16 Aug 2007) Log Message: ----------- Revised how Test Reports are named. Converter Reports now contain names of tests they are involved in. Modified Paths: -------------- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.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/TestReportSubGenerator.java trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/TestResult.java Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2007-08-16 22:10:02 UTC (rev 479) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/ConverterTester2.java 2007-08-16 22:13:37 UTC (rev 480) @@ -94,6 +94,8 @@ * and comparison converter path. */ + int numTestsSoFar = 0; + Iterator iter = fileFormats.iterator(); while(iter.hasNext()) { String fileFormat = (String) iter.next(); @@ -113,10 +115,12 @@ */ for (int kk = 0; kk < testConvs.length; kk++) { + numTestsSoFar++; ConverterPath testConv = testConvs[kk]; TestResult testResult = - runATest(testConv, compareConv, cContext, bContext); + runATest(testConv, compareConv, cContext, bContext, + numTestsSoFar); if (testResult != null) { testResults.add(testResult); @@ -130,7 +134,7 @@ private TestResult runATest(ConverterPath testConvs, ConverterPath compareConvs, CIShellContext cContext, - BundleContext bContext) { + BundleContext bContext, int numTestsSoFar) { //get test file data corresponding to the format these converters accept. @@ -154,7 +158,8 @@ FilePassResult[] results = this.testRunner.runTest(testBasicData); //return the results of the test - return new TestResult(results, testConvs, compareConvs); + String testName = "Test " + numTestsSoFar; + return new TestResult(results, testConvs, compareConvs, testName); } private Data[][] wrapInData(String[] testFilePaths, String format) { 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-16 22:10:02 UTC (rev 479) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/allconvs/ConvReportSubGenerator.java 2007-08-16 22:13:37 UTC (rev 480) @@ -11,6 +11,7 @@ import org.cishell.testing.convertertester.core.tester2.reportgen.reports.ConvReport; import org.cishell.testing.convertertester.core.tester2.reportgen.reports.TestReport; import org.cishell.testing.convertertester.core.tester2.reportgen.results.ConvResult; +import org.cishell.testing.convertertester.core.tester2.reportgen.results.TestResult; import org.osgi.framework.ServiceReference; public class ConvReportSubGenerator { @@ -52,6 +53,14 @@ report.println(""); + report.println("Involved in the following tests..."); + TestResult[] involvedTests = cr.getTests(); + for (int ii = 0; ii < involvedTests.length; ii++) { + TestResult tr = involvedTests[ii]; + report.println(" " + tr.getFullName()); + } + report.println(""); + String[] failureExps = cr.getUniqueFailureExplanations(); if (failureExps.length > 0) { report.println("Unique Failure Explanations..."); @@ -81,7 +90,6 @@ .getName(), summary); report.println(""); report.flush(); - reportOutStream.close(); } catch (IOException e) { System.out.println("Unable to generate a converter report."); 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-16 22:10:02 UTC (rev 479) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/AllTestsReportGenerator.java 2007-08-16 22:13:37 UTC (rev 480) @@ -50,21 +50,14 @@ atr.getNumTests()); report.println(""); - float percentCompletelyPassed = atr.getNumTestsPassed() / (atr.getNumTests()); + float percentCompletelyPassed = + atr.getNumTestsPassed() / (atr.getNumTests()); - TestResult[] allTRs = atr.getAllTestResults(); - for (int ii = 0; ii < allTRs.length; ii++) { - TestResult tr = allTRs[ii]; - tr.setName("Test"); - } - TestResult[] passedTRs = atr.getPassedTestResults(); report.println("Completely Passed Tests..."); for (int ii = 0; ii < passedTRs.length; ii++) { TestResult passedTR = passedTRs[ii]; - passedTR.setName("Successful " + passedTR.getName() + - " " + ii); - report.println(" " + passedTR.getName()); + report.println(" " + passedTR.getFullName()); } report.println(""); @@ -72,9 +65,7 @@ report.println("Partially Passed Tests..."); for (int ii = 0; ii < pPassedTRs.length; ii++) { TestResult pPassedTR = pPassedTRs[ii]; - pPassedTR.setName("Partially Successful " + - pPassedTR.getName() + " " + ii); - report.println(" " + pPassedTR.getName()); + report.println(" " + pPassedTR.getFullName()); } report.println(""); @@ -83,10 +74,7 @@ TestResult[] failedTRs = atr.getFailedTestResults(); for (int ii = 0; ii < failedTRs.length; ii++) { TestResult failedTR = failedTRs[ii]; - - failedTR.setName("Failed " + failedTR.getName() - + " " + ii); - report.println(" " + failedTR.getName()); + report.println(" " + failedTR.getFullName()); } report.println(""); 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-16 22:10:02 UTC (rev 479) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/alltests/TestReportSubGenerator.java 2007-08-16 22:13:37 UTC (rev 480) @@ -110,8 +110,18 @@ } // String summary = "%" + percentSuccessful + " Successful"; + String reportNamePrefix = ""; + if (tr.allSucceeded()) { + reportNamePrefix = "Successful"; + } else if (tr.someSucceeded()) { + reportNamePrefix = "Partially Successful"; + } else { + reportNamePrefix = "Failed"; + } + + String summary = ""; - this.testReport = new TestReport(reportFile, tr.getName(), + this.testReport = new TestReport(reportFile, tr.getFullName(), new FilePassReport[0], new FilePassReport[0], // (FilePassReport[]) successfulFPReports.toArray(new FilePassReport[0]), Modified: trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/TestResult.java =================================================================== --- trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/TestResult.java 2007-08-16 22:10:02 UTC (rev 479) +++ trunk/testing/org.cishell.testing.convertertester.core.new/src/org/cishell/testing/convertertester/core/tester2/reportgen/results/TestResult.java 2007-08-16 22:13:37 UTC (rev 480) @@ -24,10 +24,12 @@ private boolean cachedSuccesses = false; private boolean[] successes; - public TestResult(FilePassResult[] fprs, ConverterPath testConvs, ConverterPath compareConvs) { + public TestResult(FilePassResult[] fprs, ConverterPath testConvs, + ConverterPath compareConvs, String name) { this.fprs = fprs; this.testConvs = testConvs; this.compareConvs = compareConvs; + this.name = name; this.successes = new boolean[fprs.length]; @@ -60,13 +62,13 @@ return fprs; } - public String getShortSummary() { + public String getSummary() { if (allSucceeded()) { - return "Success"; + return "Successful"; } else if (someSucceeded()) { - return "Partial Success"; + return "Partially Successful"; } else { - return "Failure"; + return "Failed"; } } @@ -90,14 +92,14 @@ return this.fprs.length; } - public void setName(String name) { - this.name = name; - } - public String getName() { return this.name; } + public String getFullName() { + return getSummary() + " " + getName(); + } + public String getFormat() { return this.format; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |