org.custommonkey.xmlunit.Difference.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(100)

本文整理了Java中org.custommonkey.xmlunit.Difference.<init>()方法的一些代码示例,展示了Difference.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Difference.<init>()方法的具体详情如下:
包路径:org.custommonkey.xmlunit.Difference
类名称:Difference
方法名:<init>

Difference.<init>介绍

[英]Constructor for non-similar Difference instances
[中]非相似差异实例的构造函数

代码示例

代码示例来源:origin: stackoverflow.com

ReflectionComparatorMode[] modes = {ReflectionComparatorMode.LENIENT_ORDER, ReflectionComparatorMode.IGNORE_DEFAULTS};

List<org.unitils.reflectionassert.comparator.Comparator> comparators = new ArrayList<>();
  comparators.add(new Comparator() {
     @Override
     public boolean canCompare(Object left, Object right) {
        return left instanceof String && right instanceof String;
     }

     @Override
     public Difference compare(Object left, Object right, boolean onlyFirstDifference, ReflectionComparator reflectionComparator) {
        return  ((String) left).equalsIgnoreCase((String) right) ? null : new Difference("Non equal values: ", left, right);
     }
});

comparators.addAll(
  new ReflectionComparatorFactory() {
    public List<Comparator> getComparatorChainNonStatic(Set<ReflectionComparatorMode> modes) {
        return getComparatorChain(modes);
    }
  }.getComparatorChainNonStatic(asSet(modes)));

ReflectionComparator comparator = new ReflectionComparator(comparators);

代码示例来源:origin: org.custommonkey.xmlunit/com.springsource.org.custommonkey.xmlunit

testLoc == null ? null
                    : testLoc.toXpathString());
Difference differenceInstance = new Difference(difference, 
                        controlDetail, testDetail);
if (unequal(expected, actual)) {

代码示例来源:origin: org.xmlunit/xmlunit-legacy

testLoc == null ? null
                    : testLoc.toXpathString());
Difference differenceInstance = new Difference(difference, 
                        controlDetail, testDetail);
if (unequal(expected, actual)) {

代码示例来源:origin: org.xmlunit/xmlunit-legacy

diffs.add(new Difference(proto, toNodeDetail(comp.getControlDetails()),
             toNodeDetail(comp.getTestDetails())));

相关文章