use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.VariableRow in project kie-wb-common by kiegroup.
the class VariablesEditorFieldRendererTest method testSerializeVariables.
@Test
public void testSerializeVariables() {
Map<String, String> mapDataTypeDisplayNamesToNames = new HashMap<String, String>();
mapDataTypeDisplayNamesToNames.put("String", "String");
mapDataTypeDisplayNamesToNames.put("Integer", "Integer");
mapDataTypeDisplayNamesToNames.put("Potato [org.veg]", "org.veg.Potato");
variablesEditor.mapDataTypeDisplayNamesToNames = mapDataTypeDisplayNamesToNames;
List<VariableRow> variableRows = new ArrayList<VariableRow>();
variableRows.add(new VariableRow(Variable.VariableType.PROCESS, "var1", "String", null));
variableRows.add(new VariableRow(Variable.VariableType.PROCESS, "var2", "Integer", null));
variableRows.add(new VariableRow(Variable.VariableType.PROCESS, "var3", "org.veg.Potato", null));
String s = variablesEditor.serializeVariables(variableRows);
assertEquals("var1:String,var2:Integer,var3:org.veg.Potato", s);
}
use of org.kie.workbench.common.stunner.bpmn.client.forms.fields.model.VariableRow in project kie-wb-common by kiegroup.
the class VariablesEditorWidgetViewImplTest method setUp.
@Before
public void setUp() {
GwtMockito.initMocks(this);
view = GWT.create(VariablesEditorWidgetViewImpl.class);
view.variableRows = variableRows;
view.addVarButton = button;
view.nameth = nameth;
view.datatypeth = datatypeth;
view.notification = notification;
doCallRealMethod().when(view).setVariableRows(any(List.class));
doCallRealMethod().when(view).init(any(VariablesEditorWidgetView.Presenter.class));
doCallRealMethod().when(view).handleAddVarButton(any(ClickEvent.class));
doCallRealMethod().when(view).getVariableRows();
doCallRealMethod().when(view).getVariableWidget(anyInt());
doCallRealMethod().when(view).getVariableRowsCount();
doCallRealMethod().when(view).setValue(anyString(), anyBoolean());
doCallRealMethod().when(view).doSetValue(anyString(), anyBoolean(), anyBoolean());
doCallRealMethod().when(view).setDataTypes(anyListOf(String.class), anyListOf(String.class));
rows = new ArrayList<VariableRow>();
rows.add(new VariableRow(Variable.VariableType.PROCESS, "varName", null, null));
rows.add(new VariableRow(Variable.VariableType.PROCESS, "varName2", null, null));
}
Aggregations