use of com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider in project lttng-scope by lttng.
the class TimeGraphWidgetDrawnEventsTest method testRegisteredButNotEnabledProvider.
/**
* Test that a provider that is not registered but (somehow) enabled does
* not paint its event.
*/
@Test
public void testRegisteredButNotEnabledProvider() {
TimeGraphDrawnEventProvider provider1 = new StubDrawnEventProvider1();
TimeGraphDrawnEventProvider provider2 = new StubDrawnEventProvider2();
MANAGER.getRegisteredProviders().add(provider1);
MANAGER.getRegisteredProviders().add(provider2);
provider1.enabledProperty().set(false);
provider2.enabledProperty().set(true);
repaint();
Collection<Shape> events = getRenderedEvents();
assertEquals(StubDrawnEventProvider2.NB_SYMBOLS, events.size());
}
use of com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider in project lttng-scope by lttng.
the class TimeGraphWidgetDrawnEventsTest method testEnabledButNotRegisteredProvider.
/**
* Test that a provider that is registered but not enabled does not paint
* its events.
*/
@Test
public void testEnabledButNotRegisteredProvider() {
TimeGraphDrawnEventProvider provider = new StubDrawnEventProvider1();
provider.enabledProperty().set(true);
repaint();
Collection<Shape> events = getRenderedEvents();
assertTrue(events.isEmpty());
}
use of com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider in project lttng-scope by lttng.
the class TimeGraphWidgetDrawnEventsTest method testManyProviders.
/**
* Test several enabled+registered providers at the same time. They should
* all paint their own events.
*/
@Test
public void testManyProviders() {
TimeGraphDrawnEventProvider provider1 = new StubDrawnEventProvider1();
TimeGraphDrawnEventProvider provider2 = new StubDrawnEventProvider2();
MANAGER.getRegisteredProviders().add(provider1);
MANAGER.getRegisteredProviders().add(provider2);
provider1.enabledProperty().set(true);
provider2.enabledProperty().set(true);
repaint();
Collection<Shape> events = getRenderedEvents();
assertEquals(StubDrawnEventProvider1.NB_SYMBOLS + StubDrawnEventProvider2.NB_SYMBOLS, events.size());
}
use of com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider in project lttng-scope by lttng.
the class TimeGraphWidgetDrawnEventsTest method testEnabling.
/**
* Test changing the 'enabled' property of a provider from false to true.
* This should result in new events being painted.
*/
@Test
public void testEnabling() {
TimeGraphDrawnEventProvider provider = new StubDrawnEventProvider1();
MANAGER.getRegisteredProviders().add(provider);
provider.enabledProperty().set(false);
repaint();
Collection<Shape> events = getRenderedEvents();
assertTrue(events.isEmpty());
provider.enabledProperty().set(true);
repaint();
events = getRenderedEvents();
assertEquals(StubDrawnEventProvider1.NB_SYMBOLS, events.size());
}
use of com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider in project lttng-scope by lttng.
the class TimeGraphWidgetDrawnEventsTest method testRegisteredAndEnabledProvider.
/**
* Test one registered and enabled provider.
*/
@Test
public void testRegisteredAndEnabledProvider() {
TimeGraphDrawnEventProvider provider = new StubDrawnEventProvider1();
MANAGER.getRegisteredProviders().add(provider);
provider.enabledProperty().set(true);
repaint();
Collection<Shape> events = getRenderedEvents();
assertEquals(StubDrawnEventProvider1.NB_SYMBOLS, events.size());
}
Aggregations