use of org.activityinfo.store.query.shared.NodeMatcher in project activityinfo by bedatadriven.
the class SubFormSummaryTest method matchNodes.
@Test
public void matchNodes() {
TestingStorageProvider catalog = new TestingStorageProvider();
ClinicForm clinicForm = catalog.getClinicForm();
FormTree formTree = catalog.getFormTree(clinicForm.getFormId());
NodeMatcher nodeMatcher = new NodeMatcher(formTree);
Collection<NodeMatch> nodeMatches = nodeMatcher.resolveSymbol(new SymbolNode("NUM_CONSULT"));
assertThat(nodeMatches, hasSize(1));
NodeMatch nodeMatch = Iterables.getOnlyElement(nodeMatches);
JoinNode joinNode = Iterables.getOnlyElement(nodeMatch.getJoins());
}
Aggregations