【发布时间】:2010-09-10 15:45:07
【问题描述】:
我正在尝试将一些测试数据插入到我的数据库中,为此一个名为 BootStrapTest 的类可以完成这项工作。
在我的BootStrap.groovy 文件中它是这样调用的
environments {
test {
println "Test environment"
println "Executing BootStrapTest"
new BootStrapTest().init()
println "Finished BootStrapTest"
}
}
但是,当我运行集成测试时,此代码不会执行。我读过集成测试应该引导,所以我很困惑。
我看到了一些侵入性的解决方案,例如modifying the TestApp.groovy script,但我想有一条通过 conf 的道路来实现这一点。还阅读了this SO question 和this one as well,但不太明白。
也许我误解了什么,我在 grails 测试中遇到了很多麻烦。如果它带来了任何东西,我使用 Intelli JIdea 作为 IDE。
任何想法将不胜感激。
提前致谢
【问题讨论】:
标签: grails integration-testing bootstrapping