public static MetaClassLoader get(ClassLoader cl) { if(cl ==null) return null; // if no parent, delegate to the debug loader if available. synchronized(classMap) { MetaClassLoader mc = classMap.get(cl); if(mc==null) { mc = new MetaClassLoader(cl); classMap.put(cl,mc); } return mc; } }
public static MetaClassLoader get(ClassLoader cl) { if(cl ==null) return null; // if no parent, delegate to the debug loader if available. synchronized(classMap) { MetaClassLoader mc = classMap.get(cl); if(mc==null) { mc = new MetaClassLoader(cl); classMap.put(cl,mc); } return mc; } }
public static MetaClassLoader get(ClassLoader cl) { if(cl ==null) return null; // if no parent, delegate to the debug loader if available. synchronized(classMap) { MetaClassLoader mc = classMap.get(cl); if(mc==null) { mc = new MetaClassLoader(cl); classMap.put(cl,mc); } return mc; } }
/** * Given a jar file or a class file directory, recursively search all the Jelly files and build a {@link TestSuite} * that performs static syntax checks. */ public static TestSuite build(File res) throws Exception { TestSuite ts = new JellyTestSuite(); final JellyClassLoaderTearOff jct = new MetaClassLoader(JellyTestSuiteBuilder.class.getClassLoader()).loadTearOff(JellyClassLoaderTearOff.class); if (res.isDirectory()) { for (final File jelly : (Collection <File>)FileUtils.listFiles(res,new String[]{"jelly"},true)) ts.addTest(new JellyCheck(jelly.toURI().toURL(), jct)); } if (res.getName().endsWith(".jar")) { String jarUrl = res.toURI().toURL().toExternalForm(); JarFile jf = new JarFile(res); Enumeration<JarEntry> e = jf.entries(); while (e.hasMoreElements()) { JarEntry ent = e.nextElement(); if (ent.getName().endsWith(".jelly")) ts.addTest(new JellyCheck(new URL("jar:"+jarUrl+"!/"+ent.getName()), jct)); } jf.close(); } return ts; }
/** * Given a jar file or a class file directory, recursively search all the Jelly files and build a {@link TestSuite} * that performs static syntax checks. */ public static TestSuite build(File res) throws Exception { TestSuite ts = new JellyTestSuite(); final JellyClassLoaderTearOff jct = new MetaClassLoader(JellyTestSuiteBuilder.class.getClassLoader()).loadTearOff(JellyClassLoaderTearOff.class); if (res.isDirectory()) { for (final File jelly : (Collection <File>)FileUtils.listFiles(res,new String[]{"jelly"},true)) ts.addTest(new JellyCheck(jelly.toURI().toURL(), jct)); } if (res.getName().endsWith(".jar")) { String jarUrl = res.toURI().toURL().toExternalForm(); JarFile jf = new JarFile(res); Enumeration<JarEntry> e = jf.entries(); while (e.hasMoreElements()) { JarEntry ent = e.nextElement(); if (ent.getName().endsWith(".jelly")) ts.addTest(new JellyCheck(new URL("jar:"+jarUrl+"!/"+ent.getName()), jct)); } jf.close(); } return ts; }
/** * Given a jar file or a class file directory, recursively search all the Jelly files and build a {@link TestSuite} * that performs static syntax checks. */ public static TestSuite build(File res, boolean requirePI) throws Exception { TestSuite ts = new JellyTestSuite(); final JellyClassLoaderTearOff jct = new MetaClassLoader(JellyTestSuiteBuilder.class.getClassLoader()).loadTearOff(JellyClassLoaderTearOff.class); for (Map.Entry<URL,String> entry : scan(res, "jelly").entrySet()) { ts.addTest(new JellyCheck(entry.getKey(), entry.getValue(), jct, requirePI)); } return ts; }
/** * Given a jar file or a class file directory, recursively search all the * Jelly files and build a {@link TestSuite} that performs static syntax * checks. */ public static TestSuite build(File res) throws Exception { TestSuite ts = new JellyTestSuite(); final JellyClassLoaderTearOff jct = new MetaClassLoader(JellyTestSuiteBuilder.class.getClassLoader()).loadTearOff(JellyClassLoaderTearOff.class); if (res.isDirectory()) { for (final File jelly : (Collection<File>) FileUtils.listFiles(res, new String[]{"jelly"}, true)) { ts.addTest(new JellyCheck(jelly.toURI().toURL(), jct)); } } if (res.getName().endsWith(".jar")) { String jarUrl = res.toURI().toURL().toExternalForm(); JarFile jf = new JarFile(res); Enumeration<JarEntry> e = jf.entries(); while (e.hasMoreElements()) { JarEntry ent = e.nextElement(); if (ent.getName().endsWith(".jelly")) { ts.addTest(new JellyCheck(new URL("jar:" + jarUrl + "!/" + ent.getName()), jct)); } } jf.close(); } return ts; }