Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.NodeDetail


            // ignore field "updated" since it contains current time
            return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
        }

        // compare the times if possible
        NodeDetail testDetail = difference.getTestNodeDetail();

        if (testDetail.getNode().getParentNode() != null) {
            String testNodeName = testDetail.getNode().getParentNode().getNodeName();
            if (timeNodeNameSet.contains(testNodeName)) {
                String testDateStr = testDetail.getValue();
                String controlDateStr = difference.getControlNodeDetail().getValue();
                DatatypeFactory datatypeFactory;
                try {
                    datatypeFactory = DatatypeFactory.newInstance();
                } catch (DatatypeConfigurationException e) {
View Full Code Here


            if (xpath.equals("/feed[1]/entry[2]/expires[1]/text()[1]")) {
                // ignore field "expires" since it contains current time
                return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
            }
            // compare the times if possible
            NodeDetail testDetail = difference.getTestNodeDetail();
            String testNodeName = testDetail.getNode().getParentNode().getNodeName();
            if (timeNodeNameSet.contains(testNodeName)) {
                String testDateStr = testDetail.getValue();
                String controlDateStr = difference.getControlNodeDetail().getValue();
                XMLGregorianCalendar gDateBuilderTest =
                    datatypeFactory.newXMLGregorianCalendar(testDateStr);
                XMLGregorianCalendar gDateBuilderControl =
                    datatypeFactory.newXMLGregorianCalendar(controlDateStr);
View Full Code Here

            if (xpath.equals("/feed[1]/entry[2]/expires[1]/text()[1]")) {
                // ignore field "expires" since it contains current time
                return RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL;
            }
            // compare the times if possible
            NodeDetail testDetail = difference.getTestNodeDetail();
            String testNodeName = testDetail.getNode().getParentNode().getNodeName();
            if (timeNodeNameSet.contains(testNodeName)) {
                String testDateStr = testDetail.getValue();
                String controlDateStr = difference.getControlNodeDetail().getValue();
                XMLGregorianCalendar gDateBuilderTest =
                    datatypeFactory.newXMLGregorianCalendar(testDateStr);
                XMLGregorianCalendar gDateBuilderControl =
                    datatypeFactory.newXMLGregorianCalendar(controlDateStr);
View Full Code Here

        List<Difference> exceptions = new ArrayList<Difference>();
    for (Difference diffItem : allDifferences) {
          if (diffItem.isRecoverable()) {
            // Similar but not identical - ignore
          } else {
            NodeDetail actualNodeDetail = diffItem.getTestNodeDetail();
            NodeDetail expectedNodeDetail = diffItem.getControlNodeDetail();

            // If we want any exceptions to the strict comparisons done by XMLUnit we can add them here
            /*if ((expectedNodeDetail.getValue().startsWith("{urn:hl7-org:v3}")) &&
              (actualNodeDetail.getValue().startsWith("{null}"))) {
              exceptions.add(diffItem);
View Full Code Here

  private int skippedComparisons = 0;

  @Override
  public int differenceFound(Difference difference)
  {
    NodeDetail expectedNode = difference.getControlNodeDetail();
    NodeDetail actualNode = difference.getTestNodeDetail();
    String expectedXPath = expectedNode.getXpathLocation();
    String actualXPath = actualNode.getXpathLocation();
    if (!expectedXPath.equals(actualXPath))
    {
      return DifferenceListener.RETURN_ACCEPT_DIFFERENCE;
    }
    String expectedValue = expectedNode.getValue();
    expectedValue = expectedValue.replaceAll("\\s+", " ").trim();
    String actualValue = actualNode.getValue();
    actualValue = actualValue.replaceAll("\\s+", " ").trim();
    if (expectedValue.equals(actualValue))
    {
      return DifferenceListener.RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
    }
View Full Code Here

TOP

Related Classes of org.custommonkey.xmlunit.NodeDetail

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.