You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@locus.apache.org on 2000/09/07 03:38:37 UTC

cvs commit: jakarta-struts/src/test/org/apache/struts/test TestBean.java

craigmcc    00/09/06 18:38:37

  Modified:    src/test/org/apache/struts/test TestBean.java
  Log:
  Update the test bean to include a String property that returns a null
  value, and sort the properties into alphabetical order.
  
  Revision  Changes    Path
  1.2       +44 -30    jakarta-struts/src/test/org/apache/struts/test/TestBean.java
  
  Index: TestBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/test/org/apache/struts/test/TestBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBean.java	2000/09/05 21:28:03	1.1
  +++ TestBean.java	2000/09/07 01:38:37	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/test/org/apache/struts/test/TestBean.java,v 1.1 2000/09/05 21:28:03 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/09/05 21:28:03 $
  + * $Header: /home/cvs/jakarta-struts/src/test/org/apache/struts/test/TestBean.java,v 1.2 2000/09/07 01:38:37 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/09/07 01:38:37 $
    *
    * ====================================================================
    *
  @@ -67,7 +67,7 @@
    * General purpose test bean for Struts custom tag tests.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/09/05 21:28:03 $
  + * @version $Revision: 1.2 $ $Date: 2000/09/07 01:38:37 $
    */
   
   public class TestBean {
  @@ -119,20 +119,6 @@
   
   
       /**
  -     * An integer property.
  -     */
  -    private int intProperty = 123;
  -
  -    public int getIntProperty() {
  -        return (this.intProperty);
  -    }
  -
  -    public void setIntProperty(int intProperty) {
  -        this.intProperty = intProperty;
  -    }
  -
  -
  -    /**
        * An integer array that is accessed as an array as well as indexed.
        */
       private int intArray[] = { 0, 10, 20, 30, 40 };
  @@ -155,17 +141,19 @@
   
   
       /**
  -     * A nested reference to another test bean (populated as needed).
  +     * An integer property.
        */
  -    private TestBean nested = null;
  +    private int intProperty = 123;
   
  -    public TestBean getNested() {
  -        if (nested == null)
  -            nested = new TestBean();
  -        return (nested);
  +    public int getIntProperty() {
  +        return (this.intProperty);
       }
   
  +    public void setIntProperty(int intProperty) {
  +        this.intProperty = intProperty;
  +    }
   
  +
       /**
        * A long property.
        */
  @@ -181,16 +169,28 @@
   
   
       /**
  -     * A String property.
  +     * A nested reference to another test bean (populated as needed).
        */
  -    private String stringProperty = "This is a string";
  +    private TestBean nested = null;
   
  -    public String getStringProperty() {
  -        return (this.stringProperty);
  +    public TestBean getNested() {
  +        if (nested == null)
  +            nested = new TestBean();
  +        return (nested);
       }
   
  -    public void setStringProperty(String stringProperty) {
  -        this.stringProperty = stringProperty;
  +
  +    /**
  +     * A String property with an initial value of null.
  +     */
  +    private String nullProperty = null;
  +
  +    public String getNullProperty() {
  +        return (this.nullProperty);
  +    }
  +
  +    public void setNullProperty(String nullProperty) {
  +        this.nullProperty = nullProperty;
       }
   
   
  @@ -214,6 +214,20 @@
   
       public void setStringIndexed(int index, String value) {
           stringArray[index] = value;
  +    }
  +
  +
  +    /**
  +     * A String property.
  +     */
  +    private String stringProperty = "This is a string";
  +
  +    public String getStringProperty() {
  +        return (this.stringProperty);
  +    }
  +
  +    public void setStringProperty(String stringProperty) {
  +        this.stringProperty = stringProperty;
       }