You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jv...@locus.apache.org on 2000/11/16 02:51:26 UTC

cvs commit: jakarta-velocity/src/java/org/apache/velocity/test IntrospectorTestCase.java VelocityTestSuite.java

jvanzyl     00/11/15 17:51:25

  Modified:    src/java/org/apache/velocity/test IntrospectorTestCase.java
                        VelocityTestSuite.java
  Log:
  - made some changes to the testbed to accomodate the changes in
    the loading mechanism.
  
  Revision  Changes    Path
  1.3       +12 -6     jakarta-velocity/src/java/org/apache/velocity/test/IntrospectorTestCase.java
  
  Index: IntrospectorTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/IntrospectorTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IntrospectorTestCase.java	2000/11/10 05:15:46	1.2
  +++ IntrospectorTestCase.java	2000/11/16 01:51:25	1.3
  @@ -66,8 +66,12 @@
    * the Java Reflection API to determine the correct
    * signature of the methods used in VTL templates.
    *
  + * This should be split into separate tests for each
  + * of the methods searched for but this is a start
  + * for now.
  + *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: IntrospectorTestCase.java,v 1.2 2000/11/10 05:15:46 jvanzyl Exp $
  + * @version $Id: IntrospectorTestCase.java,v 1.3 2000/11/16 01:51:25 jvanzyl Exp $
    */
   public class IntrospectorTestCase extends BaseTestCase
   {
  @@ -176,9 +180,9 @@
               int totalFailures = failures.size();
               if (totalFailures > 0)
               {
  -                StringBuffer sb = new StringBuffer("Introspection Errors:\n");
  +                StringBuffer sb = new StringBuffer("\nIntrospection Errors:\n");
                   for (int i = 0; i < totalFailures; i++)
  -                    sb.append((String) failures.get(i));
  +                    sb.append((String) failures.get(i)).append("\n");
               
                   fail(sb.toString());
               }                    
  @@ -197,7 +201,9 @@
         */
       public static junit.framework.Test suite ()
       {
  -        return new VelocityTestSuite();
  +        TestSuite suite = new TestSuite();
  +        suite.addTest(new IntrospectorTestCase("Introspector Tests"));
  +        return suite;
       }
   
       static class MethodProvider
  @@ -207,10 +213,10 @@
            */
           public String booleanMethod (boolean p) { return "boolean"; }
           public String byteMethod (byte p) { return "byte"; }
  -        public String characterMethod (char p) { return "char"; }
  +        public String characterMethod (char p) { return "character"; }
           public String doubleMethod (double p) { return "double"; }
           public String floatMethod (float p) { return "float"; }
  -        public String integerMethod (int p) { return "int"; }
  +        public String integerMethod (int p) { return "integer"; }
           public String longMethod (long p) { return "long"; }
           public String shortMethod (short p) { return "short"; }
       }
  
  
  
  1.8       +6 -8      jakarta-velocity/src/java/org/apache/velocity/test/VelocityTestSuite.java
  
  Index: VelocityTestSuite.java
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/src/java/org/apache/velocity/test/VelocityTestSuite.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- VelocityTestSuite.java	2000/10/23 20:46:00	1.7
  +++ VelocityTestSuite.java	2000/11/16 01:51:25	1.8
  @@ -71,7 +71,7 @@
    *
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
  - * @version $Id: VelocityTestSuite.java,v 1.7 2000/10/23 20:46:00 jvanzyl Exp $
  + * @version $Id: VelocityTestSuite.java,v 1.8 2000/11/16 01:51:25 jvanzyl Exp $
    */
   public class VelocityTestSuite extends TestSuite
   {
  @@ -79,10 +79,10 @@
        * Path to test templates relative to the build directory
        * where the tests will be started from.
        */
  -     private final static String TEST_TEMPLATE_PATH =
  -        "../test/templates";
  -
        private final static String TEST_PROPERTIES =
  +        "org/apache/velocity/test/defaults/velocity.properties";
  +
  +     private final static String TEST_CASE_PROPERTIES =
           "../test/test.properties";
   
       private Properties testProperties;
  @@ -96,12 +96,10 @@
   
           try
           {
  -            Runtime.setDefaultProperties();
  -            Runtime.setProperty(Runtime.TEMPLATE_PATH, TEST_TEMPLATE_PATH);
  -            Runtime.init();
  +            Runtime.init(TEST_PROPERTIES);
               
               testProperties = new Properties();
  -            testProperties.load(new FileInputStream(TEST_PROPERTIES));
  +            testProperties.load(new FileInputStream(TEST_CASE_PROPERTIES));
           }
           catch (Exception e)
           {