Search in sources :

Example 1 with ConstExpressionEvaluatorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConstExpressionEvaluatorType in project midpoint by Evolveum.

the class TestParseMappingConst method assertPrismPropertyValueLocal.

@Override
protected void assertPrismPropertyValueLocal(PrismPropertyValue<MappingType> value) throws SchemaException {
    MappingType mappingType = value.getValue();
    ExpressionType expressionType = mappingType.getExpression();
    List<JAXBElement<?>> expressionEvaluatorElements = expressionType.getExpressionEvaluator();
    assertEquals("Wrong number of expression evaluator elemenets", 1, expressionEvaluatorElements.size());
    JAXBElement<?> expressionEvaluatorElement = expressionEvaluatorElements.get(0);
    Object evaluatorElementObject = expressionEvaluatorElement.getValue();
    if (!(evaluatorElementObject instanceof ConstExpressionEvaluatorType)) {
        AssertJUnit.fail("Const expression is of type " + evaluatorElementObject.getClass().getName());
    }
    ConstExpressionEvaluatorType constExpressionEvaluatorType = (ConstExpressionEvaluatorType) evaluatorElementObject;
    System.out.println("ConstExpressionEvaluatorType: " + constExpressionEvaluatorType);
    assertEquals("Wrong value in const evaluator", "foo", constExpressionEvaluatorType.getValue());
}
Also used : MappingType(com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType) ConstExpressionEvaluatorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConstExpressionEvaluatorType) JAXBElement(javax.xml.bind.JAXBElement) ExpressionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType)

Aggregations

ConstExpressionEvaluatorType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConstExpressionEvaluatorType)1 ExpressionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType)1 MappingType (com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType)1 JAXBElement (javax.xml.bind.JAXBElement)1