Package org.apache.aurora.gen

Examples of org.apache.aurora.gen.Response


  }

  @Test
  public void testPredicatePass() throws Exception {
    TaskQuery query = new TaskQuery();
    Response response = new Response()
        .setResponseCode(ResponseCode.OK);

    expect(predicate.apply(EasyMock.<Method>anyObject())).andReturn(true);
    expect(realThrift.getTasksStatus(query)).andReturn(response);
View Full Code Here


    getIface(ImmutableMap.of("notamethod", true));
  }

  private void assertCreateAllowed(Map<String, Boolean> toggledMethods) throws Exception {
    JobConfiguration job = new JobConfiguration();
    Response response = new Response();
    expect(mockThrift.createJob(job, null, SESSION_KEY)).andReturn(response);

    control.replay();

    Iface thrift = getIface(toggledMethods);
View Full Code Here

    decoratedThrift = injector.getInstance(AuroraAdmin.Iface.class);
  }

  @Test
  public void testIncrementStat() throws Exception {
    Response response = new Response().setResponseCode(OK)
        .setResult(Result.getJobsResult(new GetJobsResult()
        .setConfigs(ImmutableSet.<JobConfiguration>of())));

    expect(realThrift.getJobs(ROLE)).andReturn(response);
    control.replay();
View Full Code Here

    decoratedThrift = injector.getInstance(AuroraAdmin.Iface.class);
  }

  @Test
  public void testVersionIsSet() throws Exception {
    Response response = okResponse(
        Result.getJobsResult(
            new GetJobsResult().setConfigs(ImmutableSet.<JobConfiguration>of())));

    expect(realThrift.getJobs(ROLE)).andReturn(response);
    control.replay();
View Full Code Here

  @Test
  public void testServerInfoIsSet() throws Exception {
    ServerInfo previousServerInfo =
        new ServerInfo().setClusterName("FAKECLUSTER").setThriftAPIVersion(100000);

    Response response = okResponse(
        Result.getJobsResult(
            new GetJobsResult().setConfigs(ImmutableSet.<JobConfiguration>of())))
        .setServerInfo(previousServerInfo);

    expect(realThrift.getJobs(ROLE)).andReturn(response);
View Full Code Here

    assertEquals(SERVER_INFO.newBuilder(), decoratedThrift.getJobs(ROLE).serverInfo);
  }

  private static Response okResponse(Result result) {
    return new Response()
        .setResponseCode(OK)
        .setResult(result);
  }
View Full Code Here

        new Class<?>[] {thriftClass},
        new InvocationHandler() {
          @Override
          public Object invoke(Object o, Method method, Object[] args) throws Throwable {
            System.out.println("Invoking " + method);
            Response response = (Response) method.invoke(realThrift, args);
            assertTrue(response.isSetResponseCode());
            assertNotNull(response.getDetails());
            return response;
          }
        });
  }
View Full Code Here

    JobConfiguration job = makeJob();
    job.getTaskConfig().unsetExecutorConfig();
    expectAuth(ROLE, true);
    control.replay();

    Response response = thrift.createJob(job, LOCK.newBuilder(), SESSION);
    assertResponse(INVALID_REQUEST, response);
    // TODO(wfarner): Don't rely on a magic string here, reference a constant from the source.
    assertMessageMatches(response, "Configuration may not be null");
  }
View Full Code Here

    expectAuth(ROOT, true);
    storageUtil.expectTaskFetch(query);

    control.replay();

    Response response = thrift.killTasks(query.get(), DEFAULT_LOCK, SESSION);
    assertOkResponse(response);
    assertMessageMatches(response, SchedulerThriftInterface.NO_TASKS_TO_KILL_MESSAGE);
  }
View Full Code Here

    scheduler.restartShards(JOB_KEY, shards, USER);
    expectLastCall().andThrow(new ScheduleException(message));

    control.replay();

    Response resp = thrift.restartShards(JOB_KEY.newBuilder(), shards, DEFAULT_LOCK, SESSION);
    assertResponse(INVALID_REQUEST, resp);
    assertMessageMatches(resp, message);
  }
View Full Code Here

TOP

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

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.