6 Replies Latest reply on Jun 10, 2009 8:29 AM by Wolfgang Knauf

    JSFUnit Introduction

    Stan Silvert Master

      JSFUnit is an integration test framework for JSF applications. It is designed to allow complete integration testing and debugging of JSF applications at the JSF level. JSFUnit tests run inside the container, which provides the developer full access to managed beans, the FacesContext, and the internal JSF component tree. At the same time, you also have access to the HTML output of each client request.

      No mock objects are required and you don't need to make any changes to your JSF application to run JSFUnit tests.

      Go to http://labs.jboss.com/jsfunit/ for demos, tutorials, and other project info.

      You can also visit the JSFUnit blog for more details on the philosophy behind it. http://jsfunit.blogspot.com/

      If you have a question or comment, post it right here in this forum.

      Stan Silvert
      JSFUnit Project Lead

        • 1. Re: JSFUnit Introduction
          Shree Bose Newbie

          Hello Stat,

          I am staring with JSF unit testing.i am trying out with ur Getting Started link.

          I have following querries,please do clarify me:-

          1. Do i need to create a separate project for JSFUnit testing in eclipse?
          2. If so, what type of project i shud create?
          3. Presently i have created a normal project and kept the 2 files posted in your site in Getting Started,but gettinr many compilation errors.I have kept the jars given in that link in my project buildpath,still the same problem.

          4. After that what i need to do to run the testcase,like deploying,and running in tomcat6?


          • 2. Re: JSFUnit Introduction
            Shree Bose Newbie

            Hello Stan,

            I have another major doubt:- what should be the folder structure for JSFUNit testing project?where shud i keep the web.xml part,in my project or JsfUnit project?

            • 3. Re: JSFUnit Introduction
              Stan Silvert Master

              Hi Shree,

              Here is a wiki page with all the JSFUnit documentation including how to set up with Eclipse. It might not answer all of your questions. For each new question please create a new thread instead of using this old one. I'll be more than happy to answer any questions to help you get started.




              • 4. Re: JSFUnit Introduction
                gkumar gkumar Newbie

                I have a question regarding JSFUnit jars. The link
                http://www.jboss.org/jsfunit/gettingstarted.html clearly briefs about how to configure the JSFUnit. But to execute the JSFUnit i need to add all these jars mentioned in that link.
                currently I am evaluating the JSFUnit framework.So if i want to use JSFUnit Ineed to get licence for the jars. If then for which jars?
                I am not clear of the jars for which i should go for licence.Can you help me out in this regard as early as possible

                • 5. Re: JSFUnit Introduction
                  gkumar gkumar Newbie


                  In JSFUnit tester we create
                  JSFSession jsfSession = new JSFSession("/pages/inputname.jsf");
                  JSFClientSession client = jsfSession.getJSFClientSession();
                  JSFServerSession server = jsfSession.getJSFServerSession();

                  the objects in setup(), we use JSFServerSession obj to get data on server side and JSFClientSession obj on client side.so once done is it required to make these JSFClientSession and JSFServerSession obj clear in teardown method are the container will handle.
                  I am using tomcat server.

                  • 6. Re: JSFUnit Introduction
                    Wolfgang Knauf Master


                    please don't add unrelated questions to existing threads, always start new ones.

                    The licensing question is answered in your other post.

                    For the JSFSession instance, I would suggest that you create it in each test method and don't keep it as a member of your test class. Each "test" method will have to start a new session.

                    Best regards