Search in sources :

Example 1 with DeploymentClusterPlanner

use of com.cloud.deploy.DeploymentClusterPlanner in project cloudstack by apache.

the class DeploymentPlanningManagerImplTest method emptyClusterListTest.

@Test
public void emptyClusterListTest() throws InsufficientServerCapacityException, AffinityConflictException {
    ServiceOfferingVO svcOffering = new ServiceOfferingVO("testOffering", 1, 512, 500, 1, 1, false, false, false, "test dpm", ProvisioningType.THIN, false, false, null, false, VirtualMachine.Type.User, domainId, null, "FirstFitPlanner");
    Mockito.when(vmProfile.getServiceOffering()).thenReturn(svcOffering);
    DataCenterDeployment plan = new DataCenterDeployment(dataCenterId);
    Mockito.when(avoids.shouldAvoid((DataCenterVO) Matchers.anyObject())).thenReturn(false);
    Mockito.when(_planner.canHandle(vmProfile, plan, avoids)).thenReturn(true);
    Mockito.when(((DeploymentClusterPlanner) _planner).orderClusters(vmProfile, plan, avoids)).thenReturn(null);
    DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids, null);
    assertNull("Planner cannot handle, destination should be null! ", dest);
}
Also used : DataCenterDeployment(com.cloud.deploy.DataCenterDeployment) DeploymentClusterPlanner(com.cloud.deploy.DeploymentClusterPlanner) DeployDestination(com.cloud.deploy.DeployDestination) ServiceOfferingVO(com.cloud.service.ServiceOfferingVO) Test(org.junit.Test)

Aggregations

DataCenterDeployment (com.cloud.deploy.DataCenterDeployment)1 DeployDestination (com.cloud.deploy.DeployDestination)1 DeploymentClusterPlanner (com.cloud.deploy.DeploymentClusterPlanner)1 ServiceOfferingVO (com.cloud.service.ServiceOfferingVO)1 Test (org.junit.Test)1