Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3181

JavaCheckVerifier should fail test rather than erroring when test conditions are not met

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: Rules
    • Labels:
      None

      Description

      Currently, the JavaCheckVerifier is erroring tests (throwing IllegalStateException) when some conditions are not met:

      • No issues are raised during analysis, while some issues were expected
      • Rules having a "Constant" remediation cost are providing a "cost to fix" (which is not supposed to happen)
      • Multiple issues are reported on a file while we always expect to have a single one at file level

      In order to differentiate faults in implementation (NullPointerException or IndexOutOfBoundException, for instance) from errors in the logic of the rule, the JavaCheckVerifier should fail the test, rather than erroring and throwing the exception.

        Attachments

          Activity

            People

            • Assignee:
              michael.gumowski Michael Gumowski
              Reporter:
              michael.gumowski Michael Gumowski
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: