commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/beanutils/src/test/org/apache/commons/beanutils AlphaBean.java PropertyUtilsTestCase.java
Date Sun, 27 Oct 2002 16:50:19 GMT
rdonkin     2002/10/27 08:50:19

  Modified:    beanutils/src/test/org/apache/commons/beanutils
                        AlphaBean.java PropertyUtilsTestCase.java
  Log:
  Added test case for bug that was (unintentionally) fixed between 1.4.1 and 1.5 release.
This test is specifically for the bug reported and should ensure it doesn't come alive again.
  
  Revision  Changes    Path
  1.3       +5 -1      jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/AlphaBean.java
  
  Index: AlphaBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/AlphaBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AlphaBean.java	5 Apr 2002 14:58:15 -0000	1.2
  +++ AlphaBean.java	27 Oct 2002 16:50:18 -0000	1.3
  @@ -62,12 +62,16 @@
       private String name;
       
       public AlphaBean(String name) {
  -        this.name = name;
  +        setName(name);
       }
       
       public String getName() {
           return name;
       }    
  +    
  +    public void setName(String name) {
  +        this.name = name;
  +    }	
       
       /**
        * Used for testing that correct exception is thrown.
  
  
  
  1.26      +22 -4     jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java
  
  Index: PropertyUtilsTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/test/org/apache/commons/beanutils/PropertyUtilsTestCase.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- PropertyUtilsTestCase.java	25 Oct 2002 00:31:14 -0000	1.25
  +++ PropertyUtilsTestCase.java	27 Oct 2002 16:50:18 -0000	1.26
  @@ -3564,4 +3564,22 @@
                   "5", 
                   out); 
       }
  +    
  +    /** Text case for setting properties on parent */
  +    public void testGetSetParentBean() throws Exception {
  +
  +        SonOfAlphaBean bean = new SonOfAlphaBean("Roger");
  +        
  +        String out = (String) PropertyUtils.getProperty(bean, "name");
  +        assertEquals(
  +                "(1) Get/Set On Parent.", 
  +                "Roger", 
  +                out); 
  +        
  +        PropertyUtils.setProperty(bean, "name", "abcd");
  +        assertEquals(
  +                "(2) Get/Set On Parent.", 
  +                "abcd", 
  +                bean.getName()); 
  +    }
   }
  
  
  

--
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