FEST

German umlauts not working since upgrade from 1.1->1.2a2

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major 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 :
    0

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".

Activity

Hide
Alex Ruiz added a comment -

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:

java.awt.event.KeyEvent[KEY_PRESSED,keyCode=56,keyText=8,keyChar='8',keyLocation=KEY_LOCATION_STANDARD,rawCode=17,primaryLevelUnicode=56,scancode=0]
java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='8',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=56,scancode=0]
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=56,keyText=8,keyChar='8',keyLocation=KEY_LOCATION_STANDARD,rawCode=17,primaryLevelUnicode=56,scancode=0]

When I press the ü-key the following happens:

java.awt.event.KeyEvent[KEY_PRESSED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='ü',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=34,primaryLevelUnicode=252,scancode=0]
java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='ü',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=252,scancode=0]
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='ü',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=34,primaryLevelUnicode=252,scancode=0]

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.

Show
Alex Ruiz added a comment - 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:
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=56,keyText=8,keyChar='8',keyLocation=KEY_LOCATION_STANDARD,rawCode=17,primaryLevelUnicode=56,scancode=0]
java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='8',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=56,scancode=0]
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=56,keyText=8,keyChar='8',keyLocation=KEY_LOCATION_STANDARD,rawCode=17,primaryLevelUnicode=56,scancode=0]
When I press the ü-key the following happens:
java.awt.event.KeyEvent[KEY_PRESSED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='ü',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=34,primaryLevelUnicode=252,scancode=0]
java.awt.event.KeyEvent[KEY_TYPED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='ü',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=0,primaryLevelUnicode=252,scancode=0]
java.awt.event.KeyEvent[KEY_RELEASED,keyCode=0,keyText=Unknown keyCode:
0x0,keyChar='ü',keyLocation=KEY_LOCATION_UNKNOWN,rawCode=34,primaryLevelUnicode=252,scancode=0]
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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: