switched source tests to use xml unit

This commit is contained in:
Jonas Partner
2008-08-18 11:12:10 +00:00
parent 9b85225675
commit d03c985e44
4 changed files with 9 additions and 6 deletions

View File

@@ -13,5 +13,6 @@
<classpathentry kind="var" path="IVY_CACHE/org.springframework.ws/org.springframework.xml/1.5.1.A/org.springframework.xml-1.5.1.A.jar" sourcepath="/IVY_CACHE/org.springframework.ws/org.springframework.xml/1.5.1.A/org.springframework.xml-sources-1.5.1.A.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/org.springframework.integration"/>
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.test/2.5.5.A/org.springframework.test-2.5.5.A.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.test/2.5.5.A/org.springframework.test-sources-2.5.5.A.jar"/>
<classpathentry kind="var" path="IVY_CACHE/org.custommonkey.xmlunit/com.springsource.org.custommonkey.xmlunit/1.2.0/com.springsource.org.custommonkey.xmlunit-1.2.0.jar" sourcepath="/IVY_CACHE/org.custommonkey.xmlunit/com.springsource.org.custommonkey.xmlunit/1.2.0/com.springsource.org.custommonkey.xmlunit-sources-1.2.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -21,6 +21,7 @@
<dependencies>
<dependency org="org.junit" name="com.springsource.org.junit" rev="4.4.0" conf="test->runtime"/>
<dependency org="org.custommonkey.xmlunit" name="com.springsource.org.custommonkey.xmlunit" rev="1.2.0" conf="test->runtime"/>
<dependency org="org.springframework" name="org.springframework.test" rev="2.5.5.A" conf="test->runtime"/>
<dependency org="org.springframework" name="org.springframework.context" rev="2.5.5.A" conf="compile->runtime"/>
<dependency org="org.springframework.ws" name="org.springframework.oxm" rev="1.5.1.A" conf="compile->runtime"/>

View File

@@ -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)

View File

@@ -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);
}
}