9 messages in net.sourceforge.lists.swtbot-usersRe: [SWTBot-users] Tests does not con...
FromSent OnAttachments
Hans SchwaebliJun 24, 2008 12:21 am 
Ketan PadegaonkarJun 24, 2008 12:39 am 
Hans SchwaebliJun 24, 2008 1:45 am 
Ketan PadegaonkarJun 24, 2008 1:55 am 
Hans SchwaebliJun 25, 2008 12:41 am 
Ketan PadegaonkarJun 25, 2008 12:47 am 
Hans SchwaebliJun 25, 2008 1:10 am 
Hans SchwaebliJun 27, 2008 12:58 am 
Ketan PadegaonkarJun 28, 2008 12:09 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [SWTBot-users] Tests does not continue after a lineActions...
From:Ketan Padegaonkar (keta@gmail.com)
Date:Jun 28, 2008 12:09:13 am
List:net.sourceforge.lists.swtbot-users

There's no way an exception in one thread can be caught in another thread, which is why I had to take the pain of writing the launcher. It's not so very easy to get around.

-- Ketan

On 27-Jun-08, at 1:28 PM, Hans Schwaebli wrote:

Is there a way to avoid writing such an Eclipse plugin by using threads inside the JUnit test?

I tried this in the test:

final SWTBot bot = new SWTBot();

Runnable r = new Runnable() { public void run() { try { assertNotSame(bot.getDisplay().getThread(), Thread.currentThread()); bot.menu("File").click(); bot.menu("Open Product Teardown...").click(); bot.button("Open").click(); } catch (Exception e) { throw new RuntimeException(e); } } };

Thread t = new Thread(r); t.start();

But it didn't work since it throws WidgetNotFoundException. The threads are not the same, but it does not help in this approach. So I guess another condition must be met which I don't know of right now.