第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

跪求大神幫忙,不勝感激

源碼都沒法下載,那個(gè)BlockJUnit4ClassRunner報(bào)錯(cuò)不知道是什么原因,UnitTestBase是自己寫的類嗎?

正在回答

1 回答

UnitTestBase是自己寫的類,代碼如下

package com.imooc.test.base;


import org.junit.After;

import org.junit.Before;

import org.springframework.beans.BeansException;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import org.springframework.util.StringUtils;


public class UnitTestBase {

private ClassPathXmlApplicationContext context;

private String springXmlpath;

public UnitTestBase() {}

public UnitTestBase(String springXmlpath) {

this.springXmlpath = springXmlpath;

}

@Before

public void before() {

if (StringUtils.isEmpty(springXmlpath)) {

springXmlpath = "classpath*:spring-*.xml";

}

try {

context = new ClassPathXmlApplicationContext(springXmlpath.split("[,\\s]+"));

context.start();

} catch (BeansException e) {

e.printStackTrace();

}

}

@After

public void after() {

context.destroy();

}

@SuppressWarnings("unchecked")

protected <T extends Object> T getBean(String beanId) {

try {

return (T)context.getBean(beanId);

} catch (BeansException e) {

e.printStackTrace();

return null;

}

}

protected <T extends Object> T getBean(Class<T> clazz) {

try {

return context.getBean(clazz);

} catch (BeansException e) {

e.printStackTrace();

return null;

}

}


}


2 回復(fù) 有任何疑惑可以回復(fù)我~
#1

butcher_Inc

aligado
2015-11-13 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Spring入門篇
  • 參與學(xué)習(xí)       268802    人
  • 解答問題       1019    個(gè)

為您帶來IOC和AOP的基本概念及用法,為后續(xù)高級(jí)課程學(xué)習(xí)打下基礎(chǔ)

進(jìn)入課程

跪求大神幫忙,不勝感激

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)