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

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:

              Development