Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.ExecutionContext


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

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


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

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

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

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

        declare(conf, "default", FailCommandScriptHandler.class);
        declare(conf, "other", FailCommandScriptHandler.class);
        CommandScriptHandlerDispatcher dispatcher = create(conf);

        CommandScript script = script("stage");
        ExecutionContext something = context("something", ExecutionPhase.MAIN);
        try {
            dispatcher.execute(ExecutionMonitor.NULL, something, script);
            fail();
        } catch (MessageException e) {
            assertThat(e.message, is("default"));
            assertThat(e.context.getPhase(), is(ExecutionPhase.MAIN));
        }

        ExecutionContext testing = context("testing");
        try {
            dispatcher.execute(ExecutionMonitor.NULL, testing, script);
            fail();
        } catch (MessageException e) {
            assertThat(e.message, is("other"));
View Full Code Here

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

        ExecutionContext context = context("flow", ExecutionPhase.MAIN);
        CommandScript script = script("stage");

        assertThat(dispatcher.getResourceId(context, script), is("match"));

        ExecutionContext otherFlow = context("otherflow", ExecutionPhase.MAIN);
        assertThat(dispatcher.getResourceId(otherFlow, script), is("default"));

        ExecutionContext otherPhase = context("flow", ExecutionPhase.PROLOGUE);
        assertThat(dispatcher.getResourceId(otherPhase, script), is("default"));

        CommandScript otherScript = script("otherstage");
        assertThat(dispatcher.getResourceId(context, otherScript), is("default"));
    }
View Full Code Here

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

        ExecutionContext context = context("flow", ExecutionPhase.MAIN);
        CommandScript script = script("stage");
        assertThat(dispatcher.getResourceId(context, script), is("match"));

        ExecutionContext otherFlow = context("otherflow", ExecutionPhase.MAIN);
        assertThat(dispatcher.getResourceId(otherFlow, script), is("default"));

        ExecutionContext otherPhase = context("flow", ExecutionPhase.PROLOGUE);
        assertThat(dispatcher.getResourceId(otherPhase, script), is("default"));

        CommandScript otherScript = script("otherstage");
        assertThat(dispatcher.getResourceId(context, otherScript), is("match"));
    }
View Full Code Here

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

        ExecutionContext context = context("flow", ExecutionPhase.MAIN);
        CommandScript script = script("stage");
        assertThat(dispatcher.getResourceId(context, script), is("match"));

        ExecutionContext otherFlow = context("otherflow", ExecutionPhase.MAIN);
        assertThat(dispatcher.getResourceId(otherFlow, script), is("default"));

        ExecutionContext otherPhase = context("flow", ExecutionPhase.PROLOGUE);
        assertThat(dispatcher.getResourceId(otherPhase, script), is("match"));

        CommandScript otherScript = script("otherstage");
        assertThat(dispatcher.getResourceId(context, otherScript), is("match"));
    }
View Full Code Here

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

        ExecutionContext context = context("flow", ExecutionPhase.MAIN);
        CommandScript script = script("stage");
        assertThat(dispatcher.getResourceId(context, script), is("match"));

        ExecutionContext otherFlow = context("otherflow", ExecutionPhase.MAIN);
        assertThat(dispatcher.getResourceId(otherFlow, script), is("match"));

        ExecutionContext otherPhase = context("flow", ExecutionPhase.PROLOGUE);
        assertThat(dispatcher.getResourceId(otherPhase, script), is("match"));

        CommandScript otherScript = script("otherstage");
        assertThat(dispatcher.getResourceId(context, otherScript), is("match"));
    }
View Full Code Here

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

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

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

        ExecutionContext something = context("testing", ExecutionPhase.CLEANUP);
        try {
            dispatcher.cleanUp(ExecutionMonitor.NULL, something);
            fail();
        } catch (MessageException e) {
            assertThat(e.message, is("other"));
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.