dlr         00/10/23 15:29:49

  Modified:    src/java/org/apache/velocity/test VelocityTest.java
  Log:
  - Removed code duplicated in TemplateTestCase.
  - Sole purpose of this test is currently to be the "head" test which
    returns the appropriate test suite, JUnit style.
  
  Revision  Changes    Path
  1.7       +3 -58     
jakarta-velocity/src/java/org/apache/velocity/test/VelocityTest.java
  
  Index: VelocityTest.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/VelocityTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- VelocityTest.java 2000/10/22 22:57:34     1.6
  +++ VelocityTest.java 2000/10/23 22:29:47     1.7
  @@ -56,41 +56,20 @@
   
   import junit.framework.*;
   
  -import java.util.ArrayList;
  -import java.util.Hashtable;
  -
  -import org.apache.velocity.Context;
  -import org.apache.velocity.Template;
  -import org.apache.velocity.runtime.Runtime;
  -import org.apache.velocity.test.provider.TestProvider;
  -
   /**
    * Automated test case for Apache Velocity.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
  - * @version $Id: VelocityTest.java,v 1.6 2000/10/22 22:57:34 dlr Exp $
  + * @version $Id: VelocityTest.java,v 1.7 2000/10/23 22:29:47 dlr Exp $
    */
  -public class VelocityTest extends TemplateTestCase
  +public class VelocityTest extends BaseTestCase
   {
       /**
  -     * The name of the test case's template file.
  -     */
  -    private static final String TEMPLATE_FILE_NAME = "test.vm";
  -
  -    private TestProvider provider;
  -    private ArrayList al;
  -    private Hashtable h;
  -
  -    /**
        * Creates a new instance.
        */
       public VelocityTest (String name)
       {
           super(name);
  -
  -        provider = new TestProvider();
  -        al = provider.getCustomers();
  -        h = new Hashtable();
       }
   
       /**
  @@ -99,41 +78,7 @@
        * @return The <code>TestSuite</code> to run.
        */
       public static junit.framework.Test suite ()
  -    {
  -        return TemplateTestCase.suite();
  -    }
  -
  -    /**
  -     * Sets up the test.
  -     */
  -    protected void setUp ()
  -    {
  -        h.put("Bar", "this is from a hashtable!");
  -    }
  -
  -    /**
  -     * Runs the test.
  -     */
  -    public void runTest ()
       {
  -        try
  -        {
  -            Context context = new Context();
  -            context.put("provider", provider);
  -            context.put("name", "jason");
  -            context.put("providers", provider.getCustomers2());
  -            context.put("list", al);
  -            context.put("hashtable", h);
  -            context.put("search", provider.getSearch());
  -            context.put("relatedSearches", provider.getRelSearches());
  -            context.put("searchResults", provider.getRelSearches());
  -            
  -            Template template = Runtime.getTemplate(TEMPLATE_FILE_NAME);
  -            template.merge(context, getWriter(System.out));
  -        }
  -        catch (Exception e)
  -        {
  -            fail(e.getMessage());
  -        }
  +        return BaseTestCase.suite();
       }
   }
  
  
  

Reply via email to