Package com.asakusafw.compiler.testing

Examples of com.asakusafw.compiler.testing.BatchInfo


        }

        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("ジョブフローの入出力を初期化しています: {}#{}",
View Full Code Here


            }

            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 (JobflowInfo jobflowInfo : batchInfo.getJobflows()) {
                driverContext.prepareCurrentJobflow(jobflowInfo);
                executor.runJobflow(jobflowInfo);
            }

            // テスト結果検証ツールを実行し、Excel上の期待値とDB上の実際値を比較する。
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.testing.BatchInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.