use of org.opentosca.toscana.model.node.WebServer 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.node.WebServer 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.node.WebServer 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());
}
Aggregations