1、参考
http://code.google.com/p/accessive/
2、详细使用说明
http://code.google.com/p/accessive/wiki/Documentation
3.1 业务对象类
package com.wdzwdz; private String aMethod(int value) { public AnObject() { public AnObject(int a, String s) { |
3.2 业务对象的私有属性的测试
注意例子中的私有属性是java基本类型(int),而非包裹类(Integer);测试时使用了对应的包裹类
package com.wdzwdz.test; import junit.framework.Assert; import org.junit.AfterClass; import com.j2speed.accessor.FieldAccessor; public class AnObjectTest { @BeforeClass @AfterClass @Before @Test Integer i = anInt.get(target); @Test |