Search in sources :

Example 1 with ScalableCapability

use of org.opentosca.toscana.model.capability.ScalableCapability in project TOSCAna by StuPro-TOSCAna.

the class EffectiveModelSetterTest method setDefaultTest.

/**
 *     Tests the generic functionality of automatic setting the default value upon element creation
 */
@Test
public void setDefaultTest() {
    ScalableCapability scalable = compute.getScalable();
    assertNotNull(scalable);
}
Also used : ScalableCapability(org.opentosca.toscana.model.capability.ScalableCapability) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Example 2 with ScalableCapability

use of org.opentosca.toscana.model.capability.ScalableCapability in project TOSCAna by StuPro-TOSCAna.

the class ScalableCapabilityTest method scalableTest.

@Test
public void scalableTest() {
    EffectiveModel model = new EffectiveModelFactory().create(TestTemplates.Capabilities.SCALABLE, logMock());
    Compute compute = (Compute) model.getNodes().iterator().next();
    ScalableCapability scalable = compute.getScalable();
    assertEquals(5, (int) scalable.getMinInstances());
    assertEquals(7, (int) scalable.getDefaultInstances().get());
    assertEquals(Integer.MAX_VALUE, (int) scalable.getMaxInstances());
}
Also used : ScalableCapability(org.opentosca.toscana.model.capability.ScalableCapability) Compute(org.opentosca.toscana.model.node.Compute) EffectiveModel(org.opentosca.toscana.model.EffectiveModel) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Example 3 with ScalableCapability

use of org.opentosca.toscana.model.capability.ScalableCapability in project TOSCAna by StuPro-TOSCAna.

the class Compute method init.

private void init() {
    setDefault(HOST, new ContainerCapability(getChildEntity(HOST)));
    setDefault(OS, new OsCapability(getChildEntity(OS)));
    setDefault(ENDPOINT, new AdminEndpointCapability(getChildEntity(ENDPOINT)));
    setDefault(SCALABLE, new ScalableCapability(getChildEntity(SCALABLE)));
    setDefault(BINDING, new BindableCapability(getChildEntity(BINDING)));
    setDefault(LOCAL_STORAGE, new BlockStorageRequirement(getChildEntity(LOCAL_STORAGE)));
}
Also used : ScalableCapability(org.opentosca.toscana.model.capability.ScalableCapability) AdminEndpointCapability(org.opentosca.toscana.model.capability.AdminEndpointCapability) BlockStorageRequirement(org.opentosca.toscana.model.requirement.BlockStorageRequirement) OsCapability(org.opentosca.toscana.model.capability.OsCapability) ContainerCapability(org.opentosca.toscana.model.capability.ContainerCapability) BindableCapability(org.opentosca.toscana.model.capability.BindableCapability)

Example 4 with ScalableCapability

use of org.opentosca.toscana.model.capability.ScalableCapability in project TOSCAna by StuPro-TOSCAna.

the class ContainerRuntime method init.

private void init() {
    setDefault(CONTAINER_HOST, new ContainerCapability(getChildEntity(CONTAINER_HOST)));
    setDefault(SCALABLE, new ScalableCapability(getChildEntity(SCALABLE)));
}
Also used : ScalableCapability(org.opentosca.toscana.model.capability.ScalableCapability) ContainerCapability(org.opentosca.toscana.model.capability.ContainerCapability)

Aggregations

ScalableCapability (org.opentosca.toscana.model.capability.ScalableCapability)4 Test (org.junit.Test)2 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)2 ContainerCapability (org.opentosca.toscana.model.capability.ContainerCapability)2 EffectiveModel (org.opentosca.toscana.model.EffectiveModel)1 EffectiveModelFactory (org.opentosca.toscana.model.EffectiveModelFactory)1 AdminEndpointCapability (org.opentosca.toscana.model.capability.AdminEndpointCapability)1 BindableCapability (org.opentosca.toscana.model.capability.BindableCapability)1 OsCapability (org.opentosca.toscana.model.capability.OsCapability)1 Compute (org.opentosca.toscana.model.node.Compute)1 BlockStorageRequirement (org.opentosca.toscana.model.requirement.BlockStorageRequirement)1