Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 225963 - The invocation for some deleted testcases can't be removed in behaviour tab
Summary: The invocation for some deleted testcases can't be removed in behaviour tab
Status: CLOSED DUPLICATE of bug 201896
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-07 09:34 EDT by Tony Wang CLA
Modified: 2016-05-05 10:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Wang CLA 2008-04-07 09:34:50 EDT
If a test case is added as an invocation in behaviour tab, after delete this tese case, the invotation is still in the behaviour tab and can't be deleted(unless the invocation is under a loop, that invocation can be deleted by deleting the loop)
Comment 1 Paul Slauenwhite CLA 2008-04-08 07:35:27 EDT
JUnit Test suite:

java.lang.NullPointerException
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.populateChildrenIterator(ContainmentTraverser.java:129)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObjectChildrenIterator(ContainmentTraverser.java:148)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObject(ContainmentTraverser.java:144)
at org.eclipse.hyades.models.hierarchy.util.EObjectsTraverser.traverse(EObjectsTraverser.java:109)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObjectChildrenIterator(ContainmentTraverser.java:149)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObject(ContainmentTraverser.java:144)
at org.eclipse.hyades.models.hierarchy.util.EObjectsTraverser.traverse(EObjectsTraverser.java:109)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObjectChildrenIterator(ContainmentTraverser.java:149)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObject(ContainmentTraverser.java:144)
at org.eclipse.hyades.models.hierarchy.util.EObjectsTraverser.traverse(EObjectsTraverser.java:109)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObjectChildrenIterator(ContainmentTraverser.java:149)
at org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.traverseEObject(ContainmentTraverser.java:144)
at org.eclipse.hyades.models.hierarchy.util.EObjectsTraverser.traverse(EObjectsTraverser.java:109)
at org.eclipse.hyades.models.hierarchy.util.EObjectsTraverser.traverse(EObjectsTraverser.java:95)
at org.eclipse.hyades.models.hierarchy.util.EMFUtil.delete(EMFUtil.java:115)
at org.eclipse.hyades.models.hierarchy.util.EMFUtil.delete(EMFUtil.java:86)
at org.eclipse.hyades.models.hierarchy.util.EMFUtil.delete(EMFUtil.java:136)
at org.eclipse.hyades.test.core.util.EMFUtil.remove(EMFUtil.java:611)
at org.eclipse.hyades.test.ui.internal.model.ui.RemoveChildrenAction.breakFeatures(RemoveChildrenAction.java:146)
at org.eclipse.hyades.test.ui.internal.model.ui.RemoveChildrenAction.run(RemoveChildrenAction.java:126)
at org.eclipse.hyades.test.ui.editor.form.util.ExtensibleEObjectTreeSection.buttonSelected(ExtensibleEObjectTreeSection.java:168)
at org.eclipse.hyades.test.ui.internal.editor.form.util.TreeSection$PartAdapter.buttonSelected(TreeSection.java:55)
at org.eclipse.hyades.test.ui.internal.editor.form.base.SharedPartWithButtons$SelectionHandler.buttonSelected(SharedPartWithButtons.java:58)
at org.eclipse.hyades.test.ui.internal.editor.form.base.SharedPartWithButtons$SelectionHandler.widgetSelected(SharedPartWithButtons.java:49)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:83)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3773)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3372)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2375)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2339)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2205)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:478)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:473)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

AGR test suite:

java.lang.NullPointerException
	at org.eclipse.hyades.models.common.facades.behavioral.impl.TptpBVRExecutionOccurrenceAdapter.notifyChanged(TptpBVRExecutionOccurrenceAdapter.java:64)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:247)
	at org.eclipse.hyades.models.common.interactions.impl.BVRExecutionOccurrenceImpl.setOtherBehavior(BVRExecutionOccurrenceImpl.java:268)
	at org.eclipse.hyades.models.common.interactions.impl.BVRExecutionOccurrenceImpl.eUnset(BVRExecutionOccurrenceImpl.java:359)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObjectImpl.java:1153)
	at org.eclipse.hyades.models.hierarchy.util.EMFUtil.unsetAllFeatures(EMFUtil.java:395)
	at org.eclipse.hyades.models.hierarchy.util.EMFUtil.delete(EMFUtil.java:121)
	at org.eclipse.hyades.models.hierarchy.util.EMFUtil.delete(EMFUtil.java:86)
	at org.eclipse.hyades.models.hierarchy.util.EMFUtil.delete(EMFUtil.java:136)
	at org.eclipse.hyades.test.core.util.EMFUtil.remove(EMFUtil.java:611)
	at org.eclipse.hyades.test.ui.internal.model.ui.RemoveChildrenAction.breakFeatures(RemoveChildrenAction.java:146)
	at org.eclipse.hyades.test.ui.internal.model.ui.RemoveChildrenAction.run(RemoveChildrenAction.java:126)
	at org.eclipse.hyades.test.ui.internal.editor.form.util.EObjectTree.doRemove(EObjectTree.java:368)
	at org.eclipse.tptp.test.auto.gui.internal.editor.AutoGUIBehaviorForm$ExtendedBehaviorTree.buttonSelected(AutoGUIBehaviorForm.java:931)
	at org.eclipse.hyades.test.ui.internal.editor.form.util.EObjectTree$PartAdapter.buttonSelected(EObjectTree.java:92)
	at org.eclipse.hyades.test.ui.internal.editor.form.base.SharedPartWithButtons$SelectionHandler.buttonSelected(SharedPartWithButtons.java:58)
	at org.eclipse.hyades.test.ui.internal.editor.form.base.SharedPartWithButtons$SelectionHandler.widgetSelected(SharedPartWithButtons.java:49)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:83)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3773)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3372)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2375)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2339)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2205)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:478)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:473)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Comment 2 Bozier jerome CLA 2008-04-09 11:23:24 EDT
on it. 
seems a not so easy problem : there is an adapter to convert a testcase into IFile. 
the problem is that the returned file is the .testsuite one
so, testsuite is erased at same time as the testcase but without any of the clean update, and it produce some chained exceptions
i have to talk with Jerome/Julian to know if there is a reason for this adapter to exist (removing it would be an easy fix). 
Comment 3 Paul Slauenwhite CLA 2008-04-09 15:14:44 EDT
Hours worked for triage.

JUnit Test suite:

When deleting a test case, the associated behavior is first deleted.  That is, the   BVRExecutionOccurrence associated with the TPFTestCase is deleted.  During the deletion, the otherBehavior in deleted from the BVRExecutionOccurrence in  org.eclipse.hyades.models.hierarchy.util.EMFUtil.java:195.  As a result, a null BVRInteraction is set on the BVRInteractionFragment in org.eclipse.hyades.models.common.interactions.impl.BVRInteractionFragmentImpl.java:218, causing the eContainer to be set to null.  Since the eContainer is null, the eResource is also null, when we store it in a list in org.eclipse.hyades.models.hierarchy.util.EMFUtil.java:287.  The null element is retrieved from the list in org.eclipse.hyades.models.hierarchy.util.EObjectsTraverser.java:100 causing the NPE.

Marius/Joe: Would either or both of you be able to shed some light on the cause of this behavior?
Comment 4 Paul Slauenwhite CLA 2008-04-09 15:16:48 EDT
(In reply to comment #2)
> on it. 
> seems a not so easy problem : there is an adapter to convert a testcase into
> IFile. 
> the problem is that the returned file is the .testsuite one
> so, testsuite is erased at same time as the testcase but without any of the
> clean update, and it produce some chained exceptions
> i have to talk with Jerome/Julian to know if there is a reason for this adapter
> to exist (removing it would be an easy fix). 
> 

Jerome, is this comment for this defect?  This defect is related to the Test/TPTP models so I will own it.
Comment 5 Bozier jerome CLA 2008-04-10 02:37:37 EDT
yes, comment is about this defect, but is also relative to 166025
to make short, when we detele a test element in test navigator view, we check if this element is adaptable into a IFile.
if so, the IFile is also deleted
problem is that testcase adapter return the .testsuite file. so deleting testcase via contextual menu erase.... the testsuite file, and then makes things blow up
there should not be such adapter for testcase, i will try to remove it but i fear some side effect
Comment 6 Paul Slauenwhite CLA 2008-04-10 11:44:14 EDT
(In reply to comment #5)
> yes, comment is about this defect, but is also relative to 166025
> to make short, when we detele a test element in test navigator view, we check
> if this element is adaptable into a IFile.
> if so, the IFile is also deleted
> problem is that testcase adapter return the .testsuite file. so deleting
> testcase via contextual menu erase.... the testsuite file, and then makes
> things blow up
> there should not be such adapter for testcase, i will try to remove it but i
> fear some side effect
> 

Jerome, I will own this defect since it is a Test Model issue.  Once we have a fix, please test your use case.
Comment 7 Paul Slauenwhite CLA 2008-04-22 13:11:58 EDT
Resolved by the patch for defect #201896.

*** This bug has been marked as a duplicate of bug 201896 ***
Comment 8 Tony Wang CLA 2008-06-06 12:12:14 EDT
Verified in 4.5-200806050915 build, mark as CLOSED
Comment 9 Paul Slauenwhite CLA 2008-07-25 14:23:05 EDT
(In reply to comment #1)
> JUnit Test suite:
> 
> java.lang.NullPointerException
> at
> org.eclipse.hyades.models.hierarchy.util.ContainmentTraverser.populateChildrenIterator(ContainmentTraverser.java:129)

Note, using the 07/14 build, this exception still exists when deleting test invocations to missing test cases/methods in the test suite editor (possible due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=201896).  This will be handled under https://bugs.eclipse.org/bugs/show_bug.cgi?id=201896.