Search in sources :

Example 6 with ValueAndDataTypeHeaderMetaData

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testSetDisplayNameMultipleOutputClauseWithNonEmptyValue.

@Test
@SuppressWarnings("unchecked")
public void testSetDisplayNameMultipleOutputClauseWithNonEmptyValue() {
    setupGrid(makeHasNameForDecision(), 0);
    final String defaultName = "default-name";
    final Consumer<ValueAndDataTypeHeaderMetaData> test = (md) -> md.setValue(new Name(NAME_NEW));
    addOutputClause(3);
    final ArgumentCaptor<CompositeCommand> compositeCommandCaptor1 = ArgumentCaptor.forClass(CompositeCommand.class);
    hasExpression.getName().setValue(defaultName);
    expression.get().getOutput().get(0).setName(defaultName);
    assertHeaderMetaDataTest(0, 2, test, compositeCommandCaptor1, SetHasValueCommand.class, UpdateElementPropertyCommand.class);
    compositeCommandCaptor1.getValue().execute(canvasHandler);
    assertThat(hasExpression.getName().getValue()).isEqualTo(NAME_NEW);
    assertThat(expression.get().getOutput().get(0).getName()).isEqualTo(defaultName);
    final ArgumentCaptor<CompositeCommand> compositeCommandCaptor2 = ArgumentCaptor.forClass(CompositeCommand.class);
    hasExpression.getName().setValue(defaultName);
    expression.get().getOutput().get(0).setName(defaultName);
    assertHeaderMetaDataTest(1, 2, test, compositeCommandCaptor2, SetHasValueCommand.class);
    compositeCommandCaptor2.getValue().execute(canvasHandler);
    assertThat(hasExpression.getName().getValue()).isEqualTo(defaultName);
    assertThat(expression.get().getOutput().get(0).getName()).isEqualTo(NAME_NEW);
    final ArgumentCaptor<CompositeCommand> compositeCommandCaptor3 = ArgumentCaptor.forClass(CompositeCommand.class);
    hasExpression.getName().setValue(defaultName);
    expression.get().getOutput().get(1).setName(defaultName);
    assertHeaderMetaDataTest(0, 3, test, compositeCommandCaptor3, SetHasValueCommand.class, UpdateElementPropertyCommand.class);
    compositeCommandCaptor3.getValue().execute(canvasHandler);
    assertThat(hasExpression.getName().getValue()).isEqualTo(NAME_NEW);
    assertThat(expression.get().getOutput().get(1).getName()).isEqualTo(defaultName);
    final ArgumentCaptor<CompositeCommand> compositeCommandCaptor4 = ArgumentCaptor.forClass(CompositeCommand.class);
    hasExpression.getName().setValue(defaultName);
    expression.get().getOutput().get(1).setName(defaultName);
    assertHeaderMetaDataTest(1, 3, test, compositeCommandCaptor4, SetHasValueCommand.class);
    compositeCommandCaptor4.getValue().execute(canvasHandler);
    assertThat(hasExpression.getName().getValue()).isEqualTo(defaultName);
    assertThat(expression.get().getOutput().get(0).getName()).isEqualTo(NAME_NEW);
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) UpdateElementPropertyCommand(org.kie.workbench.common.stunner.core.client.canvas.command.UpdateElementPropertyCommand) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) ListSelectorView(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.ListSelectorView) DMNGridLayer(org.kie.workbench.common.dmn.client.widgets.layer.DMNGridLayer) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) SetTypeRefCommand(org.kie.workbench.common.dmn.client.commands.general.SetTypeRefCommand) InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) GridLayerRedrawManager(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager) GridFactoryCommandUtils(org.kie.workbench.common.dmn.client.editors.expressions.types.GridFactoryCommandUtils) DeleteDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteDecisionRuleCommand) Mockito.doAnswer(org.mockito.Mockito.doAnswer) DeleteOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteOutputClauseCommand) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) SetCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand) Index(org.kie.workbench.common.stunner.core.graph.processing.index.Index) NOPDomainObject(org.kie.workbench.common.dmn.api.definition.NOPDomainObject) HitPolicy(org.kie.workbench.common.dmn.api.definition.model.HitPolicy) OutputClause(org.kie.workbench.common.dmn.api.definition.model.OutputClause) DeleteCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteCellValueCommand) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) AddInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand) SetHitPolicyCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetHitPolicyCommand) GridBodyCellEditContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellEditContext) DMNDiagramUtils(org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils) GraphCommandExecutionContext(org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext) ValueAndDataTypePopoverView(org.kie.workbench.common.dmn.client.editors.types.ValueAndDataTypePopoverView) Mockito.mock(org.mockito.Mockito.mock) SetHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetHasValueCommand) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) Mock(org.mockito.Mock) HitPolicyPopoverView(org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.hitpolicy.HitPolicyPopoverView) RunWith(org.junit.runner.RunWith) AbsolutePanel(com.google.gwt.user.client.ui.AbsolutePanel) Mockito.spy(org.mockito.Mockito.spy) DMNSession(org.kie.workbench.common.dmn.client.session.DMNSession) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) Context(org.kie.workbench.common.dmn.api.definition.model.Context) Command(org.uberfire.mvp.Command) Before(org.junit.Before) TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) SessionCommandManager(org.kie.workbench.common.stunner.core.client.command.SessionCommandManager) DeleteInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteInputClauseCommand) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Mockito.never(org.mockito.Mockito.never) DomainObjectSelectionEvent(org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent) Assert.assertNull(org.junit.Assert.assertNull) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Mockito.reset(org.mockito.Mockito.reset) Assert.assertEquals(org.junit.Assert.assertEquals) DMNGraphUtils(org.kie.workbench.common.dmn.client.graph.DMNGraphUtils) CellEditorControlsView(org.kie.workbench.common.dmn.client.widgets.grid.controls.container.CellEditorControlsView) DefinitionUtils(org.kie.workbench.common.stunner.core.util.DefinitionUtils) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseExpressionGrid(org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid) AddDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddDecisionRuleCommand) ItemDefinitionUtils(org.kie.workbench.common.dmn.client.editors.types.common.ItemDefinitionUtils) Mockito.atLeast(org.mockito.Mockito.atLeast) AddOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddOutputClauseCommand) ContextEntry(org.kie.workbench.common.dmn.api.definition.model.ContextEntry) DecisionRule(org.kie.workbench.common.dmn.api.definition.model.DecisionRule) AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) DomainObject(org.kie.workbench.common.stunner.core.domainobject.DomainObject) GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) CanvasCommand(org.kie.workbench.common.stunner.core.client.command.CanvasCommand) List(java.util.List) DMNDiagramsSession(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramsSession) HasValueAndTypeRef(org.kie.workbench.common.dmn.client.editors.types.HasValueAndTypeRef) BaseGridCellValue(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue) DefaultCanvasCommandFactory(org.kie.workbench.common.dmn.client.commands.factory.DefaultCanvasCommandFactory) InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) BuiltInType(org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType) Optional(java.util.Optional) EventSourceMock(org.uberfire.mocks.EventSourceMock) SetBuiltinAggregatorCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetBuiltinAggregatorCommand) DecisionTable(org.kie.workbench.common.dmn.api.definition.model.DecisionTable) DeleteHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteHasValueCommand) Node(org.kie.workbench.common.stunner.core.graph.Node) IntStream(java.util.stream.IntStream) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Viewport(com.ait.lienzo.client.core.shape.Viewport) HasListSelectorControl(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl) CanvasCommandResultBuilder(org.kie.workbench.common.stunner.core.client.command.CanvasCommandResultBuilder) BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator) Function(java.util.function.Function) Captor(org.mockito.Captor) ExpressionEditorChanged(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorChanged) RefreshFormPropertiesEvent(org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) LienzoMockitoTestRunner(com.ait.lienzo.test.LienzoMockitoTestRunner) ArgumentCaptor(org.mockito.ArgumentCaptor) ReadOnlyProvider(org.kie.workbench.common.stunner.core.client.ReadOnlyProvider) Element(org.kie.workbench.common.stunner.core.graph.Element) SessionManager(org.kie.workbench.common.stunner.core.client.api.SessionManager) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) DMNEditorConstants(org.kie.workbench.common.dmn.client.resources.i18n.DMNEditorConstants) DMNGridPanel(org.kie.workbench.common.dmn.client.widgets.panel.DMNGridPanel) InputClauseLiteralExpression(org.kie.workbench.common.dmn.api.definition.model.InputClauseLiteralExpression) CanvasViolation(org.kie.workbench.common.stunner.core.client.command.CanvasViolation) Iterator(java.util.Iterator) Mockito.when(org.mockito.Mockito.when) Definition(org.kie.workbench.common.stunner.core.graph.content.definition.Definition) Mockito.verify(org.mockito.Mockito.verify) Consumer(java.util.function.Consumer) Mockito(org.mockito.Mockito) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Text(org.kie.workbench.common.dmn.api.property.dmn.Text) Decision(org.kie.workbench.common.dmn.api.definition.model.Decision) CompositeCommand(org.kie.workbench.common.stunner.core.command.impl.CompositeCommand) Collections(java.util.Collections) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) CompositeCommand(org.kie.workbench.common.stunner.core.command.impl.CompositeCommand) Test(org.junit.Test)

Example 7 with ValueAndDataTypeHeaderMetaData

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testSetDisplayNameSingleOutputClauseWithEmptyValue.

@Test
@SuppressWarnings("unchecked")
public void testSetDisplayNameSingleOutputClauseWithEmptyValue() {
    setupGrid(makeHasNameForDecision(), 0);
    final Consumer<ValueAndDataTypeHeaderMetaData> test = (md) -> md.setValue(new Name());
    assertHeaderMetaDataTest(0, 2, test, DeleteHasValueCommand.class, DeleteHasValueCommand.class, UpdateElementPropertyCommand.class);
    compositeCommandCaptor.getValue().execute(canvasHandler);
    assertThat(hasExpression.getName().getValue()).isEqualTo("");
    assertThat(expression.get().getOutput().get(0).getName()).isEqualTo("");
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) UpdateElementPropertyCommand(org.kie.workbench.common.stunner.core.client.canvas.command.UpdateElementPropertyCommand) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) ListSelectorView(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.ListSelectorView) DMNGridLayer(org.kie.workbench.common.dmn.client.widgets.layer.DMNGridLayer) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) SetTypeRefCommand(org.kie.workbench.common.dmn.client.commands.general.SetTypeRefCommand) InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) GridLayerRedrawManager(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager) GridFactoryCommandUtils(org.kie.workbench.common.dmn.client.editors.expressions.types.GridFactoryCommandUtils) DeleteDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteDecisionRuleCommand) Mockito.doAnswer(org.mockito.Mockito.doAnswer) DeleteOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteOutputClauseCommand) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) SetCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand) Index(org.kie.workbench.common.stunner.core.graph.processing.index.Index) NOPDomainObject(org.kie.workbench.common.dmn.api.definition.NOPDomainObject) HitPolicy(org.kie.workbench.common.dmn.api.definition.model.HitPolicy) OutputClause(org.kie.workbench.common.dmn.api.definition.model.OutputClause) DeleteCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteCellValueCommand) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) AddInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand) SetHitPolicyCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetHitPolicyCommand) GridBodyCellEditContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellEditContext) DMNDiagramUtils(org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils) GraphCommandExecutionContext(org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext) ValueAndDataTypePopoverView(org.kie.workbench.common.dmn.client.editors.types.ValueAndDataTypePopoverView) Mockito.mock(org.mockito.Mockito.mock) SetHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetHasValueCommand) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) Mock(org.mockito.Mock) HitPolicyPopoverView(org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.hitpolicy.HitPolicyPopoverView) RunWith(org.junit.runner.RunWith) AbsolutePanel(com.google.gwt.user.client.ui.AbsolutePanel) Mockito.spy(org.mockito.Mockito.spy) DMNSession(org.kie.workbench.common.dmn.client.session.DMNSession) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) Context(org.kie.workbench.common.dmn.api.definition.model.Context) Command(org.uberfire.mvp.Command) Before(org.junit.Before) TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) SessionCommandManager(org.kie.workbench.common.stunner.core.client.command.SessionCommandManager) DeleteInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteInputClauseCommand) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Mockito.never(org.mockito.Mockito.never) DomainObjectSelectionEvent(org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent) Assert.assertNull(org.junit.Assert.assertNull) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Mockito.reset(org.mockito.Mockito.reset) Assert.assertEquals(org.junit.Assert.assertEquals) DMNGraphUtils(org.kie.workbench.common.dmn.client.graph.DMNGraphUtils) CellEditorControlsView(org.kie.workbench.common.dmn.client.widgets.grid.controls.container.CellEditorControlsView) DefinitionUtils(org.kie.workbench.common.stunner.core.util.DefinitionUtils) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseExpressionGrid(org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid) AddDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddDecisionRuleCommand) ItemDefinitionUtils(org.kie.workbench.common.dmn.client.editors.types.common.ItemDefinitionUtils) Mockito.atLeast(org.mockito.Mockito.atLeast) AddOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddOutputClauseCommand) ContextEntry(org.kie.workbench.common.dmn.api.definition.model.ContextEntry) DecisionRule(org.kie.workbench.common.dmn.api.definition.model.DecisionRule) AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) DomainObject(org.kie.workbench.common.stunner.core.domainobject.DomainObject) GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) CanvasCommand(org.kie.workbench.common.stunner.core.client.command.CanvasCommand) List(java.util.List) DMNDiagramsSession(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramsSession) HasValueAndTypeRef(org.kie.workbench.common.dmn.client.editors.types.HasValueAndTypeRef) BaseGridCellValue(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue) DefaultCanvasCommandFactory(org.kie.workbench.common.dmn.client.commands.factory.DefaultCanvasCommandFactory) InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) BuiltInType(org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType) Optional(java.util.Optional) EventSourceMock(org.uberfire.mocks.EventSourceMock) SetBuiltinAggregatorCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetBuiltinAggregatorCommand) DecisionTable(org.kie.workbench.common.dmn.api.definition.model.DecisionTable) DeleteHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteHasValueCommand) Node(org.kie.workbench.common.stunner.core.graph.Node) IntStream(java.util.stream.IntStream) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Viewport(com.ait.lienzo.client.core.shape.Viewport) HasListSelectorControl(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl) CanvasCommandResultBuilder(org.kie.workbench.common.stunner.core.client.command.CanvasCommandResultBuilder) BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator) Function(java.util.function.Function) Captor(org.mockito.Captor) ExpressionEditorChanged(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorChanged) RefreshFormPropertiesEvent(org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) LienzoMockitoTestRunner(com.ait.lienzo.test.LienzoMockitoTestRunner) ArgumentCaptor(org.mockito.ArgumentCaptor) ReadOnlyProvider(org.kie.workbench.common.stunner.core.client.ReadOnlyProvider) Element(org.kie.workbench.common.stunner.core.graph.Element) SessionManager(org.kie.workbench.common.stunner.core.client.api.SessionManager) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) DMNEditorConstants(org.kie.workbench.common.dmn.client.resources.i18n.DMNEditorConstants) DMNGridPanel(org.kie.workbench.common.dmn.client.widgets.panel.DMNGridPanel) InputClauseLiteralExpression(org.kie.workbench.common.dmn.api.definition.model.InputClauseLiteralExpression) CanvasViolation(org.kie.workbench.common.stunner.core.client.command.CanvasViolation) Iterator(java.util.Iterator) Mockito.when(org.mockito.Mockito.when) Definition(org.kie.workbench.common.stunner.core.graph.content.definition.Definition) Mockito.verify(org.mockito.Mockito.verify) Consumer(java.util.function.Consumer) Mockito(org.mockito.Mockito) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Text(org.kie.workbench.common.dmn.api.property.dmn.Text) Decision(org.kie.workbench.common.dmn.api.definition.model.Decision) CompositeCommand(org.kie.workbench.common.stunner.core.command.impl.CompositeCommand) Collections(java.util.Collections) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) Test(org.junit.Test)

Example 8 with ValueAndDataTypeHeaderMetaData

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData in project kie-wb-common by kiegroup.

the class RendererUtilsTest method testRenderHeaderContentWithNameAndDataTypeHeaderMetaData.

@Test
public void testRenderHeaderContentWithNameAndDataTypeHeaderMetaData() {
    final ValueAndDataTypeHeaderMetaData metaData = mock(ValueAndDataTypeHeaderMetaData.class);
    when(metaData.getTitle()).thenReturn(TITLE);
    when(metaData.getTypeRef()).thenReturn(TYPE_REF);
    RendererUtils.getValueAndDataTypeHeaderText(metaData, headerContext, BLOCK_WIDTH, ROW_HEIGHT);
    assertHasNameAndDataTypeRendering();
}
Also used : ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) Test(org.junit.Test)

Example 9 with ValueAndDataTypeHeaderMetaData

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testSetTypeRefSingleInputClause.

@Test
@SuppressWarnings("unchecked")
public void testSetTypeRefSingleInputClause() {
    setupGrid(makeHasNameForDecision(), 0);
    final QName typeRef = new QName(QName.NULL_NS_URI, BuiltInType.DATE.getName());
    final Consumer<ValueAndDataTypeHeaderMetaData> test = (md) -> md.setTypeRef(typeRef);
    final ArgumentCaptor<CanvasCommand> canvasCommandCaptor = ArgumentCaptor.forClass(CanvasCommand.class);
    assertHeaderMetaDataTest(0, 1, test, canvasCommandCaptor, SetTypeRefCommand.class);
    canvasCommandCaptor.getValue().execute(canvasHandler);
    assertThat(expression.get().getInput().get(0).getInputExpression().getTypeRef()).isEqualTo(typeRef);
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) UpdateElementPropertyCommand(org.kie.workbench.common.stunner.core.client.canvas.command.UpdateElementPropertyCommand) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) ListSelectorView(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.ListSelectorView) DMNGridLayer(org.kie.workbench.common.dmn.client.widgets.layer.DMNGridLayer) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) SetTypeRefCommand(org.kie.workbench.common.dmn.client.commands.general.SetTypeRefCommand) InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) GridLayerRedrawManager(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager) GridFactoryCommandUtils(org.kie.workbench.common.dmn.client.editors.expressions.types.GridFactoryCommandUtils) DeleteDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteDecisionRuleCommand) Mockito.doAnswer(org.mockito.Mockito.doAnswer) DeleteOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteOutputClauseCommand) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) SetCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand) Index(org.kie.workbench.common.stunner.core.graph.processing.index.Index) NOPDomainObject(org.kie.workbench.common.dmn.api.definition.NOPDomainObject) HitPolicy(org.kie.workbench.common.dmn.api.definition.model.HitPolicy) OutputClause(org.kie.workbench.common.dmn.api.definition.model.OutputClause) DeleteCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteCellValueCommand) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) AddInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand) SetHitPolicyCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetHitPolicyCommand) GridBodyCellEditContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellEditContext) DMNDiagramUtils(org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils) GraphCommandExecutionContext(org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext) ValueAndDataTypePopoverView(org.kie.workbench.common.dmn.client.editors.types.ValueAndDataTypePopoverView) Mockito.mock(org.mockito.Mockito.mock) SetHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetHasValueCommand) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) Mock(org.mockito.Mock) HitPolicyPopoverView(org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.hitpolicy.HitPolicyPopoverView) RunWith(org.junit.runner.RunWith) AbsolutePanel(com.google.gwt.user.client.ui.AbsolutePanel) Mockito.spy(org.mockito.Mockito.spy) DMNSession(org.kie.workbench.common.dmn.client.session.DMNSession) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) Context(org.kie.workbench.common.dmn.api.definition.model.Context) Command(org.uberfire.mvp.Command) Before(org.junit.Before) TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) SessionCommandManager(org.kie.workbench.common.stunner.core.client.command.SessionCommandManager) DeleteInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteInputClauseCommand) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Mockito.never(org.mockito.Mockito.never) DomainObjectSelectionEvent(org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent) Assert.assertNull(org.junit.Assert.assertNull) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Mockito.reset(org.mockito.Mockito.reset) Assert.assertEquals(org.junit.Assert.assertEquals) DMNGraphUtils(org.kie.workbench.common.dmn.client.graph.DMNGraphUtils) CellEditorControlsView(org.kie.workbench.common.dmn.client.widgets.grid.controls.container.CellEditorControlsView) DefinitionUtils(org.kie.workbench.common.stunner.core.util.DefinitionUtils) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseExpressionGrid(org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid) AddDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddDecisionRuleCommand) ItemDefinitionUtils(org.kie.workbench.common.dmn.client.editors.types.common.ItemDefinitionUtils) Mockito.atLeast(org.mockito.Mockito.atLeast) AddOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddOutputClauseCommand) ContextEntry(org.kie.workbench.common.dmn.api.definition.model.ContextEntry) DecisionRule(org.kie.workbench.common.dmn.api.definition.model.DecisionRule) AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) DomainObject(org.kie.workbench.common.stunner.core.domainobject.DomainObject) GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) CanvasCommand(org.kie.workbench.common.stunner.core.client.command.CanvasCommand) List(java.util.List) DMNDiagramsSession(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramsSession) HasValueAndTypeRef(org.kie.workbench.common.dmn.client.editors.types.HasValueAndTypeRef) BaseGridCellValue(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue) DefaultCanvasCommandFactory(org.kie.workbench.common.dmn.client.commands.factory.DefaultCanvasCommandFactory) InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) BuiltInType(org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType) Optional(java.util.Optional) EventSourceMock(org.uberfire.mocks.EventSourceMock) SetBuiltinAggregatorCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetBuiltinAggregatorCommand) DecisionTable(org.kie.workbench.common.dmn.api.definition.model.DecisionTable) DeleteHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteHasValueCommand) Node(org.kie.workbench.common.stunner.core.graph.Node) IntStream(java.util.stream.IntStream) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Viewport(com.ait.lienzo.client.core.shape.Viewport) HasListSelectorControl(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl) CanvasCommandResultBuilder(org.kie.workbench.common.stunner.core.client.command.CanvasCommandResultBuilder) BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator) Function(java.util.function.Function) Captor(org.mockito.Captor) ExpressionEditorChanged(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorChanged) RefreshFormPropertiesEvent(org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) LienzoMockitoTestRunner(com.ait.lienzo.test.LienzoMockitoTestRunner) ArgumentCaptor(org.mockito.ArgumentCaptor) ReadOnlyProvider(org.kie.workbench.common.stunner.core.client.ReadOnlyProvider) Element(org.kie.workbench.common.stunner.core.graph.Element) SessionManager(org.kie.workbench.common.stunner.core.client.api.SessionManager) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) DMNEditorConstants(org.kie.workbench.common.dmn.client.resources.i18n.DMNEditorConstants) DMNGridPanel(org.kie.workbench.common.dmn.client.widgets.panel.DMNGridPanel) InputClauseLiteralExpression(org.kie.workbench.common.dmn.api.definition.model.InputClauseLiteralExpression) CanvasViolation(org.kie.workbench.common.stunner.core.client.command.CanvasViolation) Iterator(java.util.Iterator) Mockito.when(org.mockito.Mockito.when) Definition(org.kie.workbench.common.stunner.core.graph.content.definition.Definition) Mockito.verify(org.mockito.Mockito.verify) Consumer(java.util.function.Consumer) Mockito(org.mockito.Mockito) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Text(org.kie.workbench.common.dmn.api.property.dmn.Text) Decision(org.kie.workbench.common.dmn.api.definition.model.Decision) CompositeCommand(org.kie.workbench.common.stunner.core.command.impl.CompositeCommand) Collections(java.util.Collections) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) CanvasCommand(org.kie.workbench.common.stunner.core.client.command.CanvasCommand) Test(org.junit.Test)

Example 10 with ValueAndDataTypeHeaderMetaData

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testSetDisplayNameSingleOutputClauseWithNonEmptyValue.

@Test
@SuppressWarnings("unchecked")
public void testSetDisplayNameSingleOutputClauseWithNonEmptyValue() {
    setupGrid(makeHasNameForDecision(), 0);
    final Consumer<ValueAndDataTypeHeaderMetaData> test = (md) -> md.setValue(new Name(NAME_NEW));
    assertHeaderMetaDataTest(0, 2, test, SetHasValueCommand.class, SetHasValueCommand.class, UpdateElementPropertyCommand.class);
    compositeCommandCaptor.getValue().execute(canvasHandler);
    assertThat(hasExpression.getName()).isEqualTo(new Name(NAME_NEW));
    assertThat(expression.get().getOutput().get(0).getName()).isEqualTo(NAME_NEW);
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) UpdateElementPropertyCommand(org.kie.workbench.common.stunner.core.client.canvas.command.UpdateElementPropertyCommand) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) ManagedInstance(org.jboss.errai.ioc.client.api.ManagedInstance) ListSelectorView(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.ListSelectorView) DMNGridLayer(org.kie.workbench.common.dmn.client.widgets.layer.DMNGridLayer) GridColumn(org.uberfire.ext.wires.core.grids.client.model.GridColumn) SetTypeRefCommand(org.kie.workbench.common.dmn.client.commands.general.SetTypeRefCommand) InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) GridLayerRedrawManager(org.uberfire.ext.wires.core.grids.client.widget.layer.impl.GridLayerRedrawManager) GridFactoryCommandUtils(org.kie.workbench.common.dmn.client.editors.expressions.types.GridFactoryCommandUtils) DeleteDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteDecisionRuleCommand) Mockito.doAnswer(org.mockito.Mockito.doAnswer) DeleteOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteOutputClauseCommand) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) SetCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetCellValueCommand) Index(org.kie.workbench.common.stunner.core.graph.processing.index.Index) NOPDomainObject(org.kie.workbench.common.dmn.api.definition.NOPDomainObject) HitPolicy(org.kie.workbench.common.dmn.api.definition.model.HitPolicy) OutputClause(org.kie.workbench.common.dmn.api.definition.model.OutputClause) DeleteCellValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteCellValueCommand) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) AddInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddInputClauseCommand) SetHitPolicyCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetHitPolicyCommand) GridBodyCellEditContext(org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellEditContext) DMNDiagramUtils(org.kie.workbench.common.dmn.api.graph.DMNDiagramUtils) GraphCommandExecutionContext(org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext) ValueAndDataTypePopoverView(org.kie.workbench.common.dmn.client.editors.types.ValueAndDataTypePopoverView) Mockito.mock(org.mockito.Mockito.mock) SetHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.SetHasValueCommand) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) Mock(org.mockito.Mock) HitPolicyPopoverView(org.kie.workbench.common.dmn.client.editors.expressions.types.dtable.hitpolicy.HitPolicyPopoverView) RunWith(org.junit.runner.RunWith) AbsolutePanel(com.google.gwt.user.client.ui.AbsolutePanel) Mockito.spy(org.mockito.Mockito.spy) DMNSession(org.kie.workbench.common.dmn.client.session.DMNSession) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) DMNGridColumn(org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridColumn) GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) Context(org.kie.workbench.common.dmn.api.definition.model.Context) Command(org.uberfire.mvp.Command) Before(org.junit.Before) TranslationService(org.jboss.errai.ui.client.local.spi.TranslationService) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) GridData(org.uberfire.ext.wires.core.grids.client.model.GridData) SessionCommandManager(org.kie.workbench.common.stunner.core.client.command.SessionCommandManager) DeleteInputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.DeleteInputClauseCommand) Graph(org.kie.workbench.common.stunner.core.graph.Graph) Mockito.never(org.mockito.Mockito.never) DomainObjectSelectionEvent(org.kie.workbench.common.stunner.core.client.canvas.event.selection.DomainObjectSelectionEvent) Assert.assertNull(org.junit.Assert.assertNull) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Mockito.reset(org.mockito.Mockito.reset) Assert.assertEquals(org.junit.Assert.assertEquals) DMNGraphUtils(org.kie.workbench.common.dmn.client.graph.DMNGraphUtils) CellEditorControlsView(org.kie.workbench.common.dmn.client.widgets.grid.controls.container.CellEditorControlsView) DefinitionUtils(org.kie.workbench.common.stunner.core.util.DefinitionUtils) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) BaseExpressionGrid(org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid) AddDecisionRuleCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddDecisionRuleCommand) ItemDefinitionUtils(org.kie.workbench.common.dmn.client.editors.types.common.ItemDefinitionUtils) Mockito.atLeast(org.mockito.Mockito.atLeast) AddOutputClauseCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.AddOutputClauseCommand) ContextEntry(org.kie.workbench.common.dmn.api.definition.model.ContextEntry) DecisionRule(org.kie.workbench.common.dmn.api.definition.model.DecisionRule) AbstractCanvasHandler(org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler) AbstractCanvasGraphCommand(org.kie.workbench.common.stunner.core.client.canvas.command.AbstractCanvasGraphCommand) DomainObject(org.kie.workbench.common.stunner.core.domainobject.DomainObject) GridWidget(org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget) CanvasCommand(org.kie.workbench.common.stunner.core.client.command.CanvasCommand) List(java.util.List) DMNDiagramsSession(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramsSession) HasValueAndTypeRef(org.kie.workbench.common.dmn.client.editors.types.HasValueAndTypeRef) BaseGridCellValue(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue) DefaultCanvasCommandFactory(org.kie.workbench.common.dmn.client.commands.factory.DefaultCanvasCommandFactory) InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) BuiltInType(org.kie.workbench.common.dmn.api.property.dmn.types.BuiltInType) Optional(java.util.Optional) EventSourceMock(org.uberfire.mocks.EventSourceMock) SetBuiltinAggregatorCommand(org.kie.workbench.common.dmn.client.commands.expressions.types.dtable.SetBuiltinAggregatorCommand) DecisionTable(org.kie.workbench.common.dmn.api.definition.model.DecisionTable) DeleteHasValueCommand(org.kie.workbench.common.dmn.client.commands.general.DeleteHasValueCommand) Node(org.kie.workbench.common.stunner.core.graph.Node) IntStream(java.util.stream.IntStream) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Viewport(com.ait.lienzo.client.core.shape.Viewport) HasListSelectorControl(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl) CanvasCommandResultBuilder(org.kie.workbench.common.stunner.core.client.command.CanvasCommandResultBuilder) BuiltinAggregator(org.kie.workbench.common.dmn.api.definition.model.BuiltinAggregator) Function(java.util.function.Function) Captor(org.mockito.Captor) ExpressionEditorChanged(org.kie.workbench.common.dmn.client.widgets.grid.model.ExpressionEditorChanged) RefreshFormPropertiesEvent(org.kie.workbench.common.stunner.forms.client.event.RefreshFormPropertiesEvent) BaseBounds(org.uberfire.ext.wires.core.grids.client.model.impl.BaseBounds) Transform(com.ait.lienzo.client.core.types.Transform) LienzoMockitoTestRunner(com.ait.lienzo.test.LienzoMockitoTestRunner) ArgumentCaptor(org.mockito.ArgumentCaptor) ReadOnlyProvider(org.kie.workbench.common.stunner.core.client.ReadOnlyProvider) Element(org.kie.workbench.common.stunner.core.graph.Element) SessionManager(org.kie.workbench.common.stunner.core.client.api.SessionManager) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) DMNEditorConstants(org.kie.workbench.common.dmn.client.resources.i18n.DMNEditorConstants) DMNGridPanel(org.kie.workbench.common.dmn.client.widgets.panel.DMNGridPanel) InputClauseLiteralExpression(org.kie.workbench.common.dmn.api.definition.model.InputClauseLiteralExpression) CanvasViolation(org.kie.workbench.common.stunner.core.client.command.CanvasViolation) Iterator(java.util.Iterator) Mockito.when(org.mockito.Mockito.when) Definition(org.kie.workbench.common.stunner.core.graph.content.definition.Definition) Mockito.verify(org.mockito.Mockito.verify) Consumer(java.util.function.Consumer) Mockito(org.mockito.Mockito) BaseGridData(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData) Text(org.kie.workbench.common.dmn.api.property.dmn.Text) Decision(org.kie.workbench.common.dmn.api.definition.model.Decision) CompositeCommand(org.kie.workbench.common.stunner.core.command.impl.CompositeCommand) Collections(java.util.Collections) ValueAndDataTypeHeaderMetaData(org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData) HasName(org.kie.workbench.common.dmn.api.definition.HasName) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 Viewport (com.ait.lienzo.client.core.shape.Viewport)11 Transform (com.ait.lienzo.client.core.types.Transform)11 LienzoMockitoTestRunner (com.ait.lienzo.test.LienzoMockitoTestRunner)11 AbsolutePanel (com.google.gwt.user.client.ui.AbsolutePanel)11 Collections (java.util.Collections)11 Iterator (java.util.Iterator)11 List (java.util.List)11 Optional (java.util.Optional)11 Consumer (java.util.function.Consumer)11 Function (java.util.function.Function)11 IntStream (java.util.stream.IntStream)11 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)11 ManagedInstance (org.jboss.errai.ioc.client.api.ManagedInstance)11 TranslationService (org.jboss.errai.ui.client.local.spi.TranslationService)11 Assert.assertEquals (org.junit.Assert.assertEquals)11 Assert.assertNull (org.junit.Assert.assertNull)11 Assert.assertTrue (org.junit.Assert.assertTrue)11 Before (org.junit.Before)11 RunWith (org.junit.runner.RunWith)11