Search in sources :

Example 6 with TestLookupCall

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

the class SmartFieldLookupTest method testSubtreeLookup_ActiveFilterInPrepare.

@Test
public void testSubtreeLookup_ActiveFilterInPrepare() {
    m_field.setLookupCall(new TestLookupCall());
    m_field.setActiveFilterEnabled(true);
    m_field.setActiveFilter(TriState.FALSE);
    List<? extends ILookupRow<Long>> rows = m_field.callSubTreeLookup(1L);
    assertEquals(2, rows.size());
}
Also used : TestLookupCall(org.eclipse.scout.rt.client.ui.form.fields.smartfield.fixture.TestLookupCall) Test(org.junit.Test)

Example 7 with TestLookupCall

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

the class SmartFieldLookupTest method testSubtreeLookup_InBackground.

@Test
public void testSubtreeLookup_InBackground() {
    IValueField<Long> masterField = new AbstractValueField<Long>() {
    };
    masterField.setValue(testMasterValue);
    m_field.setLookupCall(new TestLookupCall());
    m_field.setMasterField(masterField);
    IFuture<List<ILookupRow<Long>>> futureRows = m_field.callSubTreeLookupInBackground(1L, TriState.TRUE, false);
    List<? extends ILookupRow<Long>> rows = awaitDoneAndGet(futureRows);
    assertEquals(2, rows.size());
}
Also used : AbstractValueField(org.eclipse.scout.rt.client.ui.form.fields.AbstractValueField) TestLookupCall(org.eclipse.scout.rt.client.ui.form.fields.smartfield.fixture.TestLookupCall) ArrayList(java.util.ArrayList) List(java.util.List) Test(org.junit.Test)

Example 8 with TestLookupCall

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

the class SmartFieldLookupTest method testSubtreeLookup.

@Test
public void testSubtreeLookup() {
    m_field.setLookupCall(new TestLookupCall());
    List<? extends ILookupRow<Long>> rows = m_field.callSubTreeLookup(1L);
    assertRecResult(rows);
}
Also used : TestLookupCall(org.eclipse.scout.rt.client.ui.form.fields.smartfield.fixture.TestLookupCall) Test(org.junit.Test)

Example 9 with TestLookupCall

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

the class SmartFieldLookupTest method testSubteeLookup_WithPrepareRec.

@Test
public void testSubteeLookup_WithPrepareRec() {
    ISmartField<Long> field = new AbstractSmartField<Long>() {

        @Override
        protected void execPrepareRecLookup(ILookupCall<Long> call, Long parentKey) {
            call.setMaster(testMasterValue);
        }
    };
    field.setLookupCall(new TestLookupCall());
    List<? extends ILookupRow<Long>> rows2 = field.callSubTreeLookup(1L);
    assertEquals(2, rows2.size());
}
Also used : TestLookupCall(org.eclipse.scout.rt.client.ui.form.fields.smartfield.fixture.TestLookupCall) ILookupCall(org.eclipse.scout.rt.shared.services.lookup.ILookupCall) Test(org.junit.Test)

Example 10 with TestLookupCall

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

the class SmartFieldLookupTest method testSubtreeLookup_ActiveFilter.

/**
 * Tests {@link ISmartField#callSubTreeLookup(Object)} using an active filter with {@link TriState#FALSE}
 * <code>null</code> values should be filtered out
 */
@Test
public void testSubtreeLookup_ActiveFilter() {
    m_field.setLookupCall(new TestLookupCall());
    List<? extends ILookupRow<Long>> rows = m_field.callSubTreeLookup(1L, TriState.FALSE);
    assertEquals(2, rows.size());
}
Also used : TestLookupCall(org.eclipse.scout.rt.client.ui.form.fields.smartfield.fixture.TestLookupCall) Test(org.junit.Test)

Aggregations

TestLookupCall (org.eclipse.scout.rt.client.ui.form.fields.smartfield.fixture.TestLookupCall)14 Test (org.junit.Test)14 ILookupCall (org.eclipse.scout.rt.shared.services.lookup.ILookupCall)6 ArrayList (java.util.ArrayList)4 List (java.util.List)4 PlatformException (org.eclipse.scout.rt.platform.exception.PlatformException)3 AbstractValueField (org.eclipse.scout.rt.client.ui.form.fields.AbstractValueField)2 IBlockingCondition (org.eclipse.scout.rt.platform.job.IBlockingCondition)2 ILookupRow (org.eclipse.scout.rt.shared.services.lookup.ILookupRow)1 ILookupRowFetchedCallback (org.eclipse.scout.rt.shared.services.lookup.ILookupRowFetchedCallback)1