【发布时间】:2014-03-06 16:29:10
【问题描述】:
我有一个简单的 junit 测试任务。
task testSanity(type: Test, dependsOn: testClasses) {
def springInstrumentJarPath = project.configurations.compile.find { it.name.startsWith("spring- instrument") }
jvmArgs '-javaagent:' + springInstrumentJarPath
exclude '**/*TimeBaseTest*'
exclude '**/*SuiteTests*'
}
问题是我在以下位置为我的 ehcache 添加了一个新的 xml 文件:
/src/main/webapp/WEB-INF/classes/ehcache.xml
我的所有测试都失败了,因为 junit 无法找到该文件。 如何在 gradle 任务中定义这个?
谢谢。
【问题讨论】:
-
由 p:configLocation="classpath:/ehcache/ehcache.xml" 修复并将 ehcache 放在 src/main/resources/ehcache/ehcache.xml 中
标签: java spring junit build gradle