use of org.opentosca.toscana.model.EffectiveModel 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.EffectiveModel 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());
}
use of org.opentosca.toscana.model.EffectiveModel in project TOSCAna by StuPro-TOSCAna.
the class IntrinsicFunctionResolverTest method getPropertyTest.
@Test
public void getPropertyTest() {
EffectiveModel model = new EffectiveModelFactory().create(GET_PROPERTY, logMock());
Database database = (Database) model.getNodeMap().get("my_second_db");
assertEquals("my_db_name", database.getDatabaseName());
}
use of org.opentosca.toscana.model.EffectiveModel in project TOSCAna by StuPro-TOSCAna.
the class IntrinsicFunctionResolverTest method correctPropertyNameTest.
/**
* Tests whether names of linked properties are correct
*/
@Test
public void correctPropertyNameTest() {
EffectiveModel model = new EffectiveModelFactory().create(GET_PROPERTY_IN_INPUT, logMock());
Database myApp = (Database) model.getNodeMap().get("my_db");
OperationVariable input = myApp.getStandardLifecycle().getConfigure().get().getInputs().iterator().next();
assertEquals("correct-name", input.getKey());
assertEquals("test-string", input.getValue().get());
}
use of org.opentosca.toscana.model.EffectiveModel in project TOSCAna by StuPro-TOSCAna.
the class IntrinsicFunctionResolverTest method getInputTest.
@Test
public void getInputTest() {
EffectiveModel model = new EffectiveModelFactory().create(GET_INPUT, logMock());
Database database = (Database) model.getNodeMap().get("my_db");
assertEquals("my_db_name", database.getDatabaseName());
}
Aggregations