public void testAsComponentDefRefs() throws Exception {
TextTokenizer tokenizer = TextTokenizer.tokenize(wholeText, null);
ComponentDefHandler cdh = new ComponentDefHandler(null, null, null);
List<ComponentDefRef> l = tokenizer.asComponentDefRefs(cdh);
assertEquals("Wrong number of ComponentDefRefs returned", 3, l.size());
ComponentDefRef c = l.get(0);
assertEquals("Incorrect ComponentDefRef type", "text", c.getDescriptor().getName());
assertEquals("Incorrect ComponentDefRef value", testText[0], c.getAttributeDefRef("value").getValue());
c = l.get(1);
assertEquals("Incorrect ComponentDefRef type", "expression", c.getDescriptor().getName());
Object o = c.getAttributeDefRef("value").getValue();
assertTrue("ComponentDefRef value is of wrong type", o instanceof PropertyReferenceImpl);
assertEquals("Incorrect ComponentDefRef value", testText[1], ((PropertyReferenceImpl) o).toString(true));
c = l.get(2);
assertEquals("Incorrect ComponentDefRef type", "text", c.getDescriptor().getName());
assertEquals("Incorrect ComponentDefRef value", testText[2], c.getAttributeDefRef("value").getValue());
}