Package org.apache.oozie

Examples of org.apache.oozie.CoordinatorActionBean


     */
    public void testCoordActionsStatusByPendingFalseForColumnValues() throws Exception {
        int actionNum = 1;
        CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false);
        String jobId = job.getId();
        CoordinatorActionBean action = addRecordToCoordActionTable(jobId, actionNum++,
                CoordinatorAction.Status.WAITING, "coord-action-get.xml", 0);

        _testCoordActionForCorrectColumnValues(jobId, action.getStatus());

    }
View Full Code Here


    }

    public void testCoordActionGet() throws Exception {
        int actionNum = 1;
        CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false);
        CoordinatorActionBean action = addRecordToCoordActionTable(job.getId(), actionNum, CoordinatorAction.Status.WAITING, "coord-action-get.xml", 0);

        Path appPath = new Path(getFsTestCaseDir(), "coord");
        String actionXml = getCoordActionXml(appPath, "coord-action-get.xml");
        String actionNomialTime = getActionNominalTime(actionXml);

        _testGetActionForNominalTime(job.getId(), action.getId(), DateUtils.parseDateUTC(actionNomialTime));
    }
View Full Code Here

    private void _testGetActionForNominalTime(String jobId, String actionId, Date d) throws Exception {
        JPAService jpaService = Services.get().get(JPAService.class);
        assertNotNull(jpaService);
        CoordJobGetActionForNominalTimeJPAExecutor actionGetCmd = new CoordJobGetActionForNominalTimeJPAExecutor(jobId, d);
        CoordinatorActionBean ret = jpaService.execute(actionGetCmd);
        assertNotNull(ret);
        assertEquals(ret.getId(), actionId);
        assertEquals(ret.getJobId(), jobId);
        assertEquals(ret.getNominalTime().toString(), d.toString());
    }
View Full Code Here

    private void _testGetActionByExternalId(String actionId, String jobId, CoordinatorAction.Status status, int pending, String extId, String slaXml) throws Exception {
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            CoordActionGetForExternalIdJPAExecutor actionGetCmd = new CoordActionGetForExternalIdJPAExecutor(extId);
            CoordinatorActionBean action = jpaService.execute(actionGetCmd);
            assertNotNull(action);
            assertEquals(actionId, action.getId());
            assertEquals(status, action.getStatus());
            assertEquals(pending, action.getPending());
            assertEquals(extId, action.getExternalId());
            assertEquals(slaXml, action.getSlaXml());
        }
        catch (Exception ex) {
            ex.printStackTrace();
            fail("Unable to GET a record for COORD Action By External ID. actionId =" + actionId + " extID =" + extId);
        }
View Full Code Here

    }

    public void testCoordActionUpdateStatus() throws Exception {
        int actionNum = 1;
        CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false);
        CoordinatorActionBean action = addRecordToCoordActionTable(job.getId(), actionNum,
                CoordinatorAction.Status.RUNNING, "coord-action-get.xml", 0);
        _testCoordActionUpdateStatus(action);
    }
View Full Code Here

        // Call the JPAUpdate executor to execute the Update command
        CoordActionUpdateForInputCheckJPAExecutor coordUpdCmd = new CoordActionUpdateForInputCheckJPAExecutor(action);
        jpaService.execute(coordUpdCmd);

        CoordActionGetJPAExecutor coordGetCmd = new CoordActionGetJPAExecutor(action.getId());
        CoordinatorActionBean newAction = jpaService.execute(coordGetCmd);

        assertNotNull(newAction);
        // Check for expected values
        assertEquals(CoordinatorAction.Status.SUCCEEDED, newAction.getStatus());
        assertEquals("dummyXml", newAction.getActionXml());
        assertEquals("dummyDependencies", newAction.getMissingDependencies());
    }
View Full Code Here

     */
    public void testCoordActionsNotCompletetedForColumnValues() throws Exception {
        int actionNum = 1;
        CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false);
        String jobId = job.getId();
        CoordinatorActionBean action = addRecordToCoordActionTable(jobId, actionNum++,
                CoordinatorAction.Status.WAITING, "coord-action-get.xml", 0);

        _testCoordActionForCorrectColumnValues(jobId, action.getId(), action.getStatus(), action.getPending());

    }
View Full Code Here

        assertNotNull(jpaService);
        // Call JPAExecutor to get actions which are not completed
        CoordJobGetActionsNotCompletedJPAExecutor actionGetCmd = new CoordJobGetActionsNotCompletedJPAExecutor(jobId);
        List<CoordinatorActionBean> actionList = jpaService.execute(actionGetCmd);
        // check for expected column values
        CoordinatorActionBean action = actionList.get(0);
        assertEquals(action.getId(), actionId);
        assertEquals(action.getStatus(), status);
        assertEquals(action.getPending(), pending);
    }
View Full Code Here

    public void testCoordActionGet() throws Exception {
        int actionNum = 1;
        String resourceXmlName = "coord-action-get.xml";
        CoordinatorJobBean job = addRecordToCoordJobTable(CoordinatorJob.Status.RUNNING, false, false);
        CoordinatorActionBean action = createCoordAction(job.getId(), actionNum, CoordinatorAction.Status.WAITING,
                resourceXmlName, 1);
        // Insert the action
        insertRecordCoordAction(action);
        Path appPath = new Path(getFsTestCaseDir(), "coord");
        Configuration conf = getCoordConf(appPath);
        // Pass expected values
        _testGetForInputCheckX(action.getId(), job.getId(), CoordinatorAction.Status.WAITING, XmlUtils
                .prettyPrint(conf).toString(), 1);
    }
View Full Code Here

            throws Exception {
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            assertNotNull(jpaService);
            CoordActionGetForTimeoutJPAExecutor actionGetCmd = new CoordActionGetForTimeoutJPAExecutor(actionId);
            CoordinatorActionBean action = jpaService.execute(actionGetCmd);
            assertNotNull(action);

            // Check for expected column values
            assertEquals(actionId, action.getId());
            assertEquals(jobId, action.getJobId());
            assertEquals(status, action.getStatus());
            assertEquals(runConf, action.getRunConf());
            assertEquals(pending, action.getPending());
        }
        catch (Exception ex) {
            ex.printStackTrace();
            fail("Unable to GET a record for COORD Action By External ID. actionId =" + actionId);
        }
View Full Code Here

TOP

Related Classes of org.apache.oozie.CoordinatorActionBean

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.