Uploaded image for project: 'SonarPHP'
  1. SonarPHP
  2. SONARPHP-826

NPE when parsing test report where a "testsuite" doesn't have a "time" attribute

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.15
    • Component/s: Unit Tests
    • Labels:
      None

      Description

      A NullPointerException should not be thrown when a report contains a "testsuite" with no "time" attribute, e.g.:

      <?xml version="1.0" encoding="UTF-8"?>
      <testsuites>
      <testsuite name="suite1" tests="10" assertions="8" errors="1" failures="1" skipped="2" time="0.000430">
          <testsuite name="Test1" file="src/Test1.php" tests="1" assertions="1" errors="0" failures="0" skipped="0">
              <testcase name="test1" class="Test1" file="src/Test1.php" line="26" assertions="1"/>
          </testsuite>
      </testsuite>
      </testsuites>
      

        Attachments

          Activity

            People

            Assignee:
            pierre-yves.nicolas Pierre-Yves Nicolas
            Reporter:
            pierre-yves.nicolas Pierre-Yves Nicolas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: