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


Java IaasContext类代码示例

本文整理汇总了Java中org.oscm.app.iaas.data.IaasContext的典型用法代码示例。如果您正苦于以下问题:Java IaasContext类的具体用法?Java IaasContext怎么用?Java IaasContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IaasContext类属于org.oscm.app.iaas.data包,在下文中一共展示了IaasContext类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: manageDeletionProcess_VSYSTEM_DELETION_REQUESTED

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
@Test
public void manageDeletionProcess_VSYSTEM_DELETION_REQUESTED()
        throws Exception {
    // given
    IaasContext ctx = mock(IaasContext.class);
    doReturn(VSystemStatus.NORMAL).when(ctx).getVSystemStatus();
    doReturn(ctx).when(paramHandler).getIaasContext();

    // when
    FlowState newState = vSystemProcessor.manageDeletionProcess(
            CONTROLLER_ID, INSTANCE_ID, paramHandler,
            FlowState.VSYSTEM_DELETION_REQUESTED);

    // then
    assertEquals(FlowState.VNET_DELETING, newState);
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:17,代码来源:VSystemProcessorBeanTest.java

示例2: getVServersForTemplate_ServerTemplateIdNotMatching

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
@Test
public void getVServersForTemplate_ServerTemplateIdNotMatching()
        throws Exception {
    // given
    IaasContext iaasContext = mock(IaasContext.class);
    doReturn(iaasContext).when(properties).getIaasContext();

    LPlatformClient platformClient = preparePlatformClient();
    doReturn(platformClient).when(rorVSystemCommunication)
            .getLPlatformClient(eq(properties));

    // when
    List<String> result = rorVSystemCommunication.getVServersForTemplate(
            SERVER_TEMPLATE_ID, properties);

    // then
    assertEquals(0, result.size());
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:19,代码来源:RORVSystemCommunicationTest.java

示例3: getVServersForTemplate_ServerTemplateIdMatching

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
@Test
public void getVServersForTemplate_ServerTemplateIdMatching()
        throws Exception {
    // given
    IaasContext iaasContext = mock(IaasContext.class);
    doReturn(iaasContext).when(properties).getIaasContext();

    LPlatformClient platformClient = preparePlatformClient();
    doReturn(platformClient).when(rorVSystemCommunication)
            .getLPlatformClient(eq(properties));

    // when
    List<String> result = rorVSystemCommunication.getVServersForTemplate(
            MASTER_TEMPLATE_ID, properties);

    // then
    assertEquals(1, result.size());
    assertEquals(SERVERID, result.get(0));
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:20,代码来源:RORVSystemCommunicationTest.java

示例4: getConfiguration_LPlatformClientConfiguration

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
@Test
public void getConfiguration_LPlatformClientConfiguration()
        throws Exception {
    // given a null VSystemConfiguration
    IaasContext iaasContext = mock(IaasContext.class);
    doReturn(iaasContext).when(properties).getIaasContext();

    LPlatformClient platformClient = preparePlatformClient();
    doReturn(platformClient).when(rorVSystemCommunication)
            .getLPlatformClient(eq(properties));

    // when
    VSystemConfiguration result = rorVSystemCommunication
            .getConfiguration(properties);

    // then retrieve the VSystemConfiguration from the LPlatformClient
    assertNotNull(result);
    assertEquals(2, result.getVServers().size());
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:20,代码来源:RORVSystemCommunicationTest.java

示例5: SubPropertyHandler

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
/**
 * Internal constructor (for sub entities)
 * 
 * @throws ConfigurationException
 */
SubPropertyHandler(ProvisioningSettings settings, String prefix,
        boolean enabled, IaasContext context) throws ConfigurationException {
    super(settings, new PropertyReader(settings.getParameters(), prefix));
    this.enabled = enabled;
    if (context != null) {
        getIaasContext().setVSystemStatus(context.getVSystemStatus());
        getIaasContext().add(context.getVSystemConfiguration());
    }
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:15,代码来源:SubPropertyHandler.java

示例6: setup

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
@Before
public void setup() throws Exception {
    IaasContext context = mock(IaasContext.class);

    properties = mock(PropertyHandler.class);
    when(properties.getIaasContext()).thenReturn(context);
    rorVSystemCommunication = spy(new RORVSystemCommunication());

    parameters = new HashMap<>();
    configSettings = new HashMap<>();
    settings = new ProvisioningSettings(parameters, configSettings, "en");
    ph = new PropertyHandler(settings);

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

示例7: scaleUp

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
@Test
public void scaleUp() throws Exception {
    // given
    IaasContext iaasContext = new IaasContext();
    when(properties.getIaasContext()).thenReturn(iaasContext);
    LPlatformClient platformClient = preparePlatformClient();
    doReturn(platformClient).when(rorVSystemCommunication)
            .getLPlatformClient(properties);

    String result = rorVSystemCommunication.scaleUp(MASTER_TEMPLATE_ID,
            SLAVE_TEMPLATE_ID, properties);
    // then
    assertNull(result);
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:15,代码来源:RORVSystemCommunicationTest.java

示例8: getPublicIps_SlaveTemplateId_privateIp

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
@Test
public void getPublicIps_SlaveTemplateId_privateIp() throws Exception {
    // given
    when(properties.getSlaveTemplateId()).thenReturn(SLAVE_TEMPLATE_ID);
    when(properties.getMasterTemplateId()).thenReturn(MASTER_TEMPLATE_ID);

    IaasContext iaasContext = mock(IaasContext.class);
    doReturn(iaasContext).when(properties).getIaasContext();

    LPlatformClient platformClient = preparePlatformClient();
    LServerClient serverClient = spy(new LServerClient(platformClient,
            "lserver_Id"));
    doReturn(platformClient).when(rorVSystemCommunication)
            .getLPlatformClient(properties);
    doReturn(serverClient).when(rorVSystemCommunication).getLServerClient(
            properties);

    List<String> list = new ArrayList<>();
    doReturn(list).when(rorVSystemCommunication).getVServersForTemplate(
            SLAVE_TEMPLATE_ID, properties);

    // when
    List<String> result = rorVSystemCommunication.getPublicIps(properties);

    // then
    assertEquals(1, result.size());
    assertEquals(PRIVATE_IP, result.get(0));
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:29,代码来源:RORVSystemCommunicationTest.java

示例9: mockConfigurationWithoutServers

import org.oscm.app.iaas.data.IaasContext; //导入依赖的package包/类
private void mockConfigurationWithoutServers() {
    VSystemConfiguration configuration = mock(VSystemConfiguration.class);
    IaasContext iaasContext = mock(IaasContext.class);
    doReturn(iaasContext).when(properties).getIaasContext();
    doReturn(configuration).when(iaasContext).getVSystemConfiguration();
    List<VServerConfiguration> servers = new ArrayList<>();
    doReturn(servers).when(configuration).getVServers();
}
 
开发者ID:servicecatalog,项目名称:development,代码行数:9,代码来源:RORVSystemCommunicationTest.java


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