Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82569 Details for
Bug 187864
Skewed completion rates in BIRT test reports.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch
org.eclipse.tptp.test.report.birt_defect_187864_patch.txt (text/plain), 8.01 KB, created by
Paul Slauenwhite
on 2007-11-09 15:44:29 EST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Paul Slauenwhite
Created:
2007-11-09 15:44:29 EST
Size:
8.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.test.report.birt >Index: templates/TabularReport.rptdesign >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.report.birt/templates/TabularReport.rptdesign,v >retrieving revision 1.14 >diff -u -r1.14 TabularReport.rptdesign >--- templates/TabularReport.rptdesign 22 Aug 2007 20:01:31 -0000 1.14 >+++ templates/TabularReport.rptdesign 9 Nov 2007 20:43:05 -0000 >@@ -115,12 +115,6 @@ > <property name="dataType">string</property> > </structure> > </list-property> >- <list-property name="filter"> >- <structure> >- <expression name="expr">((row["Test suite"] == "AllTests") | (row["Test suite"] == "AllManualTests") | (row["Test suite"] == "AllGUITests"))</expression> >- <expression name="value1">false</expression> >- </structure> >- </list-property> > <structure name="cachedMetaData"> > <list-property name="resultSet"> > <structure> >Index: src/org/eclipse/tptp/test/report/birt/internal/TabularTPFTestSuiteReportElement.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.report.birt/src/org/eclipse/tptp/test/report/birt/internal/TabularTPFTestSuiteReportElement.java,v >retrieving revision 1.10 >diff -u -r1.10 TabularTPFTestSuiteReportElement.java >--- src/org/eclipse/tptp/test/report/birt/internal/TabularTPFTestSuiteReportElement.java 6 Mar 2007 18:08:34 -0000 1.10 >+++ src/org/eclipse/tptp/test/report/birt/internal/TabularTPFTestSuiteReportElement.java 9 Nov 2007 20:43:05 -0000 >@@ -132,6 +132,8 @@ > allTestSuites = ResolveTestExecutions.getTestSuites(list); > executionResults = ResolveTestExecutions.getExecutionResultsMap(allTestSuites, (TestContextObject)context); > >+ allTestSuites = ResolveTestExecutions.getReportableTestSuites(list, executionResults); >+ > //generate root index report > String imgDir = (String)context.getProperty(IBIRTConstants.CONTEXT_IMG_DIR); > String outputFolder = (String)context.getProperty(IBIRTConstants.CONTEXT_OUT_FOLDER); >Index: src/org/eclipse/tptp/test/report/birt/internal/ResolveTestExecutions.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.report.birt/src/org/eclipse/tptp/test/report/birt/internal/ResolveTestExecutions.java,v >retrieving revision 1.5 >diff -u -r1.5 ResolveTestExecutions.java >--- src/org/eclipse/tptp/test/report/birt/internal/ResolveTestExecutions.java 3 Oct 2007 14:32:56 -0000 1.5 >+++ src/org/eclipse/tptp/test/report/birt/internal/ResolveTestExecutions.java 9 Nov 2007 20:43:05 -0000 >@@ -27,6 +27,7 @@ > import org.eclipse.hyades.models.common.testprofile.TPFExecutionEvent; > import org.eclipse.hyades.models.common.testprofile.TPFExecutionHistory; > import org.eclipse.hyades.models.common.testprofile.TPFExecutionResult; >+import org.eclipse.hyades.models.common.testprofile.TPFTestCase; > import org.eclipse.hyades.models.common.testprofile.TPFTestSuite; > import org.eclipse.hyades.models.common.util.ExecutionUtil; > >@@ -159,6 +160,148 @@ > } > } > >+ /* PES --> */ >+ >+ public static EList getReportableTestSuites(EList rootTestSuites, Map executionResults){ >+ >+ EList filteredTestSuites = new BasicEList(); >+ Iterator rootTestSuitesIterator = rootTestSuites.iterator(); >+ >+ while (rootTestSuitesIterator.hasNext()) { >+ >+ EList ancestorTestSuites = new BasicEList(); >+ >+ resolveReportableReferencedTestSuites(ancestorTestSuites, ((TPFTestSuite)(rootTestSuitesIterator.next())), executionResults); >+ >+ Iterator subIterator = ancestorTestSuites.iterator(); >+ >+ while (subIterator.hasNext()) { >+ >+ TPFTestSuite currentTestSuite = ((TPFTestSuite) (subIterator.next())); >+ >+ if ((currentTestSuite.getName() != null) && (currentTestSuite.getName().length() > 0) && (!filteredTestSuites.contains(currentTestSuite))) { >+ filteredTestSuites.add(currentTestSuite); >+ } >+ } >+ } >+ >+ return filteredTestSuites; >+ } >+ >+ protected static void resolveReportableReferencedTestSuites(EList ancestorTestSuites, TPFTestSuite testSuite, Map executionResults) { >+ >+ //Step 1. Add the parameter test suite: >+ if(hasExecutionResults(testSuite.getId(), executionResults)){ >+ ancestorTestSuites.add(testSuite); >+ } >+ else if(containsTestCaseInvocations(testSuite)){ >+ >+ //Walk up the tree to see if there is an execution result for an ancestor: >+ boolean ancestorHasExecutionResults = false; >+ Iterator ancestorTestSuitesIterator = ancestorTestSuites.iterator(); >+ >+ while(ancestorTestSuitesIterator.hasNext()){ >+ >+ if(hasExecutionResults(((TPFTestSuite)(ancestorTestSuitesIterator.next())).getId(), executionResults)){ >+ >+ ancestorHasExecutionResults = true; >+ break; >+ } >+ } >+ >+ if(!ancestorHasExecutionResults){ >+ ancestorTestSuites.add(testSuite); >+ } >+ } >+ >+ //Step 2. Add all the referenced test suite(s): >+ IImplementor implementor = testSuite.getImplementor(); >+ >+ if (implementor != null) { >+ >+ IBlock block = implementor.getBlock(); >+ >+ if (block != null) { >+ resolveReportableReferencedTestSuites(ancestorTestSuites, block, executionResults); >+ } >+ } >+ } >+ >+ private static void resolveReportableReferencedTestSuites(EList ancestorTestSuites, IBlock block, Map executionResults) { >+ >+ Iterator actionsIterator = block.getActions().iterator(); >+ >+ while(actionsIterator.hasNext()) { >+ >+ IAction action = ((IAction)(actionsIterator.next())); >+ >+ if (action instanceof ITestInvocation) { >+ >+ ITest test = ((ITestInvocation)(action)).getInvokedTest(); >+ >+ //Only invocations of external test suites currently not in the list are added: >+ if ((test instanceof TPFTestSuite) && (!ancestorTestSuites.contains(test))) { >+ resolveReportableReferencedTestSuites(ancestorTestSuites, ((TPFTestSuite)(test)), executionResults); >+ } >+ } >+ else if (action instanceof ILoop) { >+ resolveReportableReferencedTestSuites(ancestorTestSuites, ((ILoop)(action)).getBlock(), executionResults); >+ } >+ } >+ } >+ >+ private static boolean containsTestCaseInvocations(TPFTestSuite testSuite){ >+ >+ IImplementor implementor = testSuite.getImplementor(); >+ >+ if (implementor != null) { >+ >+ IBlock block = implementor.getBlock(); >+ >+ if (block != null) { >+ return (containsTestCaseInvocations(block)); >+ } >+ } >+ >+ return false; >+ } >+ >+ private static boolean containsTestCaseInvocations(IBlock block) { >+ >+ Iterator actionsIterator = block.getActions().iterator(); >+ >+ while(actionsIterator.hasNext()) { >+ >+ IAction action = ((IAction)(actionsIterator.next())); >+ >+ if (action instanceof ITestInvocation) { >+ >+ if(((ITestInvocation)(action)).getInvokedTest() instanceof TPFTestCase){ >+ return true; >+ } >+ } >+ else if (action instanceof ILoop) { >+ containsTestCaseInvocations(((ILoop)(action)).getBlock()); >+ } >+ } >+ >+ return false; >+ } >+ >+ private static boolean hasExecutionResults(String testSuiteId, Map executionResults){ >+ >+ if(executionResults.containsKey(testSuiteId)){ >+ >+ List testSuiteExecutionResults = ((List)(executionResults.get(testSuiteId))); >+ >+ return (testSuiteExecutionResults.size() > 0); >+ } >+ >+ return false; >+ } >+ >+ /* <-- PES */ >+ > /** > * This method filters the map of TestSuites to ExecutionResults by > * removing all but the last execution result that falls within the
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 187864
:
77027
|
77267
| 82569