首页 > 代码库 > Spring下的单元测试

Spring下的单元测试

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 {
	@Autowired
	ProductAddressManager addressManager;
	@Test
	public void testMaxPrice(){
		System.out.println(addressManager.getProductMaxPrice());
	}
}

Spring下的单元测试