felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre De Rop <pierre.de...@gmail.com>
Subject pax exam and temporary files ...
Date Wed, 24 Feb 2010 07:54:00 GMT
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
    public void tearDown(BundleContext context) {
        try {
            File f = new File(new
        } catch (Throwable t) {

... And then, my unit tests just inherit the Base class like this:

public class MyTest extends Base
    public static Option[] configuration()
        return options(

                // ..

2) the other consists in just setting the* java.io.tmpdir* parameter to my
target's project like this:


-> 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;

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message