Package abbot.tester

Examples of abbot.tester.ComponentTester$AWTMenuListener


            }
        }
        // Scan the corresponding component tester for additional property
        // methods
        try {
            ComponentTester tester = componentClass != null
                ? ComponentTester.getTester(componentClass)
                : (ComponentTester)testerClass.newInstance();
            Iterator iter = getComponentTesterMethods(tester).iterator();
            while (iter.hasNext()) {
                Method m = (Method)iter.next();
View Full Code Here


        }
        assertTrue("Annotation should not automatically close",
                   ann.isShowing());
        assertTrue("Annotation should block execution while displaying",
                   ann.isRunning);
        ComponentTester tester = new ComponentTester();
        Component button =
            getFinder().find(w, new ClassMatcher(JButton.class));
        tester.actionClick(button);
        // Give the annotation thread time to clean up
        Timer timer = new Timer();
        while (ann.isShowing()) {
            getRobot().sleep();
            if (timer.elapsed() > 1000)
View Full Code Here

                processed.put(methods[i].getName(), methods[i]);
            }
        }
        // Now look up propert accessors provided by the corresponding
        // ComponentTester class.
        ComponentTester tester = ComponentTester.getTester(cls);
        methods = tester.getPropertyMethods();
        for (int i=0;i < methods.length;i++) {
            if (!processed.containsKey(methods[i].getName())) {
                // Properties provided by the ComponentTester are never
                // filtered.
                processed.put(methods[i].getName(), methods[i]);
View Full Code Here

        final JTextField tf = new JTextField();
        tf.setColumns(10);
        KeyWatcher kw = new KeyWatcher();
        tf.addKeyListener(kw);
        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

            KeyEvent.VK_CAPS_LOCK,
            KeyEvent.VK_NUM_LOCK,
            KeyEvent.VK_SCROLL_LOCK,
            KeyEvent.VK_KANA_LOCK,
        };
  ComponentTester tester = new ComponentTester();
        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);
                }
                finally {
                    tester.actionKeyStroke(CODES[i]);
                }
            }
            catch(UnsupportedOperationException e) {
                // ignore
            }
View Full Code Here

TOP

Related Classes of abbot.tester.ComponentTester$AWTMenuListener

Copyright © 2018 www.massapicom. 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.