Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.ExecutionContext


        declare(conf, "other", FailCommandScriptHandler.class);
        declare(conf, "specified", FailCommandScriptHandler.class);
        declare(conf, ExecutionScriptHandlerDispatcher.KEY_CLEANUP, "specified");
        CommandScriptHandlerDispatcher dispatcher = create(conf);

        ExecutionContext something = context("testing", ExecutionPhase.CLEANUP);
        try {
            dispatcher.cleanUp(ExecutionMonitor.NULL, something);
            fail();
        } catch (MessageException e) {
            assertThat(e.message, is("specified"));
View Full Code Here


        Map<String, String> conf = createConf();
        declare(conf, "default", MockCommandScriptHandler.class);
        declare(conf, "other", MockCommandScriptHandler.class);
        CommandScriptHandlerDispatcher dispatcher = create(conf);

        ExecutionContext testing = context("testing");
        dispatcher.getResourceId(testing, null);
    }
View Full Code Here

    private ExecutionContext context(String flowId) {
        return context(flowId, ExecutionPhase.MAIN);
    }

    private ExecutionContext context(String flowId, ExecutionPhase phase) {
        return new ExecutionContext(BATCH_ID, flowId, "exec", phase, Collections.<String, String>emptyMap());
    }
View Full Code Here

    public void execute() throws Exception {
        MockJobClient c1 = new MockJobClient("testing", COMPLETED);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);

        JobScript js = c1.registered.get("testing");
        assertThat(js, is(notNullValue()));
        assertThat(js.getBatchId(), is(context.getBatchId()));
        assertThat(js.getFlowId(), is(context.getFlowId()));
        assertThat(js.getExecutionId(), is(context.getExecutionId()));
        assertThat(js.getPhase(), is(context.getPhase()));
        assertThat(js.getStageId(), is(script.getId()));
        assertThat(js.getMainClassName(), is(script.getClassName()));
        assertThat(js.getArguments(), is(context.getArguments()));

        assertThat(js.getProperties(), hasEntry("s", "service"));
        assertThat(js.getEnvironmentVariables(), is(script.getEnvironmentVariables()));
    }
View Full Code Here

    public void execute_step() throws Exception {
        MockJobClient c1 = new MockJobClient("testing", WAITING, RUNNING, COMPLETED);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 100, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here

        c1.add(fail);

        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here

    public void execute_error() throws Exception {
        MockJobClient c1 = new MockJobClient("testing", ERROR);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here

    public void execute_aborted() throws Exception {
        MockJobClient c1 = new MockJobClient("testing");
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here

    public void execute_register_failed() throws Exception {
        MockJobClient c1 = new MockJobClient(null, COMPLETED);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);
    }
View Full Code Here

        MockJobClient c1 = new MockJobClient(null, ERROR);
        MockJobClient c2 = new MockJobClient("testing", COMPLETED);
        JobClientProfile profile = new JobClientProfile("testing", list(c1), 1000, 10);
        QueueHadoopScriptHandler handler = create();
        handler.doConfigure(profile);
        ExecutionContext context = context();
        HadoopScript script = script();
        handler.execute(ExecutionMonitor.NULL, context, script);

        assertThat(c2.count, is(greaterThan(0)));
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.yaess.core.ExecutionContext

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.