assertj / assertj-swing

Fluent assertions for Swing apps
Other
108 stars 52 forks source link

Add support for Danish locale #114

Open croesch opened 10 years ago

croesch commented 10 years ago

Issue by Morten Breum Mikkelsen from Sun, 29 Nov 2009 13:36:22 -0600 Originally opened as http://jira.codehaus.org/browse/FEST-263


The following code coughs on the exception pasted below:

    public static void main(String[] args) {

        Robot robot = BasicRobot.robotWithNewAwtHierarchy();

        JFrame frame = new JFrame("Fest rules");
        frame.getContentPane().add(new JTextField());
        frame.setName("theFrame");
        frame.pack();
        frame.setVisible(true);

        FrameFixture ff = WindowFinder.findFrame("theFrame").using(robot);
        ff.textBox().enterText("+1234");
    }
Exception in thread "main" java.lang.IllegalArgumentException: Invalid key code '61'
    at org.fest.swing.core.RobotEventGenerator.pressKey(RobotEventGenerator.java:118)
    at org.fest.swing.core.BasicRobot.doPressKey(BasicRobot.java:597)
    at org.fest.swing.core.BasicRobot.keyPressAndRelease(BasicRobot.java:582)
    at org.fest.swing.core.BasicRobot.type(BasicRobot.java:553)
    at org.fest.swing.core.BasicRobot.enterText(BasicRobot.java:536)
    at org.fest.swing.driver.JTextComponentDriver.enterText(JTextComponentDriver.java:128)
    at org.fest.swing.fixture.JTextComponentFixture.enterText(JTextComponentFixture.java:209)

------------

It's not worse than one can call .pressAndReleaseKeys() instead, but it's less fluent.

I'm not sure if it's related to FEST-232 or not...


votes (original issue): 0 watches (original issue): 1

croesch commented 10 years ago

Comment by femalenerd from Wed, 26 Oct 2011 07:22:34 -0500


Attachment KeyStrokeMappingProvider_da.java (size=6994)

croesch commented 10 years ago

Comment by alexruiz from Sun, 29 Nov 2009 18:19:42 -0600


Hi Morten,

Thanks for reporting this issue!

Are you using French locale? Just curious, since you think it may be related to FEST-232

Thanks!
-Alex

croesch commented 10 years ago

Comment by mortenbreum from Mon, 30 Nov 2009 02:29:19 -0600


Hi Alex.
No, I'm in Denmark using Danish locale.
I didn't go into details about FEST-232 - this thing, I found about a month ago - it's just the 232 popping up on the mailing list that reminded me about it.
/Morten

croesch commented 10 years ago

Comment by femalenerd from Wed, 26 Oct 2011 07:22:34 -0500


I have attached a KeyStrokeMappingProvider that maps to a Danish keyboard.
It's yours to commit