Package abbot.tester

Examples of abbot.tester.ComponentTester.actionKeyStroke()


        showFrame(tf);
  ComponentTester tester = new ComponentTester();
  tester.actionFocus(tf);
        int code = KeyEvent.VK_ESCAPE;
        int mods = 0;
  tester.actionKeyStroke(code, mods);
        assertTrue("Never received key press", kw.gotPress);
        assertTrue("Never received release", kw.gotRelease);
        assertEquals("Wrong key code", code, kw.code);
        assertEquals("Wrong modifiers", mods, kw.modifiers);
    }
View Full Code Here


        for (int i=0;i < CODES.length;i++) {
            try {
                boolean state = Toolkit.getDefaultToolkit().
                    getLockingKeyState(CODES[i]);
                try {
                    tester.actionKeyStroke(CODES[i]);
                    boolean state2 = Toolkit.getDefaultToolkit().
                        getLockingKeyState(CODES[i]);
                    assertEquals("Reported state of locking key '" + KEYS[i]
                                 + "' did not change",
                                 !state, state2);
View Full Code Here

                    assertEquals("Reported state of locking key '" + KEYS[i]
                                 + "' did not change",
                                 !state, state2);
                }
                finally {
                    tester.actionKeyStroke(CODES[i]);
                }
            }
            catch(UnsupportedOperationException e) {
                // ignore
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.