Farouk Alhassan
Farouk Alhassan

Reputation: 3808

Best way to unit test jsf 2.0 Managed Bean

What is the most effective way of unit testing JSF 2.0 managed beans. I have seen JSFUnit from JBoss but it looks like its for testing the components in the facelets pages but not the managed beans themselves.

I want to find a way to effectively unit test only the managed beans.

Any ideas?

Upvotes: 4

Views: 4962

Answers (2)

Aravind Yarram
Aravind Yarram

Reputation: 80192

JSFUnit is another alternative

Upvotes: 3

Michael Borgwardt
Michael Borgwardt

Reputation: 346536

Set up your managed beans so that all their dependencies are injected as managed properties via setters. Then you can manually inject mocks or stubs in your unit tests.

Upvotes: 5

Related Questions