assertEquals("B", labels.get("b").toString());
assertEquals("C", labels.get("c").toString());
}
@Test public void testParseLabelsAndTestText() throws Exception {
TreeWizard wiz = new TreeWizard(adaptor, tokens);
CommonTree t = (CommonTree)wiz.create("(A B[foo] C)");
Map<String, Object> labels = new HashMap<String, Object>();
boolean valid = wiz.parse(t, "(%a:A %b:B[foo] %c:C)", labels);
assertTrue(valid);
assertEquals("A", labels.get("a").toString());
assertEquals("foo", labels.get("b").toString());
assertEquals("C", labels.get("c").toString());
}