Comments on: Utility class for simple getter/setter JUnit testing http://www.plaintivemewling.com/articles/gettersetter Incessant chatterings of a young fart Thu, 22 Jun 2006 04:28:36 +0000 http://wordpress.org/?v=2.0.2 by: Ken http://www.plaintivemewling.com/articles/gettersetter#comment-307 Fri, 10 Feb 2006 02:16:09 +0000 http://www.plaintivemewling.com/articles/gettersetter#comment-307 Helpful class. Thanks. It doesn't seem to support boolean properties, which by JavaBean definition should have an isPropertyName() rather than getPropertyName() getter. Should be a simple extension to support. Ken Helpful class. Thanks. It doesn’t seem to support boolean properties, which by JavaBean definition should have an isPropertyName() rather than getPropertyName() getter. Should be a simple extension to support.

Ken

]]>
by: W. Craig Trader http://www.plaintivemewling.com/articles/gettersetter#comment-304 Sat, 28 Jan 2006 01:50:55 +0000 http://www.plaintivemewling.com/articles/gettersetter#comment-304 If you're using Java 1.1 or later, you can simplify the test() method by using the facilities of the java.beans.Introspector, as follows: public test() { BeanInfo info = null; try { info = Introspector.getBeanInfo(clazz); } catch (IntrospectionException e) { throw new RuntimeException(e); } PropertyDescriptor[] properties = info.getPropertyDescriptors(); for (int i = 0; i If you’re using Java 1.1 or later, you can simplify the test() method by using the facilities of the java.beans.Introspector, as follows:

public test() {
BeanInfo info = null;
try {
info = Introspector.getBeanInfo(clazz);
} catch (IntrospectionException e) {
throw new RuntimeException(e);
}

PropertyDescriptor[] properties = info.getPropertyDescriptors();
for (int i = 0; i

]]>