Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5AAFFD417 for ; Mon, 31 Dec 2012 11:48:14 +0000 (UTC) Received: (qmail 7325 invoked by uid 500); 31 Dec 2012 11:48:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 7253 invoked by uid 500); 31 Dec 2012 11:48:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 7236 invoked by uid 99); 31 Dec 2012 11:48:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Dec 2012 11:48:12 +0000 Date: Mon, 31 Dec 2012 11:48:12 +0000 (UTC) From: "Stefan Bodewig (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COMPRESS-205) Unit tests can fail when path to project is non-trivial (fix in description) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COMPRESS-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13541348#comment-13541348 ] 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: https://issues.apache.org/jira/browse/COMPRESS-205 > 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 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