Search in sources :

Example 1 with VisitableNode

use of org.opentosca.toscana.model.visitor.VisitableNode in project TOSCAna by StuPro-TOSCAna.

the class CloudFormationPluginTest method testLamp.

@Test(expected = TransformationFailureException.class)
public void testLamp() {
    try {
        Set<RootNode> nodes = lamp.getNodes();
        // visit compute nodes first
        for (VisitableNode node : nodes) {
            if (node instanceof Compute) {
                node.accept(cfnNodeVisitor);
            }
        }
        for (VisitableNode node : nodes) {
            if (!(node instanceof Compute)) {
                node.accept(cfnNodeVisitor);
            }
        }
        System.err.println(cfnModule.toString());
    } catch (TransformationFailureException tfe) {
        // provided so this test can pass
        if (!(tfe.getCause() instanceof SdkClientException)) {
            throw tfe;
        }
        logger.debug("Passed without internet connection / credentials provided");
    }
}
Also used : RootNode(org.opentosca.toscana.model.node.RootNode) VisitableNode(org.opentosca.toscana.model.visitor.VisitableNode) TransformationFailureException(org.opentosca.toscana.plugins.util.TransformationFailureException) SdkClientException(com.amazonaws.SdkClientException) Compute(org.opentosca.toscana.model.node.Compute) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Aggregations

SdkClientException (com.amazonaws.SdkClientException)1 Test (org.junit.Test)1 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)1 Compute (org.opentosca.toscana.model.node.Compute)1 RootNode (org.opentosca.toscana.model.node.RootNode)1 VisitableNode (org.opentosca.toscana.model.visitor.VisitableNode)1 TransformationFailureException (org.opentosca.toscana.plugins.util.TransformationFailureException)1