Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 50547 invoked from network); 24 Feb 2010 07:54:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2010 07:54:29 -0000 Received: (qmail 4955 invoked by uid 500); 24 Feb 2010 07:54:29 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 4880 invoked by uid 500); 24 Feb 2010 07:54:29 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 4870 invoked by uid 99); 24 Feb 2010 07:54:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 07:54:29 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pierre.derop@gmail.com designates 72.14.220.152 as permitted sender) Received: from [72.14.220.152] (HELO fg-out-1718.google.com) (72.14.220.152) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 07:54:20 +0000 Received: by fg-out-1718.google.com with SMTP id e21so494817fga.10 for ; Tue, 23 Feb 2010 23:54:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=SD6mWK7wJWqlHLAbOKwbk3e9lN8zuXfpSzvtVu48DH4=; b=VCWqxEznyrfoL7cZBUpq8QjnbcjcKfubY1HUQCdbPN48tcLDIArmcU961tL4Lp1Fb4 a69xjuzqYkDGCbknHtfbnESNdMp2ruqc/4j2zNhZ6pqsbio+kbn5OMV8NdAOxe3Erxpl jhB4OjgjNef8kUFcYyEDePmHnbRsh8VuywQr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=gpYYjlZMOT4aH1QtEgi+n31MTe3vWliefAcyNTZNY9x+eG1rvw9xQZf0IAO0ZoHJof KKSxq/RwozvMGcO0DbcB52s3ILQkZ9slKWAClflw2amdlpGmf7PBS6eV/5FHFe3OSS5V 7bzE07Hy2z3ctNggY/WfYbzk/SNNwWZfI0jhg= MIME-Version: 1.0 Received: by 10.103.126.23 with SMTP id d23mr1361048mun.104.1266998040557; Tue, 23 Feb 2010 23:54:00 -0800 (PST) Date: Wed, 24 Feb 2010 08:54:00 +0100 Message-ID: <8203224e1002232354p625985d5u505691f03ca86f02@mail.gmail.com> Subject: pax exam and temporary files ... From: Pierre De Rop To: dev@felix.apache.org Content-Type: multipart/alternative; boundary=0016e65c8d942379c9048053f855 X-Virus-Checked: Checked by ClamAV on apache.org --0016e65c8d942379c9048053f855 Content-Type: text/plain; charset=ISO-8859-1 Hello everyone, I am facing a little issue with pax-exams and Junit4TestRunner test classes, and I would like to know if someone else got caught by the same problem: When I launch a "mvn test" command, and once the test is done, some temporary files are left in* /tmp/tb/ *directory ... So, the temp file system grows ineluctably and I would like to avoid that problem. In order to work around, I have found the two following solutions: 1) make a base class which is inherited by all unit tests: this base class just ensures that the bundle's location file is cleaned once the jvm exits: public class Base { /** * Always cleanup our bundle's location file */ @After public void tearDown(BundleContext context) { try { File f = new File(new URL(context.getBundle().getLocation()).getPath()); f.deleteOnExit(); } catch (Throwable t) { t.printStackTrace(); } } } ... And then, my unit tests just inherit the Base class like this: @RunWith(JUnit4TestRunner.class) public class MyTest extends Base { @Configuration public static Option[] configuration() { return options( provision( mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version("4.1.0"), // .. 2) the other consists in just setting the* java.io.tmpdir* parameter to my target's project like this: org.apache.maven.plugins maven-surefire-plugin 2.4.3 java.io.tmpdir ${basedir}/target/temp -> So, the tb directory is stored in my maven project's target/temp directory, which is cleaned when I type "mvn clean" The drawbak of this second solution is that the felix fwk, as well as pax-exams bundles are always downloaded each time I type "mvn clean test" ... So, I will use the solution 1) for now, but I would like to know if there is a better/simpler way to resolve this problem ? Is there a pax-exams configuration property which allows to ensure that the /tmp/tb/*.bin temp files are cleaned after jvm exits ? thanks in advance; /pierre --0016e65c8d942379c9048053f855--