main函数中测试SSH配置环境是否正确

import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.oa.teacher.control.TeatherAccessmentAction;
public class TestTeacher {
@Test
public void testExecute() throws Exception {
BeanFactory factory = new FileSystemXmlApplicationContext(new String[] {
"WebRoot/WEB-INF/applicationContext-action.xml",
"WebRoot/WEB-INF/applicationContext-beans.xml",
"WebRoot/WEB-INF/applicationContext-common.xml" });
TeatherAccessmentAction action = (TeatherAccessmentAction) factory
.getBean("tacAction");
// TestAction action=(TestAction) factory.getBean("tacListAction");
/*
* Course course = new Course(); course.setCoursecode(1);
* course.setCoursename("xxx"); course.setCoursetype("实践");
*/


//String result = action.execute();
String result=action.execute();


}
}

你可能感兴趣的:(main函数中测试SSH配置环境是否正确)