use of org.eclipse.scout.rt.client.ui.form.fields.integerfield.IIntegerField in project scout.rt by eclipse.
the class AbstractIntegerColumnTest method testPrepareEditInternal.
@Test
public void testPrepareEditInternal() {
AbstractIntegerColumn column = new AbstractIntegerColumn() {
};
column.setMandatory(true);
ITableRow row = mock(ITableRow.class);
IIntegerField field = (IIntegerField) column.prepareEditInternal(row);
assertEquals("mandatory property to be progagated to field", column.isMandatory(), field.isMandatory());
}
use of org.eclipse.scout.rt.client.ui.form.fields.integerfield.IIntegerField in project scout.rt by eclipse.
the class AbstractColumnTest method testCompleteEdit_ParsingError.
@Test
public void testCompleteEdit_ParsingError() {
ParsingTestTable table = new ParsingTestTable();
table.addRowsByArray(new Integer[] { 0 });
IIntegerField field = new AbstractIntegerField() {
};
field.parseAndSetValue("invalid number");
table.getIntTestColumn().completeEdit(table.getRow(0), field);
ICell c = table.getCell(0, 0);
assertEquals("invalid number", c.getText());
assertEquals(0, c.getValue());
assertNotNull(String.format("The invalid cell should have an error status: value '%s'", c.getValue(), c.getErrorStatus()));
}
Aggregations