Package com.cloudera.api.v6

Examples of com.cloudera.api.v6.DashboardsResource


      blueprint.getHadoopStack().setDistro("CDH-5.0.1");
      ClustersResourceV6 resourceV6 = Mockito.mock(FakeClustersResource.class);
      Mockito.when(resourceV6.startCommand(blueprint.getName())).thenThrow(
            SoftwareManagementPluginException.START_CLUSTER_FAILED(null, null, blueprint.getName()));
      ServicesResourceV6 servicesResourceV6 = Mockito.mock(ServicesResourceV6.class);
      List<ApiService> serviceList = new ArrayList<>();
      ApiService hdfs = new ApiService();
      hdfs.setName("HDFS");
      hdfs.setServiceState(ApiServiceState.STOPPED);
      serviceList.add(hdfs);
      ApiServiceList apiServiceList = new ApiServiceList();
      apiServiceList.setServices(serviceList);
      Mockito.when(servicesResourceV6.readServices((DataView) anyObject())).thenReturn(apiServiceList);

      List<ApiRole> roleList = new ArrayList<>();
      ApiRole role = new ApiRole();
      role.setName("NAMENODE");
      role.setRoleState(ApiRoleState.STOPPED);
      role.setType(role.getName());
      ApiHostRef hostRef = new ApiHostRef("host1");
      role.setHostRef(hostRef);
      roleList.add(role);
      RolesResourceV6 rolesResourceV6 = new FakeRolesResource(roleList);
      Mockito.when(servicesResourceV6.getRolesResource(hdfs.getName())).thenReturn(rolesResourceV6);
      Mockito.when(resourceV6.getServicesResource(blueprint.getName())).thenReturn(servicesResourceV6);

      ApiClusterList apiClusterList = new ApiClusterList();
      ApiCluster apiCluster = new ApiCluster();
      apiCluster.setName(blueprint.getName());
View Full Code Here

TOP

Related Classes of com.cloudera.api.v6.DashboardsResource

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.