@Test public void testClassLoaderDirFromJarWithSlash() throws Exception { String d = utils.getClassLoaderDir("/java/lang/Object.class"); log.info("Found Object in: " + d); assertTrue(d.toLowerCase().endsWith(".jar")); }
@Test(expectedExceptions = {NoSuchElementException.class}) public void testClassLoaderDirNotFound() throws Exception { String d = utils.getClassLoaderDir("/somewhere/not/found/XXX.xxx"); // above should fail log.warn("Uh oh found iamginary resource in: " + d); }
@Test public void testClassLoaderDir() throws Exception { String d = utils.getClassLoaderDir(); log.info("Found resource " + this + " in: " + d); assertTrue(new File(d + "/brooklyn/util/").exists()); }