Search in sources :

Example 1 with DomLexicalProcessor

use of com.evolveum.midpoint.prism.impl.lex.dom.DomLexicalProcessor in project midpoint by Evolveum.

the class TestParseResource method testParseResourceDom.

// todo eliminate dependency on prism-impl
@Test
public void testParseResourceDom() throws Exception {
    if (!"xml".equals(language)) {
        return;
    }
    // GIVEN
    PrismContext prismContext = getPrismContext();
    // WHEN
    DomLexicalProcessor parserDom = ((PrismContextImpl) prismContext).getParserDom();
    RootXNode xnode = parserDom.read(new ParserFileSource(getFile(TestConstants.RESOURCE_FILE_BASENAME)), createDefaultParsingContext());
    PrismObject<ResourceType> resource = prismContext.parserFor(xnode).parse();
    // THEN
    System.out.println("Parsed resource:");
    System.out.println(resource.debugDump());
    assertResource(resource, true, true, false);
}
Also used : DomLexicalProcessor(com.evolveum.midpoint.prism.impl.lex.dom.DomLexicalProcessor) RootXNode(com.evolveum.midpoint.prism.xnode.RootXNode) PrismContextImpl(com.evolveum.midpoint.prism.impl.PrismContextImpl) Test(org.testng.annotations.Test)

Aggregations

PrismContextImpl (com.evolveum.midpoint.prism.impl.PrismContextImpl)1 DomLexicalProcessor (com.evolveum.midpoint.prism.impl.lex.dom.DomLexicalProcessor)1 RootXNode (com.evolveum.midpoint.prism.xnode.RootXNode)1 Test (org.testng.annotations.Test)1