本文整理汇总了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);
}
示例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());
}
示例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));
}
示例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());
}
示例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());
}
}
示例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);
}
示例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);
}
示例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));
}
示例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();
}