}
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));
}