新学习spring框架,按照教程搭建spring环境,单元测试时最后的save方法没有运行,是怎么回事,求教
public class SpringTest { @BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@Test
public void instanceSpring(){
 ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml"); // 实例化Spring容器
     PersonService personService = (PersonService) ctx.getBean("personService"); // 从Spring容器取得bean
     personService.save();
}
}
package cn.itcast.service;
public interface PersonService {
void save();
}
package cn.itcast.service.impl;
import cn.itcast.service.PersonService;
public class PersonServiceBean implements PersonService {
/* (non-Javadoc)
 * @see cn.itcast.service.impl.PersonService#save()
 */
@Override
public void save(){
System.out.println("我是save方法");
}
}
//bean.xml文件
                <bean id="presonService" class="cn.itcast.service.impl.PersonServiceBean"></bean>输出:
十月 26, 2017 6:07:06 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@490d6c15: startup date [Thu Oct 26 18:07:06 CST 2017]; root of context hierarchy
十月 26, 2017 6:07:06 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [beans.xml]