commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (JIRA)" <>
Subject [jira] [Commented] (COMPRESS-205) Unit tests can fail when path to project is non-trivial (fix in description)
Date Mon, 31 Dec 2012 11:48:12 GMT


Stefan Bodewig commented on COMPRESS-205:

Some of our tests will need real File instances (at least those of ZipFile and some Pack200
ones), but we could make thse tests conditional or use JUnit4 assumptions.  I'll look into
it a bit later.
> Unit tests can fail when path to project is non-trivial (fix in description)
> ----------------------------------------------------------------------------
>                 Key: COMPRESS-205
>                 URL:
>             Project: Commons Compress
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Daniel Lowe
>            Priority: Minor
>         Attachments: COMPRESS-205.patch
> return factory.createCompressorInputStream(new BufferedInputStream(new FileInputStream(new
> 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()));
>     }

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message