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 68797 Details for
Bug 136186
Test invocation reference does not work with the automated gui recorder
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
136176_patch_working.txt (text/plain), 8.91 KB, created by
Liz Dancy
on 2007-05-25 12:43:43 EDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Liz Dancy
Created:
2007-05-25 12:43:43 EDT
Size:
8.91 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.test.auto.gui >Index: src/org/eclipse/tptp/test/auto/gui/internal/runner/AutoGUIRunner.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.auto.gui/src/org/eclipse/tptp/test/auto/gui/internal/runner/AutoGUIRunner.java,v >retrieving revision 1.19 >diff -u -r1.19 AutoGUIRunner.java >--- src/org/eclipse/tptp/test/auto/gui/internal/runner/AutoGUIRunner.java 2 May 2007 19:35:58 -0000 1.19 >+++ src/org/eclipse/tptp/test/auto/gui/internal/runner/AutoGUIRunner.java 25 May 2007 16:36:16 -0000 >@@ -281,7 +281,8 @@ > > > /* Run the tests */ >- startTime = getCurrentTime(); >+ startTime = getCurrentTime(); >+ > runner.runTest (testSuiteObj, EXECUTION_RUN_MODE); > } > catch(Throwable e) >@@ -381,13 +382,42 @@ > } > > /* Holds the next executable action that is to be executed */ >- Object nextExecution; >- >+ Object nextExecution = null; >+ /* Holds the test suite if we are executing a test suite reference, added for bugzilla_136186*/ >+ TestSuite nestedSuite = new TestSuite(); >+ /* To keep track of when we are in a reference to a test suite*/ >+ boolean inTestSuite =false; >+ /* To keep track of whether we are in a Loop inside of a test suite reference*/ >+ boolean loopStarted = false; >+ /* The index of test cases in a references Loop or test suite*/ >+ int index=0; >+ > /* Walk through every element that needs to be executed in our test suite */ > if (initializeState == null) > { >- while ((nextExecution = nextExecution(mode, testSuite)) != null ) >+ >+ while (((inTestSuite)|| (nextExecution =nextExecution(mode, testSuite))!=null)) > { >+ // Added for bugzilla_136186 to add the ability to step through test >+ //cases in a referenced test suite >+ // Liz D. >+ if (inTestSuite) >+ { >+ nextExecution = nestedSuite.getActions().get(index); >+ >+ if (nextExecution instanceof org.eclipse.tptp.test.manual.runner.core.internal.model.Loop) >+ { >+ if (loopStarted) >+ { >+ nextExecution = ((org.eclipse.tptp.test.manual.runner.core.internal.model.Loop)nextExecution).getActions().get(index); >+ loopStarted=false; >+ } >+ else >+ loopStarted=true; >+ } >+ >+ } >+ > try > { > errorOccurred = false; >@@ -408,7 +438,6 @@ > if (lastLoop != null) > { > IActionOwner parentOfLastLoop = lastLoop.getOwner(); >- > String parentOfLastLoopId = getActionId(parentOfLastLoop); > String nextExecutionId = getActionId(nextExecution); > >@@ -425,9 +454,10 @@ > continue; > } > >- else if (((Action)nextExecution).getOwner() instanceof TestSuite) >+ else if (((Action)nextExecution).getOwner() instanceof TestSuite && !inTestSuite) > { > sendAllLoopStop (); >+ > } > } > >@@ -436,15 +466,23 @@ > { > sendLoopStart ((org.eclipse.tptp.test.manual.runner.core.internal.model.Loop)nextExecution); > continue; >+ > } > > /* If the action is a test invocation, then send the test invocation */ >- else if (nextExecution instanceof ExtendedTestInvocation) >+ if (nextExecution instanceof ExtendedTestInvocation ) > { > lastAction = (ExtendedTestInvocation)nextExecution; > testCaseObject = lastAction.getTest(); >+ sendTestInvocation(lastAction, InvocationEvent.STATUS_SUCCESSFUL, lastAction.getName()); > >- sendTestInvocation(lastAction, InvocationEvent.STATUS_SUCCESSFUL, null); >+ if (testCaseObject instanceof TestSuite) >+ { >+ nestedSuite = ((TestSuite)testCaseObject); >+ inTestSuite=true; >+ index =0; >+ continue; >+ } > } > > /* Otherwise continue with the main loop */ >@@ -452,15 +490,16 @@ > { > continue; > } >- } >- >- if (!(testCaseObject instanceof ExtendedTestCase)) >+ } >+ if (!((testCaseObject instanceof ExtendedTestCase))) > continue; > > /* Switch to the perspective representing our starting point */ >- final ExtendedTestCase testCase = (ExtendedTestCase)testCaseObject; >+ final ExtendedTestCase testCase = (ExtendedTestCase)testCaseObject; >+ > final String startingPoint = testCase.getProperty(String.valueOf(GUITestCaseProperties.STARTING_PT)); > >+ > /* This is a required field. In case it is not set, then mark the test case with > * a verdict of error */ > if (startingPoint == null || startingPoint.length() <= 0) >@@ -502,6 +541,7 @@ > > workbench.showPerspective(startingPoint, window); > } >+ > catch (WorkbenchException e) > { > errorOccurred = true; >@@ -632,7 +672,8 @@ > > errorOccurred = true; > isDone = true; >- } >+ >+ }// end whlie > } > > public boolean isDone() >@@ -811,9 +852,16 @@ > > /* Send out a stop event on the test case invocation */ > if (mode == EXECUTION_RUN_MODE) >- sendTypeEvent(TypedEvent.STOP, null); >- } >- } >+ sendTypeEvent(TypedEvent.STOP, null); >+ index ++; >+ if (index >= (nestedSuite.getActions().size()) && inTestSuite) >+ { >+ sendSuiteStop(); >+ inTestSuite=false; >+ } >+ >+ }// end while >+ }// end if > > if (mode == EXECUTION_RUN_MODE) > { >@@ -950,7 +998,7 @@ > > /** > * Returns the last container id according to what is stored in the >- * execution event stack. A container is either a loop or the ROOT. >+ * execution event stack. A container is either a loop or the ROOT. It could also be a nested test suite invocation > * > * @return The last container id. > */ >@@ -962,8 +1010,10 @@ > { > if (stackItems[i] instanceof LoopEvent) > return ((LoopEvent)stackItems[i]).getId(); >+ else if (stackItems[i] instanceof InvocationEvent){ >+ return ((InvocationEvent)stackItems[i]).getId(); >+ } > } >- > return "ROOT"; > } > >@@ -976,10 +1026,9 @@ > { > TypedEvent event = new TypedEvent(); > String parentId = lastExecutionEventId(); >- if (executionEventStack.size() > 0) >+ if (executionEventStack.size() > 0) > event.setOwnerId(((ExecutionEvent)executionEventStack.peek()).getOwnerId()); > event.setParentId(parentId); >- event.setText(text); > event.setType(type); > > ModelUtil.getEventLogger().log(event); >@@ -988,7 +1037,14 @@ > executionEventStack.pop(); > } > >- >+ /** >+ * Added for bugzilla_136186 in order to send an additional Stop event for a test suite >+ */ >+ private void sendSuiteStop() >+ { >+ sendTypeEvent(TypedEvent.STOP, null); >+ >+ } > /** > * Sends a loop event > */ >@@ -1034,17 +1090,20 @@ > InvocationEvent event = new InvocationEvent(); > associateEventIds(testInvocation, event); > >- event.setText(text); >+ > > if(testInvocation.getTest() == null) > { > event.setStatus(InvocationEvent.STATUS_UNSUCCESSFUL); > event.setReason(InvocationEvent.REASON_NO_BEHAVIOR); >+ > } > else > { > event.setInvokedId(ModelUtil.appendHierarchyId(testInvocation.getTest(), event.getOwnerId())); > event.setStatus(status); >+ >+ > } > > ModelUtil.getEventLogger().log(event); >@@ -1075,10 +1134,10 @@ > */ > InvocationEvent invocationEvent = (InvocationEvent)executionEventStack.peek(); > verdictEvent.setId(invocationEvent.getId() + "_verdict"); >- verdictEvent.setOwnerId(ModelUtil.getHierarchyId(lastAction.getTest())); >+ //verdictEvent.setOwnerId(ModelUtil.getHierarchyId(lastAction.getTest())); > verdictEvent.setParentId(invocationEvent.getId()); > verdictEvent.setVerdict(verdict); >- >+ verdictEvent.setOwnerId(invocationEvent.getId()); > > if(reason != null && reason.trim().length() > 0) > { >@@ -1086,7 +1145,6 @@ > verdictEvent.setReason(VerdictEvent.REASON_SEE_DESCRIPTION); > } > ModelUtil.getEventLogger().log(verdictEvent); >- > testInvocation.setVerdictEvent(verdictEvent); > } > >@@ -1105,7 +1163,8 @@ > > event.setOwnerId(ownerId); > event.setId(eventId); >- event.setParentId(parentId); >+ event.setParentId(parentId); >+ > > executionEventStack.push(event); > } >@@ -1144,7 +1203,6 @@ > return nextExecution; > } > >- > private Object getNextExecutableAction() > { > if (actionIteratorStack.size() <= 0) >@@ -1161,7 +1219,7 @@ > > > /* If the invocation is disabled, then just skip it */ >- if (nextExecutableAction instanceof TestInvocation) >+ if (nextExecutableAction instanceof TestInvocation ) > { > TestInvocation testInvocation = (TestInvocation)nextExecutableAction; > GeneralPropertyRetriever properties = extendedTestSuite.getProperties();
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 136186
: 68797