use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testSetValueConsumerWhenNotNested.
@Test
@SuppressWarnings("unchecked")
public void testSetValueConsumerWhenNotNested() {
grid.fireDomainObjectSelectionEvent(decision);
reset(domainObjectSelectionEvent);
doTestSetValueConsumer(false, SetHasValueCommand.class);
verify(gridLayer).batch();
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(decision);
assertThat(domainObjectSelectionEvent.getCanvasHandler()).isEqualTo(canvasHandler);
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class DomainObjectAwareLienzoMultipleSelectionControlTest method testSelectDomainObjectThenElement.
@Test
public void testSelectDomainObjectThenElement() {
final DomainObjectSelectionEvent domainObjectEvent = new DomainObjectSelectionEvent(canvasHandler, domainObject);
control.handleDomainObjectSelectedEvent(domainObjectEvent);
assertDomainObjectSelected();
final CanvasSelectionEvent elementEvent = new CanvasSelectionEvent(canvasHandler, ELEMENT_UUID);
control.handleCanvasElementSelectedEvent(elementEvent);
assertElementSelected();
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class DomainObjectAwareLienzoMultipleSelectionControlTest method testSelectDomainObjectThenDestroy.
@Test
public void testSelectDomainObjectThenDestroy() {
final DomainObjectSelectionEvent domainObjectEvent = new DomainObjectSelectionEvent(canvasHandler, domainObject);
control.handleDomainObjectSelectedEvent(domainObjectEvent);
assertDomainObjectSelected();
control.destroy();
assertThat(control.getSelectedItemDefinition()).isNotPresent();
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class DomainObjectAwareLienzoMultipleSelectionControlTest method testSelectNullDomainObjectWithEvent.
@Test
@SuppressWarnings("unchecked")
public void testSelectNullDomainObjectWithEvent() {
final DomainObjectSelectionEvent event = new DomainObjectSelectionEvent(canvasHandler, null);
control.handleDomainObjectSelectedEvent(event);
final Optional<Object> selectedItemDefinition = control.getSelectedItemDefinition();
assertThat(selectedItemDefinition).isNotPresent();
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class PropertiesPanelNotifierTest method testOnDomainObjectSelectionEvent.
@Test
public void testOnDomainObjectSelectionEvent() {
final DomainObjectSelectionEvent selectionEvent = mock(DomainObjectSelectionEvent.class);
final DomainObject domainObject = mock(DomainObject.class);
final String uuid = "uuid";
when(selectionEvent.getDomainObject()).thenReturn(domainObject);
when(domainObject.getDomainObjectUUID()).thenReturn(uuid);
notifier.onDomainObjectSelectionEvent(selectionEvent);
verify(notifier).setSelectedElementUUID(uuid);
}
Aggregations