Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7.2
    • Fix Version/s: None
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Windows XP
      JUnit 4.4
      Cactus 1.7.2

      Description

      I found workaround that it's possible to "integrate" JUnit 4.4 with Cactus 1.7.2.
      Here is the example how do I do:
      public class CactusTestRunner extends ServletTestCase
      {
      public static Test suite()

      { ServletTestSuite suite = new ServletTestSuite("ahojO"); suite.addTest (new JUnit4TestAdapter (xxx.class)); }

      }
      – creates JUnit 3.8 compatible tests from JUnit 4.4 classes....

      I have to do change in the Cactus method: JUnitVersionHelper.getTestCaseName() to enable to write TestCase names to the output file
      else if (theTest.getClass().getSimpleName().equals ("JUnit4TestCaseFacade"))
      {
      try

      { Class cl = Class.forName (theTest.getClass().getName ()); Method me = cl.getMethod ("getDescription"); Object desc = me.invoke (theTest); Class clDesc = Class.forName (desc.getClass().getName()); Method meDesc = clDesc.getMethod ("getDisplayName"); name = (String) meDesc.invoke (desc); }

      catch (Throwable e)

      { name = "unknown"; }

      }

      The bad is that you have to have both JUnit 3.8 and JUnit 4.4 archive in testing application. There could be problems with class loader but haven't got any. So I believe that Cactus developers could use my workaround to fastly increase of JUnit dependency to JUnit 4.x.

        Activity

        Jan Krivanek created issue -
        Petar Tahchiev made changes -
        Field Original Value New Value
        Assignee Petar Tahchiev [ paranoiabla ]
        Hide
        amit khumse added a comment -

        Hi,
        We would like to upgrade our JUnit from 3.8 to 4.7. We have some cactus test cases as well. The solution provided here is not verified by anyone. Please let us know if this solution is working fine or not.

        Show
        amit khumse added a comment - Hi, We would like to upgrade our JUnit from 3.8 to 4.7. We have some cactus test cases as well. The solution provided here is not verified by anyone. Please let us know if this solution is working fine or not.
        Hide
        Stephane Nicoll added a comment -

        Is there at least the ability to bundle Junit 4.4 only and use Junit 3.X based tests using the maven plugin? Right now, we also ship junit 4.4 because some of our underlying assertion test helpers use Junit 4.x code.

        Show
        Stephane Nicoll added a comment - Is there at least the ability to bundle Junit 4.4 only and use Junit 3.X based tests using the maven plugin? Right now, we also ship junit 4.4 because some of our underlying assertion test helpers use Junit 4.x code.

          People

          • Assignee:
            Petar Tahchiev
            Reporter:
            Jan Krivanek
          • Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Development