Loading ...
Sorry, an error occurred while loading the content.

Re: Test-First Challenge, Part 5

Expand Messages
  • ipreussde
    ... work. ... This test is not complete - if you extend it by listener.wasNotified = false; frame.table.changeSelection(1, 2, false, false);
    Message 1 of 2 , Jan 31, 2002
    • 0 Attachment
      > // I expect this test to pass; it verifies how I think listeners
      work.
      > // You might call it a spike and omit it.
      >
      > public void testThatSelectionsNotifyListeners() {
      > TestSelectionListener listener = new TestSelectionListener();
      > frame.table.getSelectionModel().addListSelectionListener
      > (listener);
      >
      > assertTrue (!listener.wasNotified);
      >
      > frame.table.changeSelection (3, 2, false, false);
      >
      > assertTrue (listener.wasNotified);
      >
      >
      > listener.wasNotified = false;
      > frame.table.changeSelection (1, 1, false, false);
      > assertTrue (listener.wasNotified);
      > }

      This test is not complete - if you extend it by

      listener.wasNotified = false;
      frame.table.changeSelection(1, 2, false, false);
      assertTrue(listener.wasNotified);

      it will fail, as ListSelectionListeners only get notified about
      changes in selected rows!

      Kind Regards, Ilja
    Your message has been successfully submitted and would be delivered to recipients shortly.