Author: nbubna
Date: Tue Aug 26 08:27:06 2008
New Revision: 689111

URL: http://svn.apache.org/viewvc?rev=689111&view=rev
Log:
try again to get some useful info out of the gump failures

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

Modified: 
velocity/engine/trunk/src/test/org/apache/velocity/test/BaseTestCase.java
URL: 
http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/BaseTestCase.java?rev=689111&r1=689110&r2=689111&view=diff
==============================================================================
--- velocity/engine/trunk/src/test/org/apache/velocity/test/BaseTestCase.java 
(original)
+++ velocity/engine/trunk/src/test/org/apache/velocity/test/BaseTestCase.java 
Tue Aug 26 08:27:06 2008
@@ -123,11 +123,11 @@
         {
             String msg = "Template results directory 
("+resultsDirectory+")does not exist";
             RuntimeSingleton.getLog().info(msg);
-//caveman hack to get gump to give more info
-System.out.println(msg);
             if (dir.mkdirs())
             {
                 RuntimeSingleton.getLog().info("Created template results 
directory");
+//caveman hack to get gump to give more info
+System.out.println("Created template results directory: "+resultsDirectory);
             }
             else
             {

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=689111&r1=689110&r2=689111&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
 Tue Aug 26 08:27:06 2008
@@ -32,6 +32,7 @@
 public class ResourceExistsTestCase extends BaseTestCase
 {
     private VelocityEngine velocity;
+    private String path = TEST_COMPARE_DIR + "/resourceexists";
 
     public ResourceExistsTestCase(String name)
     {
@@ -43,16 +44,26 @@
         velocity = new VelocityEngine();
         // pass in an instance to Velocity
         velocity.addProperty("resource.loader", "myfile,string");
-        velocity.setProperty("myfile.resource.loader.instance", new 
FileResourceLoader());
-        velocity.setProperty("myfile.resource.loader.path", TEST_COMPARE_DIR + 
"/resourceexists");
+        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());
     }
 
     public void testFileResourceExists() throws Exception
     {
-        assertTrue(velocity.resourceExists("testfile.vm"));
-        assertFalse(velocity.resourceExists("nosuchfile.vm"));
+        if (!velocity.resourceExists("testfile.vm"))
+        {
+            String msg = "testfile.vm was not found in path "+path;
+            System.out.println(msg);
+            fail(msg);
+        }
+        if (velocity.resourceExists("nosuchfile.vm"))
+        {
+            String msg = "nosuchfile.vm should not have been found in path 
"+path;
+            System.out.println(msg);
+            fail(msg);
+        }
     }
 
     public void testStringResourceExists() throws Exception


Reply via email to