final JLChart chart = (JLChart) tth.findFirstComponent(JLChart.class,
jf1);
Assert.assertTrue("JLChart component not found", chart != null);
final ITableListenerImpl listenerTest = new ITableListenerImpl();
widget.addTableListener(listenerTest);
tth.mouseClickOnComponent(chart);
Sleeper.SECONDS.sleep(5);
final int notifCount = listenerTest.getNotifyCount();
Assert.assertTrue("listener has been notified " + notifCount
+ " instead of 6 times ", notifCount == 6);
Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)") != null);
Assert.assertTrue(listenerTest
.getNotification("selectedXChanged(double)") != null);
Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)") != null);
Assert.assertTrue(listenerTest
.getNotification("selectedYChanged(double)") != null);
Assert.assertTrue(listenerTest.getNotification("selectedPointChanged") != null);
// le clic est effectu� au milieu du composant
final double xClick = xData[xData.length / 2]; // le spectre en x est
// lin�aire
final double yClick = yData[yData.length / 2];
// Assert.assertTrue(listenerTest.getNotification("selectedXChanged(int)").equals((int)xClick));
// Assert.assertTrue(listenerTest.getNotification("selectedXChanged(double)").equals(xClick));
// Assert.assertTrue(listenerTest.getNotification("selectedYChanged(int)").equals((int)yClick));
// Assert.assertTrue(listenerTest.getNotification("selectedYChanged(double)").equals(yClick));
widget.removeTableListener(listenerTest);
listenerTest.reset();
tth.mouseClickOnComponent(chart);
Sleeper.SECONDS.sleep(1);
Assert.assertTrue("listener should not be notified",
listenerTest.getNotifyCount() == 0);
// clean
widget.stop();
jf1.dispose();
}