Package com.asakusafw.testdriver

Examples of com.asakusafw.testdriver.JobExecutor


    /**
     * Without runtime framework version info.
     */
    @Test
    public void validateEnvironment_wo_runtime_version() {
        JobExecutor executor = new InProcessJobExecutor(context);
        executor.validateEnvironment();
    }
View Full Code Here


    public void validateEnvironment_w_valid_runtime_version() {
        Properties props = new Properties();
        props.setProperty(TestDriverContext.KEY_FRAMEWORK_VERSION, DUMMY_FRAMEWORK_VERSION);
        putPropertiesFile(props, new File(framework.getHome(), TestDriverContext.FRAMEWORK_VERSION_PATH));

        JobExecutor executor = new InProcessJobExecutor(context);
        executor.validateEnvironment();
    }
View Full Code Here

    public void validateEnvironment_w_invalid_runtime_version() {
        Properties props = new Properties();
        props.setProperty(TestDriverContext.KEY_FRAMEWORK_VERSION, "INVALID");
        putPropertiesFile(props, new File(framework.getHome(), TestDriverContext.FRAMEWORK_VERSION_PATH));
        try {
            JobExecutor executor = new InProcessJobExecutor(context);
            executor.validateEnvironment();
            throw new IllegalStateException();
        } catch (AssertionError e) {
            // ok.
        } catch (IllegalStateException e) {
            throw new AssertionError(e);
View Full Code Here

     */
    @Test
    public void validatePlan_empty() {
        MockTestExecutionPlanBuilder builder = builder();

        JobExecutor executor = new InProcessJobExecutor(context, emptyConfigurations());
        executor.validatePlan(builder.build());
        // OK.
    }
View Full Code Here

    @Test
    public void validatePlan_hadoop() {
        MockTestExecutionPlanBuilder builder = builder();
        builder.addHadoopJob(job("com.example.Dummy"));

        JobExecutor executor = new InProcessJobExecutor(context, emptyConfigurations());
        executor.validatePlan(builder.build());
        // OK.
    }
View Full Code Here

    @Test
    public void validatePlan_direct_command_wo_hadoop() {
        MockTestExecutionPlanBuilder builder = builder();
        builder.addImporter(command("unknown", "unknown"));

        JobExecutor executor = new InProcessJobExecutor(context, emptyConfigurations());
        try {
            executor.validatePlan(builder.build());
            throw new IllegalStateException();
        } catch (AssertionError e) {
            // ok.
        } catch (IllegalStateException e) {
            throw new AssertionError(e);
View Full Code Here

    @Test
    public void validatePlan_emulated_command_wo_hadoop() {
        MockTestExecutionPlanBuilder builder = builder();
        builder.addImporter(command("mock", "mock"));

        JobExecutor executor = new InProcessJobExecutor(context, emptyConfigurations());
        executor.validatePlan(builder.build());
    }
View Full Code Here

                call.set(true);
                return 0;
            }
        });

        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(job(MockHadoopJob.class.getName()), Collections.<String, String>emptyMap());
        } catch (IOException e) {
            throw new AssertionError(e);
        }
        assertThat(call.get(), is(true));
    }
View Full Code Here

            }
        });

        TestExecutionPlan.Job job = job(MockHadoopJob.class.getName(), "com.example.testing", "true");

        JobExecutor executor = new InProcessJobExecutor(context);
        try {
            executor.execute(job, Collections.<String, String>emptyMap());
        } catch (IOException e) {
            throw new AssertionError(e);
        }
        assertThat(call.get(), is(true));
    }
View Full Code Here

                assertThat(conf.get("com.example.testing"), is("true"));
                return 0;
            }
        });

        JobExecutor executor = new InProcessJobExecutor(context);
        deploy("dummy.xml", new File(framework.getHome(), InProcessJobExecutor.PATH_ASAKUSA_RESOURCES));
        try {
            executor.execute(job(MockHadoopJob.class.getName()), Collections.<String, String>emptyMap());
        } catch (IOException e) {
            throw new AssertionError(e);
        }
        assertThat(call.get(), is(true));
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.testdriver.JobExecutor

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.