[jboss-user] [JBoss Seam] - Inject a mocked component for integration testing

denis.diggin do-not-reply at jboss.com
Thu May 17 07:32:40 EDT 2007


How can I inject a mocked Renderer into my component for integration testing?


  | @Scope(ScopeType.CONVERSATION)
  | @Name("myService")
  | public class MyService {
  | 
  | 	@In(create = true)
  | 	private Renderer renderer;
  | 
  | 	public void send() {
  | 		renderer.render("/myEmail.xhtml");
  | 	}
  | }
  | 

test.....

Renderer mockRenderer = getMockRenderer();
  | MyService myService = (MyService)lookup("myService");
  | // inject the mockRenderer, or put it somewhere the BijectionInterceptor will find it
  | myService.save();
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046452#4046452

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046452



More information about the jboss-user mailing list