You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2008/08/28 03:01:55 UTC
svn commit: r689687 - in
/velocity/engine/trunk/src/test/org/apache/velocity/test:
ParseWithMacroLibsTestCase.java ResourceExistsTestCase.java
Author: nbubna
Date: Wed Aug 27 18:01:54 2008
New Revision: 689687
URL: http://svn.apache.org/viewvc?rev=689687&view=rev
Log:
wring more info out of gump failures
Modified:
velocity/engine/trunk/src/test/org/apache/velocity/test/ParseWithMacroLibsTestCase.java
velocity/engine/trunk/src/test/org/apache/velocity/test/ResourceExistsTestCase.java
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=689687&r1=689686&r2=689687&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 Wed Aug 27 18:01:54 2008
@@ -145,6 +145,12 @@
Writer writer = new BufferedWriter(new OutputStreamWriter(fos));
Template template = ve.getTemplate("parseMacro1.vm");
+// caveman hack to get info out of gump
+// to compare to ResourceExistsTestCase
+if (template != null)
+{
+ System.out.println("parseMacro1.vm was found at "+TEST_COMPARE_DIR+"/parsemacros");
+}
template.merge(context, writer);
/**
Modified: velocity/engine/trunk/src/test/org/apache/velocity/test/ResourceExistsTestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/ResourceExistsTestCase.java?rev=689687&r1=689686&r2=689687&view=diff
==============================================================================
--- velocity/engine/trunk/src/test/org/apache/velocity/test/ResourceExistsTestCase.java (original)
+++ velocity/engine/trunk/src/test/org/apache/velocity/test/ResourceExistsTestCase.java Wed Aug 27 18:01:54 2008
@@ -21,8 +21,10 @@
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.log.NullLogChute;
+import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.resource.loader.FileResourceLoader;
import org.apache.velocity.runtime.resource.loader.StringResourceLoader;
+import org.apache.velocity.test.misc.TestLogChute;
/**
* Test the resource exists method
@@ -33,6 +35,7 @@
{
private VelocityEngine velocity;
private String path = TEST_COMPARE_DIR + "/resourceexists";
+ private TestLogChute logger = new TestLogChute();
public ResourceExistsTestCase(String name)
{
@@ -42,12 +45,14 @@
public void setUp() throws Exception
{
velocity = new VelocityEngine();
- // pass in an instance to Velocity
velocity.addProperty("resource.loader", "myfile,string");
velocity.setProperty("myfile.resource.loader.class", FileResourceLoader.class.getName());
velocity.setProperty("myfile.resource.loader.path", path);
velocity.setProperty("string.resource.loader.class", StringResourceLoader.class.getName());
- velocity.setProperty(velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, NullLogChute.class.getName());
+
+ // actual instance of logger
+ velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, logger);
+ velocity.setProperty("runtime.log.logsystem.test.level", "debug");
}
public void testFileResourceExists() throws Exception
@@ -56,6 +61,7 @@
{
String msg = "testfile.vm was not found in path "+path;
System.out.println(msg);
+ System.out.println("Log was: "+logger.getLog());
fail(msg);
}
if (velocity.resourceExists("nosuchfile.vm"))