commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r800650 - /commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira339TestCase.java
Date Tue, 04 Aug 2009 01:38:17 GMT
Author: niallp
Date: Tue Aug  4 01:38:16 2009
New Revision: 800650

URL: http://svn.apache.org/viewvc?rev=800650&view=rev
Log:
Add test for BEANUTILS-331 (duplicates BEANUTILS-339

Modified:
    commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira339TestCase.java

Modified: commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira339TestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira339TestCase.java?rev=800650&r1=800649&r2=800650&view=diff
==============================================================================
--- commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira339TestCase.java
(original)
+++ commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira339TestCase.java
Tue Aug  4 01:38:16 2009
@@ -17,6 +17,8 @@
 package org.apache.commons.beanutils.bugs;
 
 import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -83,7 +85,7 @@
     }
 
     /**
-     * Test {@link PropertyUtils#getProperty(Object, String)}
+     * Test {@link PropertyUtils#setProperty(Object, String, Object)}
      */
     public void testIssue_BEANUTILS_339_BeanUtilsBean_setProperty() {
         
@@ -98,6 +100,23 @@
     }
 
     /**
+     * Test {@link BeanUtils#populate(Object, Map)}
+     */
+    public void testIssue_BEANUTILS_331_BeanUtilsBean_populate() {
+        
+        TestBean bean = new TestBean();
+        try {
+            Map properties = new HashMap();
+            properties.put("comparator", null);
+            BeanUtils.populate(bean, properties);
+        } catch (Throwable t) {
+            log.error("Failed: " + t.getMessage(), t);
+            fail("Threw exception: " + t);
+        }
+        assertNull("TestBean comparator should be null", bean.getComparator());
+    }
+
+    /**
      * Test Bean.
      */
     public static class TestBean {



Mime
View raw message