use of org.opentosca.toscana.model.EffectiveModelFactory 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.EffectiveModelFactory 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();
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class EntrypointDetectorTest method parseValidCsar.
@Test
public void parseValidCsar() throws Exception {
Csar csar = testCsars.getCsar(TestCsars.Testing.EMPTY_TOPOLOGY);
new EffectiveModelFactory().create(csar);
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class IntrinsicFunctionResolverTest method getPropertySelfTest.
@Test
public void getPropertySelfTest() {
EffectiveModel model = new EffectiveModelFactory().create(GET_PROPERTY_SELF, logMock());
Database database = (Database) model.getNodeMap().get("my_db");
assertEquals("my_user_name", database.getDatabaseName());
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class IntrinsicFunctionResolverTest method getNestedPropertyTest.
@Test
public void getNestedPropertyTest() {
EffectiveModel model = new EffectiveModelFactory().create(GET_PROPERTY_IN_INTERFACE, logMock());
Database database = (Database) model.getNodeMap().get("my_db");
Set<OperationVariable> inputs = database.getStandardLifecycle().getConfigure().get().getInputs();
OperationVariable input = inputs.stream().findFirst().orElse(null);
assertEquals("my_user_name", input.getValue().get());
}
Aggregations