Package tangowidget.command.listener

Examples of tangowidget.command.listener.CommandListenerImpl


    final String[] values = new String[] { "1.0", "2.0", "3.0", "4.0" };

    widget.setArginValuesList(values);
    Sleeper.SECONDS.sleep(3);

    final CommandListenerImpl listenerSpy = new CommandListenerImpl();
    widget.addCommandListener(listenerSpy);

    tth.click(getButton(widget));

    // scalar must not be notify
    assertThat(
        listenerSpy.isLaterNotified("resultNumberScalarValueChange",
            2000)).isFalse();

    assertThat(
        listenerSpy.isLaterNotified("resultStringScalarValueChange",
            2000)).isFalse();

    assertThat(
        listenerSpy.isLaterNotified("resultBooleanValueChange", 2000))
        .isFalse();
    assertThat(
        listenerSpy.isLaterNotified(
            "resultSpectrumValueChange(String)", 2000)).isTrue();

    assertThat(
        listenerSpy.isLaterNotified(
            "resultSpectrumValueChange(String[])", 2000)).isTrue();
    // check listener is notify only one time.
    Sleeper.SECONDS.sleep(2);
    assertThat(listenerSpy.getNotifyCount()).isEqualTo(2);

    // check values
    assertThat(

    listenerSpy.getNotification("resultSpectrumValueChange(String)"))
        .isEqualTo("1.0,2.0,3.0,4.0,");

    final String[] res = (String[]) listenerSpy
        .getNotification("resultSpectrumValueChange(String[])");

    assertThat(res).isEqualTo(values);

    // remove listener and check is no more notify
    widget.removeCommandListener(listenerSpy);
    listenerSpy.reset();
    tth.click(getButton(widget));

    assertEquals("listener shoudn't be notify", 0,
        listenerSpy.getNotifyCount());

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


    // test command with argument is correctly executed
    widget.setArgin("1");
    Sleeper.SECONDS.sleep(3);

    final CommandListenerImpl listenerSpy = new CommandListenerImpl();
    widget.addCommandListener(listenerSpy);

    // FIXME : Work on manual test but don't with this one
    // tth.click(getButton(widget));
    // Sleeper.SECONDS.sleep(2);
View Full Code Here

TOP

Related Classes of tangowidget.command.listener.CommandListenerImpl

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.