Package org.apache.oozie.client

Examples of org.apache.oozie.client.CoordinatorJob


            if (coordActionsCount != number) {
                fail("Should have " + number + " actions created for job " + jobId);
            }

            if (status != null) {
                CoordinatorJob job = store.getCoordinatorJob(jobId, false);
                if (job.getStatus() != status) {
                    fail("Job status " + job.getStatus() + " should be " + status);
                }
            }
        }
        catch (StoreException se) {
            se.printStackTrace();
View Full Code Here


        return actionBean;
    }

    private CoordinatorJob.Status getStatus(String jobId){
        CoordinatorJob job = null;
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            job = jpaService.execute(new CoordJobGetJPAExecutor(jobId));
        }
        catch (JPAExecutorException se) {
            se.printStackTrace();
        }
        return job.getStatus();
    }
View Full Code Here

            if (actionsSize != number) {
                fail("Should have " + number + " actions created for job " + jobId + ", but has " + actionsSize + " actions.");
            }

            if (status != null) {
                CoordinatorJob job = jpaService.execute(new CoordJobGetJPAExecutor(jobId));
                if (job.getStatus() != status) {
                    fail("Job status " + job.getStatus() + " should be " + status);
                }
            }
        }
        catch (JPAExecutorException se) {
            se.printStackTrace();
View Full Code Here

        update(context, process, endTime);

        //Assert that update creates new bundle and old coord is running
        bundles = OozieTestUtils.getBundles(context);
        Assert.assertEquals(bundles.size(), 2);
        CoordinatorJob coord = ozClient.getCoordJobInfo(coordId);
        Assert.assertEquals(coord.getStatus(), Status.RUNNING);
        Assert.assertEquals(coord.getEndTime(), endTime);
    }
View Full Code Here

            if (coordActionsCount != number) {
                fail("Should have " + number + " actions created for job " + jobId);
            }

            if (status != null) {
                CoordinatorJob job = store.getCoordinatorJob(jobId, false);
                if (job.getStatus() != status) {
                    fail("Job status " + job.getStatus() + " should be " + status);
                }
            }
        }
        catch (StoreException se) {
            se.printStackTrace();
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public void testParseCoordinatorJob() {
        JSONObject json = createJsonCoordinatorJob();
        CoordinatorJob job = JsonToBean.createCoordinatorJob(json);
        assertEquals("a", job.getAppPath());
        assertEquals("b", job.getAppName());
        assertEquals("c", job.getId());
        assertEquals("d", job.getConf());
        assertEquals(CoordinatorJob.Status.RUNNING, job.getStatus());
        assertEquals(CoordinatorJob.Execution.FIFO, job.getExecutionOrder());
        assertEquals(1, job.getFrequency());
        assertEquals(CoordinatorJob.Timeunit.DAY, job.getTimeUnit());
        assertEquals("e", job.getTimeZone());
        assertEquals(2, job.getConcurrency());
        assertEquals(3, job.getTimeout());
        assertEquals(JsonUtils.parseDateRfc822(LAST_ACTION), job.getLastActionTime());
        assertEquals(JsonUtils.parseDateRfc822(NEXT_MATERIALIZED), job.getNextMaterializedTime());
        assertEquals(JsonUtils.parseDateRfc822(START_TIME), job.getStartTime());
        assertEquals(JsonUtils.parseDateRfc822(END_TIME), job.getEndTime());
        assertEquals("f", job.getUser());
        assertEquals("g", job.getGroup());
        assertEquals("h", job.getConsoleUrl());
        assertEquals(2, job.getActions().size());
        assertEquals("ca1", job.getActions().get(0).getId());
        assertEquals("ca2", job.getActions().get(1).getId());
    }
View Full Code Here

            if (actions.size() != number) {
                fail("Should have " + number + " actions created for job " + jobId);
            }

            if (status != null) {
                CoordinatorJob job = store.getCoordinatorJob(jobId, false);
                if (job.getStatus() != status) {
                    fail("Job status " + job.getStatus() + " should be " + status);
                }
            }
        }
        catch (StoreException se) {
            se.printStackTrace();
View Full Code Here

    private void _testTimeout(final String jobId) throws Exception {
        final CoordinatorEngine ce = new CoordinatorEngine(getTestUser(), "UNIT_TESTING");

        waitFor(6000, new Predicate() {
            public boolean evaluate() throws Exception {
                CoordinatorJob job = ce.getCoordJob(jobId);
                return !(job.getStatus().equals(CoordinatorJob.Status.PREP));
            }
        });

        CoordinatorJob job = ce.getCoordJob(jobId);
        assertTrue(!(job.getStatus().equals(CoordinatorJob.Status.PREP)));

        waitFor(6000, new Predicate() {
            public boolean evaluate() throws Exception {
                CoordinatorJob job = ce.getCoordJob(jobId);
                List<CoordinatorAction> actions = job.getActions();
                return actions.size() > 0;
            }
        });

        job = ce.getCoordJob(jobId);
        List<CoordinatorAction> actions = job.getActions();
        assertTrue(actions.size() > 0);

        for (CoordinatorAction action : actions) {
            JsonCoordinatorAction json = (JsonCoordinatorAction) action;
            assertEquals(10, json.getTimeOut());
View Full Code Here

    private void _testTimeout(final String jobId, Date createDate) throws Exception {
        final CoordinatorEngine ce = new CoordinatorEngine(getTestUser(), "UNIT_TESTING");

        waitFor(12000, new Predicate() {
            public boolean evaluate() throws Exception {
                CoordinatorJob job = ce.getCoordJob(jobId);
                return !(job.getStatus().equals(CoordinatorJob.Status.PREP));
            }
        });

        CoordinatorJob job = ce.getCoordJob(jobId);
        assertTrue(!(job.getStatus().equals(CoordinatorJob.Status.PREP)));

        waitFor(12000, new Predicate() {
            public boolean evaluate() throws Exception {
                CoordinatorJob job = ce.getCoordJob(jobId);
                List<CoordinatorAction> actions = job.getActions();
                return actions.size() > 0;
            }
        });

        job = ce.getCoordJob(jobId);
        List<CoordinatorAction> actions = job.getActions();
        assertTrue(actions.size() > 0);

        for (CoordinatorAction action : actions) {
            JsonCoordinatorAction jsonAction = (JsonCoordinatorAction) action;
View Full Code Here

        return jobId;
    }

    private void _testGetJob(String jobId, String appPath) throws Exception {
        CoordinatorEngine ce = new CoordinatorEngine(getTestUser(), "UNIT_TESTING");
        CoordinatorJob job = ce.getCoordJob(jobId);
        assertEquals(jobId, job.getId());
        assertEquals(job.getAppPath(), appPath);
    }
View Full Code Here

TOP

Related Classes of org.apache.oozie.client.CoordinatorJob

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.