01: package org.nanocontainer;
02:
03: import java.io.File;
04:
05: public class TestHelper {
06:
07: public static File getTestCompJarFile() {
08: String testcompJarProperty = System.getProperty("testcomp.jar");
09: if (testcompJarProperty != null) {
10: return new File(testcompJarProperty);
11: }
12:
13: Class aClass = TestHelper.class;
14: File base = new File(aClass.getProtectionDomain()
15: .getCodeSource().getLocation().getFile());
16: File tj = new File(base, "src/test-comp/testcomp.jar");
17: while (!tj.exists()) {
18: base = base.getParentFile();
19: tj = new File(base, "src/test-comp/testcomp.jar");
20: }
21: return tj;
22: }
23:
24: }
|