You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ni...@apache.org on 2009/08/04 03:38:17 UTC

svn commit: r800650 - /commons/proper/beanutils/trunk/src/test/org/apache/commons/beanutils/bugs/Jira339TestCase.java

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 {