Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.JobUpdateRequest


    final SessionContext context;
    final IJobUpdateRequest request;
    try {
      context = sessionValidator.checkAuthenticated(session, ImmutableSet.of(job.getRole()));
      request = IJobUpdateRequest.build(new JobUpdateRequest(mutableRequest).setTaskConfig(
          ConfigurationManager.validateAndPopulate(
              ITaskConfig.build(mutableRequest.getTaskConfig())).newBuilder()));

      if (cronJobManager.hasJob(job)) {
        return invalidResponse("Cron jobs may only be updated by calling replaceCronTemplate.");
View Full Code Here


    jobUpdateController.start(update, USER);

    control.replay();

    // Validate key is populated during sanitizing.
    JobUpdateRequest request = buildJobUpdateRequest(update);
    request.getTaskConfig().unsetJob();

    Response response = assertOkResponse(thrift.startJobUpdate(request, SESSION));
    assertEquals(UPDATE_ID, response.getResult().getStartJobUpdateResult().getUpdateId());
  }
View Full Code Here

  }

  @Test
  public void testStartUpdateFailsNullTaskConfig() throws Exception {
    control.replay();
    assertResponse(ERROR, thrift.startJobUpdate(new JobUpdateRequest(
        null,
        5,
        buildJobUpdateSettings()), SESSION));
  }
View Full Code Here

  }

  @Test
  public void testStartUpdateFailsInvalidJobKey() throws Exception {
    control.replay();
    assertResponse(ERROR, thrift.startJobUpdate(new JobUpdateRequest(
        new TaskConfig()
            .setJobName("&")
            .setEnvironment("devel")
            .setOwner(new Identity(ROLE, null)),
        5,
View Full Code Here

  }

  @Test
  public void testStartUpdateFailsInvalidGroupSize() throws Exception {
    control.replay();
    assertResponse(INVALID_REQUEST, thrift.startJobUpdate(new JobUpdateRequest(
        defaultTask(true),
        5,
        buildJobUpdateSettings().setUpdateGroupSize(0)), SESSION));
  }
View Full Code Here

  }

  @Test
  public void testStartUpdateFailsInvalidMaxInstanceFailures() throws Exception {
    control.replay();
    assertResponse(INVALID_REQUEST, thrift.startJobUpdate(new JobUpdateRequest(
        defaultTask(true),
        5,
        buildJobUpdateSettings().setMaxPerInstanceFailures(-1)), SESSION));
  }
View Full Code Here

  }

  @Test
  public void testStartUpdateFailsInvalidMaxFailedInstances() throws Exception {
    control.replay();
    assertResponse(INVALID_REQUEST, thrift.startJobUpdate(new JobUpdateRequest(
        defaultTask(true),
        5,
        buildJobUpdateSettings().setMaxFailedInstances(-1)), SESSION));
  }
View Full Code Here

  }

  @Test
  public void testStartUpdateFailsInvalidMaxWaitToRunning() throws Exception {
    control.replay();
    assertResponse(INVALID_REQUEST, thrift.startJobUpdate(new JobUpdateRequest(
        defaultTask(true),
        5,
        buildJobUpdateSettings().setMaxWaitToInstanceRunningMs(-1)), SESSION));
  }
View Full Code Here

  }

  @Test
  public void testStartUpdateFailsInvalidMinWaitInRunning() throws Exception {
    control.replay();
    assertResponse(INVALID_REQUEST, thrift.startJobUpdate(new JobUpdateRequest(
        defaultTask(true),
        5,
        buildJobUpdateSettings().setMinWaitInInstanceRunningMs(-1)), SESSION));
  }
View Full Code Here

        buildJobUpdateSettings().setMinWaitInInstanceRunningMs(-1)), SESSION));
  }

  @Test
  public void testStartUpdateFailsAuth() throws Exception {
    JobUpdateRequest request = buildJobUpdateRequest(populatedTask());
    expectAuth(ROLE, false);

    control.replay();
    assertResponse(AUTH_FAILED, thrift.startJobUpdate(request, SESSION));
  }
View Full Code Here

TOP

Related Classes of org.apache.aurora.gen.JobUpdateRequest

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.