use of org.opentosca.toscana.model.EffectiveModel in project TOSCAna by StuPro-TOSCAna.
the class EffectiveModelSetterTest method setUp.
@Before
public void setUp() {
EffectiveModel model = new EffectiveModelFactory().create(TestTemplates.Nodes.SOFTWARE_COMPONENT, logMock());
component = (SoftwareComponent) model.getNodeMap().get("software_component");
model = new EffectiveModelFactory().create(TestCsars.VALID_SINGLE_COMPUTE_WINDOWS_TEMPLATE, logMock());
this.compute = (Compute) model.getNodes().iterator().next();
}
use of org.opentosca.toscana.model.EffectiveModel in project TOSCAna by StuPro-TOSCAna.
the class EffectiveModelTest method inputTest.
@Test
public void inputTest() {
EffectiveModel model = new EffectiveModelFactory().create(TestCsars.Testing.INPUTS_TEMPLATE, logMock());
Map<String, InputProperty> inputs = model.getInputs();
assertNotNull(inputs);
assertEquals(4, inputs.size());
InputProperty input = inputs.get("string-input");
assertNotNull(input);
assertTrue(input.getDescription().isPresent());
assertEquals("description1", input.getDescription().get());
assertTrue(input.isRequired());
}
use of org.opentosca.toscana.model.EffectiveModel in project TOSCAna by StuPro-TOSCAna.
the class NodeConvertTest method softwareComponent.
@Test
public void softwareComponent() {
EffectiveModel model = new EffectiveModelFactory().create(SOFTWARE_COMPONENT, logMock());
SoftwareComponent softwareComponent = (SoftwareComponent) model.getNodes().iterator().next();
Credential credential = softwareComponent.getAdminCredential().get();
assertEquals("securePassword", credential.getToken());
assertEquals("alice", credential.getUser().get());
assertEquals("3.5.1", softwareComponent.getComponentVersion().get());
}
use of org.opentosca.toscana.model.EffectiveModel 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());
}
use of org.opentosca.toscana.model.EffectiveModel in project TOSCAna by StuPro-TOSCAna.
the class TemplateConverterTest method dockerConverter.
@Test
public void dockerConverter() {
EffectiveModel model = new EffectiveModelFactory().create(TestCsars.VALID_MINIMAL_DOCKER_TEMPLATE, logMock());
assertNotNull(model);
DockerApplication dockerApp = (DockerApplication) model.getNodeMap().get("simpleTaskApp");
DockerHostRequirement host = dockerApp.getDockerHost();
host.getFulfillers().stream().findFirst().get();
}
Aggregations