use of org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testSetTypeRefMultipleOutputClauses.
@Test
@SuppressWarnings("unchecked")
public void testSetTypeRefMultipleOutputClauses() {
setupGrid(makeHasNameForDecision(), 0);
final QName typeRef = new QName(QName.NULL_NS_URI, BuiltInType.DATE.getName());
final QName defaultTypeRef = new QName();
final Consumer<ValueAndDataTypeHeaderMetaData> test = (md) -> md.setTypeRef(typeRef);
addOutputClause(3);
final ArgumentCaptor<CanvasCommand> canvasCommandCaptor1 = ArgumentCaptor.forClass(CanvasCommand.class);
hasExpression.getVariable().setTypeRef(defaultTypeRef);
expression.get().getOutput().get(0).setTypeRef(defaultTypeRef);
assertHeaderMetaDataTest(0, 2, test, canvasCommandCaptor1, SetTypeRefCommand.class);
canvasCommandCaptor1.getValue().execute(canvasHandler);
assertThat(hasExpression.getVariable().getTypeRef()).isEqualTo(typeRef);
assertThat(expression.get().getOutput().get(0).getTypeRef()).isEqualTo(defaultTypeRef);
final ArgumentCaptor<CanvasCommand> canvasCommandCaptor2 = ArgumentCaptor.forClass(CanvasCommand.class);
hasExpression.getVariable().setTypeRef(defaultTypeRef);
expression.get().getOutput().get(0).setTypeRef(defaultTypeRef);
assertHeaderMetaDataTest(1, 2, test, canvasCommandCaptor2, SetTypeRefCommand.class);
canvasCommandCaptor2.getValue().execute(canvasHandler);
assertThat(hasExpression.getVariable().getTypeRef()).isEqualTo(defaultTypeRef);
assertThat(expression.get().getOutput().get(0).getTypeRef()).isEqualTo(typeRef);
final ArgumentCaptor<CanvasCommand> canvasCommandCaptor3 = ArgumentCaptor.forClass(CanvasCommand.class);
hasExpression.getVariable().setTypeRef(defaultTypeRef);
expression.get().getOutput().get(1).setTypeRef(defaultTypeRef);
assertHeaderMetaDataTest(0, 3, test, canvasCommandCaptor3, SetTypeRefCommand.class);
canvasCommandCaptor3.getValue().execute(canvasHandler);
assertThat(hasExpression.getVariable().getTypeRef()).isEqualTo(typeRef);
assertThat(expression.get().getOutput().get(1).getTypeRef()).isEqualTo(defaultTypeRef);
final ArgumentCaptor<CanvasCommand> canvasCommandCaptor4 = ArgumentCaptor.forClass(CanvasCommand.class);
hasExpression.getVariable().setTypeRef(defaultTypeRef);
expression.get().getOutput().get(1).setTypeRef(defaultTypeRef);
assertHeaderMetaDataTest(1, 3, test, canvasCommandCaptor4, SetTypeRefCommand.class);
canvasCommandCaptor4.getValue().execute(canvasHandler);
assertThat(hasExpression.getVariable().getTypeRef()).isEqualTo(defaultTypeRef);
assertThat(expression.get().getOutput().get(1).getTypeRef()).isEqualTo(typeRef);
}
use of org.kie.workbench.common.dmn.client.widgets.grid.columns.ValueAndDataTypeHeaderMetaData in project kie-wb-common by kiegroup.
the class DecisionTableGridTest method testSetTypeRefWithoutChange.
@Test
public void testSetTypeRefWithoutChange() {
setupGrid(makeHasNameForDecision(), 0);
final Consumer<ValueAndDataTypeHeaderMetaData> test = (md) -> md.setTypeRef(new QName());
assertHeaderMetaDataTest(0, 1, test);
assertHeaderMetaDataTest(0, 2, test);
addOutputClause(3);
assertHeaderMetaDataTest(0, 2, test);
assertHeaderMetaDataTest(1, 2, test);
assertHeaderMetaDataTest(0, 3, test);
assertHeaderMetaDataTest(1, 3, test);
}
Aggregations