net.sf.beanrunner
Class BeanRunner

java.lang.Object
  extended bynet.sf.beanrunner.BeanRunner

public class BeanRunner
extends java.lang.Object


Constructor Summary
BeanRunner()
           
 
Method Summary
 void addTestValue(java.lang.Class type, java.lang.Object value)
          Add a new test value for any property of the given type.
 void excludeProperty(java.lang.String propertyName)
          This method will add the name to a list of properties that need to be excluded for the automated testing.
 void testBean(java.lang.Object bean)
          Test the properties that have both getters and setters.
 void testSerializable(java.io.Serializable bean)
          Test that the bean can be serialized and deserialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanRunner

public BeanRunner()
Method Detail

addTestValue

public void addTestValue(java.lang.Class type,
                         java.lang.Object value)
Add a new test value for any property of the given type. The types must match exactly. You cannot set a Map.class and expect it to be passed to a property of type HashMap.class.

Parameters:
type - the property type
value - the value to pass

testBean

public void testBean(java.lang.Object bean)
              throws java.lang.Exception
Test the properties that have both getters and setters. Exclude those who have been excluded by excludeProperty(String). If the object implements Serializable, do a check to ensure it really is.

Parameters:
bean - the object to test
Throws:
java.lang.Exception - on failure

testSerializable

public void testSerializable(java.io.Serializable bean)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException
Test that the bean can be serialized and deserialized.

Parameters:
bean - the object to test
Throws:
java.io.IOException - if the object cannot be serialized or deserialized
java.lang.ClassNotFoundException - if the object cannot be deserialized

excludeProperty

public void excludeProperty(java.lang.String propertyName)
This method will add the name to a list of properties that need to be excluded for the automated testing.

Parameters:
propertyName - the name of the property to exclude


Copyright © 2008. All Rights Reserved.