use of com.evolveum.midpoint.prism.foo.EventHandlerType in project midpoint by Evolveum.
the class AbstractLexicalProcessorTest method testParseEventHandler.
// The following is not supported now (and probably won't be in the future).
// Enable it if that changes.
@Test(enabled = false)
public void testParseEventHandler() throws Exception {
final String TEST_NAME = "testParseEventHandler";
displayTestTitle(TEST_NAME);
// GIVEN
LexicalProcessor lexicalProcessor = createParser();
PrismContext prismContext = PrismTestUtil.getPrismContext();
// WHEN (parse to xnode)
RootXNode xnode = lexicalProcessor.read(getFileSource(EVENT_HANDLER_FILE_BASENAME), ParsingContext.createDefault());
System.out.println("XNode after parsing:");
System.out.println(xnode.debugDump());
// WHEN (parse to prism)
EventHandlerType eventHandlerType = prismContext.parserFor(xnode).parseRealValue(EventHandlerChainType.class);
// EventHandlerType eventHandlerType = prismContext.getBeanConverter().unmarshall((MapXNode) , EventHandlerChainType.class,
// ParsingContext.createDefault());
// THEN
System.out.println("Parsed object:");
System.out.println(eventHandlerType);
// WHEN2 (marshalling)
MapXNode marshalled = (MapXNode) (prismContext.xnodeSerializer().serializeRealValue(eventHandlerType).getSubnode());
System.out.println("XNode after unmarshalling and marshalling back:");
System.out.println(marshalled.debugDump());
}
Aggregations