6 Replies Latest reply on Jun 1, 2010 7:20 AM by ssilvert

    JUnit 4

    kito99

      I don't see any definitive information (i.e. on the Wiki) about how to use JSFUnit with JUnit 4. From what I can tell, it just requires upgrading to Cactus 1.8, but Cactus has a few dependencies, and I don't want to go through a trial/error process to see if upgrading them breaks JSFUnit. Is there documentation somewhere, or does someone have a definitive list of JARs that we can add to the Wiki for JUnit 4.x support?

       

      -- Kito

        • 1. Re: JUnit 4
          ssilvert

          Hi Kito,

           

          You can use the JUnit 4 jar with JSFUnit, but you can't use the annotations.  JSFUnit doesn't use Cactus 1.8.  I think that Cactus 1.8 has the same restrictions.  Please let me know if I'm wrong because Cactus is the thing that is keeping JSFUnit from supporting JUnit 4.

           

          JSFUnit 2 probably won't use Cactus at all, but if Cactus can use full JUnit 4 then we might stick with it.

           

          Stan

          • 2. Re: JUnit 4
            kito99

            Stan Silvert wrote:

             

            Hi Kito,

             

            You can use the JUnit 4 jar with JSFUnit, but you can't use the annotations.  JSFUnit doesn't use Cactus 1.8.  I think that Cactus 1.8 has the same restrictions.  Please let me know if I'm wrong because Cactus is the thing that is keeping JSFUnit from supporting JUnit 4.

             

            JSFUnit 2 probably won't use Cactus at all, but if Cactus can use full JUnit 4 then we might stick with it.

             

            Stan

            Hmmm.. I don't know. I just upgraded to JBoss 5 for this project, and I couldn't get JSFUnit to run unless I downgraded to JUnit 3.8.1. I tried JUnit 4.1 and JUnit 4.8. I'm getting the same exception shown here:  http://community.jboss.org/message/70366#70366.

             

            -- Kito

            • 3. Re: JUnit 4
              ssilvert

              I'm only basing my information on what Petar Tahchiev (Cactus lead) told me.  So your mileage may vary.

               

              Strangely, I haven't had that much pushback from people who are dying to use JUnit 4.  I know support needs to be there and certainly the more noise folks make the more impetus there is to work on JSFUnit 2, which should solve this problem and will hopefully allow us to use TestNG as well as JUnit 4.

               

              As we talked about privately, my main problem is time and resources.  JSFSpy needs some care and feeding too.  I think that overall it is potentally an even more useful tool than JSFUnit.  I just need more help.

               

              Stan

              • 4. Re: JUnit 4
                kito99

                Stan Silvert wrote:

                 

                I'm only basing my information on what Petar Tahchiev (Cactus lead) told me.  So your mileage may vary.

                 

                Strangely, I haven't had that much pushback from people who are dying to use JUnit 4.  I know support needs to be there and certainly the more noise folks make the more impetus there is to work on JSFUnit 2, which should solve this problem and will hopefully allow us to use TestNG as well as JUnit 4.

                 

                Ok -- so I think it's a library issue. I removed some other libraries from the build that are included in JBoss and now JUnit 4 works fine. I think this is why you haven't gotten too much pushback. As long as you can have JUnit 4 in your classpath and use the annotations for other tests, it's all good.

                 

                Stan Silvert wrote:

                 

                As we talked about privately, my main problem is time and resources.  JSFSpy needs some care and feeding too.  I think that overall it is potentally an even more useful tool than JSFUnit.  I just need more help.

                 

                 

                Yeah, I figured that was part of the issue. I would definitely help out if I had the time myself :-).

                 

                -- Kito

                • 5. Re: JUnit 4
                  easyrider

                  Hi,

                   

                  We would like to test our web application (spring 3.0.2, tomcat 6, jsf 1.2, richfaces 3.3.3) with jsfunit. We are using junit 4.8.1 library for our unit tests. But jsfunit (1.2.0.Final) requires non existing class junit.runner.TestSuiteLoader. If i downgrade to junit 3.8, i can't use annotations in my Test classes any more.

                   

                  Is there a solution for it?

                   

                   

                  Thanx in advance

                  • 6. Re: JUnit 4
                    ssilvert

                    As I stated above, you can use JUnit 4, but you can't use the annotations.

                     

                    We plan to have full JUnit 4 support in the next major release, but I don't know when that will happen.

                     

                    Stan