incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r415462 - in /incubator/adffaces/trunk/adf-faces/adf-faces-impl: pom.xml src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitTestCase.java
Date Mon, 19 Jun 2006 23:46:42 GMT
Author: awiner
Date: Mon Jun 19 16:46:42 2006
New Revision: 415462

URL: http://svn.apache.org/viewvc?rev=415462&view=rev
Log:
Improve output when a difference is detected

Modified:
    incubator/adffaces/trunk/adf-faces/adf-faces-impl/pom.xml
    incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitTestCase.java

Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/pom.xml?rev=415462&r1=415461&r2=415462&view=diff
==============================================================================
--- incubator/adffaces/trunk/adf-faces/adf-faces-impl/pom.xml (original)
+++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/pom.xml Mon Jun 19 16:46:42 2006
@@ -235,6 +235,13 @@
     </dependency>
 
     <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.1</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>com.sun.facelets</groupId>
       <artifactId>jsf-facelets</artifactId>
     </dependency>

Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitTestCase.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitTestCase.java?rev=415462&r1=415461&r2=415462&view=diff
==============================================================================
--- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitTestCase.java
(original)
+++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/test/java/org/apache/myfaces/adfinternal/renderkit/RenderKitTestCase.java
Mon Jun 19 16:46:42 2006
@@ -37,6 +37,8 @@
 import javax.faces.context.FacesContext;
 import javax.faces.context.ResponseWriter;
 
+import org.apache.commons.lang.StringUtils;
+
 import org.apache.myfaces.adf.context.Agent;
 import org.apache.myfaces.adf.render.ExtendedRenderKitService;
 import org.apache.myfaces.adf.util.Service;
@@ -309,8 +311,15 @@
         }
         else
         {
+          int index = StringUtils.indexOfDifference(golden, results);
+          String difference = StringUtils.difference(golden, results);
+          int diffLength = difference.length();
+          if (diffLength > 50)
+            difference = StringUtils.abbreviate(difference, 50);
           throw new AssertionFailedError(
-               "Golden file for test "+ _scriptName + " did not match");
+               "Golden file for test "+ _scriptName + " did not match; " +
+               "first difference at " + index + ", difference of length " +
+               diffLength + ", \"" + difference + "\"");
         }
       }
     }



Mime
View raw message