use of com.vip.saturn.job.shell.ScriptJobRunner in project Saturn by vipshop.
the class JsonParseObjectTest method readSaturnJobReturn.
private SaturnJobReturn readSaturnJobReturn(String filepath) throws Exception {
Map<String, String> envMap = new HashMap<>();
envMap.put(SystemEnvProperties.NAME_VIP_SATURN_OUTPUT_PATH, this.getClass().getResource(filepath).getFile());
ScriptJobRunner scriptJobRunner = new ScriptJobRunner(envMap, null, null, null, null);
Method createSaturnJobReturnFileMethod = scriptJobRunner.getClass().getDeclaredMethod("createSaturnJobReturnFile");
createSaturnJobReturnFileMethod.setAccessible(true);
createSaturnJobReturnFileMethod.invoke(scriptJobRunner);
Method readSaturnJobReturnMethod = scriptJobRunner.getClass().getDeclaredMethod("readSaturnJobReturn");
readSaturnJobReturnMethod.setAccessible(true);
return (SaturnJobReturn) readSaturnJobReturnMethod.invoke(scriptJobRunner);
}
Aggregations