Examples of JsonWorkflowJob


Examples of org.apache.oozie.client.rest.JsonWorkflowJob

            new GraphGenerator("<workflow></workflow>", null);
        }
        catch (IllegalArgumentException iae) {
            Assert.assertTrue("Construction with illegal args failed as expected: " + iae.getMessage(), true);
        }
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", new JsonWorkflowJob()));
        Assert.assertNotNull(new GraphGenerator(null, new JsonWorkflowJob()));
        JsonWorkflowJob jsonWFJob = new JsonWorkflowJob();
        jsonWFJob.setAppName("My Test App");
        jsonWFJob.setId("My Test ID");
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob));
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, false));
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, true));
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, false));
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, true));
    }

    public void testWrite() {
        JsonWorkflowJob jsonWFJob = new JsonWorkflowJob();
        jsonWFJob.setAppName("My Test App");
        jsonWFJob.setId("My Test ID");
        String png1 = "src/test/resources/tmp1.png";
        String png2 = "src/test/resources/tmp2.png";

        try {
            GraphGenerator g = new GraphGenerator(readFile("src/test/resources/graphWF.xml"), jsonWFJob);
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

        DagEngine dagEngine = Services.get().get(DagEngineService.class).getDagEngine(getUser(request),
                                                                                      getAuthToken(request));
        try {
            if (show == null || show.equals(RestConstants.JOB_SHOW_INFO)) {
                stopCron();
                JsonWorkflowJob job = (JsonWorkflowJob) dagEngine.getJob(jobId);
                startCron();
                sendJsonResponse(response, HttpServletResponse.SC_OK, job);
            }
            else {
                if (show.equals(RestConstants.JOB_SHOW_LOG)) {
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

            return idx;
        }
    }

    private static WorkflowJob createDummyWorkflow(int idx) {
        JsonWorkflowJob workflow = new JsonWorkflowJob();
        workflow.setId(JOB_ID + idx);
        workflow.setAppPath("hdfs://blah/blah/" + idx + "-blah");
        workflow.setStatus((idx % 2) == 0 ? WorkflowJob.Status.RUNNING : WorkflowJob.Status.SUCCEEDED);
        workflow.setRun(idx);
        workflow.setCreatedTime(new Date());
        workflow.setStartTime(new Date());
        workflow.setEndTime((idx % 2) == 0 ? null : (new Date()));
        workflow.setConf(CONFIGURATION);
        workflow.setAppName("workflow-" + idx);
        workflow.setGroup(GROUP);
        workflow.setUser(USER);

        List<JsonWorkflowAction> actions = new ArrayList<JsonWorkflowAction>();
        for (int i = 0; i < idx; i++) {
            actions.add(createDummyAction(i));
        }

        workflow.setActions(actions);
        return workflow;
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

        workflow.setActions(actions);
        return workflow;
    }

    private static WorkflowJob createDummyWorkflow(int idx, String conf) {
        JsonWorkflowJob workflow = new JsonWorkflowJob();
        workflow.setId(JOB_ID + idx);
        workflow.setAppPath("hdfs://blah/blah/" + idx + "-blah");
        workflow.setStatus((idx % 2) == 0 ? WorkflowJob.Status.RUNNING : WorkflowJob.Status.SUCCEEDED);
        workflow.setRun(idx);
        workflow.setCreatedTime(new Date());
        workflow.setStartTime(new Date());
        workflow.setEndTime((idx % 2) == 0 ? null : (new Date()));
        workflow.setConf(conf);
        workflow.setAppName("workflow-" + idx);
        workflow.setGroup(GROUP);
        workflow.setUser(USER);

        List<JsonWorkflowAction> actions = new ArrayList<JsonWorkflowAction>();
        for (int i = 0; i < idx; i++) {
            actions.add(createDummyAction(i));
        }

        workflow.setActions(actions);
        return workflow;
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

            return idx;
        }
    }

    private static WorkflowJob createDummyWorkflow(int idx) {
        JsonWorkflowJob workflow = new JsonWorkflowJob();
        workflow.setId(JOB_ID + idx + JOB_ID_END);
        workflow.setAppPath("hdfs://blah/blah/" + idx + "-blah");
        workflow.setStatus((idx % 2) == 0 ? WorkflowJob.Status.RUNNING : WorkflowJob.Status.SUCCEEDED);
        workflow.setRun(idx);
        workflow.setCreatedTime(new Date());
        workflow.setStartTime(new Date());
        workflow.setEndTime((idx % 2) == 0 ? null : (new Date()));
        workflow.setConf(CONFIGURATION);
        workflow.setAppName("workflow-" + idx);
        workflow.setGroup(GROUP);
        workflow.setUser(USER);

        List<JsonWorkflowAction> actions = new ArrayList<JsonWorkflowAction>();
        for (int i = 0; i < idx; i++) {
            actions.add(createDummyAction(i));
        }

        workflow.setActions(actions);
        return workflow;
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

        workflow.setActions(actions);
        return workflow;
    }

    private static WorkflowJob createDummyWorkflow(int idx, String conf) {
        JsonWorkflowJob workflow = new JsonWorkflowJob();
        workflow.setId(JOB_ID + idx + JOB_ID_END);
        workflow.setAppPath("hdfs://blah/blah/" + idx + "-blah");
        workflow.setStatus((idx % 2) == 0 ? WorkflowJob.Status.RUNNING : WorkflowJob.Status.SUCCEEDED);
        workflow.setRun(idx);
        workflow.setCreatedTime(new Date());
        workflow.setStartTime(new Date());
        workflow.setEndTime((idx % 2) == 0 ? null : (new Date()));
        workflow.setConf(conf);
        workflow.setAppName("workflow-" + idx);
        workflow.setGroup(GROUP);
        workflow.setUser(USER);

        List<JsonWorkflowAction> actions = new ArrayList<JsonWorkflowAction>();
        for (int i = 0; i < idx; i++) {
            actions.add(createDummyAction(i));
        }

        workflow.setActions(actions);
        return workflow;
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

        try {
            GraphGenerator graphGenerator1 = new GraphGenerator("<workflow></workflow>", null);
        } catch(IllegalArgumentException iae) {
            Assert.assertTrue("Construction with illegal args failed as expected: " + iae.getMessage(), true);
        }
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", new JsonWorkflowJob()));
        Assert.assertNotNull(new GraphGenerator(null, new JsonWorkflowJob()));
        JsonWorkflowJob jsonWFJob = new JsonWorkflowJob();
        jsonWFJob.setAppName("My Test App");
        jsonWFJob.setId("My Test ID");
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob));
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, false));
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, true));
    }
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, false));
        Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", jsonWFJob, true));
    }

    public void testWrite() {
        JsonWorkflowJob jsonWFJob = new JsonWorkflowJob();
        jsonWFJob.setAppName("My Test App");
        jsonWFJob.setId("My Test ID");
        String png1 = "src/test/resources/tmp1.png";
        String png2 = "src/test/resources/tmp2.png";

        try {
            GraphGenerator g = new GraphGenerator(readFile("src/test/resources/graphWF.xml"), jsonWFJob);
View Full Code Here

Examples of org.apache.oozie.client.rest.JsonWorkflowJob

        jmsBean.setTopicPrefix("topicPrefix");
        return jmsBean;
    }

    private static WorkflowJob createDummyWorkflow(int idx) {
        JsonWorkflowJob workflow = new JsonWorkflowJob();
        workflow.setId(JOB_ID + idx + JOB_ID_END);
        workflow.setAppPath("hdfs://blah/blah/" + idx + "-blah");
        workflow.setStatus((idx % 2) == 0 ? WorkflowJob.Status.RUNNING : WorkflowJob.Status.SUCCEEDED);
        workflow.setRun(idx);
        workflow.setCreatedTime(new Date());
        workflow.setStartTime(new Date());
        workflow.setEndTime((idx % 2) == 0 ? null : (new Date()));
        workflow.setConf(CONFIGURATION);
        workflow.setAppName("workflow-" + idx);
        workflow.setGroup(GROUP);
        workflow.setUser(USER);

        List<JsonWorkflowAction> actions = new ArrayList<JsonWorkflowAction>();
        for (int i = 0; i < idx; i++) {
            actions.add(createDummyAction(i));
        }

        workflow.setActions(actions);
        return workflow;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.