use of com.evolveum.midpoint.prism.foo.AccountType in project midpoint by Evolveum.
the class TestPrismContext method testBasicSchemas.
@Test
public void testBasicSchemas() throws SchemaException, SAXException, IOException {
System.out.println("===[ testBasicSchemas ]===");
// WHEN
PrismContext prismContext = constructInitializedPrismContext();
// THEN
assertNotNull("No prism context", prismContext);
SchemaRegistry schemaRegistry = prismContext.getSchemaRegistry();
assertNotNull("No schema registry in context", schemaRegistry);
System.out.println("Schema registry:");
System.out.println(schemaRegistry.debugDump());
PrismSchema fooSchema = schemaRegistry.findSchemaByNamespace(NS_FOO);
System.out.println("Foo schema:");
System.out.println(fooSchema.debugDump());
// Assert USER definition
PrismObjectDefinition<UserType> userDefinition = fooSchema.findObjectDefinitionByElementName(new QName(NS_FOO, "user"));
assertNotNull("No user definition", userDefinition);
System.out.println("User definition:");
System.out.println(userDefinition.debugDump());
PrismObjectDefinition<UserType> userDefinitionByClass = schemaRegistry.findObjectDefinitionByCompileTimeClass(UserType.class);
assertTrue("Different user def", userDefinition == userDefinitionByClass);
assertUserDefinition(userDefinition);
// Assert ACCOUNT definition
PrismObjectDefinition<AccountType> accountDefinition = fooSchema.findObjectDefinitionByElementName(new QName(NS_FOO, "account"));
assertNotNull("No account definition", accountDefinition);
System.out.println("Account definition:");
System.out.println(accountDefinition.debugDump());
PrismObjectDefinition<AccountType> accountDefinitionByClass = schemaRegistry.findObjectDefinitionByCompileTimeClass(AccountType.class);
assertTrue("Different user def", accountDefinition == accountDefinitionByClass);
assertAccountDefinition(accountDefinition);
}
Aggregations