这是测试类
package spring.demo1;
import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:Configuration.xml")
public class springtest {
//测试业务类
@Resource(name="accountService")
private AccountServiceimp accountServiceimp;
@Test
public void testdemo1(){
accountServiceimp.transfer("aaa", "bbb", 200d);
System.out.println("sdasdasd");
}
}
然后就爆出 Failed to load ApplicationContext 错误
好好认真学习
是一条鱼吗
相关分类