2 Replies Latest reply on Jun 25, 2013 8:50 AM by borges

    Move 2.3.x to JUnit4?

    borges Novice

      Hi,

       

      IMO the migration to JUnit4 has been great as it allowed us to remove all sorts of ugly hacks from HQ test code since JUnit4 supported the use cases that were forcing us to hacks while using JUnit3.

       

      Now I just had to merge the fix to HORNETQ-1224 into 2.3.x. It forced me to do all sorts of little edits because the tests I wrote used JUnit4 and in 2.3.x we are using Junit3.

       

      In short, merging anything into 2.3.x concerning unitests will be a PITA, and anything that will get merged into 2.3.x will have unittests...

       

      We are only changing test code, and we have code to automatically do most of the work. Any votes? +-1?

        • 1. Re: Move 2.3.x to JUnit4?
          Clebert Suconic Master

          + and -....

           

           

          what would be the cost on accepting them both? new tests on 2.3 using junit4, current ones at junit3?

           

           

          we would need to talk to QA guys before we do any moves on that.. once in production these branches are not just ours any longer...

          • 2. Re: Move 2.3.x to JUnit4?
            borges Novice

            Hi,

             

            We can't really mix them because:

            • Unfortunatelly, all tests using the same base classes need to be on the same JUnit-scheme (3 or 4). I assume that tests getting back-ported to 2.3.x would just use the current normal base-classes.
            • Some APIs from JUnit3 (that we use in 2.3.x) were removed from JUnit4. Deleted. So even if we had some JUnit3 and JUnit4 tests co-existing (by running JUnit3-like tests with a JUnit4 jar), a number of tests cases would need to be ported anyway.

             

            If I knew of a way to mix JUnit3 and JUnit4 tests (given HornetQ's specific usage of JUnit) in 2.3.x, I would not be proposing this... (which I reckon is a sort of a PITA but which I think it is less of a pain than staying with Junit3 in 2.3.x).