Package org.pentaho.platform.api.scheduler2

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


    deleteJobIfNecessary();

    Map<String, Serializable> parms = new HashMap<String, Serializable>();
    parms.put( VersionCheckerAction.VERSION_REQUEST_FLAGS, new Integer( versionRequestFlags ) );
    JobTrigger trigger = new SimpleJobTrigger( new Date(), null, -1, repeatSeconds );
    scheduler.createJob( EmbeddedVersionCheckSystemListener.VERSION_CHECK_JOBNAME, VersionCheckerAction.class, parms,
        trigger );
  }
View Full Code Here


  @Test
  public void testCreateJobError() throws Exception {
    JobScheduleRequest mockRequest = mock( JobScheduleRequest.class );

    SchedulerException mockSchedulerException = mock( SchedulerException.class );

    Throwable mockSchedulerExceptionCause = mock( Throwable.class );
    doReturn( mockSchedulerExceptionCause ).when( mockSchedulerException ).getCause();

    String schedulerExceptionMessage = "schedulerExceptionMessage";
View Full Code Here

    JobRequest mockJobRequest = mock( JobRequest.class );

    String jobId = "jobId";
    doReturn( jobId ).when( mockJobRequest ).getJobId();

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

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

    verify( schedulerResource.schedulerService, times( 1 ) ).getContentCleanerJob();
  }

  @Test
  public void testGetContentCleanerJobError() throws Exception {
    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).getContentCleanerJob();

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

  @Test
  public void testGetJobsError() throws Exception {
    Boolean asCronString = Boolean.FALSE;

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

    try {
      schedulerResource.getJobs( asCronString );
      fail();
View Full Code Here

    verify( schedulerResource, times( 1 ) ).buildPlainTextOkResponse( state );
  }

  @Test
  public void testGetStateError() throws Exception {
    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).getState();

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

    verify( schedulerResource, times( 1 ) ).buildPlainTextOkResponse( status );
  }

  @Test
  public void testStartError() throws Exception {
    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).start();

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

    verify( schedulerResource, times( 1 ) ).buildPlainTextOkResponse( status );
  }

  @Test
  public void testPauseError() throws Exception {
    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).pause();

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

    verify( schedulerResource, times( 1 ) ).buildPlainTextOkResponse( status );
  }

  @Test
  public void testShutdownError() throws Exception {
    SchedulerException mockSchedulerException = mock( SchedulerException.class );
    doThrow( mockSchedulerException ).when( schedulerResource.schedulerService ).shutdown();

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

    Response testResponse = schedulerResource.getJobState( mockJobRequest );
    assertEquals( mockUnauthorizedResponse, testResponse );

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

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

TOP

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

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.