You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by dl...@apache.org on 2005/06/22 01:22:27 UTC
svn commit: r191743 [3/5] - in /jakarta/velocity/core/trunk: build/xsl/
contrib/temporary/localdirective/ contrib/temporary/stderrlogsystem/
contrib/temporary/struts-velocity/
contrib/temporary/struts-velocity/src/java/org/apache/velocity/struts/
contr...
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/ResourceManager.java Tue Jun 21 16:22:20 2005
@@ -28,7 +28,7 @@
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:paulo.gaspar@krankikom.de">Paulo Gaspar</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: ResourceManager.java,v 1.36 2004/03/19 17:13:37 dlr Exp $
+ * @version $Id$
*/
public interface ResourceManager
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarHolder.java Tue Jun 21 16:22:20 2005
@@ -32,7 +32,7 @@
* A small wrapper around a Jar
*
* @author <a href="mailto:daveb@miceda-data.com">Dave Bryson</a>
- * @version $Id: JarHolder.java,v 1.10 2004/03/19 17:13:37 dlr Exp $
+ * @version $Id$
*/
public class JarHolder
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/JarResourceLoader.java Tue Jun 21 16:22:20 2005
@@ -54,7 +54,7 @@
* </p>
*
* @author <a href="mailto:daveb@miceda-data.com">Dave Bryson</a>
- * @version $Id: JarResourceLoader.java,v 1.18 2004/03/19 17:13:37 dlr Exp $
+ * @version $Id$
*/
public class JarResourceLoader extends ResourceLoader
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ResourceLoader.java Tue Jun 21 16:22:20 2005
@@ -32,7 +32,7 @@
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: ResourceLoader.java,v 1.16 2004/03/19 17:13:37 dlr Exp $
+ * @version $Id$
*/
public abstract class ResourceLoader
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/visitor/VMReferenceMungeVisitor.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/visitor/VMReferenceMungeVisitor.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/visitor/VMReferenceMungeVisitor.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/visitor/VMReferenceMungeVisitor.java Tue Jun 21 16:22:20 2005
@@ -27,7 +27,7 @@
* the VMProxy stuff more complicated than it is already.
*
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: VMReferenceMungeVisitor.java,v 1.4 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class VMReferenceMungeVisitor extends BaseVisitor
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ArithmeticTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ArithmeticTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ArithmeticTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ArithmeticTestCase.java Tue Jun 21 16:22:20 2005
@@ -1,220 +1,220 @@
-package org.apache.velocity.test;
-
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.apache.velocity.runtime.parser.node.MathUtils;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-/**
- * Test arithmetic operations. Introduced after extending from Integer-only
- * to Number-handling.
- *
- * @author <a href="mailto:pero@antaramusic.de">Peter Romianowski</a>
- */
-public class ArithmeticTestCase extends TestCase
-{
-
- public ArithmeticTestCase(String testName)
- {
- super(testName);
- }
-
- public static Test suite()
- {
- return new TestSuite(ArithmeticTestCase.class);
- }
-
- public void testAdd()
- {
- addHelper (new Integer(10), new Short( (short)20), 30, Integer.class);
- addHelper (new Byte((byte)10), new Short( (short)20), 30, Short.class);
- addHelper (new Float(10), new Short( (short)20), 30, Float.class);
- addHelper (new Byte((byte)10), new Double( 20), 30, Double.class);
- addHelper (BigInteger.valueOf(10), new Integer( 20), 30, BigInteger.class);
- addHelper (new Integer( 20), BigDecimal.valueOf(10), 30, BigDecimal.class);
-
- // Test overflow
- addHelper (new Integer(Integer.MAX_VALUE), new Short( (short)20), (double)Integer.MAX_VALUE+20, Long.class);
- addHelper (new Integer (20), new Long(Long.MAX_VALUE), (double)Long.MAX_VALUE+20, BigInteger.class);
- addHelper (new Integer (-20), new Long(Long.MIN_VALUE), (double)Long.MIN_VALUE-20, BigInteger.class);
- }
-
- private void addHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
- {
- Number result = MathUtils.add( n1, n2);
- assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
- assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
- }
-
- public void testSubtract()
- {
- subtractHelper (new Integer(100), new Short( (short)20), 80, Integer.class);
- subtractHelper (new Byte((byte)100), new Short( (short)20), 80, Short.class);
- subtractHelper (new Float(100), new Short( (short)20), 80, Float.class);
- subtractHelper (new Byte((byte)100), new Double( 20), 80, Double.class);
- subtractHelper (BigInteger.valueOf(100), new Integer( 20), 80, BigInteger.class);
- subtractHelper (new Integer( 100), BigDecimal.valueOf(20), 80, BigDecimal.class);
-
- // Test overflow
- subtractHelper (new Integer(Integer.MIN_VALUE), new Short( (short)20), (double)Integer.MIN_VALUE-20, Long.class);
- subtractHelper (new Integer (-20), new Long(Long.MAX_VALUE), -20d-(double)Long.MAX_VALUE, BigInteger.class);
- subtractHelper (new Integer (Integer.MAX_VALUE), new Long(Long.MIN_VALUE), (double)Long.MAX_VALUE+(double)Integer.MAX_VALUE, BigInteger.class);
- }
-
- private void subtractHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
- {
- Number result = MathUtils.subtract( n1, n2);
- assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
- assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
- }
-
- public void testMultiply()
- {
- multiplyHelper (new Integer(10), new Short( (short)20), 200, Integer.class);
- multiplyHelper (new Byte((byte)100), new Short( (short)20), 2000, Short.class);
- multiplyHelper (new Byte((byte)100), new Short( (short)2000), 200000, Integer.class);
- multiplyHelper (new Float(100), new Short( (short)20), 2000, Float.class);
- multiplyHelper (new Byte((byte)100), new Double( 20), 2000, Double.class);
- multiplyHelper (BigInteger.valueOf(100), new Integer( 20), 2000, BigInteger.class);
- multiplyHelper (new Integer( 100), BigDecimal.valueOf(20), 2000, BigDecimal.class);
-
- // Test overflow
- multiplyHelper (new Integer(Integer.MAX_VALUE), new Short( (short)10), (double)Integer.MAX_VALUE*10d, Long.class);
- multiplyHelper (new Integer(Integer.MAX_VALUE), new Short( (short)-10), (double)Integer.MAX_VALUE*-10d, Long.class);
- multiplyHelper (new Integer (20), new Long(Long.MAX_VALUE), 20d*(double)Long.MAX_VALUE, BigInteger.class);
- }
-
- private void multiplyHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
- {
- Number result = MathUtils.multiply( n1, n2);
- assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
- assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
- }
-
- public void testDivide()
- {
- divideHelper (new Integer(10), new Short( (short)2), 5, Integer.class);
- divideHelper (new Byte((byte)10), new Short( (short)2), 5, Short.class);
- divideHelper (BigInteger.valueOf(10), new Short( (short)2), 5, BigInteger.class);
- divideHelper (new Integer(10), new Short( (short)4), 2, Integer.class);
- divideHelper (new Integer(10), new Float( 2.5f), 4, Float.class);
- divideHelper (new Integer(10), new Double( 2.5), 4, Double.class);
- divideHelper (new Integer(10), new BigDecimal( 2.5), 4, BigDecimal.class);
- }
-
- private void divideHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
- {
- Number result = MathUtils.divide( n1, n2);
- assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
- assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
- }
-
- public void testModulo()
- {
- moduloHelper (new Integer(10), new Short( (short)2), 0, Integer.class);
- moduloHelper (new Byte((byte)10), new Short( (short)3), 1, Short.class);
- moduloHelper (BigInteger.valueOf(10), new Short( (short)4), 2, BigInteger.class);
- moduloHelper (new Integer(10), new Float( 5.5f), 4.5, Float.class);
- try
- {
- moduloHelper (new Integer(10), new BigDecimal( 2.5), 4, BigDecimal.class);
- fail ("Modulo with BigDecimal is not allowed! Should have thrown an ArithmeticException.");
- } catch( ArithmeticException e)
- {
- }
- }
-
- private void moduloHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
- {
- Number result = MathUtils.modulo( n1, n2);
- assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
- assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
- }
-
- public void testCompare()
- {
- compareHelper (new Integer(10), new Short( (short)10), 0);
- compareHelper (new Integer(10), new Short( (short)11), -1);
- compareHelper (BigInteger.valueOf(10), new Short( (short)11), -1);
- compareHelper (new Byte((byte)10), new Short( (short)3), 1);
- compareHelper (new Float(10), new Short( (short)11), -1);
- compareHelper (new Double(10), new Short( (short)11), -1);
- }
-
- private void compareHelper (Number n1, Number n2, int expectedResult)
- {
- int result = MathUtils.compare( n1, n2 );
- assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result);
- }
-
-/*
-
- COMMENT OUT FOR PERFORMANCE-MEASSUREMENTS
-
- public void testProfile()
- {
-
- long start = System.currentTimeMillis();
-
- Number v1 = new Long (1000);
- Number v2 = new Double (10.23);
- Number result = null;
- for (int a = 0; a < 10000; a++)
- {
-
- result = MathUtils.typeConvert (
- new BigDecimal (v1.doubleValue()).add (
- new BigDecimal (v2.doubleValue())), v1, v2, false);
-
- }
-
- System.out.println ("took: "+(System.currentTimeMillis()-start));
-
- start = System.currentTimeMillis();
- for (int a = 0; a < 10000; a++)
- {
-
- result = MathUtils.divide( v1, v2);
- }
-
- Number result2 = result;
- System.out.println ("took: "+(System.currentTimeMillis()-start));
- }
-
-*/
-
- /**
- * Test additional functions
- */
- public void testIsZero()
- {
- assertTrue (MathUtils.isZero (new Integer (0)));
- assertTrue (!MathUtils.isZero (new Integer (1)));
- assertTrue (!MathUtils.isZero (new Integer (-1)));
-
- assertTrue (MathUtils.isZero (new Float (0f)));
- assertTrue (!MathUtils.isZero (new Float (0.00001f)));
- assertTrue (!MathUtils.isZero (new Float (-0.00001f)));
-
- }
-
-}
+package org.apache.velocity.test;
+
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import org.apache.velocity.runtime.parser.node.MathUtils;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+/**
+ * Test arithmetic operations. Introduced after extending from Integer-only
+ * to Number-handling.
+ *
+ * @author <a href="mailto:pero@antaramusic.de">Peter Romianowski</a>
+ */
+public class ArithmeticTestCase extends TestCase
+{
+
+ public ArithmeticTestCase(String testName)
+ {
+ super(testName);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(ArithmeticTestCase.class);
+ }
+
+ public void testAdd()
+ {
+ addHelper (new Integer(10), new Short( (short)20), 30, Integer.class);
+ addHelper (new Byte((byte)10), new Short( (short)20), 30, Short.class);
+ addHelper (new Float(10), new Short( (short)20), 30, Float.class);
+ addHelper (new Byte((byte)10), new Double( 20), 30, Double.class);
+ addHelper (BigInteger.valueOf(10), new Integer( 20), 30, BigInteger.class);
+ addHelper (new Integer( 20), BigDecimal.valueOf(10), 30, BigDecimal.class);
+
+ // Test overflow
+ addHelper (new Integer(Integer.MAX_VALUE), new Short( (short)20), (double)Integer.MAX_VALUE+20, Long.class);
+ addHelper (new Integer (20), new Long(Long.MAX_VALUE), (double)Long.MAX_VALUE+20, BigInteger.class);
+ addHelper (new Integer (-20), new Long(Long.MIN_VALUE), (double)Long.MIN_VALUE-20, BigInteger.class);
+ }
+
+ private void addHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
+ {
+ Number result = MathUtils.add( n1, n2);
+ assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
+ assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
+ }
+
+ public void testSubtract()
+ {
+ subtractHelper (new Integer(100), new Short( (short)20), 80, Integer.class);
+ subtractHelper (new Byte((byte)100), new Short( (short)20), 80, Short.class);
+ subtractHelper (new Float(100), new Short( (short)20), 80, Float.class);
+ subtractHelper (new Byte((byte)100), new Double( 20), 80, Double.class);
+ subtractHelper (BigInteger.valueOf(100), new Integer( 20), 80, BigInteger.class);
+ subtractHelper (new Integer( 100), BigDecimal.valueOf(20), 80, BigDecimal.class);
+
+ // Test overflow
+ subtractHelper (new Integer(Integer.MIN_VALUE), new Short( (short)20), (double)Integer.MIN_VALUE-20, Long.class);
+ subtractHelper (new Integer (-20), new Long(Long.MAX_VALUE), -20d-(double)Long.MAX_VALUE, BigInteger.class);
+ subtractHelper (new Integer (Integer.MAX_VALUE), new Long(Long.MIN_VALUE), (double)Long.MAX_VALUE+(double)Integer.MAX_VALUE, BigInteger.class);
+ }
+
+ private void subtractHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
+ {
+ Number result = MathUtils.subtract( n1, n2);
+ assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
+ assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
+ }
+
+ public void testMultiply()
+ {
+ multiplyHelper (new Integer(10), new Short( (short)20), 200, Integer.class);
+ multiplyHelper (new Byte((byte)100), new Short( (short)20), 2000, Short.class);
+ multiplyHelper (new Byte((byte)100), new Short( (short)2000), 200000, Integer.class);
+ multiplyHelper (new Float(100), new Short( (short)20), 2000, Float.class);
+ multiplyHelper (new Byte((byte)100), new Double( 20), 2000, Double.class);
+ multiplyHelper (BigInteger.valueOf(100), new Integer( 20), 2000, BigInteger.class);
+ multiplyHelper (new Integer( 100), BigDecimal.valueOf(20), 2000, BigDecimal.class);
+
+ // Test overflow
+ multiplyHelper (new Integer(Integer.MAX_VALUE), new Short( (short)10), (double)Integer.MAX_VALUE*10d, Long.class);
+ multiplyHelper (new Integer(Integer.MAX_VALUE), new Short( (short)-10), (double)Integer.MAX_VALUE*-10d, Long.class);
+ multiplyHelper (new Integer (20), new Long(Long.MAX_VALUE), 20d*(double)Long.MAX_VALUE, BigInteger.class);
+ }
+
+ private void multiplyHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
+ {
+ Number result = MathUtils.multiply( n1, n2);
+ assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
+ assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
+ }
+
+ public void testDivide()
+ {
+ divideHelper (new Integer(10), new Short( (short)2), 5, Integer.class);
+ divideHelper (new Byte((byte)10), new Short( (short)2), 5, Short.class);
+ divideHelper (BigInteger.valueOf(10), new Short( (short)2), 5, BigInteger.class);
+ divideHelper (new Integer(10), new Short( (short)4), 2, Integer.class);
+ divideHelper (new Integer(10), new Float( 2.5f), 4, Float.class);
+ divideHelper (new Integer(10), new Double( 2.5), 4, Double.class);
+ divideHelper (new Integer(10), new BigDecimal( 2.5), 4, BigDecimal.class);
+ }
+
+ private void divideHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
+ {
+ Number result = MathUtils.divide( n1, n2);
+ assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
+ assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
+ }
+
+ public void testModulo()
+ {
+ moduloHelper (new Integer(10), new Short( (short)2), 0, Integer.class);
+ moduloHelper (new Byte((byte)10), new Short( (short)3), 1, Short.class);
+ moduloHelper (BigInteger.valueOf(10), new Short( (short)4), 2, BigInteger.class);
+ moduloHelper (new Integer(10), new Float( 5.5f), 4.5, Float.class);
+ try
+ {
+ moduloHelper (new Integer(10), new BigDecimal( 2.5), 4, BigDecimal.class);
+ fail ("Modulo with BigDecimal is not allowed! Should have thrown an ArithmeticException.");
+ } catch( ArithmeticException e)
+ {
+ }
+ }
+
+ private void moduloHelper (Number n1, Number n2, double expectedResult, Class expectedResultType)
+ {
+ Number result = MathUtils.modulo( n1, n2);
+ assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result.doubleValue(), 0.01);
+ assertEquals ("ResultType does not match.", expectedResultType, result.getClass());
+ }
+
+ public void testCompare()
+ {
+ compareHelper (new Integer(10), new Short( (short)10), 0);
+ compareHelper (new Integer(10), new Short( (short)11), -1);
+ compareHelper (BigInteger.valueOf(10), new Short( (short)11), -1);
+ compareHelper (new Byte((byte)10), new Short( (short)3), 1);
+ compareHelper (new Float(10), new Short( (short)11), -1);
+ compareHelper (new Double(10), new Short( (short)11), -1);
+ }
+
+ private void compareHelper (Number n1, Number n2, int expectedResult)
+ {
+ int result = MathUtils.compare( n1, n2 );
+ assertEquals ("The arithmetic operation produced an unexpected result.", expectedResult, result);
+ }
+
+/*
+
+ COMMENT OUT FOR PERFORMANCE-MEASSUREMENTS
+
+ public void testProfile()
+ {
+
+ long start = System.currentTimeMillis();
+
+ Number v1 = new Long (1000);
+ Number v2 = new Double (10.23);
+ Number result = null;
+ for (int a = 0; a < 10000; a++)
+ {
+
+ result = MathUtils.typeConvert (
+ new BigDecimal (v1.doubleValue()).add (
+ new BigDecimal (v2.doubleValue())), v1, v2, false);
+
+ }
+
+ System.out.println ("took: "+(System.currentTimeMillis()-start));
+
+ start = System.currentTimeMillis();
+ for (int a = 0; a < 10000; a++)
+ {
+
+ result = MathUtils.divide( v1, v2);
+ }
+
+ Number result2 = result;
+ System.out.println ("took: "+(System.currentTimeMillis()-start));
+ }
+
+*/
+
+ /**
+ * Test additional functions
+ */
+ public void testIsZero()
+ {
+ assertTrue (MathUtils.isZero (new Integer (0)));
+ assertTrue (!MathUtils.isZero (new Integer (1)));
+ assertTrue (!MathUtils.isZero (new Integer (-1)));
+
+ assertTrue (MathUtils.isZero (new Float (0f)));
+ assertTrue (!MathUtils.isZero (new Float (0.00001f)));
+ assertTrue (!MathUtils.isZero (new Float (-0.00001f)));
+
+ }
+
+}
Propchange: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ArithmeticTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/BaseTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/BaseTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/BaseTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/BaseTestCase.java Tue Jun 21 16:22:20 2005
@@ -28,7 +28,7 @@
* the rest of the tests.
*
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
- * @version $Id: BaseTestCase.java,v 1.16 2004/03/20 03:35:51 dlr Exp $
+ * @version $Id$
*/
public class BaseTestCase extends TestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClassloaderChangeTest.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClassloaderChangeTest.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClassloaderChangeTest.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClassloaderChangeTest.java Tue Jun 21 16:22:20 2005
@@ -36,7 +36,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: ClassloaderChangeTest.java,v 1.3 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class ClassloaderChangeTest extends TestCase implements LogSystem
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClasspathResourceTest.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClasspathResourceTest.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClasspathResourceTest.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ClasspathResourceTest.java Tue Jun 21 16:22:20 2005
@@ -31,7 +31,7 @@
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:daveb@miceda-data.com">Dave Bryson</a>
- * @version $Id: ClasspathResourceTest.java,v 1.11 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class ClasspathResourceTest extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/CommonsExtPropTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/CommonsExtPropTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/CommonsExtPropTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/CommonsExtPropTestCase.java Tue Jun 21 16:22:20 2005
@@ -31,7 +31,7 @@
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: CommonsExtPropTestCase.java,v 1.4 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class CommonsExtPropTestCase extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ConfigurationTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ConfigurationTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ConfigurationTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ConfigurationTestCase.java Tue Jun 21 16:22:20 2005
@@ -27,7 +27,7 @@
* Tests for the Configuration class.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: ConfigurationTestCase.java,v 1.7 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*
* @deprecated Will be removed when Configuration class is removed
*/
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ContextSafetyTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ContextSafetyTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ContextSafetyTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ContextSafetyTestCase.java Tue Jun 21 16:22:20 2005
@@ -40,7 +40,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.12 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class ContextSafetyTestCase extends BaseTestCase implements TemplateTestBase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EncodingTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EncodingTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EncodingTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EncodingTestCase.java Tue Jun 21 16:22:20 2005
@@ -40,7 +40,7 @@
*
*
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: EncodingTestCase.java,v 1.6 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class EncodingTestCase extends BaseTestCase implements TemplateTestBase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EventHandlingTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EventHandlingTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EventHandlingTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/EventHandlingTestCase.java Tue Jun 21 16:22:20 2005
@@ -38,7 +38,7 @@
* Tests event handling
*
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: EventHandlingTestCase.java,v 1.7 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class EventHandlingTestCase extends TestCase implements ReferenceInsertionEventHandler,
NullSetEventHandler, MethodExceptionEventHandler,
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ExternalLoggerTest.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ExternalLoggerTest.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ExternalLoggerTest.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ExternalLoggerTest.java Tue Jun 21 16:22:20 2005
@@ -27,7 +27,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.6 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class ExternalLoggerTest extends TestCase implements LogSystem
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/InlineScopeVMTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/InlineScopeVMTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/InlineScopeVMTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/InlineScopeVMTestCase.java Tue Jun 21 16:22:20 2005
@@ -39,7 +39,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.13 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class InlineScopeVMTestCase extends BaseTestCase implements TemplateTestBase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase.java Tue Jun 21 16:22:20 2005
@@ -34,7 +34,7 @@
* for now.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: IntrospectorTestCase.java,v 1.12 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class IntrospectorTestCase extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase2.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase2.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase2.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase2.java Tue Jun 21 16:22:20 2005
@@ -32,7 +32,7 @@
*
*
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
- * @version $Id: IntrospectorTestCase2.java,v 1.3 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class IntrospectorTestCase2 extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase3.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase3.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase3.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/IntrospectorTestCase3.java Tue Jun 21 16:22:20 2005
@@ -31,7 +31,7 @@
* Simple introspector test case for primitive problem found in 1.3
*
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
- * @version $Id: IntrospectorTestCase3.java,v 1.4 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class IntrospectorTestCase3 extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MiscTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MiscTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MiscTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MiscTestCase.java Tue Jun 21 16:22:20 2005
@@ -26,7 +26,7 @@
* anywhere else, it goes here
*
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
- * @version $Id: MiscTestCase.java,v 1.3 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class MiscTestCase extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultiLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultiLoaderTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultiLoaderTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultiLoaderTestCase.java Tue Jun 21 16:22:20 2005
@@ -38,7 +38,7 @@
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:daveb@miceda-data.com">Dave Bryson</a>
- * @version $Id: MultiLoaderTestCase.java,v 1.6 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class MultiLoaderTestCase extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultipleFileResourcePathTest.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultipleFileResourcePathTest.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultipleFileResourcePathTest.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/MultipleFileResourcePathTest.java Tue Jun 21 16:22:20 2005
@@ -39,7 +39,7 @@
* Multiple paths in the file resource loader.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: MultipleFileResourcePathTest.java,v 1.10 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class MultipleFileResourcePathTest extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ParserTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ParserTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ParserTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ParserTestCase.java Tue Jun 21 16:22:20 2005
@@ -29,7 +29,7 @@
* isn't enough.
*
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
- * @version $Id: ParserTestCase.java,v 1.3 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class ParserTestCase extends TestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ResourceLoaderInstanceTest.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ResourceLoaderInstanceTest.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ResourceLoaderInstanceTest.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ResourceLoaderInstanceTest.java Tue Jun 21 16:22:20 2005
@@ -1,141 +1,141 @@
-package org.apache.velocity.test;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.io.BufferedWriter;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.runtime.RuntimeSingleton;
-import org.apache.velocity.runtime.resource.loader.FileResourceLoader;
-import org.apache.velocity.runtime.resource.loader.ResourceLoader;
-
-/**
- * Test that an instance of a ResourceLoader can be successfully passed in.
- *
- * @author <a href="mailto:wglass@apache.org">Will Glass-Husain</a>
- * @version $Id$
- */
-public class ResourceLoaderInstanceTest extends BaseTestCase
-{
- /**
- * VTL file extension.
- */
- private static final String TMPL_FILE_EXT = "vm";
-
- /**
- * Comparison file extension.
- */
- private static final String CMP_FILE_EXT = "cmp";
-
- /**
- * Comparison file extension.
- */
- private static final String RESULT_FILE_EXT = "res";
-
- /**
- * Path for templates. This property will override the
- * value in the default velocity properties file.
- */
- private final static String FILE_RESOURCE_LOADER_PATH = "../test/resourceinstance";
-
- /**
- * Results relative to the build directory.
- */
- private static final String RESULTS_DIR = "../test/resourceinstance/results";
-
- /**
- * Results relative to the build directory.
- */
- private static final String COMPARE_DIR = "../test/resourceinstance/compare";
-
- /**
- * Default constructor.
- */
- ResourceLoaderInstanceTest()
- {
- super("ResourceLoaderInstanceTest");
-
- try
- {
- assureResultsDirectoryExists(RESULTS_DIR);
-
- ResourceLoader rl = new FileResourceLoader();
-
- // pass in an instance to Velocity
- Velocity.addProperty( "resource.loader", "testrl" );
- Velocity.setProperty( "testrl.resource.loader.instance", rl );
- Velocity.setProperty( "testrl.resource.loader.path", FILE_RESOURCE_LOADER_PATH );
-
- Velocity.init();
- }
- catch (Exception e)
- {
- System.err.println("Cannot setup ResourceLoaderInstanceTest!");
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- public static junit.framework.Test suite ()
- {
- return new ResourceLoaderInstanceTest();
- }
-
- /**
- * Runs the test.
- */
- public void runTest ()
- {
- try
- {
- Template template = RuntimeSingleton.getTemplate(
- getFileName(null, "testfile", TMPL_FILE_EXT));
-
- FileOutputStream fos =
- new FileOutputStream (
- getFileName(RESULTS_DIR, "testfile", RESULT_FILE_EXT));
-
-
- Writer writer = new BufferedWriter(new OutputStreamWriter(fos));
-
- /*
- * put the Vector into the context, and merge both
- */
-
- VelocityContext context = new VelocityContext();
-
- template.merge(context, writer);
- writer.flush();
- writer.close();
-
- if ( !isMatch(RESULTS_DIR, COMPARE_DIR, "testfile",
- RESULT_FILE_EXT, CMP_FILE_EXT) )
- {
- fail("Output incorrect.");
- }
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
- }
-}
+package org.apache.velocity.test;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.BufferedWriter;
+import java.io.FileOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.runtime.RuntimeSingleton;
+import org.apache.velocity.runtime.resource.loader.FileResourceLoader;
+import org.apache.velocity.runtime.resource.loader.ResourceLoader;
+
+/**
+ * Test that an instance of a ResourceLoader can be successfully passed in.
+ *
+ * @author <a href="mailto:wglass@apache.org">Will Glass-Husain</a>
+ * @version $Id$
+ */
+public class ResourceLoaderInstanceTest extends BaseTestCase
+{
+ /**
+ * VTL file extension.
+ */
+ private static final String TMPL_FILE_EXT = "vm";
+
+ /**
+ * Comparison file extension.
+ */
+ private static final String CMP_FILE_EXT = "cmp";
+
+ /**
+ * Comparison file extension.
+ */
+ private static final String RESULT_FILE_EXT = "res";
+
+ /**
+ * Path for templates. This property will override the
+ * value in the default velocity properties file.
+ */
+ private final static String FILE_RESOURCE_LOADER_PATH = "../test/resourceinstance";
+
+ /**
+ * Results relative to the build directory.
+ */
+ private static final String RESULTS_DIR = "../test/resourceinstance/results";
+
+ /**
+ * Results relative to the build directory.
+ */
+ private static final String COMPARE_DIR = "../test/resourceinstance/compare";
+
+ /**
+ * Default constructor.
+ */
+ ResourceLoaderInstanceTest()
+ {
+ super("ResourceLoaderInstanceTest");
+
+ try
+ {
+ assureResultsDirectoryExists(RESULTS_DIR);
+
+ ResourceLoader rl = new FileResourceLoader();
+
+ // pass in an instance to Velocity
+ Velocity.addProperty( "resource.loader", "testrl" );
+ Velocity.setProperty( "testrl.resource.loader.instance", rl );
+ Velocity.setProperty( "testrl.resource.loader.path", FILE_RESOURCE_LOADER_PATH );
+
+ Velocity.init();
+ }
+ catch (Exception e)
+ {
+ System.err.println("Cannot setup ResourceLoaderInstanceTest!");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ public static junit.framework.Test suite ()
+ {
+ return new ResourceLoaderInstanceTest();
+ }
+
+ /**
+ * Runs the test.
+ */
+ public void runTest ()
+ {
+ try
+ {
+ Template template = RuntimeSingleton.getTemplate(
+ getFileName(null, "testfile", TMPL_FILE_EXT));
+
+ FileOutputStream fos =
+ new FileOutputStream (
+ getFileName(RESULTS_DIR, "testfile", RESULT_FILE_EXT));
+
+
+ Writer writer = new BufferedWriter(new OutputStreamWriter(fos));
+
+ /*
+ * put the Vector into the context, and merge both
+ */
+
+ VelocityContext context = new VelocityContext();
+
+ template.merge(context, writer);
+ writer.flush();
+ writer.close();
+
+ if ( !isMatch(RESULTS_DIR, COMPARE_DIR, "testfile",
+ RESULT_FILE_EXT, CMP_FILE_EXT) )
+ {
+ fail("Output incorrect.");
+ }
+ }
+ catch (Exception e)
+ {
+ fail(e.getMessage());
+ }
+ }
+}
Propchange: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/ResourceLoaderInstanceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestBase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestBase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestBase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestBase.java Tue Jun 21 16:22:20 2005
@@ -21,7 +21,7 @@
* strings that are of use when testing templates.
*
* @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
- * @version $Id: TemplateTestBase.java,v 1.4 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public interface TemplateTestBase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestSuite.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestSuite.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestSuite.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TemplateTestSuite.java Tue Jun 21 16:22:20 2005
@@ -34,7 +34,7 @@
* @author <a href="mailto:jvanzyl@apache.org">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: TemplateTestSuite.java,v 1.8 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class TemplateTestSuite extends TestSuite implements TemplateTestBase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TestNumberMethodCalls.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TestNumberMethodCalls.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TestNumberMethodCalls.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TestNumberMethodCalls.java Tue Jun 21 16:22:20 2005
@@ -1,151 +1,151 @@
-package org.apache.velocity.test;
-
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import junit.framework.TestCase;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.context.Context;
-import org.apache.velocity.runtime.RuntimeServices;
-import org.apache.velocity.test.provider.NumberMethods;
-
-import java.io.StringWriter;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-
-/**
- * Used to check that method calls with number parameters are executed correctly.
- *
- * @author <a href="mailto:wglass@forio.com">Peter Romianowski</a>
- * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
- */
-public class TestNumberMethodCalls extends TestCase
-{
- private VelocityEngine ve = null;
-
- private final static boolean PRINT_RESULTS = false;
-
- /**
- * Default constructor.
- */
- public TestNumberMethodCalls()
- {
- super("TestNumberMethodCalls");
-
- try
- {
- ve = new VelocityEngine();
- ve.init();
- }
- catch (Exception e)
- {
- System.err.println("Cannot setup TestNumberMethodCalls : " + e);
- System.exit(1);
- }
- }
-
- public void init( RuntimeServices rs )
- {
- // do nothing with it
- }
-
- public static junit.framework.Test suite ()
- {
- return new TestNumberMethodCalls();
- }
-
- /**
- * Runs the test.
- */
- public void runTest ()
- {
-
- try
- {
- VelocityContext vc = new VelocityContext();
-
- // context object with overloaded methods with number arguments
- vc.put("Test",new NumberMethods());
-
- // numbers for context
- vc.put("AByte",new Byte("10"));
- vc.put("AShort",new Short("10"));
- vc.put("AInteger",new Integer(10));
- vc.put("ALong",new Long(10));
- vc.put("ADouble",new Double(10));
- vc.put("AFloat",new Float(10));
- vc.put("ABigDecimal",new BigDecimal(10));
- vc.put("ABigInteger",new BigInteger("10"));
-
- // check context objects
- System.out.println("Testing: method calls with arguments as context objects");
- checkResults(vc,"$Test.numMethod($AByte)","byte (10)");
- checkResults(vc,"$Test.numMethod($AShort)","short (10)");
- checkResults(vc,"$Test.numMethod($AInteger)","int (10)");
- checkResults(vc,"$Test.numMethod($ADouble)","double (10.0)");
- checkResults(vc,"$Test.numMethod($AFloat)","double (10.0)");
- checkResults(vc,"$Test.numMethod($ALong)","long (10)");
- checkResults(vc,"$Test.numMethod($ABigDecimal)","BigDecimal (10)");
- checkResults(vc,"$Test.numMethod($ABigInteger)","BigInteger (10)");
-
- // check literals
- // -- will cast floating point literal to smallest possible of Double, BigDecimal
- // -- will cast integer literal to smallest possible of Integer, Long, BigInteger
- System.out.println("Testing: method calls with arguments as literals");
- checkResults(vc,"$Test.numMethod(10.0)","double (10.0)");
- checkResults(vc,"$Test.numMethod(10)","int (10)");
- checkResults(vc,"$Test.numMethod(10000000000)","long (10000000000)");
- checkResults(vc,"$Test.numMethod(10000000000000000000000)","BigInteger (10000000000000000000000)");
-
- // check calculated results
- // -- note calculated value is cast to smallest possible type
- // -- method invoked is smallest relevant method
- // -- it's an unusual case here of both byte and int methods, but this works as expected
- System.out.println("Testing: method calls with arguments as calculated values");
- checkResults(vc,"#set($val = 10.0 + 1.5)$Test.numMethod($val)","double (11.5)");
- checkResults(vc,"#set($val = 100 + 1)$Test.numMethod($val)","int (101)");
- checkResults(vc,"#set($val = 100 * 1000)$Test.numMethod($val)","int (100000)");
- checkResults(vc,"#set($val = 100 + 1.5)$Test.numMethod($val)","double (101.5)");
- checkResults(vc,"#set($val = $ALong + $AInteger)$Test.numMethod($val)","long (20)");
- checkResults(vc,"#set($val = $ABigInteger + $AInteger)$Test.numMethod($val)","BigInteger (20)");
-
- }
- catch( Exception ee )
- {
- System.out.println("error in test: " + ee );
- }
-
- }
-
-
- private void checkResults(Context vc, String template, String compare) throws Exception
- {
-
- StringWriter writer = new StringWriter();
- ve.evaluate( vc, writer, "test", template);
- assertEquals("Incorrect results for template '" + template + "'.",compare,writer.toString());
-
- if (PRINT_RESULTS)
- System.out.println ("Method call successful: " + template);
-
- }
-
-
-}
-
-
+package org.apache.velocity.test;
+
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import junit.framework.TestCase;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.context.Context;
+import org.apache.velocity.runtime.RuntimeServices;
+import org.apache.velocity.test.provider.NumberMethods;
+
+import java.io.StringWriter;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+
+/**
+ * Used to check that method calls with number parameters are executed correctly.
+ *
+ * @author <a href="mailto:wglass@forio.com">Peter Romianowski</a>
+ * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
+ */
+public class TestNumberMethodCalls extends TestCase
+{
+ private VelocityEngine ve = null;
+
+ private final static boolean PRINT_RESULTS = false;
+
+ /**
+ * Default constructor.
+ */
+ public TestNumberMethodCalls()
+ {
+ super("TestNumberMethodCalls");
+
+ try
+ {
+ ve = new VelocityEngine();
+ ve.init();
+ }
+ catch (Exception e)
+ {
+ System.err.println("Cannot setup TestNumberMethodCalls : " + e);
+ System.exit(1);
+ }
+ }
+
+ public void init( RuntimeServices rs )
+ {
+ // do nothing with it
+ }
+
+ public static junit.framework.Test suite ()
+ {
+ return new TestNumberMethodCalls();
+ }
+
+ /**
+ * Runs the test.
+ */
+ public void runTest ()
+ {
+
+ try
+ {
+ VelocityContext vc = new VelocityContext();
+
+ // context object with overloaded methods with number arguments
+ vc.put("Test",new NumberMethods());
+
+ // numbers for context
+ vc.put("AByte",new Byte("10"));
+ vc.put("AShort",new Short("10"));
+ vc.put("AInteger",new Integer(10));
+ vc.put("ALong",new Long(10));
+ vc.put("ADouble",new Double(10));
+ vc.put("AFloat",new Float(10));
+ vc.put("ABigDecimal",new BigDecimal(10));
+ vc.put("ABigInteger",new BigInteger("10"));
+
+ // check context objects
+ System.out.println("Testing: method calls with arguments as context objects");
+ checkResults(vc,"$Test.numMethod($AByte)","byte (10)");
+ checkResults(vc,"$Test.numMethod($AShort)","short (10)");
+ checkResults(vc,"$Test.numMethod($AInteger)","int (10)");
+ checkResults(vc,"$Test.numMethod($ADouble)","double (10.0)");
+ checkResults(vc,"$Test.numMethod($AFloat)","double (10.0)");
+ checkResults(vc,"$Test.numMethod($ALong)","long (10)");
+ checkResults(vc,"$Test.numMethod($ABigDecimal)","BigDecimal (10)");
+ checkResults(vc,"$Test.numMethod($ABigInteger)","BigInteger (10)");
+
+ // check literals
+ // -- will cast floating point literal to smallest possible of Double, BigDecimal
+ // -- will cast integer literal to smallest possible of Integer, Long, BigInteger
+ System.out.println("Testing: method calls with arguments as literals");
+ checkResults(vc,"$Test.numMethod(10.0)","double (10.0)");
+ checkResults(vc,"$Test.numMethod(10)","int (10)");
+ checkResults(vc,"$Test.numMethod(10000000000)","long (10000000000)");
+ checkResults(vc,"$Test.numMethod(10000000000000000000000)","BigInteger (10000000000000000000000)");
+
+ // check calculated results
+ // -- note calculated value is cast to smallest possible type
+ // -- method invoked is smallest relevant method
+ // -- it's an unusual case here of both byte and int methods, but this works as expected
+ System.out.println("Testing: method calls with arguments as calculated values");
+ checkResults(vc,"#set($val = 10.0 + 1.5)$Test.numMethod($val)","double (11.5)");
+ checkResults(vc,"#set($val = 100 + 1)$Test.numMethod($val)","int (101)");
+ checkResults(vc,"#set($val = 100 * 1000)$Test.numMethod($val)","int (100000)");
+ checkResults(vc,"#set($val = 100 + 1.5)$Test.numMethod($val)","double (101.5)");
+ checkResults(vc,"#set($val = $ALong + $AInteger)$Test.numMethod($val)","long (20)");
+ checkResults(vc,"#set($val = $ABigInteger + $AInteger)$Test.numMethod($val)","BigInteger (20)");
+
+ }
+ catch( Exception ee )
+ {
+ System.out.println("error in test: " + ee );
+ }
+
+ }
+
+
+ private void checkResults(Context vc, String template, String compare) throws Exception
+ {
+
+ StringWriter writer = new StringWriter();
+ ve.evaluate( vc, writer, "test", template);
+ assertEquals("Incorrect results for template '" + template + "'.",compare,writer.toString());
+
+ if (PRINT_RESULTS)
+ System.out.println ("Method call successful: " + template);
+
+ }
+
+
+}
+
+
Propchange: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TestNumberMethodCalls.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenClasspathTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenClasspathTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenClasspathTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenClasspathTestCase.java Tue Jun 21 16:22:20 2005
@@ -26,7 +26,7 @@
* generative task and compares the output.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: TexenClasspathTestCase.java,v 1.5 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class TexenClasspathTestCase
extends BaseTestCase
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/TexenTestCase.java Tue Jun 21 16:22:20 2005
@@ -26,7 +26,7 @@
* generative task and compares the output.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: TexenTestCase.java,v 1.8 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class TexenTestCase extends BaseTestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocimacroTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocimacroTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocimacroTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocimacroTestCase.java Tue Jun 21 16:22:20 2005
@@ -38,7 +38,7 @@
* This class tests strange Velocimacro issues.
*
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: VelocimacroTestCase.java,v 1.3 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class VelocimacroTestCase extends TestCase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocityAppTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocityAppTestCase.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocityAppTestCase.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/VelocityAppTestCase.java Tue Jun 21 16:22:20 2005
@@ -39,7 +39,7 @@
*
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
* @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
- * @version $Id: VelocityAppTestCase.java,v 1.5 2004/03/19 17:13:38 dlr Exp $
+ * @version $Id$
*/
public class VelocityAppTestCase extends BaseTestCase implements TemplateTestBase
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/misc/Test.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/misc/Test.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/misc/Test.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/misc/Test.java Tue Jun 21 16:22:20 2005
@@ -58,7 +58,7 @@
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
- * @version $Id: Test.java,v 1.36 2004/03/19 17:13:39 dlr Exp $
+ * @version $Id$
*/
public class Test implements ReferenceInsertionEventHandler,
NullSetEventHandler,
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Child.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Child.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Child.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Child.java Tue Jun 21 16:22:20 2005
@@ -22,7 +22,7 @@
* class.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: Child.java,v 1.7 2004/03/19 17:13:39 dlr Exp $
+ * @version $Id$
*/
public class Child extends Person
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/ForeachMethodCallHelper.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/ForeachMethodCallHelper.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/ForeachMethodCallHelper.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/ForeachMethodCallHelper.java Tue Jun 21 16:22:20 2005
@@ -1,28 +1,28 @@
-package org.apache.velocity.test.provider;
-
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Provides overloaded methods for testing method execution within a foreach
- * @author <a href="mailto:wglass@apache.org">Will Glass-Husain</a>
- * @version $Id$
- */
-public class ForeachMethodCallHelper
-{
- public String getFoo(Integer v) { return "int "+v; }
- public String getFoo(String v) { return "str "+v; }
-}
+package org.apache.velocity.test.provider;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Provides overloaded methods for testing method execution within a foreach
+ * @author <a href="mailto:wglass@apache.org">Will Glass-Husain</a>
+ * @version $Id$
+ */
+public class ForeachMethodCallHelper
+{
+ public String getFoo(Integer v) { return "int "+v; }
+ public String getFoo(String v) { return "str "+v; }
+}
Propchange: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/ForeachMethodCallHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/NumberMethods.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/NumberMethods.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/NumberMethods.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/NumberMethods.java Tue Jun 21 16:22:20 2005
@@ -1,71 +1,71 @@
-package org.apache.velocity.test.provider;
-
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.math.*;
-
-
-/**
- * Used to check that method calls with number parameters are executed correctly.
- *
- * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
- */
-public class NumberMethods
-{
-
- public String numMethod(byte val)
- {
- return "byte (" + val + ")";
- }
-
- public String numMethod(short val)
- {
- return "short (" + val + ")";
- }
-
- public String numMethod(int val)
- {
- return "int (" + val + ")";
- }
-
- public String numMethod(double val)
- {
- return "double (" + val + ")";
- }
-
- public String numMethod(long val)
- {
- return "long (" + val + ")";
- }
-
- public String numMethod(BigInteger val)
- {
- return "BigInteger (" + val + ")";
- }
-
- public String numMethod(BigDecimal val)
- {
- return "BigDecimal (" + val + ")";
- }
-
-
-}
-
-
-
-
-
+package org.apache.velocity.test.provider;
+
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.math.*;
+
+
+/**
+ * Used to check that method calls with number parameters are executed correctly.
+ *
+ * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
+ */
+public class NumberMethods
+{
+
+ public String numMethod(byte val)
+ {
+ return "byte (" + val + ")";
+ }
+
+ public String numMethod(short val)
+ {
+ return "short (" + val + ")";
+ }
+
+ public String numMethod(int val)
+ {
+ return "int (" + val + ")";
+ }
+
+ public String numMethod(double val)
+ {
+ return "double (" + val + ")";
+ }
+
+ public String numMethod(long val)
+ {
+ return "long (" + val + ")";
+ }
+
+ public String numMethod(BigInteger val)
+ {
+ return "BigInteger (" + val + ")";
+ }
+
+ public String numMethod(BigDecimal val)
+ {
+ return "BigDecimal (" + val + ")";
+ }
+
+
+}
+
+
+
+
+
Propchange: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/NumberMethods.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Person.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Person.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Person.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/Person.java Tue Jun 21 16:22:20 2005
@@ -25,7 +25,7 @@
* be useful :-)
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: Person.java,v 1.7 2004/03/19 17:13:39 dlr Exp $
+ * @version $Id$
*/
public class Person
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestNumber.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestNumber.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestNumber.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestNumber.java Tue Jun 21 16:22:20 2005
@@ -1,43 +1,43 @@
-package org.apache.velocity.test.provider;
-
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.velocity.util.TemplateNumber;
-
-/**
- * Used for testing purposes to check that an object implementing TemplateNumber
- * will be treated as a Number.
- *
- * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
- */
-public class TestNumber implements TemplateNumber
-{
-
- private Number n;
-
- public TestNumber(double val)
- {
- n = new Double(val);
- }
-
- public Number getAsNumber()
- {
- return n;
- }
-
-
+package org.apache.velocity.test.provider;
+
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License")
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.velocity.util.TemplateNumber;
+
+/**
+ * Used for testing purposes to check that an object implementing TemplateNumber
+ * will be treated as a Number.
+ *
+ * @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>
+ */
+public class TestNumber implements TemplateNumber
+{
+
+ private Number n;
+
+ public TestNumber(double val)
+ {
+ n = new Double(val);
+ }
+
+ public Number getAsNumber()
+ {
+ return n;
+ }
+
+
}
Propchange: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestNumber.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestProvider.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestProvider.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestProvider.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/test/provider/TestProvider.java Tue Jun 21 16:22:20 2005
@@ -24,7 +24,7 @@
* is traversed and dynamic content generated.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: TestProvider.java,v 1.23 2004/03/19 17:13:39 dlr Exp $
+ * @version $Id$
*/
public class TestProvider
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/texen/util/FileUtil.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/texen/util/FileUtil.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/texen/util/FileUtil.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/texen/util/FileUtil.java Tue Jun 21 16:22:20 2005
@@ -23,7 +23,7 @@
*
* @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
- * @version $Id: FileUtil.java,v 1.11 2004/03/19 17:13:39 dlr Exp $
+ * @version $Id$
*/
public class FileUtil
{
Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/ArrayIterator.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/ArrayIterator.java?rev=191743&r1=191742&r2=191743&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/ArrayIterator.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/ArrayIterator.java Tue Jun 21 16:22:20 2005
@@ -37,7 +37,7 @@
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
* @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
- * @version $Id: ArrayIterator.java,v 1.8 2004/03/19 17:13:40 dlr Exp $
+ * @version $Id$
*/
public class ArrayIterator implements Iterator
{
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org