执行脚本TestApp时出错:请求了ApplicationContext,但在构建绑定中不存在

时间:2011-07-26 20:38:26

标签: grails groovy selenium grails-plugin

_Events.groovy中,我创建了一个测试类型:

//setup selenium test type
eventAllTestsStart = {
    phasesToRun << "selenium"
}
def seleniumTestType = new JUnit4GrailsTestType('selenium', 'selenium', new GrailsTestMode(autowire: true))
seleniumTests = [seleniumTestType]
seleniumTestPhasePreparation = {
}
seleniumTestPhaseCleanUp = {
}

当我跑步时:

grails test-app selenium:,我明白了:

Error executing script TestApp: java.lang.IllegalStateException: ApplicationContext
requested, but is not present in the build binding

这里发生了什么?

1 个答案:

答案 0 :(得分:0)

看到那条autowire线?看起来很可疑,嗯?删除它。

//setup selenium test type
def seleniumTestType = new JUnit4GrailsTestType('selenium', 'selenium')
seleniumTests = [seleniumTestType]
seleniumTestPhasePreparation = {
    unitTestPhasePreparation()
}
seleniumTestPhaseCleanUp = {
    unitTestPhaseCleanUp()
}

eventAllTestsStart = {
    phasesToRun << "selenium"
}
相关问题