1 Reply Latest reply on Aug 27, 2008 3:06 PM by Stan Silvert

    JSFUnit

    Bob Corcoran Newbie

      I'm starting a new Seam project and I would like to use JSFUnit. I have the Seam project all set up and ready to go, but I have a question (that may sound naive but I am also new to Seam).

      Do the managed beans have to be written first before JSF unit tests can be run on an xhtml file?

        • 1. Re: JSFUnit
          Stan Silvert Master

          No. In fact, I would encourage you to do true Test Driven Development with JSFUnit. This means that as soon as you start to develop an xhtml file, write a test for it. Then when you start to wire up your xhtml with managed beans, validators, a live database, etc., you will have nice tests that make sure the output is consistent on the client side.

          The same is true for testing navigation. Usually, your JSF application will start out with static navigation, which can be tested with the JSFServerSession object. Then when the navigation is changed to be dynamic your old tests should still pass.

          When you finally do get around to adding managed beans, you will test those with JSFServerSession as well.

          But you can certainly start out using only the JSFClientSession to test the output that the browser will see.

          BTW, Seam support is now built into the JSFUnit core in Beta 3. So you no longer need the SeamClient class. The bits for Beta 3 are now in the Maven repo but I need to update the wiki and the JSFUnit web site before I post a formal announcement here.

          Stan