JUnit单元测试用例获取ApplicationContext实例的方法
public class TPlatformInfoTest extends TestBase{
private static MyHttpClient TPlatformInfoDispose;
@BeforeClass
public static void setUpBeforeClass(){
System.out.println("***********here init first***************");
TPlatformInfoDispose = new MyHttpClient("platform");
DataSourceContextHolder.setDbType("ds2");
ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:WEB-INF/rest-*.xml");
pfm = ctx.getBean(TPlatformInfoMapper.class);
dim = ctx.getBean(TDeviceInfoMapper.class);
}


浙公网安备 33010602011771号