Ejemplo n.º 1
0
  @Test
  public void itemSetChangeListeners_table_shouldFire() throws SQLException {
    ItemSetChangeListener listener = EasyMock.createMock(ItemSetChangeListener.class);
    listener.containerItemSetChange(EasyMock.isA(ItemSetChangeEvent.class));
    EasyMock.replay(listener);

    container.addListener(listener);
    container.addItem();

    EasyMock.verify(listener);
  }
Ejemplo n.º 2
0
  @Test
  public void removeListener_table_shouldNotFire() throws SQLException {
    ItemSetChangeListener listener = EasyMock.createMock(ItemSetChangeListener.class);
    EasyMock.replay(listener);

    container.addListener(listener);
    container.removeListener(listener);
    container.addItem();

    EasyMock.verify(listener);
  }
Ejemplo n.º 3
0
  @Test
  public void itemSetChangeListeners_tableItemRemoved_shouldFire() throws SQLException {
    ItemSetChangeListener listener = EasyMock.createMock(ItemSetChangeListener.class);
    listener.containerItemSetChange(EasyMock.isA(ItemSetChangeEvent.class));
    EasyMock.expectLastCall().anyTimes();
    EasyMock.replay(listener);

    container.addListener(listener);
    container.removeItem(container.lastItemId());

    EasyMock.verify(listener);
  }