Maven Shared Components
  1. Maven Shared Components
  2. MSHARED-104

Verifier#assertFileNotPresent() fails when looking for an unwanted jar resource

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: maven-verifier-1.0, maven-verifier-1.2
    • Fix Version/s: maven-verifier-1.4
    • Component/s: maven-verifier
    • Labels:
      None
    • Number of attachments :
      0

      Description

      when using Verifier#assertFileNotPresent() to assert that a file is not present inside a jar, the assertion always fails.

      This is because looking for the resource throws a FileNotFoundException which is not catched at the correct place. The code that performs the actual test is never run. The exception should be catched and validated to the "wanted" parameter.

      This can be reproduced like this:

      // always fails even if the file is not present
      verifier.assertFileNotPresent("target/test.jar!/missing.xml");

      I suggest creating a unit test to test this case!

        Activity

          People

          • Assignee:
            Kristian Rosenvold
            Reporter:
            Francis De Brabandere
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: