Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 228747

Summary: Regression, URL Test Does Not Get Generated
Product: z_Archived Reporter: DuWayne Morris <dmorris>
Component: TPTPAssignee: Paul Slauenwhite <paulslau>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P1 CC: dmorris, jkubasta, paulslau
Version: unspecifiedFlags: dmorris: review+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 230280    
Attachments:
Description Flags
Patch. none

Description DuWayne Morris CLA 2008-04-24 15:11:43 EDT
This is the 04-24 TP1 build candidate.

After recording a URL test, the message appears in the Recorder Control that URL Test Generation has started.  The test does not in fact get generated.  The work-around is use the wizard again to create a test from an existing recording.

I marked this as critical, since the user may not know the recording was fine, since the recording files are not shown in the Test Navigator view.  Thus, the user would not easily understand what has happened and find the work-around.

There were no errors in the error log.
Comment 1 DuWayne Morris CLA 2008-05-05 08:56:39 EDT
Adding sizing.
Comment 2 Paul Slauenwhite CLA 2008-05-05 10:21:09 EDT
This is a blocking issue.
Comment 3 Paul Slauenwhite CLA 2008-05-05 10:48:10 EDT
Duwayne, I will fix this defect.
Comment 4 Paul Slauenwhite CLA 2008-05-05 14:37:48 EDT
In org.eclipse.hyades.internal.execution.recorder.local.RecorderClient.FinishCleanupAndGenTestThread.run() thread, we do not handle/log exceptions.  This will need to be fixed under this defect.

Running Eclipse with the -console falg renders the following exception:

osgi> Exception in thread "Recording completion listener" java.lang.NullPointerE
xception
        at org.eclipse.hyades.internal.execution.recorder.ui.views.RecorderContr
olView.getInstance(RecorderControlView.java:259)
        at org.eclipse.tptp.test.internal.recorder.ui.wizards.NewTestFromRecordi
ngWizard.runTestGen(NewTestFromRecordingWizard.java:252)
        at org.eclipse.hyades.internal.execution.recorder.ui.RecorderClientUI.st
artTestGen(RecorderClientUI.java:55)
        at org.eclipse.hyades.internal.execution.recorder.local.RecorderClient$F
inishCleanupAndGenTestThread.run(RecorderClient.java:220)

The PlatformUI.getWorkbench().getActiveWorkbenchWindow() is returing null, despite being called from the UI thread.

In addition, the Test Perspective is attempted to be opened whenever a caller retrieves an instance, which causes the user to be queried about Test Perspective twice during a recording.
Comment 5 Paul Slauenwhite CLA 2008-05-06 06:34:52 EDT
(In reply to comment #4)

> In addition, the Test Perspective is attempted to be opened whenever a caller
> retrieves an instance, which causes the user to be queried about Test
> Perspective twice during a recording.

Resolved by defect #230280. 

Comment 6 Paul Slauenwhite CLA 2008-05-06 08:42:27 EDT
(In reply to comment #4)
> The PlatformUI.getWorkbench().getActiveWorkbenchWindow() is returing null,
> despite being called from the UI thread.

Correction, the call is NOT made from the UI thread, causing the NPE.  The org.eclipse.hyades.internal.execution.recorder.ui.views.RecorderControlView.getInstance() method is called from both UI threads (e.g. adding a message) and non-UI threads (e.g. registering a org.eclipse.hyades.test.core.testgen.ITestgenListener.java).  
Comment 7 Paul Slauenwhite CLA 2008-05-06 09:54:35 EDT
In addition, the following exception is thrown when the Recorder Control View is closed during a recording since the view (and its widgets) is already disposed:

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
	at org.eclipse.swt.SWT.error(SWT.java:3773)
	at org.eclipse.swt.SWT.error(SWT.java:3691)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3759)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3384)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.internal.views.log.EventDetailsDialog.open(EventDetailsDialog.java:162)
	at org.eclipse.ui.internal.views.log.EventDetailsDialogAction.run(EventDetailsDialogAction.java:98)
	at org.eclipse.ui.internal.views.log.LogView$15.doubleClick(LogView.java:512)
	at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:799)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:880)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:797)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1419)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1173)
	at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:237)
	at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:234)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:295)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1002)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3782)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3381)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2380)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2344)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2210)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:494)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:489)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:112)
	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:379)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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)
Caused by: org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3773)
	at org.eclipse.swt.SWT.error(SWT.java:3691)
	at org.eclipse.swt.SWT.error(SWT.java:3662)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:462)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:335)
	at org.eclipse.swt.widgets.List.add(List.java:95)
	at org.eclipse.hyades.internal.execution.recorder.ui.views.RecorderControlView$6.run(RecorderControlView.java:291)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	... 42 more
Comment 8 Paul Slauenwhite CLA 2008-05-06 10:54:30 EDT
Created attachment 98849 [details]
Patch.
Comment 9 Paul Slauenwhite CLA 2008-05-06 10:55:40 EDT
Hours worked to create/test the patch.

Duwayne, please review and test the patch using the I7 candidate driver.
Comment 10 Paul Slauenwhite CLA 2008-05-06 11:44:49 EDT
(In reply to comment #7)

Caused by references to the singleton Recorder Control View being called after the view (and its widgets) has been disposed.  The singleton design pattern is a poor design choice for this view.  The only solution is to gracefully handle these  calls after the view (and its widgets) has been disposed.
Comment 11 DuWayne Morris CLA 2008-05-06 14:50:36 EDT
Reviewed and tested patch, +1.
Comment 12 Paul Slauenwhite CLA 2008-05-09 12:37:28 EDT
Patch checked into CVS (HEAD).
Comment 13 Paul Slauenwhite CLA 2008-05-15 20:02:29 EDT
*** Bug 232428 has been marked as a duplicate of this bug. ***
Comment 14 DuWayne Morris CLA 2008-06-27 09:46:34 EDT
Verified in 4.5i8 and closing.