![]() This is not what exactly what you are asking for but JSFUnit (which uses JUnit, Cactus, HtmlUnit, and HttpUnit) seems to be a serious candidate for testing in the JSF land. Good luck, and let me know how it works out for you! It would be much, much easier if IceFaces used Spring to match backing beans to JSF pages - then you could simply define the test-beans in an application.xml with the relevant test classes. ![]() Mind you, the whole business of swapping out beans and config files is messy. Voila! You've just unit-tested your JSF components. Once your tests are verified, swap the regular beans and config file back into the app. (This alone may be the reason why very few JSF developers try to unit test JSF output.) This is going to be tricky, because IceFaces loves to munge DIV IDs and other relevant parts of the DOM tree that you may want to sniff for. Your tests will probably need to sniff the raw HTML output to verify the results. If you don't want something as heavy as HTTPUnit, and if you're using Spring in your app, look at this blog post for an excellent way to mock up a full web context without a web server. ![]() The dummy beans, of course, won't touch any business logic or back-end services - they'll simply be simple sets of data that will be easy to verify in your tests.Ĭreate an ant script to substitute in your dummy backing beans and the test config file. ![]() If I understand your question correctly, then it ought to be a simple matter of creating special dummy backing beans for your pages, and then creating a test JSF configuration file mapping those beans to the. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |