Hi,
> I found that if I set
> Util.setUnitTestModeEnabled(true) then I can get the
> FacesConfigBean from the context:
> FacesConfigBean fcb =
> (FacesConfigBean)context.getAttribute("com.sun.faces.F
> ACES_CONFIG_BEAN");
I'm not really sure why you need all the beans of your application, but it looks to me that what you're doing might not be the best way. In other words, calling Util.setUnitTestModeEnabled(true) may have a number of side-effects that you wouldn't want to have in a production environment.
If the design of your application really does require you to have access to all bean instances, then I would advocate using a mechanism that uses the default (empty) constructor of the beans, like e.g.:
[code]
public MyBean() {
BeanCollector.collect(this);
}
[/code]
With BeanCollector holding a static collection (which you may want to put in a ThreadLocal).
Manuel
[Message sent by forum member 'manuelbernhardt']
http://forums.java.net/jive/thread.jspa?messageID=482225