@Test public void compareProcessingInstructions() { DOMDifferenceEngine d = new DOMDifferenceEngine(); DiffExpecter ex = new DiffExpecter(ComparisonType.PROCESSING_INSTRUCTION_TARGET); d.addDifferenceListener(ex); d.setComparisonController(ComparisonControllers.StopWhenDifferent); ProcessingInstruction foo1 = doc.createProcessingInstruction("foo", "1"); ProcessingInstruction bar1 = doc.createProcessingInstruction("bar", "1"); assertEquals(wrap(ComparisonResult.EQUAL), d.compareNodes(foo1, new XPathContext(), foo1, new XPathContext())); assertEquals(wrapAndStop(ComparisonResult.DIFFERENT), d.compareNodes(foo1, new XPathContext(), bar1, new XPathContext())); assertEquals(1, ex.invoked); d = new DOMDifferenceEngine(); ex = new DiffExpecter(ComparisonType.PROCESSING_INSTRUCTION_DATA); d.addDifferenceListener(ex); d.setComparisonController(ComparisonControllers.StopWhenDifferent); ProcessingInstruction foo2 = doc.createProcessingInstruction("foo", "2"); assertEquals(wrap(ComparisonResult.EQUAL), d.compareNodes(foo1, new XPathContext(), foo1, new XPathContext())); assertEquals(wrapAndStop(ComparisonResult.DIFFERENT), d.compareNodes(foo1, new XPathContext(), foo2, new XPathContext())); assertEquals(1, ex.invoked); }
private ComparisonState compareProcessingInstructions(ProcessingInstruction control, XPathContext controlContext, ProcessingInstruction test, XPathContext testContext) { return compare(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_TARGET, control, getXPath(controlContext), control.getTarget(), getParentXPath(controlContext), test, getXPath(testContext), test.getTarget(), getParentXPath(testContext))) .andThen(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_DATA, control, getXPath(controlContext), control.getData(), getParentXPath(controlContext), test, getXPath(testContext), test.getData(), getParentXPath(testContext))); }
DOMDifferenceEngine extends AbstractDifferenceEngine { private ComparisonState compareProcessingInstructions(ProcessingInstruction control, XPathContext controlContext, ProcessingInstruction test, XPathContext testContext) { return compare(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_TARGET, control, getXPath(controlContext), control.getTarget(), getParentXPath(controlContext), test, getXPath(testContext), test.getTarget(), getParentXPath(testContext))) .andThen(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_DATA, control, getXPath(controlContext), control.getData(), getParentXPath(controlContext), test, getXPath(testContext), test.getData(), getParentXPath(testContext))); } }
DOMDifferenceEngine extends AbstractDifferenceEngine { private ComparisonState compareProcessingInstructions(ProcessingInstruction control, XPathContext controlContext, ProcessingInstruction test, XPathContext testContext) { return compare(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_TARGET, control, getXPath(controlContext), control.getTarget(), getParentXPath(controlContext), test, getXPath(testContext), test.getTarget(), getParentXPath(testContext))) .andThen(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_DATA, control, getXPath(controlContext), control.getData(), getParentXPath(controlContext), test, getXPath(testContext), test.getData(), getParentXPath(testContext))); } DOMDifferenceEngine();  DOMDifferenceEngine(final DocumentBuilderFactory f); }
DOMDifferenceEngine extends AbstractDifferenceEngine { private ComparisonState compareProcessingInstructions(ProcessingInstruction control, XPathContext controlContext, ProcessingInstruction test, XPathContext testContext) { return compare(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_TARGET, control, getXPath(controlContext), control.getTarget(), getParentXPath(controlContext), test, getXPath(testContext), test.getTarget(), getParentXPath(testContext))) .andThen(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_DATA, control, getXPath(controlContext), control.getData(), getParentXPath(controlContext), test, getXPath(testContext), test.getData(), getParentXPath(testContext))); } DOMDifferenceEngine();  DOMDifferenceEngine(final DocumentBuilderFactory f); void setDocumentBuilderFactory(DocumentBuilderFactory f); @Override void compare(Source control, Source test); }
DOMDifferenceEngine extends AbstractDifferenceEngine { private ComparisonState compareProcessingInstructions(ProcessingInstruction control, XPathContext controlContext, ProcessingInstruction test, XPathContext testContext) { return compare(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_TARGET, control, getXPath(controlContext), control.getTarget(), getParentXPath(controlContext), test, getXPath(testContext), test.getTarget(), getParentXPath(testContext))) .andThen(new Comparison(ComparisonType.PROCESSING_INSTRUCTION_DATA, control, getXPath(controlContext), control.getData(), getParentXPath(controlContext), test, getXPath(testContext), test.getData(), getParentXPath(testContext))); } DOMDifferenceEngine();  DOMDifferenceEngine(final DocumentBuilderFactory f); void setDocumentBuilderFactory(DocumentBuilderFactory f); @Override void compare(Source control, Source test);  }