Shells is being closed uncontrollable by exception

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Shells is being closed uncontrollable by exception

Postby eeybye » Tue Mar 11, 2008 7:30 am

Hello

In my test scenario, I'm starting up an RCP application, in which I open another workbench. In that workbench, I open a Dialog in which I open a second dialog.

Now, one of my tests verifies the caption of that last dialog with a: ui.wait(new ShellShowingCondition ...
The caption was wrong, which leads to an exception after a while... but it also leads to the other shells being closed and this famous 'Widget disposed too early':

Code: Select all
!ENTRY com.instantiations.eclipse 1 0 2008-03-11 14:54:49.099
!MESSAGE closing shell [aysnc] Setup

!ENTRY com.instantiations.eclipse 1 0 2008-03-11 14:54:49.146
!MESSAGE closing shell [aysnc] Setup Tags

!ENTRY com.instantiations.eclipse 1 0 2008-03-11 14:54:49.662
!MESSAGE closing shell [aysnc] Edit Data Center

!ENTRY com.instantiations.eclipse 1 0 2008-03-11 14:54:50.162
!MESSAGE closing shell [aysnc] Capacity and Change Manager
!ENTRY org.eclipse.ui.workbench 4 0 2008-03-11 14:54:51.052
!MESSAGE Widget disposed too early!
!STACK 0
java.lang.RuntimeException: Widget disposed too early!
   at org.eclipse.ui.internal.WorkbenchPartReference$1.widgetDisposed(WorkbenchPartReference.java:169)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:116)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)


The application under test is going totally down, but junit seems to continue.

And that I can't understand. I thought I could close the dialogs nicely in a tearDown and continue the other test steps.

Running Eclipse 3.3.1.1 w. WindowTesterPro 2.3.1 on Windows XP

Any ideas ?
eeybye
 
Posts: 22
Joined: Fri Jun 22, 2007 12:34 am
Location: Denmark

Re: Shells is being closed uncontrollable by exception

Postby Phil Quitslund » Tue Mar 11, 2008 7:53 am

Exceptional conditions cause a cleanup handler to kick in which, among other things, closes shells and menus that may block progress on the UI thread. We need to do his to ensure that the exception gets propagated (we need access to the UI thread). Unfortunately, it looks like in your case, this cleanup is doing "too much". Is there any way to engineer your tests such that they are more independent? It sounds like the issue hinges on the fact that tests later in your suite expect and require that earlier tests will have driven the app under test into a desired state. Perhaps there could be a setup method that ensures the app context is properly setup?

I realize this may seem like a bit of a sidestep of your issue... Maybe with my explanation of our pre-exception cleanup you can help me understand what we might do on our end to get you the desired result. And if none of this makes sense, let me know and I'll try and elaborate!

Thanks!

-phil
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: Shells is being closed uncontrollable by exception

Postby eeybye » Tue Mar 11, 2008 11:56 am

Actually, each test function in my test classes are independent, so that shouldn't be the problem. All my test classes reside in the same plugin.

What I can see from the log is, that the clean-up routine also removes the main startup workbench window
Code: Select all
MESSAGE closing shell [aysnc] Capacity and Change Manager


'Capacity and Change Manager' is the caption of the main window.

I don't really know what else to do...
eeybye
 
Posts: 22
Joined: Fri Jun 22, 2007 12:34 am
Location: Denmark

Re: Shells is being closed uncontrollable by exception

Postby Phil Quitslund » Tue Mar 11, 2008 2:00 pm

I think we should promote this to a bug. Could you please send a mail to:

wintest-support@instantiations.com

This will open a ticket in our issue tracking system and we can follow up there.

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest