• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jsf and Junit

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic