Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.beanutils
Class TestBean  view TestBean download TestBean.java

java.lang.Object
  extended byorg.apache.commons.beanutils.TestBean
Direct Known Subclasses:
TestBeanPackageSubclass, TestBeanPublicSubclass

public class TestBean
extends java.lang.Object

General purpose test bean for JUnit tests for the "beanutils" component.

Version:
$Revision: 1.20 $ $Date: 2004/02/28 13:18:36 $

Nested Class Summary
(package private)  class TestBean.MappedTestBean
           
 
Field Summary
private  TestBean anotherNested
          Another nested reference to another test bean,
private  boolean booleanProperty
          A boolean property.
private  boolean booleanSecond
          A boolean property that uses an "is" method for the getter.
private  byte byteProperty
          A byte property.
private static int counter
          A static variable that is accessed and updated via static methods for MethodUtils testing.
private  double doubleProperty
          A double property.
private  java.lang.String[] dupProperty
          An "indexed property" accessible via both array and subscript based getters and setters.
private  float floatProperty
          A float property.
private  int[] intArray
          An integer array property accessed as an array.
private  int[] intIndexed
          An integer array property accessed as an indexed property.
private  int intProperty
          An integer property.
private  boolean invalidBoolean
          An invalid property that has two boolean getters (getInvalidBoolean and isInvalidBoolean) plus a String setter (setInvalidBoolean).
private static java.util.List listIndexed
          A List property accessed as an indexed property.
private  long longProperty
          A long property.
private  java.util.HashMap mappedIntProperty
          A mapped property that has String keys and int values.
private  TestBean.MappedTestBean mappedNested
           
private  java.util.HashMap mappedObjects
          A mapped property that has String keys and Object values.
private  java.util.HashMap mappedProperty
          A mapped property that has String keys and String values.
private  java.util.Map mapProperty
          A mapped property with only a getter and setter for a Map.
private  TestBean nested
          A nested reference to another test bean (populated as needed).
private  java.lang.String nullProperty
          A String property with an initial value of null.
private  java.lang.String readOnlyProperty
          A read-only String property.
private  short shortProperty
          A short property.
private  java.lang.String[] stringArray
          A String array property accessed as a String.
private  java.lang.String[] stringIndexed
          A String array property accessed as an indexed property.
private  java.lang.String stringProperty
          A String property.
private  java.lang.String writeOnlyProperty
          A write-only String property.
 
Constructor Summary
  TestBean()
           
  TestBean(boolean booleanProperty)
           
  TestBean(java.lang.Boolean booleanSecond)
           
protected TestBean(boolean booleanProperty, boolean booleanSecond, java.lang.String stringProperty)
           
  TestBean(boolean booleanProperty, java.lang.String stringProperty)
           
  TestBean(java.lang.Boolean booleanSecond, java.lang.String stringProperty)
           
  TestBean(double doubleProperty)
           
  TestBean(float floatProperty)
           
  TestBean(float floatProperty, java.lang.String stringProperty)
           
(package private) TestBean(int intProperty)
           
  TestBean(java.lang.Integer intProperty)
           
  TestBean(java.lang.String stringProperty)
           
 
Method Summary
static int currentCounter()
          Return the current value of the counter.
 TestBean getAnotherNested()
           
 boolean getBooleanProperty()
           
 byte getByteProperty()
           
 double getDoubleProperty()
           
 java.lang.String[] getDupProperty()
           
 java.lang.String getDupProperty(int index)
           
 float getFloatProperty()
           
 int[] getIntArray()
           
 int getIntIndexed(int index)
           
 int getIntProperty()
           
 boolean getInvalidBoolean()
           
 java.util.List getListIndexed()
           
 long getLongProperty()
           
 int getMappedIntProperty(java.lang.String key)
           
 TestBean.MappedTestBean getMappedNested()
           
 java.lang.Object getMappedObjects(java.lang.String key)
           
 java.lang.String getMappedProperty(java.lang.String key)
           
 java.util.Map getMapProperty()
           
 TestBean getNested()
           
 java.lang.String getNullProperty()
           
 java.lang.String getReadOnlyProperty()
           
 short getShortProperty()
           
 java.lang.String[] getStringArray()
           
 java.lang.String getStringIndexed(int index)
           
 java.lang.String getStringProperty()
           
 java.lang.String getWriteOnlyPropertyValue()
           
static void incrementCounter()
          Increment the current value of the counter by 1.
static void incrementCounter(int amount)
          Increment the current value of the counter by the specified amount.
 boolean isBooleanSecond()
           
 boolean isInvalidBoolean()
           
 void setAnotherNested(TestBean anotherNested)
           
 void setBooleanProperty(boolean booleanProperty)
           
 void setBooleanSecond(boolean booleanSecond)
           
 void setByteProperty(byte byteProperty)
           
 void setDoubleProperty(double doubleProperty)
           
 void setDupProperty(int index, java.lang.String value)
           
 void setDupProperty(java.lang.String[] dupProperty)
           
 void setFloatProperty(float floatProperty)
           
 void setIntArray(int[] intArray)
           
 void setIntIndexed(int index, int value)
           
 void setIntProperty(int intProperty)
           
 void setInvalidBoolean(java.lang.String invalidBoolean)
           
 void setLongProperty(long longProperty)
           
 void setMappedIntProperty(java.lang.String key, int value)
           
 void setMappedObjects(java.lang.String key, java.lang.Object value)
           
 void setMappedProperty(java.lang.String key, java.lang.String value)
           
 void setMapProperty(java.util.Map mapProperty)
           
 void setNullProperty(java.lang.String nullProperty)
           
 void setShortProperty(short shortProperty)
           
 void setStringArray(java.lang.String[] stringArray)
           
 void setStringIndexed(int index, java.lang.String value)
           
 void setStringProperty(java.lang.String stringProperty)
           
 void setWriteOnlyProperty(java.lang.String writeOnlyProperty)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

booleanProperty

private boolean booleanProperty
A boolean property.


booleanSecond

private boolean booleanSecond
A boolean property that uses an "is" method for the getter.


byteProperty

private byte byteProperty
A byte property.


doubleProperty

private double doubleProperty
A double property.


dupProperty

private java.lang.String[] dupProperty
An "indexed property" accessible via both array and subscript based getters and setters.


floatProperty

private float floatProperty
A float property.


intArray

private int[] intArray
An integer array property accessed as an array.


intIndexed

private int[] intIndexed
An integer array property accessed as an indexed property.


intProperty

private int intProperty
An integer property.


listIndexed

private static java.util.List listIndexed
A List property accessed as an indexed property.


longProperty

private long longProperty
A long property.


mapProperty

private java.util.Map mapProperty
A mapped property with only a getter and setter for a Map.


mappedObjects

private java.util.HashMap mappedObjects
A mapped property that has String keys and Object values.


mappedProperty

private java.util.HashMap mappedProperty
A mapped property that has String keys and String values.


mappedIntProperty

private java.util.HashMap mappedIntProperty
A mapped property that has String keys and int values.


nested

private TestBean nested
A nested reference to another test bean (populated as needed).


anotherNested

private TestBean anotherNested
Another nested reference to another test bean,


mappedNested

private TestBean.MappedTestBean mappedNested

nullProperty

private java.lang.String nullProperty
A String property with an initial value of null.


readOnlyProperty

private java.lang.String readOnlyProperty
A read-only String property.


shortProperty

private short shortProperty
A short property.


stringArray

private java.lang.String[] stringArray
A String array property accessed as a String.


stringIndexed

private java.lang.String[] stringIndexed
A String array property accessed as an indexed property.


stringProperty

private java.lang.String stringProperty
A String property.


writeOnlyProperty

private java.lang.String writeOnlyProperty
A write-only String property.


invalidBoolean

private boolean invalidBoolean

An invalid property that has two boolean getters (getInvalidBoolean and isInvalidBoolean) plus a String setter (setInvalidBoolean). By the rules described in the JavaBeans Specification, this will be considered a read-only boolean property, using isInvalidBoolean() as the getter.


counter

private static int counter
A static variable that is accessed and updated via static methods for MethodUtils testing.

Constructor Detail

TestBean

public TestBean()

TestBean

public TestBean(java.lang.String stringProperty)

TestBean

public TestBean(float floatProperty)

TestBean

public TestBean(boolean booleanProperty)

TestBean

public TestBean(java.lang.Boolean booleanSecond)

TestBean

public TestBean(float floatProperty,
                java.lang.String stringProperty)

TestBean

public TestBean(boolean booleanProperty,
                java.lang.String stringProperty)

TestBean

public TestBean(java.lang.Boolean booleanSecond,
                java.lang.String stringProperty)

TestBean

public TestBean(java.lang.Integer intProperty)

TestBean

public TestBean(double doubleProperty)

TestBean

TestBean(int intProperty)

TestBean

protected TestBean(boolean booleanProperty,
                   boolean booleanSecond,
                   java.lang.String stringProperty)
Method Detail

getBooleanProperty

public boolean getBooleanProperty()

setBooleanProperty

public void setBooleanProperty(boolean booleanProperty)

isBooleanSecond

public boolean isBooleanSecond()

setBooleanSecond

public void setBooleanSecond(boolean booleanSecond)

getByteProperty

public byte getByteProperty()

setByteProperty

public void setByteProperty(byte byteProperty)

getDoubleProperty

public double getDoubleProperty()

setDoubleProperty

public void setDoubleProperty(double doubleProperty)

getDupProperty

public java.lang.String[] getDupProperty()

getDupProperty

public java.lang.String getDupProperty(int index)

setDupProperty

public void setDupProperty(int index,
                           java.lang.String value)

setDupProperty

public void setDupProperty(java.lang.String[] dupProperty)

getFloatProperty

public float getFloatProperty()

setFloatProperty

public void setFloatProperty(float floatProperty)

getIntArray

public int[] getIntArray()

setIntArray

public void setIntArray(int[] intArray)

getIntIndexed

public int getIntIndexed(int index)

setIntIndexed

public void setIntIndexed(int index,
                          int value)

getIntProperty

public int getIntProperty()

setIntProperty

public void setIntProperty(int intProperty)

getListIndexed

public java.util.List getListIndexed()

getLongProperty

public long getLongProperty()

setLongProperty

public void setLongProperty(long longProperty)

getMapProperty

public java.util.Map getMapProperty()

setMapProperty

public void setMapProperty(java.util.Map mapProperty)

getMappedObjects

public java.lang.Object getMappedObjects(java.lang.String key)

setMappedObjects

public void setMappedObjects(java.lang.String key,
                             java.lang.Object value)

getMappedProperty

public java.lang.String getMappedProperty(java.lang.String key)

setMappedProperty

public void setMappedProperty(java.lang.String key,
                              java.lang.String value)

getMappedIntProperty

public int getMappedIntProperty(java.lang.String key)

setMappedIntProperty

public void setMappedIntProperty(java.lang.String key,
                                 int value)

getNested

public TestBean getNested()

getAnotherNested

public TestBean getAnotherNested()

setAnotherNested

public void setAnotherNested(TestBean anotherNested)

getMappedNested

public TestBean.MappedTestBean getMappedNested()

getNullProperty

public java.lang.String getNullProperty()

setNullProperty

public void setNullProperty(java.lang.String nullProperty)

getReadOnlyProperty

public java.lang.String getReadOnlyProperty()

getShortProperty

public short getShortProperty()

setShortProperty

public void setShortProperty(short shortProperty)

getStringArray

public java.lang.String[] getStringArray()

setStringArray

public void setStringArray(java.lang.String[] stringArray)

getStringIndexed

public java.lang.String getStringIndexed(int index)

setStringIndexed

public void setStringIndexed(int index,
                             java.lang.String value)

getStringProperty

public java.lang.String getStringProperty()

setStringProperty

public void setStringProperty(java.lang.String stringProperty)

getWriteOnlyPropertyValue

public java.lang.String getWriteOnlyPropertyValue()

setWriteOnlyProperty

public void setWriteOnlyProperty(java.lang.String writeOnlyProperty)

getInvalidBoolean

public boolean getInvalidBoolean()

isInvalidBoolean

public boolean isInvalidBoolean()

setInvalidBoolean

public void setInvalidBoolean(java.lang.String invalidBoolean)

currentCounter

public static int currentCounter()
Return the current value of the counter.


incrementCounter

public static void incrementCounter()
Increment the current value of the counter by 1.


incrementCounter

public static void incrementCounter(int amount)
Increment the current value of the counter by the specified amount.