use of com.evolveum.midpoint.schema.DeltaConvertor.toObjectDeltaType in project midpoint by Evolveum.
the class TestDeltaConverter method roundTrip.
private void roundTrip(ObjectDelta delta) throws Exception {
ObjectDeltaType deltaType = DeltaConvertor.toObjectDeltaType(delta);
System.out.println("Serialized to bean");
System.out.println(deltaType);
String xml = getPrismContext().xmlSerializer().serializeRealValue(deltaType, new QName("aDelta"));
System.out.println("Serialized to XML");
System.out.println(xml);
ObjectDeltaType deltaTypeParsed = getPrismContext().parserFor(xml).parseRealValue();
System.out.println("Parsed from XML to bean");
System.out.println(deltaTypeParsed);
ObjectDelta deltaParsed = DeltaConvertor.createObjectDelta(deltaTypeParsed, getPrismContext());
System.out.println("Parsed from XML to bean to delta");
System.out.println(deltaParsed);
assertTrue("Deltas (native) do not match", delta.equivalent(deltaParsed));
// note: comparing beans is problematic because e.g. item paths are not equal ({common-3}name vs {c=common-3}c:name)
}
Aggregations