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.
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php_______________________________________________
> SWTBot-users mailing list
> SWTBot-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/swtbot-users
> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
>



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
SWTBot-users mailing list
SWTBot-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to