本文整理汇总了Java中org.oscm.app.iaas.data.VSystemTemplateConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java VSystemTemplateConfiguration类的具体用法?Java VSystemTemplateConfiguration怎么用?Java VSystemTemplateConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VSystemTemplateConfiguration类属于org.oscm.app.iaas.data包,在下文中一共展示了VSystemTemplateConfiguration类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate_ClusterOK
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Test
public void validate_ClusterOK() throws Exception {
// given
DiskImage masterImage = mock(DiskImage.class);
doReturn("masterId").when(masterImage).getDiskImageId();
doReturn("master").when(masterImage).getDiskImageName();
doReturn("4").when(masterImage).getMaxCpuCount();
diskImages.put(masterImage.getDiskImageId(), masterImage);
DiskImage slaveImage = mock(DiskImage.class);
doReturn("slaveId").when(slaveImage).getDiskImageId();
doReturn("slave").when(slaveImage).getDiskImageName();
doReturn("4").when(slaveImage).getMaxCpuCount();
diskImages.put(slaveImage.getDiskImageId(), slaveImage);
paramHandler.setState(FlowState.VSYSTEM_CREATION_REQUESTED);
doReturn(Boolean.TRUE).when(vSystemProcessor).isAdminAgentReachable();
addDiskImageAnswer();
parameters.put(PropertyHandler.COUNT_CPU, new Setting(
PropertyHandler.COUNT_CPU, "2"));
parameters.put(PropertyHandler.CLUSTER_SIZE, new Setting(
PropertyHandler.CLUSTER_SIZE, "2"));
parameters.put(
PropertyHandler.MASTER_TEMPLATE_ID,
new Setting(PropertyHandler.MASTER_TEMPLATE_ID, masterImage
.getDiskImageId()));
parameters
.put(PropertyHandler.SLAVE_TEMPLATE_ID,
new Setting(PropertyHandler.SLAVE_TEMPLATE_ID,
slaveImage.getDiskImageId()));
doNothing().when(vSystemProcessor).validateClusterSize(
eq(paramHandler), eq(true), eq(false),
any(VSystemTemplateConfiguration.class));
// when
vSystemProcessor.validateParameters(paramHandler);
}
示例2: validate_Cluster_maxCPU
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Test
public void validate_Cluster_maxCPU() throws Exception {
// given
DiskImage masterImage = mock(DiskImage.class);
doReturn("masterId").when(masterImage).getDiskImageId();
doReturn("master").when(masterImage).getDiskImageName();
doReturn("4").when(masterImage).getMaxCpuCount();
diskImages.put(masterImage.getDiskImageId(), masterImage);
DiskImage slaveImage = mock(DiskImage.class);
doReturn("slaveId").when(slaveImage).getDiskImageId();
doReturn("slave").when(slaveImage).getDiskImageName();
doReturn("4").when(slaveImage).getMaxCpuCount();
diskImages.put(slaveImage.getDiskImageId(), slaveImage);
paramHandler.setState(FlowState.VSYSTEM_CREATION_REQUESTED);
doReturn(Boolean.TRUE).when(vSystemProcessor).isAdminAgentReachable();
addDiskImageAnswer();
parameters.put(PropertyHandler.COUNT_CPU, new Setting(
PropertyHandler.COUNT_CPU, "4"));
parameters.put(PropertyHandler.CLUSTER_SIZE, new Setting(
PropertyHandler.CLUSTER_SIZE, "2"));
parameters.put(
PropertyHandler.MASTER_TEMPLATE_ID,
new Setting(PropertyHandler.MASTER_TEMPLATE_ID, masterImage
.getDiskImageId()));
parameters
.put(PropertyHandler.SLAVE_TEMPLATE_ID,
new Setting(PropertyHandler.SLAVE_TEMPLATE_ID,
slaveImage.getDiskImageId()));
doNothing().when(vSystemProcessor).validateClusterSize(
any(PropertyHandler.class), anyBoolean(), anyBoolean(),
any(VSystemTemplateConfiguration.class));
// when
vSystemProcessor.validateParameters(paramHandler);
}
示例3: validate_Cluster_maxMasterCPUEmpty
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Test
public void validate_Cluster_maxMasterCPUEmpty() throws Exception {
// given
DiskImage masterImage = mock(DiskImage.class);
doReturn("masterId").when(masterImage).getDiskImageId();
doReturn("master").when(masterImage).getDiskImageName();
doReturn("").when(masterImage).getMaxCpuCount();
diskImages.put(masterImage.getDiskImageId(), masterImage);
DiskImage slaveImage = mock(DiskImage.class);
doReturn("slaveId").when(slaveImage).getDiskImageId();
doReturn("slave").when(slaveImage).getDiskImageName();
doReturn("4").when(slaveImage).getMaxCpuCount();
diskImages.put(slaveImage.getDiskImageId(), slaveImage);
paramHandler.setState(FlowState.VSYSTEM_CREATION_REQUESTED);
doReturn(Boolean.TRUE).when(vSystemProcessor).isAdminAgentReachable();
addDiskImageAnswer();
parameters.put(PropertyHandler.COUNT_CPU, new Setting(
PropertyHandler.COUNT_CPU, "4"));
parameters.put(PropertyHandler.CLUSTER_SIZE, new Setting(
PropertyHandler.CLUSTER_SIZE, "2"));
parameters.put(
PropertyHandler.MASTER_TEMPLATE_ID,
new Setting(PropertyHandler.MASTER_TEMPLATE_ID, masterImage
.getDiskImageId()));
parameters
.put(PropertyHandler.SLAVE_TEMPLATE_ID,
new Setting(PropertyHandler.SLAVE_TEMPLATE_ID,
slaveImage.getDiskImageId()));
doNothing().when(vSystemProcessor).validateClusterSize(
any(PropertyHandler.class), anyBoolean(), anyBoolean(),
any(VSystemTemplateConfiguration.class));
// when
vSystemProcessor.validateParameters(paramHandler);
}
示例4: validate_Cluster_maxSlaveCPUEmpty
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Test
public void validate_Cluster_maxSlaveCPUEmpty() throws Exception {
// given
DiskImage masterImage = mock(DiskImage.class);
doReturn("masterId").when(masterImage).getDiskImageId();
doReturn("master").when(masterImage).getDiskImageName();
doReturn("4").when(masterImage).getMaxCpuCount();
diskImages.put(masterImage.getDiskImageId(), masterImage);
DiskImage slaveImage = mock(DiskImage.class);
doReturn("slaveId").when(slaveImage).getDiskImageId();
doReturn("slave").when(slaveImage).getDiskImageName();
doReturn("").when(slaveImage).getMaxCpuCount();
diskImages.put(slaveImage.getDiskImageId(), slaveImage);
paramHandler.setState(FlowState.VSYSTEM_CREATION_REQUESTED);
doReturn(Boolean.TRUE).when(vSystemProcessor).isAdminAgentReachable();
addDiskImageAnswer();
parameters.put(PropertyHandler.COUNT_CPU, new Setting(
PropertyHandler.COUNT_CPU, "4"));
parameters.put(PropertyHandler.CLUSTER_SIZE, new Setting(
PropertyHandler.CLUSTER_SIZE, "2"));
parameters.put(
PropertyHandler.MASTER_TEMPLATE_ID,
new Setting(PropertyHandler.MASTER_TEMPLATE_ID, masterImage
.getDiskImageId()));
parameters
.put(PropertyHandler.SLAVE_TEMPLATE_ID,
new Setting(PropertyHandler.SLAVE_TEMPLATE_ID,
slaveImage.getDiskImageId()));
doNothing().when(vSystemProcessor).validateClusterSize(
any(PropertyHandler.class), anyBoolean(), anyBoolean(),
any(VSystemTemplateConfiguration.class));
// when
vSystemProcessor.validateParameters(paramHandler);
}
示例5: getVSystemTemplateConfiguration
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Override
public VSystemTemplateConfiguration getVSystemTemplateConfiguration(
PropertyHandler properties) throws Exception {
LPlatformDescriptorConfiguration details = getVdcClient(properties)
.getLPlatformDescriptorConfiguration(
properties.getSystemTemplateId());
return details;
}
示例6: getTemplateConfiguration
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Test
public void getTemplateConfiguration() throws Exception {
// given
prepareVdcClientWithTemplateDescriptor();
// when
VSystemTemplateConfiguration templateConfiguration = rorVSystemCommunication
.getVSystemTemplateConfiguration(properties);
// then
assertNotNull(templateConfiguration);
}
示例7: validateClusterSize
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Test
public void validateClusterSize() throws Exception {
// given
VSystemTemplateConfiguration templateConfiguration = mock(VSystemTemplateConfiguration.class);
DiskImage masterImage = mock(DiskImage.class);
doReturn("masterId").when(masterImage).getDiskImageId();
doReturn("master").when(masterImage).getDiskImageName();
doReturn("4").when(masterImage).getMaxCpuCount();
diskImages.put(masterImage.getDiskImageId(), masterImage);
DiskImage slaveImage = mock(DiskImage.class);
doReturn("slaveId").when(slaveImage).getDiskImageId();
doReturn("slave").when(slaveImage).getDiskImageName();
doReturn("4").when(slaveImage).getMaxCpuCount();
diskImages.put(slaveImage.getDiskImageId(), slaveImage);
Network network = new Network("network", "networkCategory",
"networkId", 4);
ArrayList<Network> networkList = new ArrayList<>();
networkList.add(network);
doReturn(networkList).when(templateConfiguration).getNetworks();
VServerConfiguration vserverMaster = mock(VServerConfiguration.class);
doReturn("networkId").when(vserverMaster).getNetworkId();
doReturn(masterImage.getDiskImageId()).when(vserverMaster)
.getDiskImageId();
VServerConfiguration vserverSlave = mock(VServerConfiguration.class);
doReturn("networkId").when(vserverSlave).getNetworkId();
doReturn(slaveImage.getDiskImageId()).when(vserverSlave)
.getDiskImageId();
ArrayList<VServerConfiguration> vServerList = new ArrayList<>();
vServerList.add(vserverMaster);
vServerList.add(vserverSlave);
doReturn(vServerList).when(templateConfiguration).getVServers();
paramHandler.setState(FlowState.VSYSTEM_CREATION_REQUESTED);
parameters.put(PropertyHandler.COUNT_CPU, new Setting(
PropertyHandler.COUNT_CPU, "2"));
parameters.put(PropertyHandler.CLUSTER_SIZE, new Setting(
PropertyHandler.CLUSTER_SIZE, "2"));
parameters.put(
PropertyHandler.MASTER_TEMPLATE_ID,
new Setting(PropertyHandler.MASTER_TEMPLATE_ID, masterImage
.getDiskImageId()));
parameters
.put(PropertyHandler.SLAVE_TEMPLATE_ID,
new Setting(PropertyHandler.SLAVE_TEMPLATE_ID,
slaveImage.getDiskImageId()));
// when
vSystemProcessor.validateClusterSize(paramHandler, true, false,
templateConfiguration);
}
示例8: validateClusterSize_CreateLimitReached
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
@Test(expected = AbortException.class)
public void validateClusterSize_CreateLimitReached() throws Exception {
// given
VSystemTemplateConfiguration templateConfiguration = mock(VSystemTemplateConfiguration.class);
DiskImage masterImage = mock(DiskImage.class);
doReturn("masterId").when(masterImage).getDiskImageId();
doReturn("master").when(masterImage).getDiskImageName();
doReturn("4").when(masterImage).getMaxCpuCount();
diskImages.put(masterImage.getDiskImageId(), masterImage);
DiskImage slaveImage = mock(DiskImage.class);
doReturn("slaveId").when(slaveImage).getDiskImageId();
doReturn("slave").when(slaveImage).getDiskImageName();
doReturn("4").when(slaveImage).getMaxCpuCount();
diskImages.put(slaveImage.getDiskImageId(), slaveImage);
Network network = new Network("network", "networkCategory",
"networkId", 1);
ArrayList<Network> networkList = new ArrayList<>();
networkList.add(network);
doReturn(networkList).when(templateConfiguration).getNetworks();
VServerConfiguration vserverMaster = mock(VServerConfiguration.class);
doReturn("networkId").when(vserverMaster).getNetworkId();
doReturn(masterImage.getDiskImageId()).when(vserverMaster)
.getDiskImageId();
VServerConfiguration vserverSlave = mock(VServerConfiguration.class);
doReturn("networkId").when(vserverSlave).getNetworkId();
doReturn(slaveImage.getDiskImageId()).when(vserverSlave)
.getDiskImageId();
ArrayList<VServerConfiguration> vServerList = new ArrayList<>();
vServerList.add(vserverMaster);
vServerList.add(vserverSlave);
doReturn(vServerList).when(templateConfiguration).getVServers();
paramHandler.setState(FlowState.VSYSTEM_CREATION_REQUESTED);
parameters.put(PropertyHandler.COUNT_CPU, new Setting(
PropertyHandler.COUNT_CPU, "2"));
parameters.put(PropertyHandler.CLUSTER_SIZE, new Setting(
PropertyHandler.CLUSTER_SIZE, "2"));
parameters.put(
PropertyHandler.MASTER_TEMPLATE_ID,
new Setting(PropertyHandler.MASTER_TEMPLATE_ID, masterImage
.getDiskImageId()));
parameters
.put(PropertyHandler.SLAVE_TEMPLATE_ID,
new Setting(PropertyHandler.SLAVE_TEMPLATE_ID,
slaveImage.getDiskImageId()));
// when
vSystemProcessor.validateClusterSize(paramHandler, true, false,
templateConfiguration);
}
示例9: getVSystemTemplateConfiguration
import org.oscm.app.iaas.data.VSystemTemplateConfiguration; //导入依赖的package包/类
/**
* Returns the details of the specified system template.
*
* @param properties
* the property handler providing the request parameters
* @return the system templates details
* @throws Exception
*/
public VSystemTemplateConfiguration getVSystemTemplateConfiguration(
PropertyHandler properties) throws Exception;