注解版
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"classpath:spring.xml","classpath:spring-mybatis.xml"})
非注解版
private ApplicationContext ac;
private IUserService userService;
@Before
public void before(){
ac =ClassPathXmlApplicationContext( new String[]{"spring.xml","spring-mybatis.xml"});
userService = ( IUserService)ac.getBean("userService");
}