Author: oheger
Date: Fri Jan 2 08:37:12 2009
New Revision: 730776
URL: http://svn.apache.org/viewvc?rev=730776&view=rev
Log:
CONFIGURATION-357: Fixed message of the ConversionException thrown by
AbstractConfiguration.getBigInteger().
Modified:
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestAbstractConfiguration.java
commons/proper/configuration/trunk/xdocs/changes.xml
Modified:
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java?rev=730776&r1=730775&r2=730776&view=diff
==============================================================================
---
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
(original)
+++
commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/AbstractConfiguration.java
Fri Jan 2 08:37:12 2009
@@ -1004,7 +1004,7 @@
}
catch (ConversionException e)
{
- throw new ConversionException('\'' + key + "' doesn't map to a
BigDecimal object", e);
+ throw new ConversionException('\'' + key + "' doesn't map to a
BigInteger object", e);
}
}
}
Modified:
commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestAbstractConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestAbstractConfiguration.java?rev=730776&r1=730775&r2=730776&view=diff
==============================================================================
---
commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestAbstractConfiguration.java
(original)
+++
commons/proper/configuration/trunk/src/test/org/apache/commons/configuration/TestAbstractConfiguration.java
Fri Jan 2 08:37:12 2009
@@ -21,12 +21,12 @@
import java.util.Iterator;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import junit.framework.TestCase;
import junitx.framework.ListAssert;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* Abstract TestCase for implementations of {...@link AbstractConfiguration}.
*
@@ -154,4 +154,24 @@
config.setLogger(log);
assertSame("Logger was not set", log, config.getLogger());
}
+
+ /**
+ * Tests the exception message triggered by the conversion to BigInteger.
+ * This test is related to CONFIGURATION-357.
+ */
+ public void testGetBigIntegerConversion()
+ {
+ Configuration config = getConfiguration();
+ try
+ {
+ config.getBigInteger("key1");
+ fail("No conversion exception thrown!");
+ }
+ catch (ConversionException cex)
+ {
+ assertEquals("Wrong exception message",
+ "'key1' doesn't map to a BigInteger object", cex
+ .getMessage());
+ }
+ }
}
Modified: commons/proper/configuration/trunk/xdocs/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/trunk/xdocs/changes.xml?rev=730776&r1=730775&r2=730776&view=diff
==============================================================================
--- commons/proper/configuration/trunk/xdocs/changes.xml (original)
+++ commons/proper/configuration/trunk/xdocs/changes.xml Fri Jan 2 08:37:12
2009
@@ -23,6 +23,10 @@
<body>
<release version="1.7" date="in SVN" description="">
+ <action dev="oheger" type="fix" issue="CONFIGURATION-357">
+ The message of the ConversionException thrown by
+ AbstractConfiguration.getBigInteger() is now correct.
+ </action>
<action dev="rgoers" type="add" issue="CONFIGURATION-356">
Added getConfigurations and getConfigurationNameList.
</action>