Uploaded image for project: 'MRUnit'
  1. MRUnit
  2. MRUNIT-185

IllegalFormatException for '%' in Output

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 1.1.0
    • None

    Description

      In cases where the expected output does not match the actual output, the Errors class will treat the error message created by the TestDriver.checkTypesAndLogError(...) method as a format string. If either the Expected or Actual Output value contains a '%' character, the String.format will result in some type of IllegalFormatException. In my case, I received an UnknownFormatConversionException with "%D" in the expected output.

      Fortunately, this behavior is only triggered if the unit test is in error, but it can make tracking down the source of the issue hard to find.

      Attachments

        1. JIRA_185.patch
          2 kB
          Joseph Beard

        Activity

          People

            Unassigned Unassigned
            jbeard6 Joseph Beard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: