velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r680255 - in /velocity/engine/trunk/src/test/org/apache/velocity/test: MacroForwardDefineTestCase.java ParseWithMacroLibsTestCase.java
Date Mon, 28 Jul 2008 05:23:47 GMT
Author: nbubna
Date: Sun Jul 27 22:23:46 2008
New Revision: 680255

URL: http://svn.apache.org/viewvc?rev=680255&view=rev
Log:
produce more helpful fail messages

Modified:
    velocity/engine/trunk/src/test/org/apache/velocity/test/MacroForwardDefineTestCase.java
    velocity/engine/trunk/src/test/org/apache/velocity/test/ParseWithMacroLibsTestCase.java

Modified: velocity/engine/trunk/src/test/org/apache/velocity/test/MacroForwardDefineTestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/MacroForwardDefineTestCase.java?rev=680255&r1=680254&r2=680255&view=diff
==============================================================================
--- velocity/engine/trunk/src/test/org/apache/velocity/test/MacroForwardDefineTestCase.java
(original)
+++ velocity/engine/trunk/src/test/org/apache/velocity/test/MacroForwardDefineTestCase.java
Sun Jul 27 22:23:46 2008
@@ -100,9 +100,17 @@
 
         template.merge(context, new StringWriter());
 
-        if ( !isMatch(logger.getLog(), COMPARE_DIR, "velocity.log", "cmp"))
+        String resultLog = logger.getLog();
+        if ( !isMatch(resultLog, COMPARE_DIR, "velocity.log", "cmp"))
         {
-            fail("Output incorrect.");
+            String compare = getFileContents(COMPARE_DIR, "velocity.log", CMP_FILE_EXT);
+
+            String msg = "Log output was incorrect\n"+
+                "-----Result-----\n"+ resultLog +
+                "----Expected----\n"+ compare +
+                "----------------";
+
+            fail(msg);
         }
     }
 }

Modified: velocity/engine/trunk/src/test/org/apache/velocity/test/ParseWithMacroLibsTestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/ParseWithMacroLibsTestCase.java?rev=680255&r1=680254&r2=680255&view=diff
==============================================================================
--- velocity/engine/trunk/src/test/org/apache/velocity/test/ParseWithMacroLibsTestCase.java
(original)
+++ velocity/engine/trunk/src/test/org/apache/velocity/test/ParseWithMacroLibsTestCase.java
Sun Jul 27 22:23:46 2008
@@ -156,7 +156,15 @@
         if (!isMatch(RESULT_DIR, COMPARE_DIR, outputBaseFileName,
                 RESULT_FILE_EXT,CMP_FILE_EXT))
         {
-            fail("Processed template did not match expected output");
+            String result = getFileContents(RESULT_DIR, outputBaseFileName, RESULT_FILE_EXT);
+            String compare = getFileContents(COMPARE_DIR, outputBaseFileName, CMP_FILE_EXT);
+
+            String msg = "Processed template did not match expected output\n"+
+                "-----Result-----\n"+ result +
+                "----Expected----\n"+ compare +
+                "----------------";
+            
+            fail(msg);
         }
 
         /*



Mime
View raw message