Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330882 - SWTBotApplicationLauncherClassRunner can't use on Mac OSX Cocoa platform.
Summary: SWTBotApplicationLauncherClassRunner can't use on Mac OSX Cocoa platform.
Status: RESOLVED DUPLICATE of bug 308425
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-23 01:54 EST by Hiroki Kondo CLA
Modified: 2011-02-22 10:39 EST (History)
1 user (show)

See Also:


Attachments
suggested source (527 bytes, text/plain)
2010-11-23 02:02 EST, Hiroki Kondo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroki Kondo CLA 2010-11-23 01:54:00 EST
Build Identifier: 20100917-0705

on Cocoa platform, SWT UI Thread needs to run on main thread. It is a cocoa restriction.If you use SWTBotApplicationLauncherClassRunner on Mac OSX, you'll get the follow message.

***WARNING: Display must be created on main thread due to Cocoa restrictions.
Exception in thread "Thread-2" org.eclipse.swt.SWTException: Invalid thread access
	at org.eclipse.swt.SWT.error(SWT.java:4083)
	at org.eclipse.swt.SWT.error(SWT.java:3998)
	at org.eclipse.swt.SWT.error(SWT.java:3969)
	at org.eclipse.swt.widgets.Display.error(Display.java:1027)
	at org.eclipse.swt.widgets.Display.createDisplay(Display.java:794)
	at org.eclipse.swt.widgets.Display.create(Display.java:777)
	at org.eclipse.swt.graphics.Device.<init>(Device.java:130)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:668)
	at org.eclipse.swt.widgets.Display.<init>(Display.java:659)
	at org.kompiro.jamcircle.scripting.ui.internal.action.MockActionRunner.startApplication(MockActionRunner.java:21)
	at org.eclipse.swtbot.swt.finder.junit.SWTBotApplicationLauncherClassRunner$1.run(SWTBotApplicationLauncherClassRunner.java:63)
	at java.lang.Thread.run(Thread.java:680)


SWTBotApplicationLauncherClassRunner creates Display on another thread.
So it can't use on cocoa platform.

Reproducible: Always
Comment 1 Hiroki Kondo CLA 2010-11-23 02:02:06 EST
Created attachment 183634 [details]
suggested source

I suggest to change point of view to think SWTBot's TestRunner like attachment source.The attached source is start on main thread, and running test on another thread.
Comment 2 Mariot Chauvin CLA 2010-11-23 05:30:17 EST
Correct me if I am wrong but this is not related to GEFBot.

This is may be related to (or a duplicate of) bug 308425.
Comment 3 Ketan Padegaonkar CLA 2011-02-22 10:39:14 EST
Marking as dup. Fixing this on cocoa is turning out to be a nightmare. Any suggestions to improve the situation are welcome. I'm myself stuck with development of swtbot on carbon 32bit.

*** This bug has been marked as a duplicate of bug 308425 ***