--- SSM整合 基础篇/dao层 测试代码

2019-07-11  本文已影响0人  楊柯林

此为父文章下的链接资源


//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);
        }
    }

}
上一篇 下一篇

猜你喜欢

热点阅读