Search in sources :

Example 1 with LayerEventFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture in project nebula.widgets.nattable by eclipse.

the class EventConflaterChainTest method shouldStartUpAllConflaterTasksAtTheEndOfTheInterval.

@Test
public void shouldStartUpAllConflaterTasksAtTheEndOfTheInterval() throws Exception {
    this.conflaterChain.start();
    this.conflaterChain.addEvent(new LayerEventFixture());
    this.conflaterChain.addEvent(new LayerEventFixture());
    Thread.sleep(100);
    assertEquals(0, this.conflater1.getCount());
    assertEquals(0, this.conflater2.getCount());
}
Also used : LayerEventFixture(org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture) Test(org.junit.Test)

Example 2 with LayerEventFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture in project nebula.widgets.nattable by eclipse.

the class VisualChangeEventConflaterTest method shouldAccumulateEvents.

@Test
public void shouldAccumulateEvents() throws Exception {
    NatTableFixture natTable = new NatTableFixture();
    VisualChangeEventConflater conflater = new VisualChangeEventConflater(natTable);
    EventConflaterChain chain = new EventConflaterChain();
    chain.add(conflater);
    conflater.addEvent(new LayerEventFixture());
    conflater.addEvent(new LayerEventFixture());
    assertEquals(2, conflater.getCount());
    chain.start();
    Thread.sleep(EventConflaterChain.DEFAULT_INITIAL_DELAY + 100);
    assertEquals(0, conflater.getCount());
}
Also used : NatTableFixture(org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture) LayerEventFixture(org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture) EventConflaterChain(org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain) VisualChangeEventConflater(org.eclipse.nebula.widgets.nattable.conflation.VisualChangeEventConflater) Test(org.junit.Test)

Example 3 with LayerEventFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture in project nebula.widgets.nattable by eclipse.

the class EventConflaterChainTest method shouldAddEventsToAllChildren.

@Test
public void shouldAddEventsToAllChildren() throws Exception {
    this.conflaterChain.addEvent(new LayerEventFixture());
    this.conflaterChain.addEvent(new LayerEventFixture());
    assertEquals(2, this.conflater1.getCount());
    assertEquals(2, this.conflater2.getCount());
}
Also used : LayerEventFixture(org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture) Test(org.junit.Test)

Example 4 with LayerEventFixture

use of org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture in project nebula.widgets.nattable by eclipse.

the class NatTableTest method shouldPassOnLayerEventsToListeners.

@Test
public void shouldPassOnLayerEventsToListeners() throws Exception {
    LayerListenerFixture listener = new LayerListenerFixture();
    this.natTable.addLayerListener(listener);
    this.natTable.handleLayerEvent(new LayerEventFixture());
    assertTrue(listener.containsInstanceOf(LayerEventFixture.class));
}
Also used : LayerEventFixture(org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture) LayerListenerFixture(org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture) Test(org.junit.Test)

Aggregations

LayerEventFixture (org.eclipse.nebula.widgets.nattable.test.fixture.LayerEventFixture)4 Test (org.junit.Test)4 EventConflaterChain (org.eclipse.nebula.widgets.nattable.conflation.EventConflaterChain)1 VisualChangeEventConflater (org.eclipse.nebula.widgets.nattable.conflation.VisualChangeEventConflater)1 NatTableFixture (org.eclipse.nebula.widgets.nattable.test.fixture.NatTableFixture)1 LayerListenerFixture (org.eclipse.nebula.widgets.nattable.test.fixture.layer.LayerListenerFixture)1