美文网首页
--- SSM整合 基础篇/dao层 测试代码

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

作者: 楊柯林 | 来源:发表于2019-07-11 13:57 被阅读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);
        }
    }

}

相关文章

网友评论

      本文标题:--- SSM整合 基础篇/dao层 测试代码

      本文链接:https://www.haomeiwen.com/subject/idorkctx.html