harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Svetlana Samoilenko (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1838) [classlib][beans] java.beans.Introspector.getBeanInfo(Bean.class).getPropertyDescriptors() returns wrong object
Date Fri, 13 Oct 2006 05:39:36 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1838?page=all ]

Svetlana Samoilenko updated HARMONY-1838:
-----------------------------------------

    Attachment: H-1838-IntrospectorTest.patch

test

> [classlib][beans] java.beans.Introspector.getBeanInfo(Bean.class).getPropertyDescriptors()
 returns wrong object
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1838
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1838
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Svetlana Samoilenko
>         Attachments: H-1838-IntrospectorTest.patch
>
>
> Description:
> Bean.class contains 2 methods getProp1 and setProp2.
> java.beans.Introspector.getBeanInfo(Bean.class).getPropertyDescriptors()  returns an
array with 1 element 
>    propertyDescriptors[0].getName()=class
> while RI returns an array with 3 element:
>    propertyDescriptors[0].getName()=class
>    propertyDescriptors[1].getName() =prop1
>    propertyDescriptors[2].getName() =prop2
> public class test extends TestCase{
>     public void testgetPropertyDescriptors() {        
>           try {
>               PropertyDescriptor[] propertyDescriptors = Introspector.getBeanInfo(Bean.class).getPropertyDescriptors()
          
>               assertEquals("class", propertyDescriptors[0].getName()); 
>               assertEquals("prop1",propertyDescriptors[1].getName()); 
>               assertEquals("prop2",propertyDescriptors[2].getName()); 
>               assertEquals(3,propertyDescriptors.length); 
>           } catch (IntrospectionException e) {        
>               fail("unexpected IntrospectionException");     
>           }
>     }
> class Bean {      
>     public String getProp1(int i) {
>         return null;
>     }
>     public void setProp2(int i, String str) {
>     }  
> } 
> HARMONY output:
> =============
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or
its licensors, as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r453981, (Oct  9 2006), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> .E
> Time: 0.11
> There was 1 error:
> 1) testgetPropertyDescriptors(test)java.lang.ArrayIndexOutOfBoundsException
>         at test.testgetPropertyDescriptors(test.java:12)
>         at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
> SUN output:
> ==========
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> .
> Time: 0.01
> OK (1 test)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message