ClassLoaderUtils { @Deprecated public static File getLocationOfClassPath() { return BasicFileUtils.toCanonicalFile(extractPathFromURL(getUrlOfClassPath())); } private  ClassLoaderUtils(); @Deprecated static File findClassPathOfClass(Class<?> cl); static URL findUrlClassPathOfClass(Class<?> cl); static URL extractFileUrlFromUrl(URL url); @Deprecated static File extractPathFromURL(URL url); static URL getUrlOfClassPath(); @Deprecated static File getLocationOfClassPath(); static ClassLoader classLoaderFromClassPathUrls(Collection<URL> classPath, ClassLoader parent); @Deprecated static ClassLoader classLoaderFromClassPath(Collection<File> classPath, ClassLoader parent);  }
@Test public void testGetLocationOfClassPath() { File dir = ClassLoaderUtils.getLocationOfClassPath(); assertTrue("Class path must exist", dir.exists()); }
@Test public void testGetLocationOfClassPathInDirectory() { File dir = ClassLoaderUtils.getLocationOfClassPath(); assumeTrue("The project binaries must be in a directory and not a jar for this test to be executed", dir.isDirectory()); String relPath = ClassLoaderUtils.class.getName().replace(".", File.separator) + ".class"; File classFile = new File(dir, relPath); assertTrue("Class file must be on the class path: " + dir, classFile.isFile()); }