mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Add XmlUnitUtils.assertXmlSimilar()
This commit is contained in:
parent
8aa7029b38
commit
f2ea3e0d5b
1 changed files with 6 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Copyright 2014 Florian Schmaus
|
* Copyright 2014-2018 Florian Schmaus
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -26,10 +26,14 @@ import org.xml.sax.SAXException;
|
||||||
|
|
||||||
public class XmlUnitUtils {
|
public class XmlUnitUtils {
|
||||||
|
|
||||||
|
// TOOD: Remove this method.
|
||||||
public static void assertSimilar(CharSequence expected, CharSequence actual) throws SAXException, IOException {
|
public static void assertSimilar(CharSequence expected, CharSequence actual) throws SAXException, IOException {
|
||||||
|
assertXmlSimilar(expected, actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void assertXmlSimilar(CharSequence expected, CharSequence actual) throws SAXException, IOException {
|
||||||
Diff diff = new Diff(expected.toString(), actual.toString());
|
Diff diff = new Diff(expected.toString(), actual.toString());
|
||||||
diff.overrideElementQualifier(new RecursiveElementNameAndTextQualifier());
|
diff.overrideElementQualifier(new RecursiveElementNameAndTextQualifier());
|
||||||
assertXMLEqual(diff, true);
|
assertXMLEqual(diff, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue