在ServiceImpl层加载Spring配置文件进行测试

public static void main(String[] args) {
        Xm xm = new Xm();
        Resource resource = new ClassPathResource("applicationContext-common.xml");
        BeanFactory factory = new XmlBeanFactory(resource);
        XmServiceImpl xmServiceImpl = (XmServiceImpl) factory.getBean("xmService");
        int i = xmServiceImpl.getXmByConditionCount(xm);
        System.out.println(i);
}

 

posted @ 2019-11-13 09:10  Java-Legend  阅读(394)  评论(0编辑  收藏  举报