有时候我们需要加载spring的bean进行单元测试,代码如下:
/* * Copyright (c) 2017, S.F. Express Inc. All rights reserved. */ package com.sf.ddt.redisUtils; import java.io.Serializable; 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; import com.sf.framework.cacheproxy.ICache; import com.sf.framework.cacheproxy.redis.RedisCache; /** * 描述: * *
* @author 835089 * @since 1.0 */ @RunWith(SpringJUniHISTORY * **************************************************************************** * ID DATE PERSON REASON * 1 2017年3月23日 835089 Create * **************************************************************************** *