Package org.apache.ambari.server.controller

Examples of org.apache.ambari.server.controller.ServiceComponentResponse


    ServiceComponent sc = service.getServiceComponent(componentName);
    Assert.assertNotNull(sc);
    sc.setDesiredState(State.INSTALLED);
    sc.setDesiredStackVersion(new StackId("HDP-1.0.0"));

    ServiceComponentResponse r = sc.convertToResponse();
    Assert.assertEquals(sc.getClusterName(), r.getClusterName());
    Assert.assertEquals(sc.getClusterId(), r.getClusterId().longValue());
    Assert.assertEquals(sc.getName(), r.getComponentName());
    Assert.assertEquals(sc.getServiceName(), r.getServiceName());
    Assert.assertEquals(sc.getDesiredStackVersion().getStackId(),
        r.getDesiredStackVersion());
    Assert.assertEquals(sc.getDesiredState().toString(),
        r.getDesiredState());

    // TODO check configs
    // r.getConfigVersions()

    // TODO test debug dump
View Full Code Here


    Resource.Type type = Resource.Type.Component;

    AmbariManagementController managementController = createMock(AmbariManagementController.class);

    Set<ServiceComponentResponse> allResponse = new HashSet<ServiceComponentResponse>();
    allResponse.add(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component100", null, null, ""));
    allResponse.add(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null, null, ""));
    allResponse.add(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null, null, ""));

    // set expectations
    expect(managementController.getComponents(
        AbstractResourceProviderTest.Matcher.getComponentRequestSet(
            "Cluster100", null, null, null, null))).andReturn(allResponse).once();
View Full Code Here

    Map<String, String> mapRequestProps = new HashMap<String, String>();
    mapRequestProps.put("context", "Called from a test");

    Set<ServiceComponentResponse> nameResponse = new HashSet<ServiceComponentResponse>();
    nameResponse.add(new ServiceComponentResponse(102L, "Cluster102", "Service", "Component", null, "1", "STARTED"));

    // set expectations
    expect(managementController.getComponents(EasyMock.<Set<ServiceComponentRequest>>anyObject())).
        andReturn(nameResponse).once();
    expect(managementController.updateComponents(
View Full Code Here

  public ServiceComponentResponse convertToResponse() {
    clusterGlobalLock.readLock().lock();
    try {
      readWriteLock.readLock().lock();
      try {
        ServiceComponentResponse r = new ServiceComponentResponse(
            getClusterId(), service.getCluster().getClusterName(),
            service.getName(), getName(), this.desiredConfigs,
            getDesiredStackVersion().getStackId(),
            getDesiredState().toString());
        return r;
View Full Code Here

    saveIfPersisted();
  }

  @Override
  public synchronized ServiceComponentResponse convertToResponse() {
    ServiceComponentResponse r  = new ServiceComponentResponse(
        getClusterId(), service.getCluster().getClusterName(),
        service.getName(), getName(), this.desiredConfigs,
        getDesiredStackVersion().getStackId(),
        getDesiredState().toString());
    return r;
View Full Code Here

    ServiceComponent sc = service.getServiceComponent(componentName);
    Assert.assertNotNull(sc);
    sc.setDesiredState(State.INSTALLED);
    sc.setDesiredStackVersion(new StackId("HDP-1.0.0"));

    ServiceComponentResponse r = sc.convertToResponse();
    Assert.assertEquals(sc.getClusterName(), r.getClusterName());
    Assert.assertEquals(sc.getClusterId(), r.getClusterId().longValue());
    Assert.assertEquals(sc.getName(), r.getComponentName());
    Assert.assertEquals(sc.getServiceName(), r.getServiceName());
    Assert.assertEquals(sc.getDesiredStackVersion().getStackId(),
        r.getDesiredStackVersion());
    Assert.assertEquals(sc.getDesiredState().toString(),
        r.getDesiredState());

    // TODO check configs
    // r.getConfigVersions()

    // TODO test debug dump
View Full Code Here

    saveIfPersisted();
  }

  @Override
  public synchronized ServiceComponentResponse convertToResponse() {
    ServiceComponentResponse r  = new ServiceComponentResponse(
        getClusterId(), service.getCluster().getClusterName(),
        service.getName(), getName(), this.desiredConfigs,
        getDesiredStackVersion().getStackId(),
        getDesiredState().toString());
    return r;
View Full Code Here

    expect(cluster.getServices()).andReturn(Collections.singletonMap("Service100", service)).anyTimes();

    expect(service.getServiceComponents()).andReturn(serviceComponentMap).anyTimes();

    expect(serviceComponent1.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component100", null, ""));
    expect(serviceComponent2.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null, ""));
    expect(serviceComponent3.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null, ""));


    expect(ambariMetaInfo.getComponentCategory((String) anyObject(), (String) anyObject(),
        (String) anyObject(), (String) anyObject())).andReturn(componentInfo).anyTimes();
View Full Code Here

    expect(cluster.getServices()).andReturn(Collections.singletonMap("Service100", service)).anyTimes();

    expect(service.getServiceComponents()).andReturn(serviceComponentMap).anyTimes();

    expect(serviceComponent1.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component101", null, ""));
    expect(serviceComponent2.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component102", null, ""));
    expect(serviceComponent3.convertToResponse()).andReturn(new ServiceComponentResponse(100L, "Cluster100", "Service100", "Component103", null, ""));
    expect(serviceComponent1.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
    expect(serviceComponent2.getDesiredState()).andReturn(State.INSTALLED).anyTimes();
    expect(serviceComponent3.getDesiredState()).andReturn(State.INSTALLED).anyTimes();

    expect(serviceComponentHost.getState()).andReturn(State.INSTALLED).anyTimes();
View Full Code Here

    StackId stackId = createNiceMock(StackId.class);

    Cluster cluster = createNiceMock(Cluster.class);
    Service service = createNiceMock(Service.class);
    ServiceComponent component = createNiceMock(ServiceComponent.class);
    ServiceComponentResponse response = createNiceMock(ServiceComponentResponse.class);

    // requests
    ServiceComponentRequest request1 = new ServiceComponentRequest("cluster1", "service1", "component1",
        null);
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.ServiceComponentResponse

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.