You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by st...@apache.org on 2014/02/27 13:11:28 UTC

svn commit: r1572528 - /maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java

Author: stephenc
Date: Thu Feb 27 12:11:28 2014
New Revision: 1572528

URL: http://svn.apache.org/r1572528
Log:
When you get a test failure it is very difficult to determine exactly which of the multiple events was the one with the mismatch, so compare a string version and then IDE's can give meaningful diff support

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java?rev=1572528&r1=1572527&r2=1572528&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java Thu Feb 27 12:11:28 2014
@@ -138,10 +138,18 @@ public abstract class AbstractParserTest
 
     protected void assertEquals( Iterator<SinkEventElement> it, String... names )
     {
-        for ( String name: names )
+        StringBuilder expected = new StringBuilder();
+        StringBuilder actual = new StringBuilder();
+
+        for ( String name : names )
         {
-            assertEquals( name, it.next().getName() );
+            expected.append( name ).append( '\n' );
+            if ( it.hasNext() )
+            {
+                actual.append( it.next().getName() ).append( '\n' );
+            }
         }
+        assertEquals( expected.toString(), actual.toString() );
     }