Package org.apache.oozie.workflow.lite

Examples of org.apache.oozie.workflow.lite.LiteWorkflowApp


        return workflow;
    }

    private void _testInsertWF() throws Exception {
        store.beginTrx();
        WorkflowApp app = new LiteWorkflowApp("testApp", "<workflow-app/>", new StartNodeDef("end"))
                .addNode(new EndNodeDef("end"));
        Configuration conf1 = new Configuration();

        conf1.set(OozieClient.APP_PATH, "testPath");
        conf1.set(OozieClient.LOG_TOKEN, "testToken");
View Full Code Here


    private void _testPurge() throws Exception {
        store.beginTrx();
        wfBean1.setEndTime(new Date(System.currentTimeMillis() - (31 * 24 * 60 * 60 * 1000l)));
        wfBean2.setEndTime(new Date(System.currentTimeMillis() - (31 * 24 * 60 * 60 * 1000l)));
        WorkflowApp app = new LiteWorkflowApp("testApp", "<workflow-app/>", new StartNodeDef("end"))
                .addNode(new EndNodeDef("end"));
        Configuration conf2 = new Configuration();
        conf2.set(OozieClient.APP_PATH, "testPath");
        conf2.set(OozieClient.LOG_TOKEN, "testToken");
        conf2.set(OozieClient.USER_NAME, "testUser2");
View Full Code Here

            Configuration jobConf = new XConfiguration();
            jobConf.set(OozieClient.APP_PATH, "file://" + getTestCaseDir() + File.separator + "workflow.xml");
            jobConf.set(OozieClient.USER_NAME, getTestUser());


            LiteWorkflowApp app = (LiteWorkflowApp) wps.parseDef(jobConf, "authToken");
            assertNotNull(app);
            assertEquals("test-wf", app.getName());

            reader = IOUtils.getResourceAsReader("wf-ext-schema-invalid.xml", -1);
            writer = new FileWriter(getTestCaseDir() + "/workflow.xml");
            IOUtils.copyCharStream(reader, writer);
View Full Code Here

            jobConf.set(OozieClient.APP_PATH, "file://" + getTestCaseDir() + File.separator + "workflow.xml");
            jobConf.set(OozieClient.USER_NAME, getTestUser());


            try {
                LiteWorkflowApp app = (LiteWorkflowApp) wps.parseDef(jobConf, "authToken");
                fail();
            }
            catch (WorkflowException ex) {
                assertEquals(ErrorCode.E0724, ex.getErrorCode());
                //nop
View Full Code Here

            Configuration jobConf = new XConfiguration();
            jobConf.set(OozieClient.APP_PATH, "file://" + getTestCaseDir() + File.separator + "workflow.xml");
            jobConf.set(OozieClient.USER_NAME, getTestUser());


            LiteWorkflowApp app = (LiteWorkflowApp) wps.parseDef(jobConf, "authToken");
            assertNotNull(app);
            assertEquals("test-wf", app.getName());
            assertNotNull(app.getNode(StartNodeDef.START));
            assertEquals("a", app.getNode(StartNodeDef.START).getTransitions().get(0));
            assertEquals("b", app.getNode("a").getTransitions().get(0));
            assertEquals("c", app.getNode("a").getTransitions().get(1));
            assertEquals("c", app.getNode("a").getTransitions().get(2));
            assertTrue(app.getNode("b").getConf().contains("kill"));
            assertEquals("d", app.getNode("c").getTransitions().get(0));
            assertEquals("e", app.getNode("c").getTransitions().get(1));
            assertEquals(2, app.getNode("c").getTransitions().size());

            assertEquals("f", app.getNode("d").getTransitions().get(0));
            assertEquals("b", app.getNode("d").getTransitions().get(1));
            assertTrue(app.getNode("d").getConf().startsWith("<map-reduce"));

            assertEquals("f", app.getNode("e").getTransitions().get(0));
            assertEquals("b", app.getNode("e").getTransitions().get(1));
            assertTrue(app.getNode("e").getConf().startsWith("<pig"));

            assertEquals("g", app.getNode("f").getTransitions().get(0));

            assertEquals("z", app.getNode("g").getTransitions().get(0));
            assertEquals("b", app.getNode("g").getTransitions().get(1));
            assertTrue(app.getNode("g").getConf().startsWith("<fs"));

            assertNotNull(app.getNode("z"));
        }
        finally {
            services.destroy();
        }
    }
View Full Code Here

    }

    protected WorkflowJobBean addRecordToWfJobTableForNegCase(WorkflowJob.Status jobStatus,
            WorkflowInstance.Status instanceStatus) throws Exception {
        WorkflowApp app =
            new LiteWorkflowApp("testApp", "<workflow-app/>",
                new StartNodeDef(LiteWorkflowStoreService.LiteControlNodeHandler.class, "end")).
                    addNode(new EndNodeDef("end", LiteWorkflowStoreService.LiteControlNodeHandler.class));
        Configuration conf = new Configuration();
        Path appUri = new Path(getAppPath(), "workflow.xml");
        conf.set(OozieClient.APP_PATH, appUri.toString());
View Full Code Here

    }

    @Override
    protected WorkflowJobBean addRecordToWfJobTable(WorkflowJob.Status jobStatus, WorkflowInstance.Status instanceStatus) throws Exception {
        WorkflowApp app =
            new LiteWorkflowApp("testApp", "<workflow-app/>",
                new StartNodeDef(LiteWorkflowStoreService.LiteControlNodeHandler.class, "end")).
                    addNode(new EndNodeDef("end", LiteWorkflowStoreService.LiteControlNodeHandler.class));
        Configuration conf = new Configuration();
        conf.set(OozieClient.APP_PATH, "testPath");
        conf.set(OozieClient.LOG_TOKEN, "testToken");
View Full Code Here

     * @return workflow job bean
     * @throws Exception thrown if failed to create workflow job
     */
    protected WorkflowJobBean addRecordToWfJobTableWithCustomAppPath(WorkflowJob.Status jobStatus, WorkflowInstance.Status instanceStatus)
    throws Exception {
        WorkflowApp app = new LiteWorkflowApp("testApp", "<workflow-app/>",
            new StartNodeDef(LiteWorkflowStoreService.LiteControlNodeHandler.class, "end")).
                addNode(new EndNodeDef("end", LiteWorkflowStoreService.LiteControlNodeHandler.class));
        Configuration conf = new Configuration();
        Path appUri = getAppPath();
        conf.set(OozieClient.APP_PATH, appUri.toString());
View Full Code Here

    /**
     * Test bulk inserts by inserting a workflow job and two workflow actions
     * @throws Exception
     */
    public void testInserts() throws Exception{
        WorkflowApp app = new LiteWorkflowApp("testApp", "<workflow-app/>",
            new StartNodeDef(LiteWorkflowStoreService.LiteControlNodeHandler.class, "end"))
                .addNode(new EndNodeDef("end", LiteWorkflowStoreService.LiteControlNodeHandler.class));
        Configuration conf = new Configuration();
        Path appUri = new Path(getAppPath(), "workflow.xml");
        conf.set(OozieClient.APP_PATH, appUri.toString());
View Full Code Here

        return workflow;
    }

    private void _testInsertWF() throws Exception {
        store.beginTrx();
        WorkflowApp app = new LiteWorkflowApp("testApp", "<workflow-app/>",
            new StartNodeDef(LiteWorkflowStoreService.LiteControlNodeHandler.class, "end")).
            addNode(new EndNodeDef("end", LiteWorkflowStoreService.LiteControlNodeHandler.class));
        Configuration conf1 = new Configuration();

        conf1.set(OozieClient.APP_PATH, "testPath");
View Full Code Here

TOP

Related Classes of org.apache.oozie.workflow.lite.LiteWorkflowApp

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.