Util.deleteFile(pigServer.getPigContext(), "simple_table");
Util.createInputFile(pigServer.getPigContext(), "simple_table", input);
Util.createLocalInputFile( "testScript.js", script);
ScriptEngine scriptEngine = ScriptEngine.getInstance("javascript");
Map<String, List<PigStats>> statsMap = scriptEngine.run(pigServer.getPigContext(), "testScript.js");
assertEquals(1, statsMap.size());
Iterator<List<PigStats>> it = statsMap.values().iterator();
PigStats stats = it.next().get(0);
assertTrue(stats.isSuccessful());
assertEquals(1, stats.getNumberJobs());