Commons Compress
  1. Commons Compress
  2. COMPRESS-205

Unit tests can fail when path to project is non-trivial (fix in description)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      Description

      return factory.createCompressorInputStream(new BufferedInputStream(new FileInputStream(new File(rsc.getFile()))));

      can fail to find the files for testing e.g. /root/.jenkins/jobs/Commons%20Compress/workspace/target/test-classes/test.txt (No such file or directory)

      This can be fixed by simply opening the stream from the URL:

      private CompressorInputStream getStreamFor(String resource)
      throws CompressorException, IOException

      { final URL rsc = classLoader.getResource(resource); assertNotNull("Could not find resource "+resource,rsc); return factory.createCompressorInputStream( new BufferedInputStream(rsc.openStream())); }

        Activity

        Daniel Lowe created issue -
        Daniel Lowe made changes -
        Field Original Value New Value
        Attachment COMPRESS-205.patch [ 12562727 ]
        Stefan Bodewig made changes -
        Fix Version/s 1.5 [ 12320751 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel Lowe
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development