private void _testRegionMetadata(FacesContext context)
{
RegionMetadata rmd = RegionMetadata.getRegionMetadata(context);
ComponentMetaData comp =
(ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.trinidad.view.test.TestRegion1");
assertEquals("/regions/testRegion1.jspx", comp.getJspUIDef());
List<AttributeMetaData> attrs = comp.getAttributes();
assertEquals(2, attrs.size());
AttributeMetaData attr = attrs.get(0);
assertEquals("stock", attr.getAttrName());
assertEquals(Integer.class, attr.getAttrClass());
assertTrue(attr.isRequired());
assertNull(attr.getDefaultValue());
attr = attrs.get(1);
assertEquals("desc", attr.getAttrName());
assertEquals(String.class, attr.getAttrClass());
assertFalse(attr.isRequired());
assertEquals("Test", attr.getDefaultValue());
comp = (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.trinidad.view.test.TestRegion2");
assertEquals("/regions/testRegion2.jspx", comp.getJspUIDef());
attrs = comp.getAttributes();
assertEquals(0, attrs.size());
comp = (ComponentMetaData) rmd.getRegionConfig("org.apache.myfaces.trinidad.view.test.TestRegion3");
assertEquals("/regions/testRegion3.jspx", comp.getJspUIDef());
attrs = comp.getAttributes();
assertEquals(0, attrs.size());
}