Package org.custommonkey.xmlunit

Examples of org.custommonkey.xmlunit.Diff.similar()


        String query = "declare namespace hoge=\"http://www.hoge.jp/dtd\"; <records xmlns:hoge=\"http://www.hoge.jp/dtd\"> {for $t in doc(\"./main/test/java/scenario/multithread/data-s.xml\")/records/record return <record>{$t/@*}{$t/author/text()}{ fn:concat(\"《\", $t/title/text() , \"》\") }</record>} </records>";
        String xbirdOut = invokeQueryPushModeUsingSAX(query);
        String saxonOut = invokeQueryBySaxon(query);
        Diff diff = new Diff(saxonOut, xbirdOut);
        if(!diff.identical()) {
            if(!diff.similar()) {
                Assert.fail(diff.toString());
            } else {               
                System.out.println(diff.toString());
            }
        }
View Full Code Here


                        }

                        final String compareForm = output.getAttribute("compare");
                        if("XML".equals(compareForm)) {
                            Diff diff = new Diff(expectedStr, resString);
                            if(diff.similar()) {
                                reportTestResult(testName, "pass", null);
                                break;
                            } else {
                                if(oi == lastoi) {
                                    String errmsg = diff.toString();
View Full Code Here

                                _expectedDocumentCache.put(expFileName, expectedDoc);
                            }
                            String actual = "<doc>" + resString + "</doc>";
                            Document actualDoc = buildDocument(new ByteArrayInputStream(actual.getBytes("UTF-8")));
                            Diff diff = new Diff(expectedDoc, actualDoc);
                            if(diff.similar()) {
                                reportTestResult(testName, "pass", null);
                                break;
                            } else {
                                if(oi == lastoi) {
                                    String errmsg = diff.toString();
View Full Code Here

                                _expectedDocumentCache.put(expFileName, expectedDoc);
                            }
                            String actual = "<doc>" + resString + "</doc>";
                            Document actualDoc = buildDocument(new ByteArrayInputStream(actual.getBytes("UTF-8")));
                            Diff diff = new Diff(expectedDoc, actualDoc);
                            if(diff.similar()) {
                                reportTestResult(testName, "pass", null);
                                break;
                            } else {
                                if(oi == lastoi) {
                                    reportTestResult(testName, "not tested", "Inspectection is required");
View Full Code Here

                            } else {
                                if(oi == lastoi) {
                                    reportTestResult(testName, "not tested", "Inspectection is required");
                                }
                            }
                            if(ispect && !diff.similar()) {
                                if(oi == lastoi) {
                                    Assert.fail("Inspectection is required: \n" + diff.toString());
                                }
                            }
                        } else {
View Full Code Here

    expected.getDocumentElement().normalize();
    actual.getDocumentElement().normalize();

    Diff diff = compareXML(expected, actual);

    if (!diff.similar())
    {
      try
      {
        System.out.println("expected:");
        print(expected);
View Full Code Here

      {
        e.printStackTrace();
      }
    }

    assertEquals(msg+", "+diff.toString(), true, diff.similar());
  }

  /**
   * Assert that the result of an XML comparison is similar.
   *
 
View Full Code Here

    expected.getDocumentElement().normalize();
    actual.getDocumentElement().normalize();

    Diff diff = compareXML(expected, actual);

    if (!diff.similar())
    {
      try
      {
        System.out.println("expected:");
        print(expected);
View Full Code Here

      {
        e.printStackTrace();
      }
    }

    assertEquals("Test if the assertion document is equal, "+diff.toString(), true, diff.similar());
  }

  public static Test suite()
  {
    TestSuite suite = new TestSuite("LexicalProcessorTest");
View Full Code Here

    expected.getDocumentElement().normalize();
    actual.getDocumentElement().normalize();

    Diff diff = compareXML(expected, actual);

    assertEquals(msg+", "+diff.toString(), true, diff.similar());
  }

  /**
   * Assert that the result of an XML comparison is similar.
   *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.