当前位置: 首页>>代码示例>>Java>>正文


Java Difference.isRecoverable方法代码示例

本文整理汇总了Java中org.custommonkey.xmlunit.Difference.isRecoverable方法的典型用法代码示例。如果您正苦于以下问题:Java Difference.isRecoverable方法的具体用法?Java Difference.isRecoverable怎么用?Java Difference.isRecoverable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.custommonkey.xmlunit.Difference的用法示例。


在下文中一共展示了Difference.isRecoverable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: differenceFound

import org.custommonkey.xmlunit.Difference; //导入方法依赖的package包/类
public int differenceFound(Difference difference) {
	//ignore dissimilarities
	if (difference.isRecoverable())
	{
		return RETURN_ACCEPT_DIFFERENCE;
	}
	if ("${IGNORE}".equals(difference.getControlNodeDetail().getValue())) {
		return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
	} 
	else if (isDifferenceOnlyInAttributeValuePrefix(difference)) 
	{
		return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
	}
	else
	{
		return super.differenceFound(difference);
	}

}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:20,代码来源:EnhancedDiff.java

示例2: logUnrecoverableDifferences

import org.custommonkey.xmlunit.Difference; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static void logUnrecoverableDifferences(DetailedDiff diff) {
	for (Difference difference : (List<Difference>) diff.getAllDifferences()) {
		if (!difference.isRecoverable()) {
			LOG.error(difference.toString());
		}
	}
}
 
开发者ID:groupe-sii,项目名称:ogham,代码行数:9,代码来源:AssertHtml.java

示例3: haltComparison

import org.custommonkey.xmlunit.Difference; //导入方法依赖的package包/类
/**
 * Determine whether a Difference that this listener has been notified of
 *  should halt further XML comparison. This implementation halts 
 *  if the Difference is not recoverable.
 * @param afterDifference the last Difference passed to <code>differenceFound</code>
 * @return false if the difference is recoverable, otherwise return true
 */
public boolean haltComparison(Difference afterDifference) {
    if (afterDifference.isRecoverable()) {
        return false;
    }
    
    return true;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:15,代码来源:WSDLController.java

示例4: compare

import org.custommonkey.xmlunit.Difference; //导入方法依赖的package包/类
public void compare ()
{
    // Comparing
    try {
        output.println("Comparing " + controlFile + " to " + testFile);

        final Document controlDoc;
        final Document testDoc;

        try (InputStream cis = new FileInputStream(controlFile)) {
            controlDoc = new PositionalXMLReader().readXML(cis);
        }
        try (InputStream tis = new FileInputStream(testFile)) {
            testDoc = new PositionalXMLReader().readXML(tis);
        }

        // Tuning
        XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
        XMLUnit.setNormalizeWhitespace(true);
        XMLUnit.setIgnoreWhitespace(true);

        ///XMLUnit.setIgnoreComments(true); NO!!!!!!!!
        // The setIgnoreComments triggers the use of XSLT transform
        // which 1/ ruins userdata and 2/ fails on xml:space and xml:lang.
        // Moreover, comments are actually ignored by Diff

        ///XMLUnit.setCompareUnmatched(false); NO need

        // Customization
        Filter filter = (filterFile != null)
                ? new BasicFilter(new FileInputStream(filterFile))
                : null;

        Diff diff = new Diff(controlDoc, testDoc, null);
        diff.overrideElementQualifier(
                new ElementNameAndAttributeQualifier("number"));
        diff.overrideDifferenceListener(
                new MusicDifferenceListener(filter, output));

        output.println("Similar:     " + diff.similar());
        output.println("Identical:   " + diff.identical());

        DetailedDiff detDiff = new DetailedDiff(diff);

        List differences = detDiff.getAllDifferences();
        output.println();
        output.println("Physical differences: " + differences.size());

        int diffId = 0;

        for (Object object : differences) {
            Difference difference = (Difference) object;

            if (!difference.isRecoverable()
                && ((filter == null) || !filter.canIgnore(difference))) {
                diffId++;
                output.dump(diffId, difference);
            }
        }
        output.println("Logical  differences: " + diffId);
        logger.info("Logical  differences: {}", diffId);

    } catch (ConfigurationException | SAXException | IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:jlpoolen,项目名称:libreveris,代码行数:67,代码来源:Main.java


注:本文中的org.custommonkey.xmlunit.Difference.isRecoverable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。