Spring Test 方式

来源:互联网 发布:淘宝海外集运怎么用 编辑:程序博客网 时间:2024/06/15 21:51

第一种:main函数执行

public static void main(String[] args)

{
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(

"classpath*:META-INF/spring/*.xml");

                //TODO :


}


第二种:Spring Test

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")


@org.junit.Test

测试函数


0 0
原创粉丝点击