Search in sources :

Example 21 with ReferenceType

use of org.activityinfo.model.type.ReferenceType in project activityinfo by bedatadriven.

the class LookupViewModelTest method noKeysTest.

@Test
public void noKeysTest() {
    TestingStorageProvider catalog = new TestingStorageProvider();
    NfiForm nfiForm = catalog.getNfiForm();
    FormTree formTree = catalog.getFormTree(nfiForm.getFormId());
    FormField referenceField = new FormField(ResourceId.generateFieldId(ReferenceType.TYPE_CLASS)).setType(new ReferenceType(Cardinality.SINGLE, nfiForm.getFormId()));
    LookupViewModel viewModel = new LookupViewModel(setup.getFormStore(), formTree, referenceField);
    LookupKeyViewModel keyViewModel = viewModel.getLookupKeys().get(0);
    Connection<List<String>> choices = setup.connect(keyViewModel.getChoices());
    assertThat(choices.assertLoaded(), hasSize(821));
}
Also used : FormTree(org.activityinfo.model.formTree.FormTree) FormField(org.activityinfo.model.form.FormField) ReferenceType(org.activityinfo.model.type.ReferenceType) Test(org.junit.Test)

Aggregations

ReferenceType (org.activityinfo.model.type.ReferenceType)21 FormField (org.activityinfo.model.form.FormField)16 ResourceId (org.activityinfo.model.resource.ResourceId)10 FormClass (org.activityinfo.model.form.FormClass)6 FormTree (org.activityinfo.model.formTree.FormTree)6 Test (org.junit.Test)6 SubFormReferenceType (org.activityinfo.model.type.subform.SubFormReferenceType)4 FormTreeBuilder (org.activityinfo.model.formTree.FormTreeBuilder)2 RecordRef (org.activityinfo.model.type.RecordRef)2 EnumType (org.activityinfo.model.type.enumerated.EnumType)2 CalculatedFieldType (org.activityinfo.model.type.expr.CalculatedFieldType)2 QuantityType (org.activityinfo.model.type.number.QuantityType)2 Optional (com.google.common.base.Optional)1 ValueUpdater (com.google.gwt.cell.client.ValueUpdater)1 LinkedList (java.util.LinkedList)1 FormProfile (org.activityinfo.geoadmin.merge2.view.profile.FormProfile)1 FormSection (org.activityinfo.model.form.FormSection)1 FormClassProvider (org.activityinfo.model.formTree.FormClassProvider)1 FormMetadataProviderStub (org.activityinfo.model.formTree.FormMetadataProviderStub)1 LookupKeySet (org.activityinfo.model.formTree.LookupKeySet)1