use of com.evolveum.midpoint.prism.impl.PrismContextImpl in project midpoint by Evolveum.
the class MidPointPrismContextFactory method createEmptyPrismContext.
public PrismContext createEmptyPrismContext() throws SchemaException, IOException {
SchemaRegistryImpl schemaRegistry = createSchemaRegistry();
PrismContextImpl context = PrismContextImpl.createEmptyContext(schemaRegistry);
context.setDefinitionFactory(createDefinitionFactory());
context.setDefaultRelation(SchemaConstants.ORG_DEFAULT);
context.setObjectsElementName(SchemaConstants.C_OBJECTS);
context.setDefaultReferenceTypeName(ObjectReferenceType.COMPLEX_TYPE);
context.setExtensionContainerTypeName(ExtensionType.COMPLEX_TYPE);
return context;
}
use of com.evolveum.midpoint.prism.impl.PrismContextImpl in project midpoint by Evolveum.
the class MidPointPrismContextFactory method createPrismContext.
@Override
public PrismContext createPrismContext() throws SchemaException, IOException {
SchemaRegistryImpl schemaRegistry = createSchemaRegistry();
PrismContextImpl context = PrismContextImpl.create(schemaRegistry);
context.setDefinitionFactory(createDefinitionFactory());
context.setDefaultRelation(SchemaConstants.ORG_DEFAULT);
context.setObjectsElementName(SchemaConstants.C_OBJECTS);
context.setDefaultReferenceTypeName(ObjectReferenceType.COMPLEX_TYPE);
context.setExtensionContainerTypeName(ExtensionType.COMPLEX_TYPE);
if (InternalsConfig.isPrismMonitoring()) {
context.setMonitor(new InternalMonitor());
}
context.setParsingMigrator(new MidpointParsingMigrator());
context.setValueMetadataFactory(new MidpointValueMetadataFactory(context));
context.setProvenanceEquivalenceStrategy(MidpointProvenanceEquivalenceStrategy.INSTANCE);
context.registerQueryExpressionFactory(new PrismQueryExpressionSupport());
return context;
}
use of com.evolveum.midpoint.prism.impl.PrismContextImpl 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);
}
Aggregations