use of org.activityinfo.analysis.ParsedFormula in project activityinfo by bedatadriven.
the class LookupKeySetTest method overlappingHierarchiesParse.
@Test
public void overlappingHierarchiesParse() {
TestingStorageProvider catalog = setup.getCatalog();
LocaliteForm localiteForm = catalog.getLocaliteForm();
FormTree formTree = setup.getFormTree(localiteForm.getFormId());
LookupKeySet lookupKeySet = new LookupKeySet(formTree, localiteForm.getAdminField());
Map<LookupKey, FormulaNode> formulas = lookupKeySet.getKeyFormulas(localiteForm.getAdminField().getId());
ParsedFormula province = new ParsedFormula(formTree, formulas.get(lookupKeySet.getKey(0)).asExpression());
assertThat(province.isValid(), equalTo(true));
assertThat(province.getResultType(), instanceOf(TextType.class));
}
Aggregations