Skip to content

Commit 16c9f1e

Browse files
Ajit GeorgeAjit George
authored andcommitted
Using XMLUnit's diff and similar method rather than assertXMLEqual. To
aviod intermittent failures from assertXMLEqual.
1 parent 97f07b1 commit 16c9f1e

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

test-complete/src/test/java/com/marklogic/client/functionaltest/TestBug19443.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,25 @@
1616

1717
package com.marklogic.client.functionaltest;
1818

19-
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
20-
21-
import org.custommonkey.xmlunit.XMLUnit;
19+
import static org.junit.Assert.assertTrue;
2220

2321
import javax.xml.namespace.QName;
2422

25-
import com.marklogic.client.admin.QueryOptionsManager;
26-
import com.marklogic.client.admin.config.QueryOptionsBuilder;
27-
import com.marklogic.client.io.Format;
23+
import org.custommonkey.xmlunit.Diff;
24+
import org.custommonkey.xmlunit.XMLUnit;
25+
import org.junit.After;
26+
import org.junit.AfterClass;
27+
import org.junit.BeforeClass;
28+
import org.junit.Test;
2829

2930
import com.marklogic.client.DatabaseClient;
3031
import com.marklogic.client.DatabaseClientFactory;
3132
import com.marklogic.client.DatabaseClientFactory.Authentication;
33+
import com.marklogic.client.admin.QueryOptionsManager;
34+
import com.marklogic.client.admin.config.QueryOptionsBuilder;
35+
import com.marklogic.client.io.Format;
3236
import com.marklogic.client.io.QueryOptionsHandle;
3337
import com.marklogic.client.io.StringHandle;
34-
35-
import org.junit.*;
3638
public class TestBug19443 extends BasicJavaClientREST {
3739

3840
private static String dbName = "TestBug19443DB";
@@ -103,7 +105,8 @@ public void testBug19443() throws Exception
103105

104106
XMLUnit.setIgnoreWhitespace(true);
105107
XMLUnit.setNormalizeWhitespace(true);
106-
assertXMLEqual("testBug19443", actual, output);
108+
Diff diff = XMLUnit.compareXML( actual, output );
109+
assertTrue( "Not Similar", diff.similar() );
107110

108111
// release client
109112
client.release();

0 commit comments

Comments
 (0)