当前位置: 首页>>代码示例>>Java>>正文


Java VSystemTemplateConfiguration类代码示例

本文整理汇总了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);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:38,代码来源:VSystemProcessorBeanTest.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:40,代码来源:VSystemProcessorBeanTest.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:38,代码来源:VSystemProcessorBeanTest.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:38,代码来源:VSystemProcessorBeanTest.java

示例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;
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:9,代码来源:RORVSystemCommunication.java

示例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);

}
 
开发者ID:servicecatalog,项目名称:development,代码行数:15,代码来源:RORVSystemCommunicationTest.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:54,代码来源:VSystemProcessorBeanTest.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:53,代码来源:VSystemProcessorBeanTest.java

示例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;
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:11,代码来源:VSystemCommunication.java


注:本文中的org.oscm.app.iaas.data.VSystemTemplateConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。