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 77261 Details for
Bug 187242
Test report generators should not traverse the referenced suites.
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.
org.eclipse.tptp.test.report.birt_defect_187242_patch.txt
org.eclipse.tptp.test.report.birt_defect_187242_patch.txt (text/plain), 5.92 KB, created by
Paul Slauenwhite
on 2007-08-29 11:17:36 EDT
(
hide
)
Description:
org.eclipse.tptp.test.report.birt_defect_187242_patch.txt
Filename:
MIME Type:
Creator:
Paul Slauenwhite
Created:
2007-08-29 11:17:36 EDT
Size:
5.92 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.test.report.birt >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.4 >diff -u -r1.4 ResolveTestExecutions.java >--- src/org/eclipse/tptp/test/report/birt/internal/ResolveTestExecutions.java 19 Apr 2007 18:44:13 -0000 1.4 >+++ src/org/eclipse/tptp/test/report/birt/internal/ResolveTestExecutions.java 29 Aug 2007 15:17:34 -0000 >@@ -13,18 +13,33 @@ > import java.util.ArrayList; > import java.util.HashMap; > import java.util.Iterator; >-import java.util.LinkedList; > import java.util.List; > import java.util.Map; > > import org.eclipse.emf.common.util.BasicEList; > import org.eclipse.emf.common.util.EList; >+import org.eclipse.hyades.models.common.facades.behavioral.IAction; >+import org.eclipse.hyades.models.common.facades.behavioral.IBlock; >+import org.eclipse.hyades.models.common.facades.behavioral.IImplementor; >+import org.eclipse.hyades.models.common.facades.behavioral.ILoop; >+import org.eclipse.hyades.models.common.facades.behavioral.ITest; >+import org.eclipse.hyades.models.common.facades.behavioral.ITestInvocation; > 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.TPFTestSuite; > import org.eclipse.hyades.models.common.util.ExecutionUtil; > >+/** >+ * Test execution resolver. >+ * <p> >+ * >+ * >+ * @author Sheldon Lee-Loy >+ * @author Paul E. Slauenwhite >+ * @version August 29, 2007 >+ * @since August 28, 2006 >+ */ > public class ResolveTestExecutions { > > public static List[] getExecutionResults(EList allTestSuites, TestContextObject context){ >@@ -57,7 +72,7 @@ > //- Find the all children testsuites given a list of test suites > TPFTestSuite testSuite = (TPFTestSuite)iterator.next(); > >- Iterator subIterator = findAllReferencedTestSuites(testSuite).iterator(); >+ Iterator subIterator = resolveReferencedTestSuites(testSuite).iterator(); > while (subIterator.hasNext()) { > TPFTestSuite currentTestSuite = ((TPFTestSuite) (subIterator.next())); > >@@ -73,27 +88,76 @@ > > } > >- /** >- * Recursively resolves all referenced test suites from the parameter root >- * test suite. >- * <p> >- * >- * @param testSuite >- * The root test suite. >- * @return The list of all recursively referenced test suites, including the >- * root grandparent test suite. >- */ >- protected static List findAllReferencedTestSuites(TPFTestSuite testSuite) { >- List referencedTestSuites = new LinkedList(); >- //Step 1. Add the parameter test suite: >- referencedTestSuites.add(testSuite); >- //Step 2. Add all the referenced test suite(s): >- Iterator referencedSuitesIterator = testSuite.getReferencedSuites().iterator(); >- while (referencedSuitesIterator.hasNext()) { >- referencedTestSuites.addAll(findAllReferencedTestSuites(((TPFTestSuite) (referencedSuitesIterator.next())))); >- } >- return referencedTestSuites; >- } >+ /** >+ * Recursively resolves all referenced test suites from and including the >+ * parameter root test suite. >+ * <p> >+ * Referenced test suites are defined as invocations of external test suites. >+ * <p> >+ * The returned list ({@link TPFTestSuite}) does not contain duplicate test suites. >+ * <p> >+ * >+ * @param testSuite The root test suite. >+ * @return The list ({@link TPFTestSuite}) of all referenced test suites. >+ */ >+ protected static List resolveReferencedTestSuites(TPFTestSuite testSuite) { >+ >+ List referencedTestSuites = new ArrayList(); >+ >+ //Step 1. Add the parameter test suite: >+ referencedTestSuites.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) { >+ addReferencedTestSuites(block, referencedTestSuites); >+ } >+ } >+ >+ return referencedTestSuites; >+ } >+ >+ /** >+ * Recursively added all referenced test suites from the parameter root >+ * block to the parameter list ({@link TPFTestSuite}). >+ * <p> >+ * Referenced test suites are defined as invocations of external test suites. >+ * <p> >+ * Only referenced test suites not in the parameter list ({@link TPFTestSuite}) >+ * are added. As such, the parameter list ({@link TPFTestSuite}) does not >+ * contain duplicate test suites. >+ * <p> >+ * >+ * @param block The root block. >+ * @return The list ({@link TPFTestSuite}) of referenced test suites. >+ */ >+ private static void addReferencedTestSuites(IBlock block, List referencedTestSuites) { >+ >+ 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) && (!referencedTestSuites.contains(test))) { >+ referencedTestSuites.addAll(resolveReferencedTestSuites(((TPFTestSuite)(test)))); >+ } >+ } >+ else if (action instanceof ILoop) { >+ addReferencedTestSuites(((ILoop)(action)).getBlock(), referencedTestSuites); >+ } >+ } >+ } > > /** > * This method filters the map of TestSuites to ExecutionResults by
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 Raw
Actions:
View
Attachments on
bug 187242
:
77061
| 77261