### Question:
JaninoScriptManager extends ScriptManager { @Override public CompiledClass compileScript(String script, File sourceFile) throws CompileException, ClassNotFoundException, IOException { if ( sourceFile.exists() && sourceFile.canRead() ) { try { SimpleCompiler compiler = new SimpleCompiler(); JavaSourceClassLoader javaSourceLoader = new JavaSourceClassLoader( this.getClass().getClassLoader(), new File[]{this.scriptDirFile}, Constant.ENC_UTF8); javaSourceLoader.setDebuggingInfo(true, true, true); compiler.setParentClassLoader(javaSourceLoader); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile)); compiler.cook(bis, Constant.ENC_UTF8); bis.close(); CompiledClass compiledClass = new CompiledClass(); compiledClass.fileLastModified = sourceFile.lastModified(); compiledClass.loadedClass = compiler.getClassLoader().loadClass(script); compiledClass.lastCheckTime = System.currentTimeMillis(); compiledMap.put(script, compiledClass); return compiledClass; } catch (IOException e) { logger.warn("Failed to compile sourceFile {}, exception: ", sourceFile, e); throw e; } } else { String className = script; try { Class clazz = Class.forName(className); CompiledClass compiled = new CompiledClass(); compiled.loadedClass = clazz; return compiled; } catch (Exception e) { logger.warn("Cannot find script file {}", sourceFile.getAbsolutePath()); } } return null; } protected  JaninoScriptManager(); void compileAllScripts(File scriptDirFile); boolean reloadScript(ScriptHook hook); @Override CompiledClass compileScript(String script,
			File sourceFile); static void main(String args[]);  }### Answer:
@Test public void testAllScript() throws Exception { File scriptDirFile = new File("src/main/script"); int error = 0; File targetDir = new File("target/classes/script"); for ( ScriptHook hook : ScriptHook.values() ) { if ( hook == ScriptHook.HELLO ) continue; String sourceFileName = hook.getHook().replace('.', '/').concat(".java"); File sourceFile = new File(scriptDirFile, sourceFileName); try { ((JaninoScriptManager)JaninoScriptManager.getInstance()). compileScript(hook.getHook(), sourceFile); } catch (Exception e) { error++; System.out.println(sourceFile+" failed to compile"); e.printStackTrace(); } } assertEquals(0, error); }