[ 
https://issues.apache.org/jira/browse/COMPRESS-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stefan Bodewig resolved COMPRESS-205.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5

I've extracted the common "get file from src/test/resources via classloader" 
logic and used that all over the place.  It would be good if you could verify 
svn revision 1439043 works for you.
                
> Unit tests can fail when path to project is non-trivial (fix in description)
> ----------------------------------------------------------------------------
>
>                 Key: COMPRESS-205
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-205
>             Project: Commons Compress
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Daniel Lowe
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: COMPRESS-205.patch
>
>
> 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()));
>     }

--
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: http://www.atlassian.com/software/jira

Reply via email to