ClayContext clayContext = new ClayContext();
clayContext.setFacesContext(facesContext);
clayContext.setSymbols(symbols);
SymbolBean symbol = this.createSymbol("@a", "@b");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@b", "@c");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@c", "@d");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@d", "test");
symbols.put(symbol.getName(), symbol);
AbstractCommand.realizeSymbols(clayContext);
symbol = (SymbolBean) symbols.get("@a");
assertNotNull(symbol);
assertEquals("test", symbol.getValue());
symbol = (SymbolBean) symbols.get("@b");
assertNotNull(symbol);
assertEquals("test", symbol.getValue());
symbol = (SymbolBean) symbols.get("@c");
assertNotNull(symbol);
assertEquals("test", symbol.getValue());
symbol = (SymbolBean) symbols.get("@d");
assertNotNull(symbol);
assertEquals("test", symbol.getValue());
symbols.clear();
symbol = this.createSymbol("@a", "@b");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@b", "@a");
symbols.put(symbol.getName(), symbol);
AbstractCommand.realizeSymbols(clayContext);
symbol = (SymbolBean) symbols.get("@a");
assertNotNull(symbol);
assertEquals("@a", symbol.getValue());
symbol = (SymbolBean) symbols.get("@b");
assertNotNull(symbol);
assertEquals("@a", symbol.getValue());
symbols.clear();
symbol = this.createSymbol("@foo", "@xbeanx.@xpropertyx");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@xbeanx", "@a");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@xpropertyx", "@b");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@a", "foo");
symbols.put(symbol.getName(), symbol);
symbol = this.createSymbol("@b", "bar");
symbols.put(symbol.getName(), symbol);
AbstractCommand.realizeSymbols(clayContext);
symbol = (SymbolBean) symbols.get("@foo");
assertNotNull(symbol);
assertEquals("foo.bar", symbol.getValue());
}