Unfortunately, I am running into some issues. When I try to get the Swing
frame, I always get a Invalid thread access exception:

Exception in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid
thread access
        at org.eclipse.swt.SWT.error(SWT.java:3777)
        at org.eclipse.swt.SWT.error(SWT.java:3695)
        at org.eclipse.swt.SWT.error(SWT.java:3666)
        at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:355)
        at org.eclipse.swt.widgets.Widget.getStyle(Widget.java:661)
        at org.eclipse.swt.awt.SWT_AWT.getFrame(SWT_AWT.java:110)

I've tried calling it directly from the unit and invoking it via
SwingUtilities, e.g.

        SWTBotView cm = bot.view("Connection Manager");
        assertNotNull("ConnectionManager view is null", cm);
        
        final Composite composite = (Composite) cm.widget;
        assertNotNull("Composite is null",composite);
     
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                Frame swingFrame = SWT_AWT.getFrame(composite);
                assertNotNull("Swing frame is null",swingFrame);
            }
        });

but both approaches gave me the same exception.

Any suggestions as to how I may get around it (and whether it is even
possible)?
-- 
View this message in context: 
http://www.nabble.com/Testing-Swing-components-in-an-RCP-app-tp20666693p20704213.html
Sent from the SWTBot Users List mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
SWTBot-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swtbot-users
http://swtbot.org/ - a functional testing tool for SWT/Eclipse

Reply via email to