@Test(expected = BadUsageKeywordException.class) public void getPropertyWrongDefOrUSageTest() throws Throwable { String computeName = "comp_tomcat_war"; PaaSNodeTemplate computePaaS = builtPaaSNodeTemplates.get(computeName); Operation configOp = computePaaS.getIndexedToscaElement().getInterfaces().get(ToscaNodeLifecycleConstants.STANDARD).getOperations() .get(ToscaNodeLifecycleConstants.CONFIGURE); IValue param = configOp.getInputParameters().get("keywordSourceBadUsage"); try { FunctionEvaluator.evaluateGetPropertyFunction((FunctionPropertyValue) param, computePaaS, builtPaaSNodeTemplates); } catch (BadUsageKeywordException e) { param = configOp.getInputParameters().get("KeywordTargetBadUsage"); FunctionEvaluator.evaluateGetPropertyFunction((FunctionPropertyValue) param, computePaaS, builtPaaSNodeTemplates); } }
public static String evaluateGetPropertyFunction(FunctionPropertyValue functionParam, IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates) { AbstractPropertyValue propertyValue = processGetPropertyFunction(functionParam, basePaaSTemplate, builtPaaSTemplates); if (propertyValue == null) { return null; } else if (!(propertyValue instanceof PropertyValue)) { throw new NotSupportedException("Not a property value " + propertyValue); } else { return PropertyUtil.serializePropertyValue(propertyValue); } }
FunctionEvaluator { public static String evaluateGetPropertyFunction(FunctionPropertyValue functionParam, IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates) { AbstractPropertyValue propertyValue = processGetPropertyFunction(functionParam, basePaaSTemplate, builtPaaSTemplates); if (propertyValue == null) { return null; } else if (!(propertyValue instanceof PropertyValue)) { throw new NotSupportedException("Not a property value " + propertyValue); } else { return PropertyUtil.serializePropertyValue(propertyValue); } } }
FunctionEvaluator { public static String evaluateGetPropertyFunction(FunctionPropertyValue functionParam, IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates) { AbstractPropertyValue propertyValue = processGetPropertyFunction(functionParam, basePaaSTemplate, builtPaaSTemplates); if (propertyValue == null) { return null; } else if (!(propertyValue instanceof PropertyValue)) { throw new NotSupportedException("Not a property value " + propertyValue); } else { return PropertyUtil.serializePropertyValue(propertyValue); } }  }
FunctionEvaluator { public static String evaluateGetPropertyFunction(FunctionPropertyValue functionParam, IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates) { AbstractPropertyValue propertyValue = processGetPropertyFunction(functionParam, basePaaSTemplate, builtPaaSTemplates); if (propertyValue == null) { return null; } else if (!(propertyValue instanceof PropertyValue)) { throw new NotSupportedException("Not a property value " + propertyValue); } else { return PropertyUtil.serializePropertyValue(propertyValue); } }  static String parseAttribute(String attributeId, IValue attributeValue, Topology topology,
            Map<String, Map<String, InstanceInformation>> runtimeInformations, String currentInstance,
            IPaaSTemplate<? extends AbstractToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates); static List<? extends IPaaSTemplate> getPaaSTemplatesFromKeyword(IPaaSTemplate<? extends AbstractToscaType> basePaaSTemplate, String keyword,
            Map<String, PaaSNodeTemplate> builtPaaSTemplates); static String evaluateGetPropertyFunction(FunctionPropertyValue functionParam,
            IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates); static AbstractPropertyValue processGetPropertyFunction(FunctionPropertyValue functionParam,
            IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates); static Map<String, String> getScalarValues(Map<String, AbstractPropertyValue> propertyValues); static boolean isGetAttribute(FunctionPropertyValue function); static boolean isGetOperationOutput(FunctionPropertyValue function); static boolean isGetInput(AbstractPropertyValue propertyValue); static boolean isGetInput(FunctionPropertyValue function); static boolean isGetSecret(AbstractPropertyValue propertyValue); static boolean isGetSecret(FunctionPropertyValue function); }
FunctionEvaluator { public static String evaluateGetPropertyFunction(FunctionPropertyValue functionParam, IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates) { AbstractPropertyValue propertyValue = processGetPropertyFunction(functionParam, basePaaSTemplate, builtPaaSTemplates); if (propertyValue == null) { return null; } else if (!(propertyValue instanceof PropertyValue)) { throw new NotSupportedException("Not a property value " + propertyValue); } else { return PropertyUtil.serializePropertyValue(propertyValue); } }  static String parseAttribute(String attributeId, IValue attributeValue, Topology topology,
            Map<String, Map<String, InstanceInformation>> runtimeInformations, String currentInstance,
            IPaaSTemplate<? extends AbstractToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates); static List<? extends IPaaSTemplate> getPaaSTemplatesFromKeyword(IPaaSTemplate<? extends AbstractToscaType> basePaaSTemplate, String keyword,
            Map<String, PaaSNodeTemplate> builtPaaSTemplates); static String evaluateGetPropertyFunction(FunctionPropertyValue functionParam,
            IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates); static AbstractPropertyValue processGetPropertyFunction(FunctionPropertyValue functionParam,
            IPaaSTemplate<? extends AbstractInheritableToscaType> basePaaSTemplate, Map<String, PaaSNodeTemplate> builtPaaSTemplates); static Map<String, String> getScalarValues(Map<String, AbstractPropertyValue> propertyValues); static boolean isGetAttribute(FunctionPropertyValue function); static boolean isGetOperationOutput(FunctionPropertyValue function); static boolean isGetInput(AbstractPropertyValue propertyValue); static boolean isGetInput(FunctionPropertyValue function); static boolean isGetSecret(AbstractPropertyValue propertyValue); static boolean isGetSecret(FunctionPropertyValue function);  }