Spring下的单元测试

来源:互联网 发布:新人怎么成为网络作家 编辑:程序博客网 时间:2024/05/01 07:13
package test.v2;import org.junit.Test;import org.junit.runner.RunWith;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.test.context.ContextConfiguration;import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;import cn.uihome.service.product.ProductAddressManager;@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration({ "classpath:beans-*.xml" })public class SearchAPITest extends AbstractJUnit4SpringContextTests {@AutowiredProductAddressManager addressManager;@Testpublic void testMaxPrice(){System.out.println(addressManager.getProductMaxPrice());}}

0 0