use of org.opentosca.toscana.model.EffectiveModelFactory 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.EffectiveModelFactory 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.EffectiveModelFactory 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());
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class LinkResolverTest method resolveImplementationLink.
@Test
public void resolveImplementationLink() {
EffectiveModel model = new EffectiveModelFactory().create(ARTIFACT, logMock());
WebServer node = (WebServer) model.getNodeMap().get("test-node");
Optional<Operation> create = node.getStandardLifecycle().getCreate();
assertTrue(create.isPresent());
Optional<Artifact> artifact = create.get().getArtifact();
assertTrue(artifact.isPresent());
assertEquals("test-file", artifact.get().getFilePath());
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class DataTypeTest method portTest.
@Test
public void portTest() {
EffectiveModel model = new EffectiveModelFactory().create(TestTemplates.Datatypes.PORT, logMock());
WebApplication app = (WebApplication) model.getNodes().iterator().next();
EndpointCapability endpoint = app.getAppEndpoint();
assertEquals(new Port(3000), endpoint.getPort().get());
Port expected = new Port(4000);
endpoint.setPort(expected);
assertEquals(expected, endpoint.getPort().get());
}
Aggregations