use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class LinkResolverTest method resolveRequirementLink.
@Test
public void resolveRequirementLink() {
EffectiveModel model = new EffectiveModelFactory().create(REQUIREMENT, logMock());
WebServer node = (WebServer) model.getNodeMap().get("test-node1");
HostRequirement requirement = node.getHost();
assertNotNull(requirement);
Set<Compute> fulfillers = requirement.getFulfillers();
assertEquals(1, fulfillers.size());
Compute fulfiller = fulfillers.iterator().next();
assertEquals("test-node2", fulfiller.getEntityName());
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class LinkResolverTest method resolveRepositoryLink.
@Test
public void resolveRepositoryLink() {
EffectiveModel model = new EffectiveModelFactory().create(REPOSITORY, logMock());
WebServer node = (WebServer) model.getNodeMap().get("test-node");
Set<Artifact> artifacts = node.getArtifacts();
Artifact artifact = artifacts.iterator().next();
assertNotNull(artifact);
Optional<Repository> repo = artifact.getRepository();
assertTrue(repo.isPresent());
assertEquals("http://test.repo.com/", repo.get().getUrl());
}
use of org.opentosca.toscana.model.EffectiveModelFactory 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.EffectiveModelFactory 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.EffectiveModelFactory 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());
}
Aggregations