Package org.apache.falcon.resource

Examples of org.apache.falcon.resource.TestContext


    @BeforeClass
    public void setup() throws Exception {
        Map<String, String> overlay = new HashMap<String, String>();
        overlay.put("cluster", "testCluster");
        TestContext context = new TestContext();
        String file = context.
                overlayParametersOverTemplate(TestContext.CLUSTER_TEMPLATE, overlay);
        testCluster = StandAloneCluster.newCluster(file);
        STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
/*
        new File("target/libs").mkdirs();
View Full Code Here


    @BeforeClass
    public void setup() throws Exception {
        Map<String, String> overlay = new HashMap<String, String>();
        overlay.put("cluster", "logProviderTest");
        overlay.put("colo", "gs");
        TestContext context = new TestContext();
        String file = context.
                overlayParametersOverTemplate(context.CLUSTER_TEMPLATE, overlay);
        testCluster = StandAloneCluster.newCluster(file);
        cleanupStore();
        STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
        fs = FileSystem.get(testCluster.getConf());
View Full Code Here

    public void testSubmitEntityValidCommands() throws Exception {

        FalconCLI.OUT.set(stream);

        String filePath;
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();

        filePath = context.overlayParametersOverTemplate(TestContext.CLUSTER_TEMPLATE, overlay);
        Assert.assertEquals(
                0,
                executeWithURL("entity -submit -type cluster -file " + filePath));
        context.setCluster(filePath);
        Assert.assertEquals(stream.buffer.toString().trim(),
                "default/Submit successful (cluster) " + context.getClusterName());

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));
        Assert.assertEquals(
                stream.buffer.toString().trim(),
                "default/Submit successful (feed) "
                        + overlay.get("inputFeedName"));

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));
        Assert.assertEquals(
                stream.buffer.toString().trim(),
                "default/Submit successful (feed) "
                        + overlay.get("outputFeedName"));

        filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
        Assert.assertEquals(
                0,
                executeWithURL("entity -submit -type process -file " + filePath));
        Assert.assertEquals(
                stream.buffer.toString().trim(),
View Full Code Here

    @Test(enabled = TEST_ENABLED)
    public void testSubmitAndScheduleEntityValidCommands() throws Exception {

        Thread.sleep(5000);
        String filePath;
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();

        filePath = context.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
        Assert.assertEquals(-1,
                executeWithURL("entity -submitAndSchedule -type cluster -file "
                        + filePath));
        context.setCluster(filePath);

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submitAndSchedule -type feed -file "
                        + filePath));
        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submitAndSchedule -type feed -file "
                        + filePath));
        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submitAndSchedule -type process -file "
                        + filePath));

        Thread.sleep(5000);
View Full Code Here

    @Test(enabled = TEST_ENABLED)
    public void testValidateValidCommands() throws Exception {

        String filePath;
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();

        filePath = context.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type cluster -file "
                        + filePath));
        context.setCluster(filePath);
        Assert.assertEquals(
                0,
                executeWithURL("entity -submit -type cluster -file " + filePath));
        context.setCluster(filePath);

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type feed -file " + filePath));
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type feed -file " + filePath));
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type process -file "
                        + filePath));
        Assert.assertEquals(
                0,
View Full Code Here

    }

    @Test(enabled = TEST_ENABLED)
    public void testDefinitionEntityValidCommands() throws Exception {
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        submitTestFiles(context, overlay);

        Assert.assertEquals(0,
                executeWithURL("entity -definition -type cluster -name "
                        + overlay.get("cluster")));
View Full Code Here

    }

    @Test(enabled = TEST_ENABLED)
    public void testScheduleEntityValidCommands() throws Exception {

        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        submitTestFiles(context, overlay);

        Assert.assertEquals(-1,
                executeWithURL("entity -schedule -type cluster -name "
                        + overlay.get("cluster")));
View Full Code Here

    @Test(enabled = TEST_ENABLED)
    public void testSuspendResumeStatusEntityValidCommands() throws Exception {

        Thread.sleep(5000);
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        submitTestFiles(context, overlay);

        Assert.assertEquals(
                0,
                executeWithURL("entity -status -type feed -name "
                        + overlay.get("outputFeedName")));

        Assert.assertEquals(
                0,
                executeWithURL("entity -status -type process -name "
                        + overlay.get("processName")));

        Assert.assertEquals(
                0,
                executeWithURL("entity -schedule -type feed -name "
                        + overlay.get("outputFeedName")));

        Assert.assertEquals(0,
                executeWithURL("entity -schedule -type process -name "
                        + overlay.get("processName")));

        context.waitForProcessWFtoStart();

        Assert.assertEquals(
                0,
                executeWithURL("entity -suspend -type feed -name "
                        + overlay.get("outputFeedName")));
View Full Code Here

    }

    @Test(enabled = TEST_ENABLED)
    public void testDeleteEntityValidCommands() throws Exception {

        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        submitTestFiles(context, overlay);

        Assert.assertEquals(
                -1,
                executeWithURL("entity -delete -type cluster -name "
View Full Code Here

    }

    @Test(enabled = TEST_ENABLED)
    public void testInvalidCLIEntitycommands() throws Exception {

        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(-1,
                executeWithURL("entity -submit -type feed -name " + "name"));

        Assert.assertEquals(-1,
                executeWithURL("entity -schedule -type feed -file " + "name"));
View Full Code Here

TOP

Related Classes of org.apache.falcon.resource.TestContext

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.