KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > TestHelper


1 package org.nanocontainer;
2
3 import java.io.File JavaDoc;
4
5 public class TestHelper {
6
7     public static File JavaDoc getTestCompJarFile() {
8         String JavaDoc testcompJarProperty = System.getProperty("testcomp.jar");
9         if (testcompJarProperty != null) {
10             return new File JavaDoc(testcompJarProperty);
11         }
12
13         Class JavaDoc aClass = TestHelper.class;
14         File JavaDoc base = new File JavaDoc(aClass.getProtectionDomain().getCodeSource().getLocation().getFile());
15         File JavaDoc tj = new File JavaDoc(base,"src/test-comp/testcomp.jar");
16         while (!tj.exists()) {
17             base = base.getParentFile();
18             tj = new File JavaDoc(base,"src/test-comp/testcomp.jar");
19         }
20         return tj;
21     }
22
23
24 }
25
Popular Tags