本文整理匯總了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();
}