0
使用JUnit我已经使用JUnit使用Groovy类加载器
class GroovyJunitTest {
@Test
void test() {
println this.class.getClassLoader().toString()
}
}
一个简单的Groovy测试类此打印出
[email protected]
这意味着Java类加载器使用。
我使用Intellij IDE和Gradle测试运行测试。在这两种情况下都是相同的结果。
有没有办法配置JUnit使用Groovy类加载器?
你是如何运行它?从任何IDE?或构建工具? – Rao
@Rao刚刚更新了我的问题 – lolotron
请看看这是否有帮助 - https://stackoverflow.com/questions/42102/using-different-classloaders-for-different-junit-tests – Rao