commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r178855 - in /jakarta/commons/proper/beanutils/trunk/src: java/org/apache/commons/beanutils/locale/converters/ test/org/apache/commons/beanutils/locale/ test/org/apache/commons/beanutils/locale/converters/
Date Sat, 28 May 2005 02:42:42 GMT
Author: niallp
Date: Fri May 27 19:42:41 2005
New Revision: 178855

URL: http://svn.apache.org/viewcvs?rev=178855&view=rev
Log:
Fix Bug 33839 - DecimalLocaleConverter and subClasses never throw a ConversionException, reported
by Stefan Lötscher.

This was caused by the change made to DecimalLocaleConveter on 4th Feb 2004 (revision 128763)
- also the test in LocaleConvertUtilsTestCase which started failing when the bug was introduced
was just prefixed with "fixme" so that it didn't run!

Modified:
    jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java
    jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/LocaleConvertUtilsTestCase.java
    jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/BaseLocaleConverterTestCase.java
    jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/DateLocaleConverterTestCase.java

Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java?rev=178855&r1=178854&r2=178855&view=diff
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java
(original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/locale/converters/DecimalLocaleConverter.java
Fri May 27 19:42:41 2005
@@ -123,7 +123,7 @@
      */
     public DecimalLocaleConverter(Locale locale, String pattern, boolean locPattern) {
 
-        this(null, locale, pattern, locPattern);
+        super(locale, pattern, locPattern);
     }
 
     /**

Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/LocaleConvertUtilsTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/LocaleConvertUtilsTestCase.java?rev=178855&r1=178854&r2=178855&view=diff
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/LocaleConvertUtilsTestCase.java
(original)
+++ jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/LocaleConvertUtilsTestCase.java
Fri May 27 19:42:41 2005
@@ -134,7 +134,7 @@
      * Negative scalar conversion tests.  These rely on the standard
      * default value conversions in LocaleConvertUtils.
      */
-    public void fixmetestNegativeScalar() {
+    public void testNegativeScalar() {
 
         Object value = null;
 

Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/BaseLocaleConverterTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/BaseLocaleConverterTestCase.java?rev=178855&r1=178854&r2=178855&view=diff
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/BaseLocaleConverterTestCase.java
(original)
+++ jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/BaseLocaleConverterTestCase.java
Fri May 27 19:42:41 2005
@@ -242,13 +242,16 @@
         // Convert value with no pattern
         try {
             result = converter.convert("xyz");
+            if (expectedValue == null) {
+                fail("Expected ConversionException if no default value " + msgId);
+            }
         } catch (Exception e) {
-            fail("Invalid conversion " + msgId + " threw " + e);
+            if (expectedValue != null) {
+                fail("Expected default value " + msgId + " threw " + e);
+            }
         }
 
-        if (expectedValue == null) {
-            assertNull("Check invalid conversion is null " + msgId + " result="+result, result);
-        } else {
+        if (expectedValue != null) {
             assertEquals("Check invalid conversion is default " + msgId, expectedValue, result);
         }
 

Modified: jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/DateLocaleConverterTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/DateLocaleConverterTestCase.java?rev=178855&r1=178854&r2=178855&view=diff
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/DateLocaleConverterTestCase.java
(original)
+++ jakarta/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/locale/converters/DateLocaleConverterTestCase.java
Fri May 27 19:42:41 2005
@@ -411,28 +411,5 @@
 
     }
 
-    /**
-     * Test Converting an invalid value.
-     */
-    protected void convertInvalid(BaseLocaleConverter converter, String msgId, Object expectedValue)
{
-
-        // Convert value with no pattern
-        try {
-            result = converter.convert("xyz");
-            if (expectedValue == null) {
-                fail("Expected ConversionException if no default value " + msgId);
-            }
-        } catch (Exception e) {
-            if (expectedValue != null) {
-                fail("Expected default value " + msgId + " threw " + e);
-            }
-        }
-
-        if (expectedValue != null) {
-            assertEquals("Check invalid conversion is default " + msgId, expectedValue, result);
-        }
-
-    }
-
 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message