use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class ExpressionContainerGridTest method testSelectCellWithPoint.
@Test
public void testSelectCellWithPoint() {
final Point2D point = mock(Point2D.class);
final LiteralExpression domainObject = mock(LiteralExpression.class);
when(hasExpression.asDMNModelInstrumentedBase()).thenReturn(domainObject);
grid.setExpression(NODE_UUID, hasExpression, Optional.of(hasName), false);
grid.selectCell(point, false, true);
verify(gridLayer).select(eq(grid));
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getCanvasHandler()).isEqualTo(canvasHandler);
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(domainObject);
verify(cellSelectionManager).selectCell(eq(point), eq(false), eq(true));
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class ExpressionContainerGridTest method testSelectCellWithCoordinatesNonDomainObject.
@Test
public void testSelectCellWithCoordinatesNonDomainObject() {
final int uiRowIndex = 0;
final int uiColumnIndex = 1;
grid.setExpression(NODE_UUID, hasExpression, Optional.of(hasName), false);
grid.selectCell(uiRowIndex, uiColumnIndex, false, true);
verify(gridLayer).select(eq(grid));
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getCanvasHandler()).isEqualTo(canvasHandler);
assertThat(domainObjectSelectionEvent.getDomainObject()).isInstanceOf(NOPDomainObject.class);
verify(cellSelectionManager).selectCell(eq(uiRowIndex), eq(uiColumnIndex), eq(false), eq(true));
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class ContextGridTest method assertDomainObjectSelection.
private void assertDomainObjectSelection(final DomainObject domainObject) {
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(domainObject);
}
use of org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent in project kie-wb-common by kiegroup.
the class BaseExpressionGridGeneralTest method testSetTypeRefConsumerWhenNotNested.
@Test
@SuppressWarnings("unchecked")
public void testSetTypeRefConsumerWhenNotNested() {
grid.fireDomainObjectSelectionEvent(decision);
reset(domainObjectSelectionEvent);
doTestSetTypeRefConsumer();
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 BaseExpressionGridGeneralTest method testClearValueConsumerWhenNotNested.
@Test
@SuppressWarnings("unchecked")
public void testClearValueConsumerWhenNotNested() {
grid.fireDomainObjectSelectionEvent(decision);
reset(domainObjectSelectionEvent);
doTestClearValueConsumer(false, DeleteHasValueCommand.class);
verify(gridLayer).batch();
verify(domainObjectSelectionEvent).fire(domainObjectSelectionEventCaptor.capture());
final DomainObjectSelectionEvent domainObjectSelectionEvent = domainObjectSelectionEventCaptor.getValue();
assertThat(domainObjectSelectionEvent.getDomainObject()).isEqualTo(decision);
assertThat(domainObjectSelectionEvent.getCanvasHandler()).isEqualTo(canvasHandler);
}
Aggregations