Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 475804 - 3 gitflow UI tests failing on Mac with locale setting "U.S. International - PC"
Summary: 3 gitflow UI tests failing on Mac with locale setting "U.S. International - PC"
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Gitflow (show other bugs)
Version: 4.1   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-25 09:00 EDT by Matthias Sohn CLA
Modified: 2016-01-26 14:58 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Sohn CLA 2015-08-25 09:00:07 EDT
Observed this problem on Mac OS X 10.10.5:

when locale is set to "U.S. International - PC" in Mac "System Preferences > Language & Region > Keyboard Preferences"
the following 3 gitflow ui test cases fail with the error message seen when running the tests from Eclipse:

"MAC_US_USERDEFINED_G{}".keyboard not found, see http://wiki.eclipse.org/SWTBot/Keyboard_Layouts for more information."

when running them from Maven I observe the following errors

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 35.625 sec <<< FAILURE! - in org.eclipse.egit.ui.gitflow.FeatureFinishSquashHandlerTest
testFeatureFinishSquash(org.eclipse.egit.ui.gitflow.FeatureFinishSquashHandlerTest)  Time elapsed: 3.194 sec  <<< ERROR!
java.lang.ExceptionInInitializerError: null
	at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.getKeyboardLayout(KeyboardLayout.java:89)
	at org.eclipse.swtbot.swt.finder.keyboard.KeyboardLayout.getDefaultKeyboardLayout(KeyboardLayout.java:75)
	at org.eclipse.swtbot.swt.finder.keyboard.Keystrokes.<clinit>(Keystrokes.java:110)
	at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeCharacter(Keyboard.java:100)
	at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeText(Keyboard.java:89)
	at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeText(Keyboard.java:77)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText.typeText(SWTBotStyledText.java:227)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText.typeText(SWTBotStyledText.java:211)
	at org.eclipse.egit.ui.gitflow.FeatureFinishSquashHandlerTest.finishFeature(FeatureFinishSquashHandlerTest.java:108)
	at org.eclipse.egit.ui.gitflow.FeatureFinishSquashHandlerTest.testFeatureFinishSquash(FeatureFinishSquashHandlerTest.java:65)

Running org.eclipse.egit.ui.gitflow.FeatureStartFinishHandlerTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.48 sec <<< FAILURE! - in org.eclipse.egit.ui.gitflow.FeatureStartFinishHandlerTest
testFeatureStart(org.eclipse.egit.ui.gitflow.FeatureStartFinishHandlerTest)  Time elapsed: 0.991 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.swtbot.swt.finder.keyboard.Keystrokes
	at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeCharacter(Keyboard.java:100)
	at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeText(Keyboard.java:89)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotText.typeText(SWTBotText.java:92)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotText.typeText(SWTBotText.java:78)
	at org.eclipse.egit.ui.gitflow.FeatureStartFinishHandlerTest.createFeature(FeatureStartFinishHandlerTest.java:94)
	at org.eclipse.egit.ui.gitflow.FeatureStartFinishHandlerTest.testFeatureStart(FeatureStartFinishHandlerTest.java:43)

Running org.eclipse.egit.ui.gitflow.InitHandlerTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.484 sec <<< FAILURE! - in org.eclipse.egit.ui.gitflow.InitHandlerTest
testInit(org.eclipse.egit.ui.gitflow.InitHandlerTest)  Time elapsed: 1.039 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.swtbot.swt.finder.keyboard.Keystrokes
	at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeCharacter(Keyboard.java:100)
	at org.eclipse.swtbot.swt.finder.keyboard.Keyboard.typeText(Keyboard.java:89)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotText.typeText(SWTBotText.java:92)
	at org.eclipse.swtbot.swt.finder.widgets.SWTBotText.typeText(SWTBotText.java:78)
	at org.eclipse.egit.ui.gitflow.InitHandlerTest.init(InitHandlerTest.java:78)
	at org.eclipse.egit.ui.gitflow.InitHandlerTest.testInit(InitHandlerTest.java:48)
Comment 1 Matthias Sohn CLA 2015-08-25 09:04:16 EDT
I debugged the problem and found that SWTBot tries to autodetect the keyboard layout
and maps the Mac keyboard layout "U.S. International - PC" to "MAC_US_USERDEFINED_G{}". This keyboard layout isn't coming with swtbot 2.3.0 out of the box. Hence these tests are failing.

Workaround is to either change keyboard setting to "U.S." in Mac's System Preferences or to set the following system property when running these tests:

-Dorg.eclipse.swtbot.keyboard.layout=org.eclipse.swtbot.swt.finder.keyboard.MAC_EN_US

We could contribute this keyboard layout to swtbot following
http://wiki.eclipse.org/SWTBot/Keyboard_Layouts

Closing as worksforme since this workaround is ok for me.
Comment 2 Eclipse Genie CLA 2016-01-24 08:36:58 EST
New Gerrit change created: https://git.eclipse.org/r/65050
Comment 3 Eclipse Genie CLA 2016-01-26 14:55:35 EST
Gerrit change https://git.eclipse.org/r/65050 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=759c7560001739b0f8ed8c34a7c6d9b3b70940ce
Comment 4 Thomas Wolf CLA 2016-01-26 14:58:06 EST
Tests made independent from the keyboard layout.