Community
Participate
Working Groups
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)
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.
New Gerrit change created: https://git.eclipse.org/r/65050
Gerrit change https://git.eclipse.org/r/65050 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=759c7560001739b0f8ed8c34a7c6d9b3b70940ce
Tests made independent from the keyboard layout.