Package org.apache.ambari.server.state

Examples of org.apache.ambari.server.state.ServiceComponentHost.convertToResponse()


    expect(component.getName()).andReturn("component1");
    expect(component.getServiceComponentHosts()).andReturn(
      new HashMap<String, ServiceComponentHost>() {{
        put("host1", componentHost);
    }});
    expect(componentHost.convertToResponse()).andReturn(response);
    expect(componentHost.getHostName()).andReturn("host1").anyTimes();
    expect(maintHelper.getEffectiveState(componentHost, host)).andReturn(MaintenanceState.OFF);

    // replay mocks
    replay(maintHelper, injector, clusters, cluster, host, response, stack,
View Full Code Here


    expect(component3.getName()).andReturn("component3");
    expect(component3.getServiceComponentHosts()).andReturn(
      new HashMap<String, ServiceComponentHost>() {{
        put("host1", componentHost2);
      }});
    expect(componentHost2.convertToResponse()).andReturn(response2);

    // replay mocks
    replay(stateHelper, injector, clusters, cluster, host, stack,
        metaInfo, service, component, component2, component3, componentHost1,
        componentHost2, response1, response2);
View Full Code Here

    expect(component3.getName()).andReturn("component3");
    expect(component3.getServiceComponentHosts()).andReturn(new
      HashMap<String, ServiceComponentHost>() {{
        put("host1", componentHost2);
      }});
    expect(componentHost2.convertToResponse()).andReturn(response2);
    expect(componentHost2.getHostName()).andReturn("host1");

    // replay mocks
    replay(maintHelper, injector, clusters, cluster, host, stack, metaInfo,
        service, component, component2, component3, componentHost1,
View Full Code Here

    expect(component3.getName()).andReturn("component3");
    expect(component3.getServiceComponentHosts()).andReturn(
      new HashMap<String, ServiceComponentHost>() {{
        put("host1", componentHost2);
      }});
    expect(componentHost2.convertToResponse()).andReturn(response2);
    expect(componentHost2.getHostName()).andReturn("host1");

    // replay mocks
    replay(maintHelper, injector, clusters, cluster, host, stack, metaInfo,
      service, service2, component, component2, component3, componentHost1,
View Full Code Here

    expect(metaInfo.getComponentToService("stackName", "stackVersion", "component3")).andReturn("service1");
    expect(cluster.getService("service1")).andReturn(service);
    expect(service.getServiceComponent("component3")).andReturn(component3);
    expect(component3.getName()).andReturn("component3");
    expect(component3.getServiceComponentHosts()).andReturn(Collections.singletonMap("foo", componentHost2));
    expect(componentHost2.convertToResponse()).andReturn(response2);
    expect(componentHost2.getHostName()).andReturn("host1");

    // replay mocks
    replay(maintHelper, injector, clusters, cluster, host, stack, metaInfo,
        service, service2, component, component2, component3, componentHost1,
View Full Code Here

    expect(service.getServiceComponent("component1")).andReturn(component);
    expect(component.getName()).andReturn("component1").anyTimes();

    expect(component.getServiceComponentHosts()).andReturn(mapHostComponents);
    expect(componentHost1.convertToResponse()).andReturn(response1);
    expect(componentHost2.convertToResponse()).andReturn(response2);
    expect(componentHost1.getHostName()).andReturn("host1");
    expect(componentHost2.getHostName()).andReturn("host1");

    // replay mocks
    replay(maintHelper, injector, clusters, cluster, response1, response2,
View Full Code Here

    expect(componentHost1.getHostName()).andReturn("host1");
    expect(componentHost2.getHostName()).andReturn("host1");
    expect(componentHost3.getHostName()).andReturn("host1");

    expect(component2.getServiceComponentHosts()).andReturn(Collections.singletonMap("foobar", componentHost3));
    expect(componentHost3.convertToResponse()).andReturn(response3);

    // replay mocks
    replay(maintHelper, injector, clusters, cluster, response1, response2,
        response3, stack, metaInfo, service1, service2, component1, component2,
        componentHost1, componentHost2, componentHost3);
View Full Code Here

    expect(metaInfo.getComponentToService("stackName", "stackVersion", "component1")).andReturn("service1");
    expect(cluster.getService("service1")).andReturn(service);
    expect(service.getServiceComponent("component1")).andReturn(component);
    expect(component.getName()).andReturn("component1").anyTimes();
    expect(component.getServiceComponentHost("host1")).andReturn(componentHost);
    expect(componentHost.convertToResponse()).andReturn(response);

    // replay mocks
    replay(injector, clusters, cluster, host, response, stack, metaInfo, service, component, componentHost);

    //test
View Full Code Here

    expect(metaInfo.getComponentToService("stackName", "stackVersion", "component3")).andReturn("service1");
    expect(service.getServiceComponent("component3")).andReturn(component3);
    expect(component3.getName()).andReturn("component3");
    expect(component3.getServiceComponentHost("host1")).andReturn(componentHost2);
    expect(componentHost2.convertToResponse()).andReturn(response2);

    // replay mocks
    replay(injector, clusters, cluster, host, stack, metaInfo, service, component, component2, component3,
        componentHost1, componentHost2, response1, response2);
View Full Code Here

    expect(metaInfo.getComponentToService("stackName", "stackVersion", "component3")).andReturn("service1");
    expect(cluster.getService("service1")).andReturn(service);
    expect(service.getServiceComponent("component3")).andReturn(component3);
    expect(component3.getName()).andReturn("component3");
    expect(component3.getServiceComponentHost("host1")).andReturn(componentHost2);
    expect(componentHost2.convertToResponse()).andReturn(response2);

    // replay mocks
    replay(injector, clusters, cluster, host, stack, metaInfo, service, component, component2, component3,
        componentHost1, componentHost2, response1, response2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.