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 77061 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.
[patch]
org.eclipse.tptp.test.report.birt_defect_187242_patch.txt
org.eclipse.tptp.test.report.birt_defect_187242_patch.txt (text/plain), 5.77 KB, created by
Paul Slauenwhite
on 2007-08-27 15:07:12 EDT
(
hide
)
Description:
org.eclipse.tptp.test.report.birt_defect_187242_patch.txt
Filename:
MIME Type:
Creator:
Paul Slauenwhite
Created:
2007-08-27 15:07:12 EDT
Size:
5.77 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 27 Aug 2007 19:08:47 -0000 >@@ -13,18 +13,32 @@ > 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.fragments.BVRCombinedFragment; >+import org.eclipse.hyades.models.common.fragments.BVRInteractionOperand; >+import org.eclipse.hyades.models.common.interactions.BVRExecutionOccurrence; >+import org.eclipse.hyades.models.common.interactions.BVRInteractionFragment; > 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.TPFTest; > 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 27, 2007 >+ * @since August 28, 2007 >+ */ > public class ResolveTestExecutions { > > public static List[] getExecutionResults(EList allTestSuites, TestContextObject context){ >@@ -77,23 +91,83 @@ > * Recursively resolves all referenced test suites from the parameter root > * test suite. > * <p> >+ * Only test suite invocations are considered referenced test suites. >+ * <p> > * > * @param testSuite > * The root test suite. >- * @return The list of all recursively referenced test suites, including the >- * root grandparent test suite. >+ * @return The list ({@link TPFTestSuite}) of all recursively referenced test suites, including the >+ * parameter root 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; >+ >+ List referencedTestSuites = new ArrayList(); >+ >+ //Step 1. Add the parameter test suite: >+ referencedTestSuites.add(testSuite); >+ >+ //Step 2. Add all the referenced test suite(s): >+ Iterator interactionFragmentsIterator = testSuite.getBehavior().getInteraction().getInteractionFragments().iterator(); >+ >+ while(interactionFragmentsIterator.hasNext()){ >+ >+ Iterator testInvocationIterator = findAllTestInvocations(((BVRInteractionFragment)(interactionFragmentsIterator.next()))).iterator(); >+ >+ while(testInvocationIterator.hasNext()){ >+ >+ TPFTest testInvocation = ((TPFTest)(testInvocationIterator.next())); >+ >+ //Only test suite invocations are considered referenced test suites: >+ if (testInvocation instanceof TPFTestSuite) { >+ >+ TPFTestSuite testSuiteInvocation = ((TPFTestSuite)(testInvocation)); >+ >+ if(!testSuiteInvocation.getId().equals(testSuite.getId())){ >+ referencedTestSuites.addAll(findAllReferencedTestSuites(testSuiteInvocation)); >+ } >+ } >+ } >+ } >+ >+ return referencedTestSuites; > } >+ >+ /** >+ * Recursively resolves all test invocations from the parameter root >+ * interaction fragment. >+ * <p> >+ * Test suite and test case invocations are considered test invocations. >+ * <p> >+ * >+ * @param interactionFragment >+ * The root interaction fragment. >+ * @return The list ({@link TPFTest}) of all recursively referenced test invocations by the >+ * parameter root interaction fragment. >+ */ >+ protected static List findAllTestInvocations(BVRInteractionFragment interactionFragment) { >+ >+ List testInvocations = new ArrayList(); >+ >+ if (interactionFragment instanceof BVRExecutionOccurrence){ >+ testInvocations.add(((BVRExecutionOccurrence) (interactionFragment)).getOtherBehavior().getTest()); >+ } >+ else if (interactionFragment instanceof BVRCombinedFragment) { >+ >+ Iterator interactionOperandsIterator = ((BVRCombinedFragment) (interactionFragment)).getInteractionOperands().iterator(); >+ >+ while (interactionOperandsIterator.hasNext()) { >+ >+ Iterator interactionFragmentsIterator = ((BVRInteractionOperand) (interactionOperandsIterator.next())).getInteractionFragments().iterator(); >+ >+ while (interactionFragmentsIterator.hasNext()) { >+ testInvocations.addAll(findAllTestInvocations(((BVRInteractionFragment) (interactionFragmentsIterator.next())))); >+ } >+ } >+ } >+ >+ return testInvocations; >+ } >+ > > /** > * 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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 187242
:
77061
|
77261