You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@apache.org on 2001/08/08 00:20:29 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/test/view TemplateNodeView.java

geirm       01/08/07 15:20:29

  Modified:    src/java/org/apache/velocity/test AnakiaTestCase.java
                        BaseTestCase.java ClasspathResourceTest.java
                        ContextSafetyTestCase.java EncodingTestCase.java
                        EventHandlingTestCase.java ExternalLoggerTest.java
                        InlineScopeVMTestCase.java
                        MethodInvocationExceptionTest.java
                        MultipleFileResourcePathTest.java
                        TemplateTestCase.java TexenTestCase.java
               src/java/org/apache/velocity/test/misc Test.java
               src/java/org/apache/velocity/test/provider TestProvider.java
               src/java/org/apache/velocity/test/view TemplateNodeView.java
  Log:
  Changes for new runtime support
  
  Revision  Changes    Path
  1.5       +1 -2      jakarta-velocity/src/java/org/apache/velocity/test/AnakiaTestCase.java
  
  Index: AnakiaTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/AnakiaTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AnakiaTestCase.java	2001/03/19 22:38:57	1.4
  +++ AnakiaTestCase.java	2001/08/07 22:20:28	1.5
  @@ -59,7 +59,6 @@
   import org.apache.velocity.anakia.AnakiaTask;
   
   import org.apache.velocity.VelocityContext;
  -import org.apache.velocity.runtime.Runtime;
   import org.apache.velocity.util.StringUtils;
   
   import junit.framework.TestCase;
  @@ -70,7 +69,7 @@
    * first running Anakia and then running this test.
    *
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
  - * @version $Id: AnakiaTestCase.java,v 1.4 2001/03/19 22:38:57 jvanzyl Exp $
  + * @version $Id: AnakiaTestCase.java,v 1.5 2001/08/07 22:20:28 geirm Exp $
    */
   public class AnakiaTestCase extends BaseTestCase
   {
  
  
  
  1.11      +5 -5      jakarta-velocity/src/java/org/apache/velocity/test/BaseTestCase.java
  
  Index: BaseTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/BaseTestCase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BaseTestCase.java	2001/03/23 15:59:17	1.10
  +++ BaseTestCase.java	2001/08/07 22:20:28	1.11
  @@ -67,7 +67,7 @@
   
   import org.apache.velocity.VelocityContext;
   import org.apache.velocity.Template;
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   import org.apache.velocity.test.provider.TestProvider;
   import org.apache.velocity.util.StringUtils;
   
  @@ -81,7 +81,7 @@
    * the rest of the tests.
    *
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  - * @version $Id: BaseTestCase.java,v 1.10 2001/03/23 15:59:17 geirm Exp $
  + * @version $Id: BaseTestCase.java,v 1.11 2001/08/07 22:20:28 geirm Exp $
    */
   public class BaseTestCase extends TestCase
   {
  @@ -123,15 +123,15 @@
           File dir = new File(resultsDirectory);
           if (!dir.exists())
           {
  -            Runtime.info("Template results directory does not exist");
  +            RuntimeSingleton.info("Template results directory does not exist");
               if (dir.mkdirs())
               {
  -                Runtime.info("Created template results directory");
  +                RuntimeSingleton.info("Created template results directory");
               }
               else
               {
                   String errMsg = "Unable to create template results directory";
  -                Runtime.warn(errMsg);
  +                RuntimeSingleton.warn(errMsg);
                   fail(errMsg);
               }
           }
  
  
  
  1.7       +4 -4      jakarta-velocity/src/java/org/apache/velocity/test/ClasspathResourceTest.java
  
  Index: ClasspathResourceTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/ClasspathResourceTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ClasspathResourceTest.java	2001/03/25 22:56:03	1.6
  +++ ClasspathResourceTest.java	2001/08/07 22:20:28	1.7
  @@ -66,7 +66,7 @@
   import org.apache.velocity.app.Velocity;
   import org.apache.velocity.VelocityContext;
   import org.apache.velocity.test.provider.TestProvider;
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   import org.apache.velocity.util.StringUtils;
   import org.apache.velocity.runtime.VelocimacroFactory;
   
  @@ -77,7 +77,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:daveb@miceda-data.com">Dave Bryson</a>
  - * @version $Id: ClasspathResourceTest.java,v 1.6 2001/03/25 22:56:03 jvanzyl Exp $
  + * @version $Id: ClasspathResourceTest.java,v 1.7 2001/08/07 22:20:28 geirm Exp $
    */
   public class ClasspathResourceTest extends BaseTestCase
   {
  @@ -162,10 +162,10 @@
                */
               assureResultsDirectoryExists(RESULTS_DIR);
   
  -            Template template1 = Runtime.getTemplate(
  +            Template template1 = RuntimeSingleton.getTemplate(
                   getFileName(null, "template/test1", TMPL_FILE_EXT));
               
  -            Template template2 = Runtime.getTemplate(
  +            Template template2 = RuntimeSingleton.getTemplate(
                   getFileName(null, "template/test2", TMPL_FILE_EXT));
              
               FileOutputStream fos1 = 
  
  
  
  1.9       +3 -3      jakarta-velocity/src/java/org/apache/velocity/test/ContextSafetyTestCase.java
  
  Index: ContextSafetyTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/ContextSafetyTestCase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ContextSafetyTestCase.java	2001/03/19 22:38:57	1.8
  +++ ContextSafetyTestCase.java	2001/08/07 22:20:28	1.9
  @@ -65,7 +65,7 @@
   
   import org.apache.velocity.Template;
   import org.apache.velocity.app.Velocity;
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   import org.apache.velocity.test.provider.TestProvider;
   import org.apache.velocity.util.StringUtils;
   
  @@ -82,7 +82,7 @@
    * RuntimeTestCase causes the Runtime to be initialized twice.
    *
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: ContextSafetyTestCase.java,v 1.8 2001/03/19 22:38:57 jvanzyl Exp $
  + * @version $Id: ContextSafetyTestCase.java,v 1.9 2001/08/07 22:20:28 geirm Exp $
    */
   public class ContextSafetyTestCase extends BaseTestCase implements TemplateTestBase
   {
  @@ -141,7 +141,7 @@
                *  get the template and the output
                */
   
  -            Template template = Runtime.getTemplate(
  +            Template template = RuntimeSingleton.getTemplate(
                   getFileName(null, "context_safety", TMPL_FILE_EXT));
   
               FileOutputStream fos1 = 
  
  
  
  1.4       +1 -2      jakarta-velocity/src/java/org/apache/velocity/test/EncodingTestCase.java
  
  Index: EncodingTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/EncodingTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EncodingTestCase.java	2001/06/10 21:55:34	1.3
  +++ EncodingTestCase.java	2001/08/07 22:20:28	1.4
  @@ -65,7 +65,6 @@
   
   import org.apache.velocity.Template;
   import org.apache.velocity.app.Velocity;
  -import org.apache.velocity.runtime.Runtime;
   import org.apache.velocity.test.provider.TestProvider;
   import org.apache.velocity.util.StringUtils;
   
  @@ -79,7 +78,7 @@
    *
    *
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: EncodingTestCase.java,v 1.3 2001/06/10 21:55:34 geirm Exp $
  + * @version $Id: EncodingTestCase.java,v 1.4 2001/08/07 22:20:28 geirm Exp $
    */
   public class EncodingTestCase extends BaseTestCase implements TemplateTestBase
   {
  
  
  
  1.5       +8 -1      jakarta-velocity/src/java/org/apache/velocity/test/EventHandlingTestCase.java
  
  Index: EventHandlingTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/EventHandlingTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EventHandlingTestCase.java	2001/06/02 14:48:25	1.4
  +++ EventHandlingTestCase.java	2001/08/07 22:20:28	1.5
  @@ -70,11 +70,13 @@
   import org.apache.velocity.app.event.MethodExceptionEventHandler;
   import org.apache.velocity.app.event.NullSetEventHandler;
   
  +import org.apache.velocity.runtime.RuntimeServices;
  +
   /**
    *  Tests event handling
    *
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: EventHandlingTestCase.java,v 1.4 2001/06/02 14:48:25 geirm Exp $
  + * @version $Id: EventHandlingTestCase.java,v 1.5 2001/08/07 22:20:28 geirm Exp $
    */
   public class EventHandlingTestCase extends TestCase implements ReferenceInsertionEventHandler, 
                                        NullSetEventHandler, MethodExceptionEventHandler,
  @@ -107,6 +109,11 @@
               System.err.println("Cannot setup event handling test : " + e);
               System.exit(1);
           }            
  +    }
  +
  +    public void init( RuntimeServices rs )
  +    {
  +        /* don't need it...*/
       }
   
       public static junit.framework.Test suite ()
  
  
  
  1.3       +11 -4     jakarta-velocity/src/java/org/apache/velocity/test/ExternalLoggerTest.java
  
  Index: ExternalLoggerTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/ExternalLoggerTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExternalLoggerTest.java	2001/03/19 22:38:57	1.2
  +++ ExternalLoggerTest.java	2001/08/07 22:20:28	1.3
  @@ -55,7 +55,9 @@
    */
   
   import org.apache.velocity.app.Velocity;
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeServices;
  +import org.apache.velocity.runtime.RuntimeSingleton;
  +
   import org.apache.velocity.runtime.log.LogSystem;
   
   import junit.framework.TestCase;
  @@ -64,7 +66,7 @@
    * Tests if we can hand Velocity an arbitrary class for logging.
    *
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: ExternalLoggerTest.java,v 1.2 2001/03/19 22:38:57 jvanzyl Exp $
  + * @version $Id: ExternalLoggerTest.java,v 1.3 2001/08/07 22:20:28 geirm Exp $
    */
   public class ExternalLoggerTest extends TestCase implements LogSystem
   {
  @@ -94,6 +96,11 @@
           }            
       }
   
  +    public void init( RuntimeServices rs )
  +    {
  +        // do nothing with it
  +    }
  +
       public static junit.framework.Test suite ()
       {
           return new ExternalLoggerTest();
  @@ -112,9 +119,9 @@
   
           String testString = "This is a test.";
   
  -        Runtime.warn( testString );
  +        RuntimeSingleton.warn( testString );
   
  -        if (logString == null || !logString.equals( Runtime.WARN_PREFIX +  testString ) )
  +        if (logString == null || !logString.equals( RuntimeSingleton.WARN_PREFIX +  testString ) )
           {
               fail("Didn't recieve log message.");
           }
  
  
  
  1.11      +4 -4      jakarta-velocity/src/java/org/apache/velocity/test/InlineScopeVMTestCase.java
  
  Index: InlineScopeVMTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/InlineScopeVMTestCase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- InlineScopeVMTestCase.java	2001/03/19 22:38:57	1.10
  +++ InlineScopeVMTestCase.java	2001/08/07 22:20:28	1.11
  @@ -65,7 +65,7 @@
   
   import org.apache.velocity.Template;
   import org.apache.velocity.app.Velocity;
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   import org.apache.velocity.test.provider.TestProvider;
   import org.apache.velocity.util.StringUtils;
   import org.apache.velocity.runtime.VelocimacroFactory;
  @@ -77,7 +77,7 @@
    *
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
    * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
  - * @version $Id: InlineScopeVMTestCase.java,v 1.10 2001/03/19 22:38:57 jvanzyl Exp $
  + * @version $Id: InlineScopeVMTestCase.java,v 1.11 2001/08/07 22:20:28 geirm Exp $
    */
   public class InlineScopeVMTestCase extends BaseTestCase implements TemplateTestBase
   {
  @@ -134,10 +134,10 @@
                * vm_test2 uses a local VM and vm_test1 doesn't
                */
   
  -            Template template2 = Runtime.getTemplate(
  +            Template template2 = RuntimeSingleton.getTemplate(
                   getFileName(null, "vm_test2", TMPL_FILE_EXT));
               
  -            Template template1 = Runtime.getTemplate(
  +            Template template1 = RuntimeSingleton.getTemplate(
                   getFileName(null, "vm_test1", TMPL_FILE_EXT));
              
               FileOutputStream fos1 = 
  
  
  
  1.6       +4 -4      jakarta-velocity/src/java/org/apache/velocity/test/MethodInvocationExceptionTest.java
  
  Index: MethodInvocationExceptionTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/MethodInvocationExceptionTest.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MethodInvocationExceptionTest.java	2001/04/18 20:43:36	1.5
  +++ MethodInvocationExceptionTest.java	2001/08/07 22:20:28	1.6
  @@ -58,7 +58,6 @@
   
   import org.apache.velocity.app.Velocity;
   import org.apache.velocity.VelocityContext;
  -import org.apache.velocity.runtime.Runtime;
   import org.apache.velocity.runtime.log.LogSystem;
   
   import org.apache.velocity.exception.MethodInvocationException;
  @@ -69,7 +68,7 @@
    * Tests if we can hand Velocity an arbitrary class for logging.
    *
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: MethodInvocationExceptionTest.java,v 1.5 2001/04/18 20:43:36 geirm Exp $
  + * @version $Id: MethodInvocationExceptionTest.java,v 1.6 2001/08/07 22:20:28 geirm Exp $
    */
   public class MethodInvocationExceptionTest extends TestCase 
   {
  @@ -119,7 +118,7 @@
   
           try
           {
  -            Velocity. evaluate( vc,  w, "test", template );
  +            Velocity.evaluate( vc,  w, "test", template );
               fail("No exception thrown");
           }
           catch( MethodInvocationException mie )
  @@ -138,7 +137,8 @@
           }
           catch( Exception e)
           {
  -            fail("Wrong exception thrown, first test.");
  +            fail("Wrong exception thrown, first test." + e);
  +            e.printStackTrace();
           }
   
           /*
  
  
  
  1.7       +4 -4      jakarta-velocity/src/java/org/apache/velocity/test/MultipleFileResourcePathTest.java
  
  Index: MultipleFileResourcePathTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/MultipleFileResourcePathTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MultipleFileResourcePathTest.java	2001/03/25 22:56:03	1.6
  +++ MultipleFileResourcePathTest.java	2001/08/07 22:20:28	1.7
  @@ -66,7 +66,7 @@
   
   import org.apache.velocity.Template;
   import org.apache.velocity.app.Velocity;
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   import org.apache.velocity.test.provider.TestProvider;
   import org.apache.velocity.util.StringUtils;
   import org.apache.velocity.runtime.VelocimacroFactory;
  @@ -77,7 +77,7 @@
    * Multiple paths in the file resource loader.
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: MultipleFileResourcePathTest.java,v 1.6 2001/03/25 22:56:03 jvanzyl Exp $
  + * @version $Id: MultipleFileResourcePathTest.java,v 1.7 2001/08/07 22:20:28 geirm Exp $
    */
   public class MultipleFileResourcePathTest extends BaseTestCase
   {
  @@ -157,10 +157,10 @@
       {
           try
           {
  -            Template template1 = Runtime.getTemplate(
  +            Template template1 = RuntimeSingleton.getTemplate(
                   getFileName(null, "path1", TMPL_FILE_EXT));
               
  -            Template template2 = Runtime.getTemplate(
  +            Template template2 = RuntimeSingleton.getTemplate(
                   getFileName(null, "path2", TMPL_FILE_EXT));
              
               FileOutputStream fos1 = 
  
  
  
  1.31      +6 -4      jakarta-velocity/src/java/org/apache/velocity/test/TemplateTestCase.java
  
  Index: TemplateTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/TemplateTestCase.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- TemplateTestCase.java	2001/04/09 02:36:48	1.30
  +++ TemplateTestCase.java	2001/08/07 22:20:28	1.31
  @@ -67,7 +67,7 @@
   
   import org.apache.velocity.VelocityContext;
   import org.apache.velocity.Template;
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   import org.apache.velocity.test.provider.TestProvider;
   import org.apache.velocity.util.StringUtils;
   
  @@ -99,7 +99,7 @@
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
  - * @version $Id: TemplateTestCase.java,v 1.30 2001/04/09 02:36:48 geirm Exp $
  + * @version $Id: TemplateTestCase.java,v 1.31 2001/08/07 22:20:28 geirm Exp $
    */
   public class TemplateTestCase extends BaseTestCase implements TemplateTestBase
   {
  @@ -176,7 +176,7 @@
           context2.put("stringarray", provider.getArray());
           context.put("vector", vec );
           context.put("mystring", new String());
  -        context.put("runtime", new FieldMethodizer( "org.apache.velocity.runtime.Runtime" ));
  +        context.put("runtime", new FieldMethodizer( "org.apache.velocity.runtime.RuntimeSingleton" ));
           context.put("fmprov", new FieldMethodizer( provider ));
           context.put("Floog", "floogie woogie");
   
  @@ -201,7 +201,7 @@
       {
           try
           {
  -            Template template = Runtime.getTemplate
  +            Template template = RuntimeSingleton.getTemplate
                   (getFileName(null, baseFileName, TMPL_FILE_EXT));
               
               assureResultsDirectoryExists(RESULT_DIR);
  @@ -228,6 +228,8 @@
           }
           catch (Exception e)
           {
  +            System.out.println("EXCEPTION : " + e );
  +
               fail(e.getMessage());
           }
       }
  
  
  
  1.4       +1 -2      jakarta-velocity/src/java/org/apache/velocity/test/TexenTestCase.java
  
  Index: TexenTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/TexenTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TexenTestCase.java	2001/03/23 17:32:45	1.3
  +++ TexenTestCase.java	2001/08/07 22:20:28	1.4
  @@ -59,7 +59,6 @@
   import org.apache.velocity.anakia.AnakiaTask;
   
   import org.apache.velocity.VelocityContext;
  -import org.apache.velocity.runtime.Runtime;
   import org.apache.velocity.util.StringUtils;
   
   import junit.framework.TestCase;
  @@ -69,7 +68,7 @@
    * generative task and compares the output.
    *
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: TexenTestCase.java,v 1.3 2001/03/23 17:32:45 jvanzyl Exp $
  + * @version $Id: TexenTestCase.java,v 1.4 2001/08/07 22:20:28 geirm Exp $
    */
   public class TexenTestCase extends BaseTestCase
   {
  
  
  
  1.31      +22 -11    jakarta-velocity/src/java/org/apache/velocity/test/misc/Test.java
  
  Index: Test.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/misc/Test.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Test.java	2001/05/20 21:14:32	1.30
  +++ Test.java	2001/08/07 22:20:29	1.31
  @@ -79,7 +79,7 @@
   import org.apache.velocity.exception.ResourceNotFoundException;
   import org.apache.velocity.exception.MethodInvocationException;
   
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   import org.apache.velocity.test.provider.TestProvider;
   
   import org.apache.velocity.app.event.EventCartridge;
  @@ -95,7 +95,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
  - * @version $Id: Test.java,v 1.30 2001/05/20 21:14:32 geirm Exp $
  + * @version $Id: Test.java,v 1.31 2001/08/07 22:20:29 geirm Exp $
    */
   public class Test implements ReferenceInsertionEventHandler, 
                                NullSetEventHandler,
  @@ -126,9 +126,12 @@
   
           Vector v = new Vector();
   
  +        String str = "mystr";
  +
           v.addElement( new String("hello") );
           v.addElement( new String("hello2") );
  -            
  +        v.addElement( str );
  +
           try
           {
               /*
  @@ -203,7 +206,7 @@
   
               try 
               {
  -                template = Runtime.getTemplate(templateFile, encoding);
  +                template = RuntimeSingleton.getTemplate(templateFile, encoding);
               }
               catch( ResourceNotFoundException rnfe )
               {
  @@ -233,10 +236,13 @@
               context.put("vector", v);
               context.put("mystring", new String());
               context.put("hashmap", new HashMap() );
  -            context.put("runtime", new FieldMethodizer( "org.apache.velocity.runtime.Runtime" ));
  +            context.put("runtime", new FieldMethodizer( "org.apache.velocity.runtime.RuntimeSingleton" ));
               context.put("fmprov", new FieldMethodizer( provider ));
               context.put("Floog", "floogie woogie");
  +            context.put("geirstring", str );
  +            context.put("mylong", new Long(5) );
   
  +
               /*
                *  we want to make sure we test all types of iterative objects
                *  in #foreach()
  @@ -251,7 +257,7 @@
   
               String stest = " My name is $name -> $Floog";
               StringWriter w = new StringWriter();
  -            Velocity.evaluate( context, w, "evaltest",stest );
  +            //            Velocity.evaluate( context, w, "evaltest",stest );
               //            System.out.println("Eval = " + w );
   
               w = new StringWriter();
  @@ -275,10 +281,12 @@
                *  make a writer, and merge the template 'against' the context
                */
   
  +            VelocityContext vc = new VelocityContext( context );
  +
               if( template != null)
               {
  -                writer = new BufferedWriter(new OutputStreamWriter(System.out));
  -                template.merge( context , writer);
  +                writer = new BufferedWriter(new OutputStreamWriter(System.out, encoding));
  +                template.merge( vc , writer);
                   writer.flush();
                   writer.close();
               }
  @@ -290,19 +298,22 @@
           }
           catch( Exception e )
           {
  -            Runtime.error(e);
  +            RuntimeSingleton.error( "Test- exception : " + e);
  +            e.printStackTrace();
  +
           }
       }
   
       public Object referenceInsert( String reference, Object value  )
       {
  -        System.out.println("Woo! referenceInsert : " + reference + " = " + value.toString() );
  +        if (value != null)
  +            ; // System.out.println("Woo! referenceInsert : " + reference + " = " + value.toString() );
           return value;
       }
   
       public boolean shouldLogOnNullSet( String lhs, String rhs )
       {
  -        System.out.println("Woo2! nullSetLogMessage : " + lhs + " :  RHS = " + rhs);
  +        //        System.out.println("Woo2! nullSetLogMessage : " + lhs + " :  RHS = " + rhs);
   
           if (lhs.equals("$woogie"))
               return false;
  
  
  
  1.19      +5 -2      jakarta-velocity/src/java/org/apache/velocity/test/provider/TestProvider.java
  
  Index: TestProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/provider/TestProvider.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TestProvider.java	2001/07/18 09:16:19	1.18
  +++ TestProvider.java	2001/08/07 22:20:29	1.19
  @@ -62,7 +62,7 @@
    * is traversed and dynamic content generated.
    *
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: TestProvider.java,v 1.18 2001/07/18 09:16:19 dlr Exp $
  + * @version $Id: TestProvider.java,v 1.19 2001/08/07 22:20:29 geirm Exp $
    */
   public class TestProvider
   {
  @@ -383,12 +383,15 @@
       public String getFoo()
           throws Exception
       {
  +        System.out.println("Hello from getfoo");
  +
           throw new Exception("From getFoo()");
       }
   
       public String getThrow()
           throws Exception
       {
  -        throw new Exception("From getThrow()");
  +        System.out.println("Hello from geThrow");
  +       throw new Exception("From getThrow()");
       }
   }
  
  
  
  1.5       +4 -4      jakarta-velocity/src/java/org/apache/velocity/test/view/TemplateNodeView.java
  
  Index: TemplateNodeView.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/view/TemplateNodeView.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TemplateNodeView.java	2001/04/22 18:22:30	1.4
  +++ TemplateNodeView.java	2001/08/07 22:20:29	1.5
  @@ -60,7 +60,7 @@
   import java.io.BufferedReader;
   import java.io.InputStreamReader;
   
  -import org.apache.velocity.runtime.Runtime;
  +import org.apache.velocity.runtime.RuntimeSingleton;
   
   import org.apache.velocity.runtime.visitor.NodeViewMode;
   import org.apache.velocity.runtime.parser.node.SimpleNode;
  @@ -95,15 +95,15 @@
       {
           try
           {
  -            Runtime.init("velocity.properties");
  +            RuntimeSingleton.init("velocity.properties");
   
               InputStreamReader isr = new InputStreamReader(
                                          new FileInputStream(template),
  -                                       Runtime.getString(Runtime.INPUT_ENCODING));
  +                                       RuntimeSingleton.getString(RuntimeSingleton.INPUT_ENCODING));
   
               BufferedReader br = new BufferedReader( isr );
                                            
  -            document = Runtime.parse( br, template);
  +            document = RuntimeSingleton.parse( br, template);
   
               visitor = new NodeViewMode();
               visitor.setContext(null);