use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class KubernetesPluginTest method modelCheckTest.
@Test(expected = ValidationFailureException.class)
public void modelCheckTest() throws Exception {
EffectiveModel singleComputeModel = new EffectiveModelFactory().create(TestCsars.VALID_SINGLE_COMPUTE_WINDOWS_TEMPLATE, logMock());
TransformationContext context = setUpMockTransformationContext(singleComputeModel);
KubernetesLifecycle lifecycle = plugin.getInstance(context);
plugin.transform(lifecycle);
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class TestNodeStacks method getLampNodeStacks.
public static Set<NodeStack> getLampNodeStacks(Log log) {
Map<String, RootNode> map = new EffectiveModelFactory().create(TestCsars.VALID_LAMP_NO_INPUT_TEMPLATE, log).getNodeMap();
List<KubernetesNodeContainer> webAppNodes = new LinkedList<>();
KubernetesNodeContainer computeContainer = new KubernetesNodeContainer(map.get("server"));
computeContainer.hasParentComputeNode();
webAppNodes.add(new KubernetesNodeContainer(map.get("my_app")));
webAppNodes.add(new KubernetesNodeContainer(map.get("apache_web_server")));
webAppNodes.add(computeContainer);
NodeStack webAppNodeStack = new NodeStack(webAppNodes);
// Manualy set the docker image tag (used for testing the ResourceFileCreator)
webAppNodeStack.setDockerImageTag("my-app");
return Sets.newHashSet(webAppNodeStack);
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class CsarImpl method parseValidate.
private boolean parseValidate() {
LifecyclePhase phase = getLifecyclePhase(Csar.Phase.PARSE);
phase.setState(LifecyclePhase.State.EXECUTING);
logger.info(" > Constructing model from TOSCA template");
try {
new EffectiveModelFactory().create(this);
logger.info("Model construction successful");
phase.setState(LifecyclePhase.State.DONE);
return true;
} catch (Exception e) {
logger.error("Model construction failed", this.identifier, e);
phase.setState(LifecyclePhase.State.FAILED);
return false;
}
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class EntrypointDetectorTest method parseEntrypointMissing.
@Test(expected = InvalidCsarException.class)
public void parseEntrypointMissing() throws FileNotFoundException, InvalidCsarException {
Csar csar = testCsars.getCsar(TestCsars.Testing.ENTRYPOINT_MISSING);
new EffectiveModelFactory().create(csar);
}
use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.
the class EntrypointDetectorTest method parseEntrypointAmbiguous.
@Test(expected = InvalidCsarException.class)
public void parseEntrypointAmbiguous() throws FileNotFoundException, InvalidCsarException {
Csar csar = testCsars.getCsar(TestCsars.Testing.ENTRYPOINT_AMBIGUOUS);
new EffectiveModelFactory().create(csar);
}
Aggregations