Code example for ResourceScriptSource

0
	} 
 
	@Test
	public void testRhinoHadoopScript() throws Exception {
		UrlResource urlResource = new UrlResource(getClass().getResource("basic-script.js"));
		ScriptSource script = new ResourceScriptSource(urlResource);
 
		Jsr223ScriptEvaluator eval = new Jsr223ScriptEvaluator();
		eval.setLanguage("javascript");
 
		Map<String, Object> args = new LinkedHashMap<String, Object>();
		FileSystem fs = FileSystem.get(config);
		SimplerFileSystem sfs = new SimplerFileSystem(fs);
		 
		args.put("fs", sfs);
		args.put("fsh", new FsShell(config, sfs));
 
		eval.evaluate(script, args);
	} 
 
	@Test
	public void testScriptNSJavaScript() throws Exception {
		assertTrue(ctx.containsBean("script-js"));