Author: veithen
Date: Sun Feb 6 13:37:18 2011
New Revision: 1067663
URL: http://svn.apache.org/viewvc?rev=1067663&view=rev
Log:
TestSerializeToOutputStream: Dump the two documents if the assertion fails.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestSerializeToOutputStream.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestSerializeToOutputStream.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestSerializeToOutputStream.java?rev=1067663&r1=1067662&r2=1067663&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestSerializeToOutputStream.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestSerializeToOutputStream.java
Sun Feb 6 13:37:18 2011
@@ -27,6 +27,8 @@ import javax.xml.transform.TransformerFa
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+import junit.framework.AssertionFailedError;
+
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMMetaFactory;
import org.apache.axiom.om.OMXMLBuilderFactory;
@@ -71,8 +73,19 @@ public class TestSerializeToOutputStream
} else {
element.serializeAndConsume(baos);
}
- assertXMLIdentical(compareXML(new InputSource(new
ByteArrayInputStream(control)),
- new InputSource(new
ByteArrayInputStream(baos.toByteArray()))), true);
+ byte[] actual = baos.toByteArray();
+ try {
+ assertXMLIdentical(compareXML(new InputSource(new
ByteArrayInputStream(control)),
+ new InputSource(new
ByteArrayInputStream(actual))), true);
+ } catch (AssertionFailedError ex) {
+ System.out.println("Control:");
+ System.out.write(control);
+ System.out.println();
+ System.out.println("Actual:");
+ System.out.write(actual);
+ System.out.println();
+ throw ex;
+ }
if (cache) {
assertTrue(element.isComplete());
} else {