}
File compilerOutputDir = new File(compileWorkDir, "output");
File compilerLocalWorkingDir = new File(compileWorkDir, "build");
BatchInfo batchInfo = DirectBatchCompiler.compile(
batchDescriptionClass,
"test.batch",
Location.fromPath(driverContext.getClusterWorkDir(), '/'),
compilerOutputDir,
compilerLocalWorkingDir,
Arrays.asList(new File[] {
DirectFlowCompiler.toLibraryPath(batchDescriptionClass)
}),
batchDescriptionClass.getClassLoader(),
driverContext.getOptions());
// ジョブフロー名の検査
for (String flowId : jobFlowMap.keySet()) {
if (batchInfo.findJobflow(flowId) == null) {
throw new IllegalStateException(MessageFormat.format(
"ジョブフロー{1}はバッチ{0}に定義されていません",
driverContext.getCallerClass().getName(),
flowId));
}
}
// 環境の検証
driverContext.validateExecutionEnvironment();
LOG.info("テスト環境を初期化しています: {}", driverContext.getCallerClass().getName());
JobflowExecutor executor = new JobflowExecutor(driverContext);
executor.cleanWorkingDirectory();
for (JobflowInfo jobflowInfo : batchInfo.getJobflows()) {
driverContext.prepareCurrentJobflow(jobflowInfo);
executor.cleanInputOutput(jobflowInfo);
}
for (JobflowInfo jobflowInfo : batchInfo.getJobflows()) {
driverContext.prepareCurrentJobflow(jobflowInfo);
String flowId = jobflowInfo.getJobflow().getFlowId();
JobFlowTester tester = jobFlowMap.get(flowId);
if (tester != null) {
LOG.debug("ジョブフローの入出力を初期化しています: {}#{}",