use of com.evolveum.midpoint.prism.PrismParser in project midpoint by Evolveum.
the class TestParseMappingConst method testParseSerialize.
@Test
public void testParseSerialize() throws Exception {
displayTestTitle("testParseSerialize");
PrismContext prismContext = getPrismContext();
PrismParser parser = prismContext.parserFor(getFile());
PrismPropertyValue<MappingType> mappingPval = parser.parseItemValue();
System.out.println("\nmappingPval:\n" + mappingPval.debugDump(1));
PrismSerializer<RootXNode> xserializer = prismContext.xnodeSerializer();
RootXNode xnode = xserializer.root(new QName("dummy")).serialize(mappingPval);
System.out.println("\nSerialized xnode:\n" + xnode.debugDump(1));
MapXNode xexpression = (MapXNode) ((MapXNode) xnode.getSubnode()).get(new QName("expression"));
ListXNode xconstList = (ListXNode) xexpression.get(new QName("const"));
XNode xconst = xconstList.get(0);
if (!(xconst instanceof PrimitiveXNode<?>)) {
AssertJUnit.fail("const is not primitive: " + xconst);
}
}
Aggregations