Package org.pentaho.platform.api.scheduler2

Examples of org.pentaho.platform.api.scheduler2.IScheduler


    String jobId = "jobId";

    JobRequest mockJobRequest = mock( JobRequest.class );
    doReturn( jobId ).when( mockJobRequest ).getJobId();

    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).pauseJob( jobId );

    try {
      schedulerResource.pauseJob( mockJobRequest );
      fail();
View Full Code Here


    String jobId = "jobId";

    JobRequest mockJobRequest = mock( JobRequest.class );
    doReturn( jobId ).when( mockJobRequest ).getJobId();

    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).resumeJob( jobId );

    try {
      schedulerResource.resumeJob( mockJobRequest );
      fail();
View Full Code Here

    String jobId = "jobId";

    JobRequest mockJobRequest = mock( JobRequest.class );
    doReturn( jobId ).when( mockJobRequest ).getJobId();

    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).removeJob( jobId );

    try {
      schedulerResource.removeJob( mockJobRequest );
      fail();
View Full Code Here

  @Test
  public void testGetJobError() throws Exception {
    String jobId = "jobId";
    String asCronString = "asCronString";

    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).getJobInfo( jobId );

    try {
      schedulerResource.getJob( jobId, asCronString );
      fail();
View Full Code Here

    Response testResponse = schedulerResource.addBlockout( mockJobScheduleRequest );
    assertEquals( mockUnauthorizedResponse, testResponse );

    // Test 2
    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).addBlockout( mockJobScheduleRequest );

    testResponse = schedulerResource.addBlockout( mockJobScheduleRequest );
    assertEquals( mockUnauthorizedResponse, testResponse );
View Full Code Here

    Response testResponse = schedulerResource.updateBlockout( jobId, mockJobScheduleRequest );
    assertEquals( mockUnauthorizedResponse, testResponse );

    // Test 2
    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).updateBlockout( jobId,
      mockJobScheduleRequest );

    testResponse = schedulerResource.updateBlockout( jobId, mockJobScheduleRequest );
    assertEquals( mockUnauthorizedResponse, testResponse );
View Full Code Here

  public void testBlockoutWillFireError() throws Exception {
    JobScheduleRequest mockJobScheduleRequest = mock( JobScheduleRequest.class );

    UnifiedRepositoryException mockUnifiedRepositoryException = mock( UnifiedRepositoryException.class );

    SchedulerException mockSchedulerException = mock( SchedulerException.class );

    Response mockUnifiedRepositoryExceptionResponse = mock( Response.class );
    doReturn( mockUnifiedRepositoryExceptionResponse ).when( schedulerResource )
      .buildServerErrorResponse( mockUnifiedRepositoryException );
View Full Code Here

          .debug( MessageFormat
              .format(
                  "Scheduling job {0} with trigger {1} and job parameters [ {2} ]", jobId.toString(), trigger, prettyPrintMap( jobParams ) ) ); //$NON-NLS-1$
      scheduler.scheduleJob( jobDetail, quartzTrigger );
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance().getString(
          "QuartzScheduler.ERROR_0001_FAILED_TO_SCHEDULE_JOB", jobName ), e ); //$NON-NLS-1$
    }

    Job job = new Job();
    job.setJobParams( jobParams );
View Full Code Here

      logger
          .debug( MessageFormat
              .format(
                  "Scheduling job {0} with trigger {1} and job parameters [ {2} ]", jobId.toString(), trigger, prettyPrintMap( jobParams ) ) ); //$NON-NLS-1$
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance().getString(
          "QuartzScheduler.ERROR_0001_FAILED_TO_SCHEDULE_JOB", jobKey.getJobName() ), e ); //$NON-NLS-1$
    }
  }
View Full Code Here

        scheduler.rescheduleJob( jobId, jobKey.getUserName(), trigger );
      }

      scheduler.triggerJob( jobId, jobKey.getUserName() );
    } catch ( org.quartz.SchedulerException e ) {
      throw new SchedulerException( Messages.getInstance().getString(
          "QuartzScheduler.ERROR_0007_FAILED_TO_GET_JOB", jobId ), e ); //$NON-NLS-1$
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.scheduler2.IScheduler

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.