use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetTest method initTestCase.
@Before
public void initTestCase() {
GwtMockito.initMocks(this);
dataType = mock(ValueListBox.class);
processVar = mock(ValueListBox.class);
customDataType = mock(TextBox.class);
constant = mock(TextBox.class);
dataTypeComboBox = mock(ComboBox.class);
processVarComboBox = mock(ComboBox.class);
widget = GWT.create(AssignmentListItemWidgetViewImpl.class);
AssignmentRow assignmentRow = new AssignmentRow();
widget.dataType = dataType;
widget.customDataType = customDataType;
widget.processVar = processVar;
widget.constant = constant;
widget.dataTypeComboBox = dataTypeComboBox;
widget.name = name;
widget.deleteButton = deleteButton;
widget.processVarComboBox = processVarComboBox;
widget.assignment = assignment;
Mockito.doCallRealMethod().when(widget).setTextBoxModelValue(any(TextBox.class), anyString());
Mockito.doCallRealMethod().when(widget).setListBoxModelValue(any(ValueListBox.class), anyString());
Mockito.doCallRealMethod().when(widget).getModelValue(any(ValueListBox.class));
Mockito.doCallRealMethod().when(widget).setDataType(anyString());
Mockito.doCallRealMethod().when(widget).getDataType();
Mockito.doCallRealMethod().when(widget).setCustomDataType(anyString());
Mockito.doCallRealMethod().when(widget).getCustomDataType();
Mockito.doCallRealMethod().when(widget).setConstant(anyString());
Mockito.doCallRealMethod().when(widget).getConstant();
Mockito.doCallRealMethod().when(widget).setProcessVar(anyString());
Mockito.doCallRealMethod().when(widget).getProcessVar();
Mockito.doCallRealMethod().when(widget).setDataTypes(any(ListBoxValues.class));
Mockito.doCallRealMethod().when(widget).setProcessVariables(any(ListBoxValues.class));
Mockito.doCallRealMethod().when(widget).init();
Mockito.doCallRealMethod().when(widget).setModel(any(AssignmentRow.class));
Mockito.doCallRealMethod().when(processVarComboBox).setAddCustomValues(any(Boolean.class));
Mockito.doCallRealMethod().when(processVarComboBox).addCustomValueToListBoxValues(any(String.class), any(String.class));
Mockito.doCallRealMethod().when(processVarComboBox).setListBoxValues(any(ListBoxValues.class));
when(widget.getModel()).thenReturn(assignmentRow);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetTest method testSetModelOutput.
@Test
public void testSetModelOutput() {
when(widget.getVariableType()).thenReturn(Variable.VariableType.OUTPUT);
widget.setModel(new AssignmentRow());
verify(deleteButton).setIcon(IconType.TRASH);
verify(constant).setVisible(false);
verify(widget).getCustomDataType();
verify(widget).getDataType();
verify(widget).getConstant();
verify(widget).getProcessVar();
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetTest method testQuotedConstant1.
@Test
public void testQuotedConstant1() {
AssignmentRow row = new AssignmentRow();
String s = "abc";
row.setConstant(s);
when(widget.getModel()).thenReturn(row);
widget.setModel(row);
verify(constant).setValue(s);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetTest method testQuotedConstant2.
@Test
public void testQuotedConstant2() {
AssignmentRow row = new AssignmentRow();
String s = "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.";
row.setConstant(s);
when(widget.getModel()).thenReturn(row);
widget.setModel(row);
verify(constant).setValue(s);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.AssignmentRow in project kie-wb-common by kiegroup.
the class AssignmentListItemWidgetViewImplTest method setUp.
@Before
public void setUp() throws Exception {
GwtMockito.initMocks(this);
customDataType = mock(TextBox.class);
constant = mock(TextBox.class);
dataType = mock(ValueListBox.class);
processVar = mock(ValueListBox.class);
dataTypeComboBox = mock(ComboBox.class);
processVarComboBox = mock(ComboBox.class);
view = mock(AssignmentListItemWidgetViewImpl.class);
view.assignment = assignment;
view.name = name;
view.deleteButton = deleteButton;
view.customDataType = customDataType;
view.dataType = dataType;
view.constant = constant;
view.processVar = processVar;
view.dataTypeComboBox = dataTypeComboBox;
view.processVarComboBox = processVarComboBox;
view.notification = notification;
doCallRealMethod().when(view).init();
doCallRealMethod().when(view).getConstant();
doCallRealMethod().when(view).setConstant(anyString());
doCallRealMethod().when(view).getCustomDataType();
doCallRealMethod().when(view).setCustomDataType(anyString());
doCallRealMethod().when(view).getModel();
doCallRealMethod().when(view).setModel(any(AssignmentRow.class));
doCallRealMethod().when(view).getModelValue(any(ValueListBox.class));
doCallRealMethod().when(view).setTextBoxModelValue(any(TextBox.class), anyString());
doCallRealMethod().when(view).setListBoxModelValue(any(ValueListBox.class), anyString());
doCallRealMethod().when(view).getDataType();
doCallRealMethod().when(view).setDataType(anyString());
doCallRealMethod().when(view).getProcessVar();
doCallRealMethod().when(view).setProcessVar(anyString());
doCallRealMethod().when(view).getVariableType();
doCallRealMethod().when(view).setAllowDuplicateNames(anyBoolean(), anyString());
doCallRealMethod().when(view).setParentWidget(any(ActivityDataIOEditorWidget.class));
doCallRealMethod().when(view).isDuplicateName(anyString());
doCallRealMethod().when(view).setShowConstants(anyBoolean());
doCallRealMethod().when(view).setDisallowedNames(anySet(), anyString());
doCallRealMethod().when(view).handleDeleteButton(any(ClickEvent.class));
AssignmentRow row = new AssignmentRow();
doReturn(row).when(assignment).getModel();
}
Aggregations