Iterable<Node> testSeq, final XPathContext testContext) { ComparisonState chain = new OngoingComparisonState();
break; return new OngoingComparisonState();
boolean mustChangeTestContext = testAttr != null; if (!mustChangeControlContext && !mustChangeTestContext) { return new OngoingComparisonState();
@Override public ComparisonState apply() { ComparisonState chain = new OngoingComparisonState(); for (final Attr controlAttr : controlAttributes.remainingAttributes) { final QName controlAttrName = Nodes.getQName(controlAttr);
/** * Compares the detail values for object equality, lets the * difference evaluator and comparison controller evaluate the * result, notifies all listeners and returns the outcome. * * @return the outcome as pair of result and a flag that says * "stop the whole comparison process" when true. */ protected final ComparisonState compare(Comparison comp) { Object controlValue = comp.getControlDetails().getValue(); Object testValue = comp.getTestDetails().getValue(); boolean equal = controlValue == null ? testValue == null : controlValue.equals(testValue); ComparisonResult initial = equal ? ComparisonResult.EQUAL : ComparisonResult.DIFFERENT; ComparisonResult altered = getDifferenceEvaluator().evaluate(comp, initial); listeners.fireComparisonPerformed(comp, altered); return altered != ComparisonResult.EQUAL && getComparisonController().stopDiffing(new Difference(comp, altered)) ? new FinishedComparisonState(altered) : new OngoingComparisonState(altered); }
@Override public ComparisonState apply() { ComparisonState chain = new OngoingComparisonState(); final int controlSize = controlList.size(); for (int i = 0; i < controlSize; i++) { if (!seen.contains(controlList.get(i))) { controlContext.navigateToChild(i); try { chain = chain.andThen(new Comparison(ComparisonType.CHILD_LOOKUP, controlList.get(i), getXPath(controlContext), Nodes.getQName(controlList.get(i)), getParentXPath(controlContext), null, null, null, getXPath(testContext))); } finally { controlContext.navigateToParent(); } } } return chain; } }
@Override public ComparisonState apply() { ComparisonState chain = new OngoingComparisonState(); final int testSize = testList.size(); for (int i = 0; i < testSize; i++) { if (!seen.contains(testList.get(i))) { testContext.navigateToChild(i); try { chain = chain.andThen(new Comparison(ComparisonType.CHILD_LOOKUP, null, null, null, getXPath(controlContext), testList.get(i), getXPath(testContext), Nodes.getQName(testList.get(i)), getParentXPath(testContext))); } finally { testContext.navigateToParent(); } } } return chain; } }
@Override public ComparisonState apply() { ComparisonState chain = new OngoingComparisonState(); for (Attr testAttr : testAttributes.remainingAttributes) { if (!foundTestAttributes.contains(testAttr)) { QName testAttrName = Nodes.getQName(testAttr); testContext.navigateToAttribute(testAttrName); try { chain = chain.andThen(new Comparison(ComparisonType.ATTR_NAME_LOOKUP, control, getXPath(controlContext), null, getParentXPath(controlContext), test, getXPath(testContext), testAttrName, getParentXPath(testContext))); } finally { testContext.navigateToParent(); } } } return chain; }