// test vertical inheritance
ComponentBean bean = standardConfigBean.getElement("baseSymbolLabel");
assertNotNull(bean);
//look for a base symbol definition
SymbolBean symbol = (SymbolBean) bean.getSymbols().get("@mystyle");
assertNotNull(symbol);
assertEquals("@mystyle == color:blue", "color:blue", symbol.getValue());
// symbol1Label extends baseSymbolLabel
bean = standardConfigBean.getElement("symbol1Label");
assertNotNull(bean);
//look for inherited symbol
symbol = (SymbolBean) bean.getSymbols().get("@mystyle");
assertNotNull(symbol);
assertEquals("@mystyle == color:blue", "color:blue", symbol.getValue());
// symbol2Label extends symbol1Label
bean = standardConfigBean.getElement("symbol2Label");
assertNotNull(bean);
//look for an overridden symbol
symbol = (SymbolBean) bean.getSymbols().get("@mystyle");
assertNotNull(symbol);
assertEquals("@mystyle == color:red", "color:red", symbol.getValue());
//test nested/inner element inheritance
bean = standardConfigBean.getElement("symbolPanel");
assertNotNull(bean);
assertEquals(bean.getChildren().size(), 2);
Iterator ei = bean.getChildrenIterator();
while (ei.hasNext()) {
ElementBean ebean = (ElementBean) ei.next();
if (ebean.getRenderId() == 1) {
//look for inherited symbol
symbol = (SymbolBean) ebean.getSymbols().get("@mystyle");
assertNotNull(symbol);
assertEquals("@mystyle == color:blue", "color:blue", symbol.getValue());
} else if (ebean.getRenderId() == 2) {
//look for an overridden symbol
symbol = (SymbolBean) ebean.getSymbols().get("@mystyle");
assertNotNull(symbol);
assertEquals("@mystyle == color:red", "color:red", symbol.getValue());
}
}