Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find JSFUnit real-life example?

I'm trying to use JSFUnit framework, but can't understand how to allocate projects/files. How many projects/sub-projects should I have and whether it is possible to have just ONE project, as it normally happens with JUnit and similar frameworks. Would be nice to see some example.

I still can't understand whether I need to create a separate maven project for testing purposes (as this page says) or I can work in my main project...

like image 623
yegor256 Avatar asked Jul 28 '10 17:07

yegor256


1 Answers

I'm trying to use JSFUnit framework, but can't understand how to allocate projects/files. How many projects/sub-projects should I have and whether it is possible to have just ONE project, as it normally happens with JUnit and similar frameworks. Would be nice to see some example.

The JSFUnit project itself has many examples (as we can see in the JBoss repository) and I suggest to get them from the subversion repository (checkout the whole jboss-jsfunit-examples).

I still can't understand whether I need to create a separate maven project for testing purposes (as this page says) or I can work in my main project...

JSFUnit tests are in-container tests and need to be packaged and deployed as a war. But you obviously don't want them to end up in the "production" WAR and putting them in a separate project is the obvious way to separate things (they will be then merged with the war under test using overlays). So, yes, create a separate project.

See also

  • Test, Test, JSF (the JSFUnit blog)
  • Intro to Exadel RichFaces and JBoss JSFUnit [PDF]
  • Testing RichFaces Applications with JBoss JSFUnit [PDF]
like image 81
Pascal Thivent Avatar answered Sep 26 '22 16:09

Pascal Thivent