assertEquals("p1", cayenneMap.getDefaultPackage());
assertEquals("s1", cayenneMap.getDefaultSchema());
}
public void testLoadClassMapping() throws Exception {
EntityMapLoaderContext context = new EntityMapLoaderContext(
new MockPersistenceUnitInfo());
EntityMapAnnotationLoader loader = new EntityMapAnnotationLoader(context);
loader.loadClassMapping(MockCayenneEntity1.class);
loader.loadClassMapping(MockCayenneEntity2.class);
loader.loadClassMapping(MockCayenneTargetEntity1.class);
loader.loadClassMapping(MockCayenneTargetEntity2.class);
loader.loadClassMapping(MockCayenneEntityMap1.class);
// apply defaults before conversion
new EntityMapDefaultsProcessor().applyDefaults(context);
assertFalse("Found conflicts: " + context.getConflicts(), context
.getConflicts()
.hasFailures());
DataMap dataMap = new DataMapConverter().toDataMap("n1", context);
assertFalse("Found DataMap conflicts: " + context.getConflicts(), context
.getConflicts()
.hasFailures());
new DataMapMappingAssertion().testDataMap(dataMap);
}