Examples of StartExecutionParameters


Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

    @Test
    public void testNormalExecution() throws Exception {
        // Start execution

        StartExecutionParameters startExecutionParameters = new StartExecutionParameters();
        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));

        ScheduleExecution scheduleExecution =
            scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);
        Assert.assertNotNull(scheduleExecution);
        Assert.assertNull(scheduleExecution.getFinished());
View Full Code Here

Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

    @Test
    public void testCancelExecution() throws Exception {
        // Start execution

        StartExecutionParameters startExecutionParameters = new StartExecutionParameters();
        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));

        ScheduleExecution scheduleExecution =
            scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);
        Assert.assertNotNull(scheduleExecution);
        Assert.assertNull(scheduleExecution.getFinished());
View Full Code Here

Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

        Assert.assertFalse(scheduleExecutionModified.isCancelled());
    }

    @Test
    public void testSpecifiedCreation() throws Exception {
        StartExecutionParameters startExecutionParameters = new StartExecutionParameters();
        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setComment("Test comment");
        startExecutionParameters.setAddresses(Lists.newArrayList("192.168.1.1", "192.168.1.2"));

        ScheduleExecution scheduleExecution =
            scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);
        Assert.assertNotNull(scheduleExecution);
        Assert.assertNull(scheduleExecution.getFinished());
View Full Code Here

Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

        jobParameters.setActionIdentifier("action.type");
        jobParameters.setActionDefinition("action.data".getBytes());

        ScheduleJob localhostScheduleJob = scheduleJobManagementService.createJob(jobParameters);

        StartExecutionParameters startExecutionParameters = new StartExecutionParameters();
        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setComment("Test comment");

        ScheduleExecution scheduleExecution =
            scheduleExecutionManagementService.startExecution(localhostScheduleJob.getId(), startExecutionParameters);
        Assert.assertNotNull(scheduleExecution);
        Assert.assertNull(scheduleExecution.getFinished());
View Full Code Here

Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

        Assert.assertEquals("localhost", scheduleExecutionNode.getAddress());
    }

    @Test
    public void testFindFinished() throws Exception {
        StartExecutionParameters startExecutionParameters = new StartExecutionParameters();

        // Execution 1 - finished

        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setComment("Test comment");

        ScheduleExecution scheduleExecution1 =
            scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);

        scheduleExecutionManagementService.finishExecution(
            scheduleExecution1.getId(), ScheduleExecutionStatus.SUCCEED);

        // Execution 2 - non-finished

        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:13.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:33:12.000 UTC"));
        startExecutionParameters.setComment("Test comment");

        ScheduleExecution scheduleExecution2 =
            scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);

        // Check
View Full Code Here

Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

        Assert.assertFalse(Iterators.contains(scheduleExecutions.iterator(), scheduleExecution2));
    }

    @Test
    public void testFindEngaged() throws Exception {
        StartExecutionParameters startExecutionParameters = new StartExecutionParameters();

        // Execution 1 - finished

        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:32:12.000 UTC"));
        startExecutionParameters.setComment("Test comment");

        ScheduleExecution scheduleExecution1 =
            scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);

        scheduleExecutionManagementService.finishExecution(
            scheduleExecution1.getId(), ScheduleExecutionStatus.SUCCEED);

        // Execution 2 - non-finished

        startExecutionParameters.setManual(false);
        startExecutionParameters.setFired(ChronometerUtils.parseMoment("2012-01-02 12:32:13.000 UTC"));
        startExecutionParameters.setScheduled(ChronometerUtils.parseMoment("2012-01-02 12:33:12.000 UTC"));
        startExecutionParameters.setComment("Test comment");

        ScheduleExecution scheduleExecution2 =
            scheduleExecutionManagementService.startExecution(scheduleJob.getId(), startExecutionParameters);

        // Check
View Full Code Here

Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

        LOGGER.debug("Job [id={}] will be executed (manual)", scheduleJobId);

        Date now = chronometer.getCurrentMoment();

        StartExecutionParameters executionParameters = new StartExecutionParameters();
        executionParameters.setScheduled(now);
        executionParameters.setFired(now);
        executionParameters.setManual(true);
        executionParameters.setComment(parameters.getComment());
        executionParameters.setAddresses(parameters.getAddresses());

        return executeJob(scheduleJobId, executionParameters);
    }
View Full Code Here

Examples of org.qzerver.model.service.job.execution.dto.StartExecutionParameters

    public ScheduleExecution executeAutomaticJob(long scheduleJobId, AutomaticJobExecutionParameters parameters) {
        BeanValidationUtils.checkValidity(parameters, beanValidator);

        LOGGER.debug("Job [id={}] will be executed (auto)", scheduleJobId);

        StartExecutionParameters executionParameters = new StartExecutionParameters();
        executionParameters.setScheduled(parameters.getScheduledTime());
        executionParameters.setFired(parameters.getFiredTime());
        executionParameters.setManual(false);
        executionParameters.setComment(null);
        executionParameters.setAddresses(null);

        ScheduleExecution scheduleExecution = executeJob(scheduleJobId, executionParameters);

        if (scheduleExecution.getStatus() != ScheduleExecutionStatus.SUCCEED) {
            ScheduleJob scheduleJob = scheduleExecution.getJob();
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.