Spring 测试类


//测试类引入2个配置文件要{"",""}用逗号隔开
@ContextConfiguration(locations = { "classpath*:spring.xml","classpath*:spring-jdbc.xml" })


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.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath*:spring.xml",
		"classpath*:spring-redis.xml", "classpath*:spring-jdbc.xml" })
public class PwdLogTest extends AbstractJUnit4SpringContextTests {

	@Resource
	private GetPwdLogDao dao;


你可能感兴趣的:(Spring 测试类)