我试图将一些测试数据插入到我的数据库中,为此,一个名为BootStrapTest的类可以完成这项工作。集成测试中的Grails引导
在我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。
任何想法将不胜感激。
在此先感谢BootStrap.groovy中
我不认为'正在所有执行BootStrap.groovy'。 – Tom 2010-09-10 17:49:32
您正在做其他不正确的事情,bootstrap必须在集成测试过程中运行 – 2010-09-10 18:52:21