    001    package org.nanocontainer;
    002
    003    import java.io.File;
    004
    005    public class TestHelper {
    006
    007        public static File getTestCompJarFile() {
    008            String testcompJarProperty = System.getProperty("testcomp.jar");
    009            if (testcompJarProperty != null) {
    010                return new File(testcompJarProperty);
    011            }
    012
    013            Class aClass = TestHelper.class;
    014            File base = new File(aClass.getProtectionDomain().getCodeSource().getLocation().getFile());
    015            File tj = new File(base,"src/test-comp/testcomp.jar");
    016            while (!tj.exists()) {
    017                base = base.getParentFile();
    018                tj = new File(base,"src/test-comp/testcomp.jar");
    019            }
    020            return tj;
    021        }
    022
    023
    024    }