Search in sources :

Example 1 with TimeGraphDrawnEventProvider

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());
}
Also used : StubDrawnEventProvider1(org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider1) StubDrawnEventProvider2(org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider2) Shape(javafx.scene.shape.Shape) TimeGraphDrawnEventProvider(com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider) Test(org.junit.Test)

Example 2 with TimeGraphDrawnEventProvider

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());
}
Also used : StubDrawnEventProvider1(org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider1) Shape(javafx.scene.shape.Shape) TimeGraphDrawnEventProvider(com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider) Test(org.junit.Test)

Example 3 with TimeGraphDrawnEventProvider

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());
}
Also used : StubDrawnEventProvider1(org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider1) StubDrawnEventProvider2(org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider2) Shape(javafx.scene.shape.Shape) TimeGraphDrawnEventProvider(com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider) Test(org.junit.Test)

Example 4 with TimeGraphDrawnEventProvider

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());
}
Also used : StubDrawnEventProvider1(org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider1) Shape(javafx.scene.shape.Shape) TimeGraphDrawnEventProvider(com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider) Test(org.junit.Test)

Example 5 with TimeGraphDrawnEventProvider

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());
}
Also used : StubDrawnEventProvider1(org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider1) Shape(javafx.scene.shape.Shape) TimeGraphDrawnEventProvider(com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider) Test(org.junit.Test)

Aggregations

TimeGraphDrawnEventProvider (com.efficios.jabberwocky.views.timegraph.model.provider.drawnevents.TimeGraphDrawnEventProvider)6 Shape (javafx.scene.shape.Shape)6 Test (org.junit.Test)6 StubDrawnEventProvider1 (org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider1)6 StubDrawnEventProvider2 (org.lttng.scope.views.timeline.widgets.timegraph.StubDrawnEventProviders.StubDrawnEventProvider2)2