Package tangowidget.util.listenerimpl

Examples of tangowidget.util.listenerimpl.ActionListenerImpl


        deviceValue);
    // FIXME : stateChange return null instead of VALID
    // assertThat((String) listenerTest.getNotification("stateChange"))
    // .isEqualTo("VALID");

    final ActionListenerImpl ali = new ActionListenerImpl();
    final IconButton button = abb.getIconButton();
    button.addActionListener(ali);
    final JButton b = (JButton) this.tth.findFirstComponent(JButton.class,
        this.jf1);
    this.tth.click(b);
    Sleeper.SECONDS.sleep(3);
    assertThat(ali.getNotifyCount()).isEqualTo(1);
    button.removeActionListener(ali);
    Sleeper.SECONDS.sleep(3);
    ali.reset();
    this.tth.click(b);
    Sleeper.SECONDS.sleep(3);
    assertThat(ali.getNotifyCount()).isEqualTo(0);
    // clean
    abb.stop();
    jf1.dispose();
  }
View Full Code Here


        final DeviceStateButtonCometeV2 widget = new DeviceStateButtonCometeV2.Builder(m_deviceName).jframe(jf1)
                .build();
        Sleeper.SECONDS.sleep(2);

        final ActionListenerImpl listenerSpy = new ActionListenerImpl();
        widget.addActionListener(listenerSpy);

        final JButton button = (JButton) tth.findFirstComponent(JButton.class, jf1);
        assertThat(button).isNotNull();
        tth.click(button);

        assertThat(listenerSpy.isLaterNotified("actionPerformed", 3000)).isTrue();
        // check listener is notify only one time.
        Sleeper.SECONDS.sleep(2);
        assertThat(listenerSpy.getNotifyCount()).isEqualTo(1);

        widget.removeActionListener(listenerSpy);
        listenerSpy.reset();

        tth.click(button);
        Sleeper.SECONDS.sleep(3);
        assertThat(listenerSpy.getNotifyCount()).isZero();

        // clean
        widget.stop();
        jf1.dispose();
View Full Code Here

TOP

Related Classes of tangowidget.util.listenerimpl.ActionListenerImpl

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.