2011-08-07 31 views

回答

0

您可以通過添加一個條目加載= FALSE配置junit.properties文件。找到的文件應位於「user.home」中。

欲瞭解更多信息查看jUnit主頁[http://junit.sourceforge.net/junit3.8.1/index.html]。是的,我知道這個問題與jUnit4有關。我再次檢查了junit.runner.BaseTestRunner並且加載屬性選項仍然存在。

0

而不是設置-noloading參數(我不相信在當前的Junit TestRunner中支持),請將此方法添加到您的junit類中。它會直接解決你的問題

@BeforeClass 
public static void beforeClass() { 
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Log4JLogger"); 
System.setProperty("org.apache.commons.logging.LogFactory", "org.apache.commons.logging.impl.LogFactoryImpl"); 
} 
相關問題