In order to run my apache axis integration tests from inside eclipse, I need to set the -noloading option on the eclipse junit test runner. Does anyone know how I can do this??
I am using eclipse Version: 3.5.1开发者_Go百科
You can configure a junit.properties file by adding an entry loading=false. The file located should be located in the "user.home".
For more information check out the jUnit homepage [http://junit.sourceforge.net/junit3.8.1/index.html]. Yes I know this question is related to jUnit4. I double checked the junit.runner.BaseTestRunner and the loading properties option is still present.
rather than set the -noloading parameter (which I don't believe is supported in the current Junit TestRunner), add this method in your junit class. It will solve your issue directly
@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");
}
精彩评论