commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/beanutils/src/test/org/apache/commons/beanutils BasicDynaBeanTestCase.java
Date Fri, 11 Jan 2002 02:25:43 GMT
craigmcc    02/01/10 18:25:43

  Modified:    beanutils/src/java/org/apache/commons/beanutils
                        BasicDynaBean.java BasicDynaClass.java
                        DynaClass.java PropertyUtils.java
               beanutils/src/test/org/apache/commons/beanutils
                        BasicDynaBeanTestCase.java
  Log:
  Rename getPropertyDescritor() --> getDynaProperty() and
         getPropertyDescriptors() --> getDynaProperties()
  to avoid name clashes on implementation classes that want to deal with
  *real* PropertyDescriptor instances.
  
  Revision  Changes    Path
  1.4       +14 -14    jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaBean.java
  
  Index: BasicDynaBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasicDynaBean.java	6 Jan 2002 06:01:08 -0000	1.3
  +++ BasicDynaBean.java	11 Jan 2002 02:25:43 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaBean.java,v
1.3 2002/01/06 06:01:08 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/06 06:01:08 $
  + * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaBean.java,v
1.4 2002/01/11 02:25:43 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/11 02:25:43 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    * accessed from multiple threads simultaneously need to be synchronized.</p>
    *
    * @author Craig McClanahan
  - * @version $Revision: 1.3 $ $Date: 2002/01/06 06:01:08 $
  + * @version $Revision: 1.4 $ $Date: 2002/01/11 02:25:43 $
    */
   
   public class BasicDynaBean implements DynaBean {
  @@ -131,7 +131,7 @@
        */
       public boolean contains(String name, String key) {
   
  -        DynaProperty descriptor = getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaProperty(name);
           Object value = values.get(name);
           if (value == null) {
               throw new NullPointerException
  @@ -163,7 +163,7 @@
           } 
   
           // Return a null value for a non-primitive property
  -        Class type = getPropertyDescriptor(name).getType();
  +        Class type = getDynaProperty(name).getType();
           if (!type.isPrimitive()) {
               return (value);
           }
  @@ -209,7 +209,7 @@
        */
       public Object get(String name, int index) {
   
  -        DynaProperty descriptor = getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaProperty(name);
           Object value = values.get(name);
           if (value == null) {
               throw new NullPointerException
  @@ -240,7 +240,7 @@
        */
       public Object get(String name, String key) {
   
  -        DynaProperty descriptor = getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaProperty(name);
           Object value = values.get(name);
           if (value == null) {
               throw new NullPointerException
  @@ -279,7 +279,7 @@
        */
       public void remove(String name, String key) {
   
  -        DynaProperty descriptor = getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaProperty(name);
           Object value = values.get(name);
           if (value == null) {
               throw new NullPointerException
  @@ -309,7 +309,7 @@
        */
       public void set(String name, Object value) {
   
  -        DynaProperty descriptor = getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaProperty(name);
           if (value == null) {
               if (descriptor.getType().isPrimitive()) {
                   throw new NullPointerException
  @@ -345,7 +345,7 @@
        */
       public void set(String name, int index, Object value) {
   
  -        DynaProperty descriptor = getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaProperty(name);
           Object prop = values.get(name);
           if (prop == null) {
               throw new NullPointerException
  @@ -382,7 +382,7 @@
        */
       public void set(String name, String key, Object value) {
   
  -        DynaProperty descriptor = getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaProperty(name);
           Object prop = values.get(name);
           if (prop == null) {
               throw new NullPointerException
  @@ -408,9 +408,9 @@
        * @exception IllegalArgumentException if this is not a valid property
        *  name for our DynaClass
        */
  -    protected DynaProperty getPropertyDescriptor(String name) {
  +    protected DynaProperty getDynaProperty(String name) {
   
  -        DynaProperty descriptor = getDynaClass().getPropertyDescriptor(name);
  +        DynaProperty descriptor = getDynaClass().getDynaProperty(name);
           if (descriptor == null) {
               throw new IllegalArgumentException
                   ("Invalid property name '" + name + "'");
  
  
  
  1.4       +6 -6      jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaClass.java
  
  Index: BasicDynaClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaClass.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasicDynaClass.java	6 Jan 2002 06:01:08 -0000	1.3
  +++ BasicDynaClass.java	11 Jan 2002 02:25:43 -0000	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaClass.java,v
1.3 2002/01/06 06:01:08 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/01/06 06:01:08 $
  + * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BasicDynaClass.java,v
1.4 2002/01/11 02:25:43 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/01/11 02:25:43 $
    *
    * ====================================================================
    *
  @@ -78,7 +78,7 @@
    * used to associate the DynaBean instance with this DynaClass.</p>
    *
    * @author Craig McClanahan
  - * @version $Revision: 1.3 $ $Date: 2002/01/06 06:01:08 $
  + * @version $Revision: 1.4 $ $Date: 2002/01/11 02:25:43 $
    */
   
   public class BasicDynaClass implements DynaClass {
  @@ -220,7 +220,7 @@
        *
        * @exception IllegalArgumentException if no property name is specified
        */
  -    public DynaProperty getPropertyDescriptor(String name) {
  +    public DynaProperty getDynaProperty(String name) {
   
           if (name == null) {
               throw new IllegalArgumentException
  @@ -240,7 +240,7 @@
        * <code>getBeanInfo()</code> instead, which returns property descriptors
        * and a bunch of other stuff?</p>
        */
  -    public DynaProperty[] getPropertyDescriptors() {
  +    public DynaProperty[] getDynaProperties() {
   
           return (properties);
   
  
  
  
  1.7       +6 -6      jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/DynaClass.java
  
  Index: DynaClass.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/DynaClass.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DynaClass.java	6 Jan 2002 06:01:08 -0000	1.6
  +++ DynaClass.java	11 Jan 2002 02:25:43 -0000	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/DynaClass.java,v
1.6 2002/01/06 06:01:08 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2002/01/06 06:01:08 $
  + * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/DynaClass.java,v
1.7 2002/01/11 02:25:43 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/01/11 02:25:43 $
    *
    * ====================================================================
    *
  @@ -76,7 +76,7 @@
    * @author Craig McClanahan
    * @author Michael Smith
    * @author Paulo Gaspar
  - * @version $Revision: 1.6 $ $Date: 2002/01/06 06:01:08 $
  + * @version $Revision: 1.7 $ $Date: 2002/01/11 02:25:43 $
    */
   
   public interface DynaClass {
  @@ -100,7 +100,7 @@
        *
        * @exception IllegalArgumentException if no property name is specified
        */
  -    public DynaProperty getPropertyDescriptor(String name);
  +    public DynaProperty getDynaProperty(String name);
   
   
       /**
  @@ -112,7 +112,7 @@
        * <code>getBeanInfo()</code> instead, which returns property descriptors
        * and a bunch of other stuff?</p>
        */
  -    public DynaProperty[] getPropertyDescriptors();
  +    public DynaProperty[] getDynaProperties();
   
   
       /**
  
  
  
  1.19      +11 -11    jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtils.java
  
  Index: PropertyUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtils.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- PropertyUtils.java	9 Jan 2002 19:27:30 -0000	1.18
  +++ PropertyUtils.java	11 Jan 2002 02:25:43 -0000	1.19
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtils.java,v
1.18 2002/01/09 19:27:30 craigmcc Exp $
  - * $Revision: 1.18 $
  - * $Date: 2002/01/09 19:27:30 $
  + * $Header: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtils.java,v
1.19 2002/01/11 02:25:43 craigmcc Exp $
  + * $Revision: 1.19 $
  + * $Date: 2002/01/11 02:25:43 $
    *
    * ====================================================================
    *
  @@ -133,7 +133,7 @@
    * @author Gregor Rażman
    * @author Jan Sorensen
    * @author Scott Sanders
  - * @version $Revision: 1.18 $ $Date: 2002/01/09 19:27:30 $
  + * @version $Revision: 1.19 $ $Date: 2002/01/11 02:25:43 $
    */
   
   public class PropertyUtils {
  @@ -403,7 +403,7 @@
           // Handle DynaBean instances specially
           if (bean instanceof DynaBean) {
               DynaProperty descriptor =
  -                ((DynaBean) bean).getDynaClass().getPropertyDescriptor(name);
  +                ((DynaBean) bean).getDynaClass().getDynaProperty(name);
               if (descriptor == null) {
                   throw new NoSuchMethodException("Unknown property '" +
                                                   name + "'");
  @@ -545,7 +545,7 @@
           // Handle DynaBean instances specially
           if (bean instanceof DynaBean) {
               DynaProperty descriptor =
  -                ((DynaBean) bean).getDynaClass().getPropertyDescriptor(name);
  +                ((DynaBean) bean).getDynaClass().getDynaProperty(name);
               if (descriptor == null) {
                   throw new NoSuchMethodException("Unknown property '" +
                                                   name + "'");
  @@ -948,7 +948,7 @@
           // Special handling for DynaBeans
           if (bean instanceof DynaBean) {
               DynaProperty descriptor =
  -                ((DynaBean) bean).getDynaClass().getPropertyDescriptor(name);
  +                ((DynaBean) bean).getDynaClass().getDynaProperty(name);
               if (descriptor == null) {
                   return (null);
               }
  @@ -1034,7 +1034,7 @@
           // Handle DynaBean instances specially
           if (bean instanceof DynaBean) {
               DynaProperty descriptor =
  -                ((DynaBean) bean).getDynaClass().getPropertyDescriptor(name);
  +                ((DynaBean) bean).getDynaClass().getDynaProperty(name);
               if (descriptor == null) {
                   throw new NoSuchMethodException("Unknown property '" +
                                                   name + "'");
  @@ -1173,7 +1173,7 @@
           // Handle DynaBean instances specially
           if (bean instanceof DynaBean) {
               DynaProperty descriptor =
  -                ((DynaBean) bean).getDynaClass().getPropertyDescriptor(name);
  +                ((DynaBean) bean).getDynaClass().getDynaProperty(name);
               if (descriptor == null) {
                   throw new NoSuchMethodException("Unknown property '" +
                                                   name + "'");
  @@ -1321,7 +1321,7 @@
           // Handle DynaBean instances specially
           if (bean instanceof DynaBean) {
               DynaProperty descriptor =
  -                ((DynaBean) bean).getDynaClass().getPropertyDescriptor(name);
  +                ((DynaBean) bean).getDynaClass().getDynaProperty(name);
               if (descriptor == null) {
                   throw new NoSuchMethodException("Unknown property '" +
                                                   name + "'");
  @@ -1510,7 +1510,7 @@
           // Handle DynaBean instances specially
           if (bean instanceof DynaBean) {
               DynaProperty descriptor =
  -                ((DynaBean) bean).getDynaClass().getPropertyDescriptor(name);
  +                ((DynaBean) bean).getDynaClass().getDynaProperty(name);
               if (descriptor == null) {
                   throw new NoSuchMethodException("Unknown property '" +
                                                   name + "'");
  
  
  
  1.2       +19 -19    jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BasicDynaBeanTestCase.java
  
  Index: BasicDynaBeanTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BasicDynaBeanTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasicDynaBeanTestCase.java	6 Jan 2002 06:01:08 -0000	1.1
  +++ BasicDynaBeanTestCase.java	11 Jan 2002 02:25:43 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BasicDynaBeanTestCase.java,v
1.1 2002/01/06 06:01:08 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/01/06 06:01:08 $
  + * $Header: /home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/BasicDynaBeanTestCase.java,v
1.2 2002/01/11 02:25:43 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/01/11 02:25:43 $
    *
    * ====================================================================
    *
  @@ -85,7 +85,7 @@
    * because the two classes provide similar levels of functionality.</p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/01/06 06:01:08 $
  + * @version $Revision: 1.2 $ $Date: 2002/01/11 02:25:43 $
    */
   
   public class BasicDynaBeanTestCase extends TestCase {
  @@ -102,7 +102,7 @@
   
       /**
        * The set of property names we expect to have returned when calling
  -     * <code>getPropertyDescriptors()</code>.  You should update this list
  +     * <code>getDynaProperties()</code>.  You should update this list
        * when new properties are added to TestBean.
        */
       protected final static String[] properties = {
  @@ -216,13 +216,13 @@
   
   
       /**
  -     * Corner cases on getPropertyDescriptor invalid arguments.
  +     * Corner cases on getDynaProperty invalid arguments.
        */
       public void testGetDescriptorArguments() {
   
           try {
               DynaProperty descriptor =
  -                bean.getDynaClass().getPropertyDescriptor("unknown");
  +                bean.getDynaClass().getDynaProperty("unknown");
               assertNull("Unknown property descriptor should be null",
                          descriptor);
           } catch (Throwable t) {
  @@ -230,7 +230,7 @@
           }
   
           try {
  -            bean.getDynaClass().getPropertyDescriptor(null);
  +            bean.getDynaClass().getDynaProperty(null);
               fail("Should throw IllegalArgumentException");
           } catch (IllegalArgumentException e) {
               ; // Expected response
  @@ -242,7 +242,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>booleanProperty</code>.
  +     * Positive getDynaProperty on property <code>booleanProperty</code>.
        */
       public void testGetDescriptorBoolean() {
   
  @@ -252,7 +252,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>doubleProperty</code>.
  +     * Positive getDynaProperty on property <code>doubleProperty</code>.
        */
       public void testGetDescriptorDouble() {
   
  @@ -262,7 +262,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>floatProperty</code>.
  +     * Positive getDynaProperty on property <code>floatProperty</code>.
        */
       public void testGetDescriptorFloat() {
   
  @@ -272,7 +272,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>intProperty</code>.
  +     * Positive getDynaProperty on property <code>intProperty</code>.
        */
       public void testGetDescriptorInt() {
   
  @@ -282,7 +282,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>longProperty</code>.
  +     * Positive getDynaProperty on property <code>longProperty</code>.
        */
       public void testGetDescriptorLong() {
   
  @@ -292,7 +292,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>booleanSecond</code>
  +     * Positive getDynaProperty on property <code>booleanSecond</code>
        * that uses an "is" method as the getter.
        */
       public void testGetDescriptorSecond() {
  @@ -303,7 +303,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>shortProperty</code>.
  +     * Positive getDynaProperty on property <code>shortProperty</code>.
        */
       public void testGetDescriptorShort() {
   
  @@ -313,7 +313,7 @@
   
   
       /**
  -     * Positive getPropertyDescriptor on property <code>stringProperty</code>.
  +     * Positive getDynaProperty on property <code>stringProperty</code>.
        */
       public void testGetDescriptorString() {
   
  @@ -323,12 +323,12 @@
   
   
       /**
  -     * Positive test for getPropertyDescriptors().  Each property name
  +     * Positive test for getDynaPropertys().  Each property name
        * listed in <code>properties</code> should be returned exactly once.
        */
       public void testGetDescriptors() {
   
  -        DynaProperty pd[] = bean.getDynaClass().getPropertyDescriptors();
  +        DynaProperty pd[] = bean.getDynaClass().getDynaProperties();
           assertNotNull("Got descriptors", pd);
           int count[] = new int[properties.length];
           for (int i = 0; i < pd.length; i++) {
  @@ -1035,7 +1035,7 @@
   
           try {
               DynaProperty descriptor =
  -                bean.getDynaClass().getPropertyDescriptor(name);
  +                bean.getDynaClass().getDynaProperty(name);
               assertNotNull("Got descriptor", descriptor);
               assertEquals("Got correct type", type, descriptor.getType());
           } catch (Throwable t) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message