switched source tests to use xml unit
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.springframework.integration.xml.source;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.custommonkey.xmlunit.XMLAssert.*;
|
||||
|
||||
import java.io.StringReader;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class DomSourceFactoryTests {
|
||||
Source source = sourceFactory.createSource(doc);
|
||||
assertNotNull("Returned source was null", source);
|
||||
assertEquals("Expected DOMSource", DOMSource.class, source.getClass());
|
||||
assertEquals("Wrong content in source ", docContent, getAsString(source));
|
||||
assertXMLEqual("Wrong content in source ", docContent, getAsString(source));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -65,7 +65,7 @@ public class DomSourceFactoryTests {
|
||||
Source source = sourceFactory.createSource(docContent);
|
||||
assertNotNull("Returned source was null", source);
|
||||
assertEquals("Expected DOMSource", DOMSource.class, source.getClass());
|
||||
assertEquals("Wrong content in source ", docContent, getAsString(source));
|
||||
assertXMLEqual("Wrong content in source ", docContent, getAsString(source));
|
||||
}
|
||||
|
||||
@Test(expected = MessagingException.class)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.springframework.integration.xml.source;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.custommonkey.xmlunit.XMLAssert.*;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
||||
@@ -42,7 +43,7 @@ public class StringSourceTests {
|
||||
StringSource source = (StringSource)sourceFactory.createSource(doc);
|
||||
BufferedReader reader = new BufferedReader(source.getReader());
|
||||
String docAsString =reader.readLine();
|
||||
assertEquals("Wrong content in StringSource","<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>one</item>", docAsString);
|
||||
assertXMLEqual("Wrong content in StringSource","<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>one</item>", docAsString);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +53,7 @@ public class StringSourceTests {
|
||||
StringSource source = (StringSource)sourceFactory.createSource(docString);
|
||||
BufferedReader reader = new BufferedReader(source.getReader());
|
||||
String docAsString =reader.readLine();
|
||||
assertEquals("Wrong content in StringSource","<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>one</item>", docAsString);
|
||||
assertXMLEqual("Wrong content in StringSource","<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>one</item>", docAsString);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +64,7 @@ public class StringSourceTests {
|
||||
StringSource source = (StringSource)sourceFactory.createSource(buffer);
|
||||
BufferedReader reader = new BufferedReader(source.getReader());
|
||||
String docAsString =reader.readLine();
|
||||
assertEquals("Wrong content in StringSource","<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>one</item>", docAsString);
|
||||
assertXMLEqual("Wrong content in StringSource","<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>one</item>", docAsString);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user