Package tangowidget.util.listenerimpl

Examples of tangowidget.util.listenerimpl.InputListenerImpl


  }

  private void controlNumberValueChange(final JTextField jtf,
      final NumberScalarFieldCometeV2 widget, final Double value)
      throws DevFailed {
    final InputListenerImpl listenerTest = new InputListenerImpl();
    widget.addInputListener(listenerTest);

    Assert.assertTrue("Listener should not yet be called",
        listenerTest.getNotifyCount() == 0);

    writeInTextField(jtf, value.toString());
    Sleeper.SECONDS.sleep(1);

    assertTrue("InputListener has not been wake up on numberValueChange",
        listenerTest.isLaterNotified("numberValueChange", 5000L));
    assertTrue(
        "Value received in InputListener.numberValueChange is not the good one",
        value.equals(listenerTest.getNotification("numberValueChange")));

    // FIXME : Called 2 time in ATk
    // Assert.assertTrue("Listener should be called 6 times but called "
    // + listenerTest.getNotifyCount(),
    // listenerTest.getNotifyCount() == 6);
    Assert.assertTrue("numberValueChange method should be called",
        listenerTest.getNotification("numberValueChange").equals(value));
    Assert.assertTrue("numberValueChange method should be called",
        listenerTest.getNotification("numberValueChange").equals(value));

    // check if the listener is correctly removed
    widget.removeInputListener(listenerTest);
    listenerTest.reset();

    final Double newValue = value + value;
    writeInTextField(jtf, newValue.toString());

    assertFalse("InputListener has not been correctly removed",
        listenerTest.isLaterNotified("numberValueChange", 5000L));
  }
View Full Code Here


  }

  private void controlNumberValueChange(final JTextField jtf,
      final NumberScalarFieldCometeV2 widget, final Double value)
      throws DevFailed {
    final InputListenerImpl listenerTest = new InputListenerImpl();
    widget.addInputListener(listenerTest);

    Assert.assertTrue("Listener should not yet be called",
        listenerTest.getNotifyCount() == 0);

    writeInTextField(jtf, value.toString());
    Sleeper.SECONDS.sleep(1);

    assertTrue("InputListener has not been wake up on numberValueChange",
        listenerTest.isLaterNotified("numberValueChange", 5000L));
    assertTrue(
        "Value received in InputListener.numberValueChange is not the good one",
        value.equals(listenerTest.getNotification("numberValueChange")));

    Assert.assertTrue("Listener should be called 2 times",
        listenerTest.getNotifyCount() == 2);
    Assert.assertTrue("numberValueChange method should be called",
        listenerTest.getNotification("numberValueChange").equals(value));
    Assert.assertTrue("numberValueChange method should be called",
        listenerTest.getNotification("numberValueChange").equals(value));

    // check if the listener is correctly removed
    widget.removeInputListener(listenerTest);
    listenerTest.reset();

    final Double newValue = value + value;
    writeInTextField(jtf, newValue.toString());

    assertFalse("InputListener has not been correctly removed",
        listenerTest.isLaterNotified("numberValueChange", 5000L));
  }
View Full Code Here

        final AttributeBooleanCheckBox widget = new AttributeBooleanCheckBox.Builder(m_deviceName,
                attribute).jframe(jf1).build();
        Sleeper.SECONDS.sleep(3);

        final InputListenerImpl listenerTest = new InputListenerImpl();
        widget.addInputListener(listenerTest);

        Assert.assertTrue("Listener should not yet be called", listenerTest.getNotifyCount() == 0);

        tth.click(widget);
        Sleeper.SECONDS.sleep(1);

        Assert.assertTrue("Listener should be called 3 times", listenerTest.getNotifyCount() == 3);
        Assert.assertTrue("stringValueChange method shoud be called",
                listenerTest.getNotification("stringValueChange").equals("true"));
        Assert.assertTrue("numberValueChange method should be called", listenerTest
                .getNotification("numberValueChange").equals(new Double(1.0)));
        Assert.assertTrue("booleanValueChange method should be called", listenerTest
                .getNotification("booleanValueChange").equals(true));

        widget.removeInputListener(listenerTest);
        listenerTest.reset();

        Sleeper.SECONDS.sleep(1);

        Assert.assertTrue("Listener should not be called", listenerTest.getNotifyCount() == 0);

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

TOP

Related Classes of tangowidget.util.listenerimpl.InputListenerImpl

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.