单测Spring的bean装配情况

来源:互联网 发布:mac的网页开发工具 编辑:程序博客网 时间:2024/05/29 13:49
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("xxx.xml");applicationContext.start();xxxService x = (xxxService) applicationContext.getBean("xxxService");


比较简单的方式,在主函数中测试Spring装配Bean的情况,不需要启动装个系统。



0 0
原创粉丝点击