Package com.asakusafw.yaess.core

Examples of com.asakusafw.yaess.core.ExecutionContext


                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                ProcessHadoopScriptHandler.KEY_CLEANUP, "true",
                ProcessHadoopScriptHandler.KEY_WORKING_DIRECTORY, "OBSOLETE",
                ProcessUtil.PREFIX_CLEANUP + "1", "OBSOLETE");

        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.CLEANUP, map());

        handler.cleanUp(ExecutionMonitor.NULL, context);

        List<String> results = getOutput(shell);
        assertThat(results.subList(0, 5), is(Arrays.asList(
                ProcessHadoopScriptHandler.CLEANUP_STAGE_CLASS,
                "tbatch",
                "tflow",
                "texec",
                context.getArgumentsAsString())));
    }
View Full Code Here


        VariableResolver resolver = VariableResolver.system();

        JschProcessExecutor extracted = JschProcessExecutor.extract("testing", config, resolver);
        try {
            int exit = extracted.execute(
                    new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, Collections.<String, String>emptyMap()),
                    Arrays.asList("touch", file.getAbsolutePath()),
                    Collections.<String, String>emptyMap());
            assertThat(exit, is(0));
        } catch (IOException e) {
            System.err.printf("Test is skipped because SSH session was not available%n");
View Full Code Here

        try {
            Map<String, String> env = new HashMap<String, String>();
            env.put("file1", file1.getAbsolutePath());
            env.put("file2", file2.getAbsolutePath());
            int exit = extracted.execute(
                    new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, Collections.<String, String>emptyMap()),
                    Arrays.asList(script.getAbsolutePath()),
                    env);
            assertThat(exit, is(0));
        } catch (IOException e) {
            System.err.printf("Test is skipped because SSH session was not available: variables%n");
View Full Code Here

        VariableResolver resolver = VariableResolver.system();

        JschProcessExecutor extracted = JschProcessExecutor.extract("testing", config, resolver);
        try {
            int exit = extracted.execute(
                    new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, Collections.<String, String>emptyMap()),
                    Arrays.asList(".__INVALID__"),
                    Collections.<String, String>emptyMap());
            assertThat(exit, is(not(0)));
        } catch (IOException e) {
            System.err.printf("Test is skipped because SSH session was not available%n");
View Full Code Here

        VariableResolver resolver = VariableResolver.system();

        JschProcessExecutor extracted = JschProcessExecutor.extract("testing", config, resolver);
        try {
            int exit = extracted.execute(
                    new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, Collections.<String, String>emptyMap()),
                    Arrays.asList("touch", file.getAbsolutePath()),
                    Collections.<String, String>emptyMap());
            assertThat(exit, is(0));
        } catch (IOException e) {
            System.err.printf("Test is skipped because SSH session was not available%n");
View Full Code Here

        JschProcessExecutor extracted = JschProcessExecutor.extract("testing", config, resolver);
        try {
            Map<String, String> env = new HashMap<String, String>();
            env.put("file", file.getAbsolutePath());
            int exit = extracted.execute(
                    new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, Collections.<String, String>emptyMap()),
                    Arrays.asList(script.getAbsolutePath()),
                    env);
            assertThat(exit, is(0));
        } catch (IOException e) {
            System.err.printf("Test is skipped because SSH session was not available: variables/meta%n");
View Full Code Here

                "com.example.Client",
                map(),
                map());

        HadoopScriptHandler handler = handler("env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath());
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map("hello", "world", "key", "value"));
        execute(context, script, handler);

        List<String> results = getOutput(shell);
        assertThat(results.subList(0, 5), is(Arrays.asList(
                "com.example.Client",
                "tbatch",
                "tflow",
                "texec",
                context.getArgumentsAsString())));
    }
View Full Code Here

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                "prop.hello", "handler",
                "prop.bar", "moga");
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map());
        execute(context, script, handler);

        List<String> results = getOutput(shell);
        assertThat(results.subList(0, 5), is(Arrays.asList(
                "com.example.Client",
                "tbatch",
                "tflow",
                "texec",
                context.getArgumentsAsString())));

        List<String> rest = results.subList(5, results.size());
        int hello = rest.indexOf("hello=world");
        assertThat(hello, greaterThanOrEqualTo(1));
        assertThat(rest.get(hello - 1), is("-D"));
View Full Code Here

        HadoopScriptHandler handler = handler(
                "env.ASAKUSA_HOME", getAsakusaHome().getAbsolutePath(),
                "command.0", "@[0]",
                "command.1", "@[2]-@[3]-@[4]");
        ExecutionContext context = new ExecutionContext(
                "tbatch", "tflow", "texec", ExecutionPhase.MAIN, map("hello", "world", "key", "value"));
        execute(context, script, handler);

        List<String> results = getOutput(shell);
        assertThat(results.subList(0, 7), is(Arrays.asList(
                "tbatch-tflow-texec",
                shell.getAbsolutePath(),
                "com.example.Client",
                "tbatch",
                "tflow",
                "texec",
                context.getArgumentsAsString())));
    }
View Full Code Here

        RuntimeContext rc = RuntimeContext.DEFAULT
            .batchId("b")
            .mode(ExecutionMode.SIMULATION)
            .buildId("OK");
        ExecutionContext context = new ExecutionContext("b", "f", "e", ExecutionPhase.MAIN, map(), rc.unapply());
        execute(context, script, handler);

        Map<String, String> map = new HashMap<String, String>();
        for (String line : getOutput(shell)) {
            if (line.trim().isEmpty()) {
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.