此为父文章下的链接资源
//spring整合了junit,同时 只有spring引入外部文件时需要classpath
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class PreTest {
@Autowired
private ItemMapper itemMapper;
@Test
public void test1(){
List<Item> itemList = itemMapper.findAllItem();
for (Item item : itemList) {
System.out.println(item);
}
}
}
网友评论