Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsf and Junit  RSS feed

 
Ben Bouchard
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm quite new to the world of Java and JSF but we have a new project and I'm the one looking in on Junit. So far it's been ok but I can't figure out how to test JavaBeans with JSF's.

A simple case would be testing a message method that uses the FacesContext :

My method :

My test method :


I guess I have to instanciate a JSP somewhere along the way but I'm kind of lost so far .

Does anyone have a link to Unit testing WITH JSF ?

Thanks

-Ben
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example from Spring

Basically, it creates and registers it's own FacesContext for use.
 
Ben Bouchard
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Carl,

The thing is, I'm not and won't be using the spring framework and from what I gather from the exemple, it calls a class from the framework to instantiate or simulate a FacesContext.

Would I be better off looking in on HttpUnit or JwebUnit to test Jsf's ?

-Ben
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!