Spring MVC Junit4 单元測试 JunitTest

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/config/spring3/applicationContext.xml" })//启动Spring容器
public class TestISrmVendorService {
	//注入Spring容器中的Bean
	@Autowired
	private ISrmVendorService srmVendorService;

	@Test
	public void testHasMatchUser() throws Exception {
		List<SrmVendor> searchAllVendorList = srmVendorService.searchAllVendorList();
		System.out.println(searchAllVendorList.size()+"--------------------------------");
	}
}


posted @ 2016-04-06 20:27  phlsheji  阅读(256)  评论(0编辑  收藏  举报