Search in sources :

Example 1 with ScriptJobRunner

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);
}
Also used : ScriptJobRunner(com.vip.saturn.job.shell.ScriptJobRunner) SaturnJobReturn(com.vip.saturn.job.SaturnJobReturn) HashMap(java.util.HashMap) Method(java.lang.reflect.Method)

Aggregations

SaturnJobReturn (com.vip.saturn.job.SaturnJobReturn)1 ScriptJobRunner (com.vip.saturn.job.shell.ScriptJobRunner)1 Method (java.lang.reflect.Method)1 HashMap (java.util.HashMap)1