4 Replies Latest reply on May 8, 2008 10:17 AM by Alexej

    Start set of tests

    Alexej Newbie

      Hi! I'm new with JSFUnit and I've got a question:

      How can I start a set of tests??

      E.g. there are 5 different test cases wich should be run...


      Best regards Alexej.

        • 1. Re: Start set of tests
          Stan Silvert Master

          There are several different ways, but basically it boils down to two:

          1) Deploy your application and use your browser to hit it with the test url as shown in the Getting Started Guide:
          http://www.jboss.org/jsfunit/gettingstarted.html
          http://wiki.jboss.org/wiki/GettingStartedGuide

          2) Let Maven or Ant deploy your application and run all the tests.
          http://wiki.jboss.org/wiki/JSFUnitWithMaven
          http://wiki.jboss.org/wiki/JSFUnitWithAnt

          I use Maven most often. The JSFUnit test suite contains several applications that are automatically deployed to several different containers. The Maven script starts the container with cargo, deploys the application, and kicks off the whole suite of JSFUnit tests run against these application/web container combinations.

          Since JSFUnit is based on Cactus, there are actually lots of possibilities for kicking off the tests. JSFUnit tests can be run any way that Cactus tests can be run, including from an IDE.

          See http://jakarta.apache.org/cactus/. The only difference is that the Maven plugin and Ant plugin won't bundle everything you need. We have an Ant plugin that helps and we'll create a Maven plugin in the future to make it even easier to deploy and run JSFUnit tests.

          Stan

          • 2. Re: Start set of tests
            Alexej Newbie

            Thanks for the fast ansver.
            For me the first way is more interesting.
            But I meen: how can I run(if it's possible?) e.g. two different test suites without changing start url for every suite.
            I have 2 suites testJSF.java and testJSF2.java
            Somthing like this:
            http://localhost:7080/test/ServletTestRunner?suite=test.TestJSF,testJSF2&xsl=cactus-report.xsl
            doesn't work.

            Best regards Alexej.

            • 3. Re: Start set of tests
              Stan Silvert Master

               

              "akushunin" wrote:
              But I meen: how can I run(if it's possible?) e.g. two different test suites without changing start url for every suite.


              Just make a suite of JUnit tests:

              Here is the one that we use for the RichFaces JSFUnit demo:
              http://jsfunit.demo.jboss.com/jboss-jsfunit-examples-richfaces/ServletTestRunner?suite=org.jboss.jsfunit.example.richfaces.RichFacesTestAll&xsl=cactus-report.xsl
              public class RichFacesTestAll extends ServletTestCase
              {
               public static Test suite()
               {
               TestSuite suite = new TestSuite();
               suite.addTestSuite(ActionParamTest.class);
               suite.addTestSuite(AjaxFormTest.class);
               suite.addTestSuite(AjaxRegionValidationErrorTest.class);
               suite.addTestSuite(AjaxRegionSelfRenderTest.class);
               suite.addTestSuite(AjaxSupportTest.class);
               suite.addTestSuite(AjaxCommandButtonTest.class);
               suite.addTestSuite(AjaxCommandLinkTest.class);
               suite.addTestSuite(AjaxJsFunctionTest.class);
               suite.addTestSuite(AjaxKeepaliveTest.class);
               suite.addTestSuite(AjaxIncludeTest.class);
               suite.addTestSuite(AjaxOutputPanelTest.class);
               suite.addTestSuite(AjaxRepeaterTest.class);
               suite.addTestSuite(RichDataFilterSliderTest.class);
               suite.addTestSuite(RichDataTableScrollerTest.class);
               suite.addTestSuite(RichDragAndDropTest.class);
               suite.addTestSuite(RichDropDownMenuTest.class);
               suite.addTestSuite(RichCalendarTest.class);
               suite.addTestSuite(RichInputNumberSliderTest.class);
               suite.addTestSuite(RichInputNumberSpinnerTest.class);
               suite.addTestSuite(RichTabPanelTest.class);
               suite.addTestSuite(RichPanelMenuTest.class);
               return suite;
               }
              
              }


              Stan

              • 4. Re: Start set of tests
                Alexej Newbie

                Thanks Stan! Now all clear...