background image

 
};

  }
  3.2 业务对象的私有属性的测试
  注意例子中的私有属性是 java 基本类型(int),而非包裹类(Integer);测试时使用了

对应的包裹类 

package com.wdzwdz.test;

  import junit.framework.Assert;

  import org.junit.AfterClass;

  import org.junit.Before;

  import org.junit.BeforeClass;

  import org.junit.Test;

  import com.j2speed.accessor.FieldAccessor;

  import com.wdzwdz.AnObject;

  public class AnObjectTest {

  private AnObject target;

  @BeforeClass

  public static void setUpBeforeClass() throws Exception {

  }

  @AfterClass

  public static void tearDownAfterClass() throws Exception {

  }

  @Before

  public void setUp() throws Exception {