Package net.sf.pipet.modules

Examples of net.sf.pipet.modules.ExternalCommand$Job


      @ResponseCode ( code = 400, condition = "Invalid input." ),
      @ResponseCode ( code = 500, condition = "Invalid jobId." )
  } )
  public Response triggerNow( JobRequest jobRequest ) {
    try {
      Job job = schedulerService.triggerNow( jobRequest.getJobId() );
      return buildPlainTextOkResponse( job.getState().name() );
    } catch ( SchedulerException e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here


  public Response removeJob( JobRequest jobRequest ) {
    try {
      if ( schedulerService.removeJob( jobRequest.getJobId() ) ) {
        return buildPlainTextOkResponse( "REMOVED" );
      }
      Job job = schedulerService.getJob( jobRequest.getJobId() );
      return buildPlainTextOkResponse( job.getState().name() );
    } catch ( SchedulerException e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here

      @ResponseCode ( code = 200, condition = "Successful operation." ),
      @ResponseCode ( code = 401, condition = "User is not authorized to create blockout." )
  } )
  public Response addBlockout( JobScheduleRequest jobScheduleRequest ) {
    try {
      Job job = schedulerService.addBlockout( jobScheduleRequest );
      return buildPlainTextOkResponse( job.getJobId() );
    } catch ( IOException e ) {
      return buildStatusResponse( UNAUTHORIZED );
    } catch ( SchedulerException e ) {
      return buildStatusResponse( UNAUTHORIZED );
    } catch ( IllegalAccessException e ) {
View Full Code Here

      @ResponseCode ( code = 200, condition = "Successful operation." ),
      @ResponseCode ( code = 401, condition = "User is not authorized to update blockout." )
  } )
  public Response updateBlockout( @QueryParam ( "jobid" ) String jobId, JobScheduleRequest jobScheduleRequest ) {
    try {
      Job job = schedulerService.updateBlockout( jobId, jobScheduleRequest );
      return buildPlainTextOkResponse( job.getJobId() );
    } catch ( IOException e ) {
      return buildStatusResponse( Status.UNAUTHORIZED );
    } catch ( SchedulerException e ) {
      return buildStatusResponse( Status.UNAUTHORIZED );
    } catch ( IllegalAccessException e ) {
View Full Code Here

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

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).createJob( mockRequest );

    String jobId = "jobId";
    doReturn( jobId ).when( mockJob ).getJobId();
View Full Code Here

    JobRequest mockJobRequest = mock( JobRequest.class );

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

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).triggerNow( jobId );

    Job.JobState mockJobState = Job.JobState.BLOCKED;
    doReturn( mockJobState ).when( mockJob ).getState();
View Full Code Here

    verify( schedulerResource.schedulerService, times( 1 ) ).triggerNow( jobId );
  }

  @Test
  public void testGetContentCleanerJob() throws Exception {
    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).getContentCleanerJob();

    Job testJob = schedulerResource.getContentCleanerJob();
    assertEquals( mockJob, testJob );

    verify( schedulerResource.schedulerService, times( 1 ) ).getContentCleanerJob();
  }
View Full Code Here

    JobRequest mockJobRequest = mock( JobRequest.class );

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

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).getJob( jobId );

    Job.JobState mockJobState = Job.JobState.BLOCKED;
    doReturn( mockJobState ).when( mockJob ).getState();
View Full Code Here

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

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).getJobInfo( jobId );

    Job testJob = schedulerResource.getJob( jobId, asCronString );
    assertEquals( mockJob, testJob );

    verify( schedulerResource.schedulerService, times( 1 ) ).getJobInfo( jobId );
  }
View Full Code Here

  @Test
  public void testAddBlockout() throws Exception {
    JobScheduleRequest mockJobScheduleRequest = mock( JobScheduleRequest.class );

    Job mockJob = mock( Job.class );
    doReturn( mockJob ).when( schedulerResource.schedulerService ).addBlockout( mockJobScheduleRequest );

    String jobId = "jobId";
    doReturn( jobId ).when( mockJob ).getJobId();
View Full Code Here

TOP

Related Classes of net.sf.pipet.modules.ExternalCommand$Job

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.