String initial = DocOpUtil.toXmlString(docAsOp);
IndexedDocument<Node, Element, Text> copy = DocProviders.POJO.build(docAsOp,
DocumentSchema.NO_SCHEMA_CONSTRAINTS);
System.out.println(doc);
DocOp docOp = doc.consumeAndReturnInvertible(op);
System.out.println(op + "==========> " + docOp);
ViolationCollector v = new ViolationCollector();
if (!DocOpValidator.validate(v, DocumentSchema.NO_SCHEMA_CONSTRAINTS,
Automatons.fromReadable(copy), docOp).isValid()) {
v.printDescriptions(System.err);
fail("Invalid operation");
}
copy.consume(docOp);
System.out.println("=======" + doc + " --------- " + copy);
assertEquals(
DocOpUtil.toXmlString(doc.asOperation()),
DocOpUtil.toXmlString(copy.asOperation()));
DocOp inverted = DocOpInverter.invert(docOp);
v = new ViolationCollector();
if (!DocOpValidator.validate(v, DocumentSchema.NO_SCHEMA_CONSTRAINTS,
Automatons.fromReadable(copy), inverted).isValid()) {
v.printDescriptions(System.err);
fail("Invalid operation");