use of org.opentosca.toscana.model.node.Database in project TOSCAna by StuPro-TOSCAna.
the class CheckModelRelationshipVisitor method visit.
@Override
public void visit(ConnectsTo relation) {
RootNode source = topology.getEdgeSource(relation);
RootNode target = topology.getEdgeTarget(relation);
if (!(source instanceof WebApplication && target instanceof Database)) {
throw new UnsupportedTypeException("ConnectsTo relationship from source: " + source + " to target: " + target + " not supported.");
}
}
use of org.opentosca.toscana.model.node.Database 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.node.Database 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.node.Database 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.node.Database 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());
}
Aggregations