[jboss-user] [JBoss Seam] - Substituting ScopeType.APPLICATION components during testing
charles.crouch@jboss.com
do-not-reply at jboss.com
Tue Mar 13 11:29:34 EDT 2007
Say you have a component in your app annotated like:
@Name("productionInitializer")
@Scope(ScopeType.APPLICATION)
@Startup
which sets up some stuff that you will need in production.
Now assume you want to test your app using SeamTest and a FacesRequest say, but using a mock implementation of "productionInitializer". Is it possible from within your test to specify an alternative implementation for "productionInitializer"?
If you were testing just a single POJO component then I guess you could just inject your mock implementation into the component e.g. pojo.setInitializer(mockInitializer), and start testing from there. But I don't know if its possible to do something similar within the more managed environment of SeamTest?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027579#4027579
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027579
More information about the jboss-user
mailing list