Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: FEST-Swing 1.2a2
-
Fix Version/s: FEST-Swing 1.2a4
-
Component/s: Swing
-
Labels:None
-
Number of attachments :
Description
From Jan Zuchhold:
I've just upgraded to FEST-Swing 1.2a2 but a test that enters some German umlauts into a JTextField breaks. I guess this has to do something with the recently added KeyStrokeMappingProvider_de.
I can reproduce this with something simple like this:
// Setup return new JTextField(); [...] // Exercise String expText = "äöüÄÖÜ"; JTextComponentFixture textBox = frameFixture.textBox(); textBox.enterText(expText); String actText = textBox.text(); // Verify assertEquals(actText, expText);
This gives me something like this:
FAILED: test_germanUmlautsWithFEST
java.lang.AssertionError: expected:<äöüÄÖÜ> but was:<#,8';(>
at de.fluxmed.magicform.FestTest$1.exerciseComponent(FestTest.java:42)
at
de.fluxmed.magicform.GuiTestBase$AbstractComponentTestTemplate.run(GuiTestBase.java:253)
at de.fluxmed.magicform.FestTest.test_germanUmlautsWithFEST(FestTest.java:44)
... Removed 27 stack frames
>>>
I don't know if you can see the expText value correctly with your locale, it should be like "aouAOU", but each character with two dots above.
This is on Debian GNU/Linux 4.0 with LANG=de_DE.UTF-8, java version "1.6.0_14".
From Jan Zuchhold:
I tried digging into the code. I used the ü-character (u with two dots above) as an example. This gets converted to "VK_OPEN_BRACKET, NO_MASK", which
results in a call "robot.keyPress(91)". This results in "8" being entered into the textbox.
Keyboard layouts:
http://en.wikipedia.org/wiki/File:KB_United_States-NoAltGr.svg
http://de.wikipedia.org/w/index.php?title=Datei:KB_Germany.svg&filetimestamp=20060815191327
US-"[" key is DE-"Ü" key. But the "8" means that it takes the DE-"8" key where "[" is located.
I hooked up a keylistener to the textfield to see what happens.
When the robot enters the key, I get the following events:
When I press the ü-key the following happens:
When I comment out the "ü"-Line in KeyStrokeMappingProvider_de the BasicRobot branches to the first path in type(char character), which works and enters the correct character.