Search in sources :

Example 1 with AbstractMixedSmartField

use of org.eclipse.scout.rt.client.ui.form.fields.smartfield.AbstractMixedSmartField in project scout.rt by eclipse.

the class AbstractMixedSmartColumnTest method tesConvertValueToKeyCallback.

/**
 * Tests that {@link AbstractMixedSmartColumn#execPrepareLookup(ILookupCall, ITableRow)} is called when
 * {@link IMixedSmartField#prepareKeyLookup(ILookupCall, Object)} is called on the editor field.
 */
@SuppressWarnings("unchecked")
@Test
public void tesConvertValueToKeyCallback() {
    TestMixedSmartColumn column = new TestMixedSmartColumn();
    ITableRow row = Mockito.mock(ITableRow.class);
    AbstractMixedSmartField<String, Long> field = (AbstractMixedSmartField<String, Long>) column.prepareEditInternal(row);
    field.setValue("test");
    Long lookupKey = field.getValueAsLookupKey();
    assertEquals(Long.valueOf(0L), lookupKey);
    assertEquals(column.lastValue, "test");
}
Also used : AbstractMixedSmartField(org.eclipse.scout.rt.client.ui.form.fields.smartfield.AbstractMixedSmartField) ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Aggregations

ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)1 AbstractMixedSmartField (org.eclipse.scout.rt.client.ui.form.fields.smartfield.AbstractMixedSmartField)1 Test (org.junit.Test)1