//@ContextConfiguration(locations = { "classpath*:/spring1.xml", "classpath*:/spring2.xml" })
public class TimerTest {
@Test
public void testTimeRun(){
String[] str = new String[]{"service.context.xml","schedule.context.xml","actions.context.xml"};
ApplicationContext con = new ClassPathXmlApplicationContext(str);
SystemDao systemDao = (SystemDao) con.getBean("systemDao");
System.out.println(systemDao);
}
}
本文介绍了一个使用Spring框架进行定时任务测试的例子。通过配置多个Spring XML文件,创建了一个包含SystemDao Bean的ApplicationContext,并打印了SystemDao实例。此测试用例展示了如何在Spring环境中设置和运行定时任务。
3583

被折叠的 条评论
为什么被折叠?



