首先,添加Junit的jar包,cfgligb.jar , asm.jar.
接下来,该开始编写测试程序了,右键新建Junit Test Case。
建好Test Case以后。具体程序如下:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"file:WebContent/WEB-INF/action.xml", "file:WebContent/WEB-INF/service.xml"})
public class ApicilentServiceTest {
@Resource
private AccountService service;
@Test
public void testGetAllApicilent() {
//fail("Not yet implemented");
//这里就可以调用service的方法了
}
}