commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1452029 - in /commons/proper/beanutils/trunk: pom.xml src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java
Date Sun, 03 Mar 2013 11:33:42 GMT
Author: britter
Date: Sun Mar  3 11:33:42 2013
New Revision: 1452029

URL: http://svn.apache.org/r1452029
Log:
[BEANUTILS-422] - getPropertyType return null on second descendant class; Add test case provided
by Alex Crown

Added:
    commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java
  (with props)
Modified:
    commons/proper/beanutils/trunk/pom.xml

Modified: commons/proper/beanutils/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/trunk/pom.xml?rev=1452029&r1=1452028&r2=1452029&view=diff
==============================================================================
--- commons/proper/beanutils/trunk/pom.xml (original)
+++ commons/proper/beanutils/trunk/pom.xml Sun Mar  3 11:33:42 2013
@@ -140,6 +140,10 @@
       <name>Berin Loritsch</name>
       <email></email>
     </contributor>    
+    <contributor>
+      <name>Alex Crown</name>
+      <email></email>
+    </contributor>    
   </contributors>
 
   <dependencies>

Added: commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java?rev=1452029&view=auto
==============================================================================
--- commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java
(added)
+++ commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java
Sun Mar  3 11:33:42 2013
@@ -0,0 +1,51 @@
+package org.apache.commons.beanutils.bugs;
+
+import org.apache.commons.beanutils.PropertyUtils;
+
+import java.util.ArrayList;
+
+import junit.framework.TestCase;
+
+public class Jira422TestCase extends TestCase {
+
+    public void testRootBean() throws Exception {
+        RootBean bean = new FirstChildBean();
+        Class propertyType = PropertyUtils.getPropertyType(bean, "file[0]");
+        assertEquals(String.class.getName(), propertyType.getName());
+    }
+
+    public void testSecondChildBean() throws Exception {
+        RootBean bean = new SecondChildBean();
+        Class propertyType = PropertyUtils.getPropertyType(bean, "file[0]");
+        assertEquals(String.class.getName(), propertyType.getName());
+    }
+
+}
+
+class RootBean {
+
+    private ArrayList file;
+
+    public ArrayList getFile() {
+        return file;
+    }
+
+    public void setFile(ArrayList file) {
+        this.file = file;
+    }
+
+    public String getFile(int i) {
+        return (String) file.get(i);
+    }
+
+    public void setFile(int i, String file) {
+        this.file.set(i, file);
+    }
+
+}
+
+class FirstChildBean extends RootBean {
+}
+
+class SecondChildBean extends RootBean {
+}

Propchange: commons/proper/beanutils/trunk/src/test/java/org/apache/commons/beanutils/bugs/Jira422TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message