From: Modell, M. <mic...@ta...> - 2002-03-06 16:21:24
|
In my testing, I found that testing JavaBeans tended to be particularly = tedious and, as a result, was often neglected. I've also found that=20 they are frequently the victims of cut-n-paste errors. These two facts = result in production issues that are difficult to trace. To remedy this situation, I've written a JavaBean tester with the=20 following methods: JBeanTestResults testJBeanProperties( Class clazz) JBeanTestResults testJBeanProperties( Object obj ) JBeanTestResults testJBeanConstructor( Class clazz, String[ ] params ) The methods perform tests and compile data however they do not perform=20 any assertions regarding that data (some input data viability = assertions=20 exist, but none that makes assumptions based upon the test results). =20 The data is returned in the JBeanTestResults object for the tester to=20 analyse. It is heavily documented and includes the appropriate JUnit tests. I=20 would now like to add this to the JUnit project and I'm wondering how=20 you would like me to submit it? Currently, I'm extending TestCase to=20 add these test methods, but I don't know that this the best way to=20 package it. I believe this to be of generic usefullness and would love to see it=20 used and improved upon by others. Please provide me input on how to=20 proceed. Cheers! Micah Modell -- Senior Developer Tall=E1n http://www.csh.rit.edu/~micah AIM: MicahModell It is not noble to be better than others. It is noble to be better than your former self. |