Package org.rhq.core.domain.operation.bean

Examples of org.rhq.core.domain.operation.bean.GroupOperationSchedule


        simulatedOperation_Sleep = 0L;

        // let the trigger not fire until several seconds from now so we can query the schedule itself
        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis() + 10000L));
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), null,
            true, PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
        assert schedule.getParameters() == null;
        assert schedule.getGroup().getId() == newGroup.getId();

        List<GroupOperationSchedule> schedules;
        schedules = operationManager.findScheduledGroupOperations(overlord(), newGroup.getId());
        assert schedules != null;
        assert schedules.size() == 1;
        GroupOperationSchedule returnedSchedule = schedules.get(0);
        assert returnedSchedule.getSubject().equals(overlord());
        assert returnedSchedule.getGroup().getId() == newGroup.getId();
        assert returnedSchedule.getParameters() == null;
        assert returnedSchedule.getOperationName().equals(PREFIX + "testOp");
        assert returnedSchedule.getDescription().equals(PREFIX + "desc");

        // let's immediately unschedule it before it triggers
        operationManager.unscheduleGroupOperation(overlord(), returnedSchedule.getJobId().toString(), returnedSchedule
            .getGroup().getId());

        PageList<GroupOperationHistory> results;
        results = operationManager.findCompletedGroupOperationHistories(overlord(), newGroup.getId(),
            PageControl.getUnlimitedInstance());
View Full Code Here


        params.put(new PropertySimple("param2", "blah"));

        // let the trigger not fire until several seconds from now so we can query the schedule itself
        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis() + 3600000L));
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), null,
            true, PREFIX + "testOp", params, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
        assert schedule.getParameters() != null;
        assert schedule.getGroup().getId() == newGroup.getId();

        int configId = params.getId();
        Configuration returnedConfiguration = configurationManager.getConfigurationById(configId);
        assert returnedConfiguration.getProperties().size() == 2;
        assert returnedConfiguration.getSimple("param1").getStringValue().equals("group-test");
        assert returnedConfiguration.getSimple("param2").getStringValue().equals("blah");

        List<GroupOperationSchedule> schedules;
        schedules = operationManager.findScheduledGroupOperations(overlord(), newGroup.getId());
        assert schedules != null;
        assert schedules.size() == 1;
        GroupOperationSchedule returnedSchedule = schedules.get(0);
        assert returnedSchedule.getSubject().equals(overlord());
        assert returnedSchedule.getGroup().getId() == newGroup.getId();
        assert returnedSchedule.getParameters() != null;
        assert returnedSchedule.getOperationName().equals(PREFIX + "testOp");
        assert returnedSchedule.getDescription().equals(PREFIX + "desc");

        PageList<GroupOperationScheduleComposite> list;
        list = operationManager.findCurrentlyScheduledGroupOperations(overlord(), PageControl.getUnlimitedInstance());
        assert list.size() == 1;
        assert list.get(0).getGroupId() == newGroup.getId();
        assert list.get(0).getGroupName().equals(newGroup.getName());
        assert list.get(0).getOperationName().equals("Test Operation");

        // let's immediately unschedule it before it triggers
        operationManager.unscheduleGroupOperation(overlord(), returnedSchedule.getJobId().toString(), returnedSchedule
            .getGroup().getId());

        list = operationManager.findCurrentlyScheduledGroupOperations(overlord(), PageControl.getUnlimitedInstance());
        assert list.size() == 0;
View Full Code Here

        simulatedOperation_Sleep = 0L;

        // let the trigger not fire until several seconds from now so we can query the schedule itself
        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date(
            System.currentTimeMillis() + 5000L));
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(), null,
            true, PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
        assert schedule.getParameters() == null;
        assert schedule.getGroup().getId() == newGroup.getId();

        List<GroupOperationSchedule> schedules;
        schedules = operationManager.findScheduledGroupOperations(overlord(), newGroup.getId());
        assert schedules != null;
        assert schedules.size() == 1;
        GroupOperationSchedule returnedSchedule = schedules.get(0);
        assert returnedSchedule.getSubject().equals(overlord());
        assert returnedSchedule.getGroup().getId() == newGroup.getId();
        assert returnedSchedule.getParameters() == null;
        assert returnedSchedule.getOperationName().equals(PREFIX + "testOp");
        assert returnedSchedule.getDescription().equals(PREFIX + "desc");

        Thread.sleep(9000L); // wait for it to be triggered and finish

        PageList<GroupOperationHistory> results;
        results = operationManager.findCompletedGroupOperationHistories(overlord(), newGroup.getId(),
View Full Code Here

        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        Trigger trigger = new SimpleTrigger(PREFIX + "triggername", PREFIX + "triggergroup", new Date());
        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(),
            new int[] { newResource.getId() }, true, PREFIX + "testOp", null, trigger, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
        assert schedule.getParameters() == null;
        assert schedule.getGroup().getId() == newGroup.getId();

        Thread.sleep(4000L); // wait for it to finish, should be fast

        PageList<GroupOperationHistory> results;
        results = operationManager.findCompletedGroupOperationHistories(overlord(), newGroup.getId(),
View Full Code Here

        // make it a success
        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        GroupOperationSchedule schedule = operationManager.scheduleGroupOperation(overlord(), newGroup.getId(),
            new int[] { newResource.getId() }, true, PREFIX + "testOp", null, 0, 0, 0, 20, PREFIX + "desc");
        assert schedule != null;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
        assert schedule.getParameters() != null;
        assert schedule.getGroup().getId() == newGroup.getId();

        long start = nanoTime();
        boolean testOpComplete;
        PageList<GroupOperationHistory> results;
        do {
View Full Code Here

        // make it a success
        simulatedOperation_Error = null;
        simulatedOperation_Timeout = false;
        simulatedOperation_Sleep = 0L;

        GroupOperationSchedule newSchedule = new GroupOperationSchedule();
        newSchedule.setGroup(newGroup);
        newSchedule.setExecutionOrder(Arrays.asList(newResource));
        newSchedule.setHaltOnFailure(true);
        newSchedule.setOperationName(PREFIX + "testOp");
        newSchedule.setParameters(null);
        newSchedule.setJobTrigger(JobTrigger.createNowTrigger());
        newSchedule.setDescription(PREFIX + "desc");

        int scheduleId = operationManager.scheduleGroupOperation(overlord(), newSchedule);
        List<GroupOperationSchedule> schedules = operationManager.findScheduledGroupOperations(overlord(),
            newGroup.getId());

        assert schedules != null;
        assert !schedules.isEmpty();
        GroupOperationSchedule schedule = schedules.get(0);
        assert schedule != null;
        assert schedule.getId() == scheduleId;
        assert schedule.getDescription().equals(PREFIX + "desc");
        assert schedule.getOperationName().equals(PREFIX + "testOp");
        assert schedule.getParameters() == null;
        assert schedule.getGroup().getId() == newGroup.getId();

        Thread.sleep(4000L); // wait for it to finish, should be fast

        PageList<GroupOperationHistory> results;
        results = operationManager.findCompletedGroupOperationHistories(overlord(), newGroup.getId(),
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.operation.bean.GroupOperationSchedule

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.