velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wgl...@apache.org
Subject svn commit: r589949 - /velocity/engine/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java
Date Tue, 30 Oct 2007 03:37:40 GMT
Author: wglass
Date: Mon Oct 29 20:37:39 2007
New Revision: 589949

URL: http://svn.apache.org/viewvc?rev=589949&view=rev
Log:
as long as we're using svn as a run-time debugging tool, let's get the details of the Gump
failure

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

Modified: velocity/engine/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java?rev=589949&r1=589948&r2=589949&view=diff
==============================================================================
--- velocity/engine/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java
(original)
+++ velocity/engine/trunk/src/test/org/apache/velocity/test/BuiltInEventHandlerTestCase.java
Mon Oct 29 20:37:39 2007
@@ -27,6 +27,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import junit.framework.AssertionFailedError;
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -257,46 +258,58 @@
      */
     public void testEscapeReferenceMatch() throws Exception
     {
-        // set up HTML match on everything, JavaScript match on _js*
-        VelocityEngine ve = new VelocityEngine();
-        ve.setProperty(RuntimeConstants.EVENTHANDLER_REFERENCEINSERTION, "org.apache.velocity.app.event.implement.EscapeHtmlReference,org.apache.velocity.app.event.implement.EscapeJavaScriptReference");
-        ve.setProperty("eventhandler.escape.javascript.match", "/.*_js.*/");
-        ve.init();
-
-        System.out.println("Successfully engine init()");
-
-        Writer writer;
-
-        // Html no JavaScript
-        writer = new StringWriter();
-        ve.evaluate(newEscapeContext(),writer,"test","$test1");
-        System.out.println("Escaping test1: "+writer.toString());
-        assertEquals("Jimmy's <b>pizza</b>",writer.toString());
-        System.out.println("Successfully escaped test1: ");
-
-        // JavaScript and HTML
-        writer = new StringWriter();
-        ve.evaluate(newEscapeContext(),writer,"test","$test1_js");
-        System.out.println("Escaping test1_js: "+writer.toString());
-        assertEquals("Jimmy\\'s <b>pizza</b>",writer.toString());
-        System.out.println("Successfully escaped test1_js");
-
-        // JavaScript and HTML
-        writer = new StringWriter();
-        ve.evaluate(newEscapeContext(),writer,"test","$test1_js_test");
-        System.out.println("Escaping test1_js_test: "+writer.toString());
-        assertEquals("Jimmy\\'s <b>pizza</b>",writer.toString());
-        System.out.println("Successfully escaped test1_js_test");
-
-        // JavaScript and HTML (method call)
-        writer = new StringWriter();
-        ve.evaluate(newEscapeContext(),writer,"test","$test1_js.substring(0,7)");
-        System.out.println("Escaping test1_js.substring(0,7): "+writer.toString());
-        assertEquals("Jimmy\\'s",writer.toString());
-        System.out.println("Successfully escaped test1_js.substring(0,7)");
-
-        System.out.println("Escape selected references (global configuration)");
-
+        try
+        {
+            // set up HTML match on everything, JavaScript match on _js*
+            VelocityEngine ve = new VelocityEngine();
+            ve.setProperty(RuntimeConstants.EVENTHANDLER_REFERENCEINSERTION, "org.apache.velocity.app.event.implement.EscapeHtmlReference,org.apache.velocity.app.event.implement.EscapeJavaScriptReference");
+            ve.setProperty("eventhandler.escape.javascript.match", "/.*_js.*/");
+            ve.init();
+    
+            System.out.println("Successfully engine init()");
+    
+            Writer writer;
+    
+            // Html no JavaScript
+            writer = new StringWriter();
+            ve.evaluate(newEscapeContext(),writer,"test","$test1");
+            System.out.println("Escaping test1: "+writer.toString());
+            assertEquals("Jimmy's <b>pizza</b>",writer.toString());
+            System.out.println("Successfully escaped test1: ");
+    
+            // JavaScript and HTML
+            writer = new StringWriter();
+            ve.evaluate(newEscapeContext(),writer,"test","$test1_js");
+            System.out.println("Escaping test1_js: "+writer.toString());
+            assertEquals("Jimmy\\'s <b>pizza</b>",writer.toString());
+            System.out.println("Successfully escaped test1_js");
+    
+            // JavaScript and HTML
+            writer = new StringWriter();
+            ve.evaluate(newEscapeContext(),writer,"test","$test1_js_test");
+            System.out.println("Escaping test1_js_test: "+writer.toString());
+            assertEquals("Jimmy\\'s <b>pizza</b>",writer.toString());
+            System.out.println("Successfully escaped test1_js_test");
+    
+            // JavaScript and HTML (method call)
+            writer = new StringWriter();
+            ve.evaluate(newEscapeContext(),writer,"test","$test1_js.substring(0,7)");
+            System.out.println("Escaping test1_js.substring(0,7): "+writer.toString());
+            assertEquals("Jimmy\\'s",writer.toString());
+            System.out.println("Successfully escaped test1_js.substring(0,7)");
+    
+            System.out.println("Escape selected references (global configuration)");
+        
+        }
+        
+        catch (AssertionFailedError e) 
+        {
+            System.out.println(e.getMessage());
+            e.printStackTrace();
+            
+            throw e;
+        }
+            
     }
 
     private Context newEscapeContext()



Mime
View raw message