You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/04/19 11:44:37 UTC
svn commit: r649783 - in /tomcat/trunk/test/org/apache/el: ./ lang/
lang/TestELSupport.java
Author: markt
Date: Sat Apr 19 02:44:35 2008
New Revision: 649783
URL: http://svn.apache.org/viewvc?rev=649783&view=rev
Log:
Add test case for bug 43656. Based on a patch from Konstantin Kolinko.
Added:
tomcat/trunk/test/org/apache/el/
tomcat/trunk/test/org/apache/el/lang/
tomcat/trunk/test/org/apache/el/lang/TestELSupport.java (with props)
Added: tomcat/trunk/test/org/apache/el/lang/TestELSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/lang/TestELSupport.java?rev=649783&view=auto
==============================================================================
--- tomcat/trunk/test/org/apache/el/lang/TestELSupport.java (added)
+++ tomcat/trunk/test/org/apache/el/lang/TestELSupport.java Sat Apr 19 02:44:35 2008
@@ -0,0 +1,46 @@
+package org.apache.el.lang;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import junit.framework.TestCase;
+
+public class TestELSupport extends TestCase {
+ public void testBigDecimal() {
+ testIsSame(new BigDecimal(
+ "0.123456789012345678901234567890123456789012345678901234567890123456789"));
+ }
+
+ public void testBigInteger() {
+ testIsSame(new BigInteger(
+ "1234567890123456789012345678901234567890123456789012345678901234567890"));
+ }
+
+ public void testLong() {
+ testIsSame(Long.valueOf(0x0102030405060708L));
+ }
+
+ public void testInteger() {
+ testIsSame(Integer.valueOf(0x01020304));
+ }
+
+ public void testShort() {
+ testIsSame(Short.valueOf((short) 0x0102));
+ }
+
+ public void testByte() {
+ testIsSame(Byte.valueOf((byte) 0xEF));
+ }
+
+ public void testDouble() {
+ testIsSame(Double.valueOf(0.123456789012345678901234));
+ }
+
+ public void testFloat() {
+ testIsSame(Float.valueOf(0.123456F));
+ }
+
+ private static void testIsSame(Object value) {
+ assertEquals(value, ELSupport.coerceToNumber(value, value.getClass()));
+ }
+}
Propchange: tomcat/trunk/test/org/apache/el/lang/TestELSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org