Search in sources :

Example 6 with IMixedSmartField

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

the class AbstractMixedSmartColumnTest method testPrepareLookupCallback.

/**
 * 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 testPrepareLookupCallback() {
    TestMixedSmartColumn column = new TestMixedSmartColumn();
    ITableRow row = Mockito.mock(ITableRow.class);
    IMixedSmartField<String, Long> field = (IMixedSmartField<String, Long>) column.prepareEditInternal(row);
    ILookupCall call = mock(ILookupCall.class);
    field.prepareKeyLookup(call, 10L);
    assertEquals(row, column.lastRow);
    assertEquals(call, column.lastCall);
}
Also used : ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) IMixedSmartField(org.eclipse.scout.rt.client.ui.form.fields.smartfield.IMixedSmartField) ILookupCall(org.eclipse.scout.rt.shared.services.lookup.ILookupCall) Test(org.junit.Test)

Aggregations

IMixedSmartField (org.eclipse.scout.rt.client.ui.form.fields.smartfield.IMixedSmartField)6 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)5 Test (org.junit.Test)5 ICell (org.eclipse.scout.rt.client.ui.basic.cell.ICell)1 ILookupCall (org.eclipse.scout.rt.shared.services.lookup.ILookupCall)1