Package org.apache.oozie.event

Examples of org.apache.oozie.event.WorkflowActionEvent


        output.setLength(0);

        /*
         * Workflow Action events
         */
        WorkflowActionEvent event3 = new WorkflowActionEvent("parentid@wfaction", "parentid",
                WorkflowAction.Status.RUNNING, getTestUser(), "myapp", null, null);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event STARTED"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.START_MANUAL);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event SUSPEND"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.OK);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event SUCCESS"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.ERROR);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event FAILURE"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.KILLED);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event FAILURE"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.FAILED);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event FAILURE"));
        output.setLength(0);

View Full Code Here


        generateEvent(wfJob, null, null);
    }

    protected void generateEvent(WorkflowActionBean wfAction, String wfUser) {
        if (eventService.isSupportedApptype(AppType.WORKFLOW_ACTION.name())) {
            WorkflowActionEvent event = new WorkflowActionEvent(wfAction.getId(), wfAction.getJobId(),
                    wfAction.getStatus(), wfUser, wfAction.getName(), wfAction.getStartTime(), wfAction.getEndTime());
            event.setErrorCode(wfAction.getErrorCode());
            event.setErrorMessage(wfAction.getErrorMessage());
            eventService.queueEvent(event);
        }
    }
View Full Code Here

        job = _createSLARegBean("wfId1@wa1", AppType.WORKFLOW_ACTION);
        slas.addRegistrationEvent(job);
        assertEquals(2, slas.getSLACalculator().size());
        job.setExpectedStart(DateUtils.parseDateUTC("2012-07-22T00:00Z"));
        WorkflowActionEvent wae = new WorkflowActionEvent("wfId1@wa1", "wfId1", WorkflowAction.Status.RUNNING, "user1",
                "wf-app-name1", actualStart, null);
        listener.onWorkflowActionEvent(wae);
        serviceObj = slas.getSLACalculator().get("wfId1@wa1");
        // check that start sla has been calculated
        assertEquals(EventStatus.START_MISS, serviceObj.getEventStatus());
View Full Code Here

        output.setLength(0);

        /*
         * Workflow Action events
         */
        WorkflowActionEvent event3 = new WorkflowActionEvent("waction-1", "parentid",
                WorkflowAction.Status.RUNNING, getTestUser(), "myapp", null, null);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event STARTED"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.START_MANUAL);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event SUSPEND"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.OK);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event SUCCESS"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.ERROR);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event FAILURE"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.KILLED);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event FAILURE"));
        output.setLength(0);

        event3.setStatus(WorkflowAction.Status.FAILED);
        ehs.queueEvent(event3);
        ehs.new EventWorker().run();
        assertTrue(output.toString().contains("Workflow Action event FAILURE"));
        output.setLength(0);

View Full Code Here

        generateEvent(wfJob, null, null);
    }

    protected void generateEvent(WorkflowActionBean wfAction, String wfUser) {
        if (eventService.isSupportedApptype(AppType.WORKFLOW_ACTION.name())) {
            WorkflowActionEvent event = new WorkflowActionEvent(wfAction.getId(), wfAction.getJobId(),
                    wfAction.getStatus(), wfUser, wfAction.getName(), wfAction.getStartTime(), wfAction.getEndTime());
            event.setErrorCode(wfAction.getErrorCode());
            event.setErrorMessage(wfAction.getErrorMessage());
            eventService.queueEvent(event);
        }
    }
View Full Code Here

        job = _createSLARegBean("wa1", AppType.WORKFLOW_ACTION);
        slas.addRegistrationEvent(job);
        assertEquals(2, slas.getSLACalculator().size());
        job.setExpectedStart(DateUtils.parseDateUTC("2012-07-22T00:00Z"));
        WorkflowActionEvent wae = new WorkflowActionEvent("wa1", "wfId1", WorkflowAction.Status.RUNNING, "user1",
                "wf-app-name1", actualStart, null);
        listener.onWorkflowActionEvent(wae);
        serviceObj = slas.getSLACalculator().get("wa1");
        // check that start sla has been calculated
        assertEquals(EventStatus.START_MISS, serviceObj.getEventStatus());
View Full Code Here

TOP

Related Classes of org.apache.oozie.event.WorkflowActionEvent

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.