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