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

JUnit4RunListener doesn't handle apparently 'legal' junit descriptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.8, 2.11
    • 2.12
    • Junit 4.x support
    • None
    • linux/windows/maven 2.2.1
    • 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. parensRegex.patch
          1 kB
          cng
        2. surefire-testcase.zip
          2 kB
          cng

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: