Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-822

JUnit4RunListener doesn't handle apparently 'legal' junit descriptions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8, 2.11
    • Fix Version/s: 2.12
    • Component/s: Junit 4.x support
    • Labels:
      None
    • Environment:
      linux/windows/maven 2.2.1
    • Flags:
      Patch

      Description

      from trawling around in the junit code, it appears that a 'legal' displayName for a test org.junit.runner.Description takes the format:

      <anyText>(className)

      This is created by the method Description.createTestDescription(Class<?> clazz, String name, Annotation... annotations).

      JunitParams creates names in the format:

      <parameterText> (<methodName>)(className)

      and the PARENS regex in JUnit4RunListener doesn't parse this correctly, so fails to find the className. If surefire is run in parallel mode this bombs the ConcurrentReporterManager with an NPE. This stops all subsequent tests from being reported correctly.

      There are some changes in SUREFIRE-800 which may stop the NPE from ConcurrentReporterManager, but I've attached a patch to make the PARENS regex just search for the contents of the last pair of braces.

        Attachments

        1. surefire-testcase.zip
          2 kB
          cng
        2. parensRegex.patch
          1 kB
          cng

          Activity

            People

            • Assignee:
              krosenvold Kristian Rosenvold
              Reporter:
              cng cng
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: