2011-07-26 29 views
0

_Events.groovy,我創建了一個測試類型,例如:錯誤執行腳本TestApp:ApplicationContext的請求,但不存在於構建結合

//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 

這是怎麼回事?

回答

0

看到autowire線?看起來很可疑,呃?去掉它。

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

eventAllTestsStart = { 
    phasesToRun << "selenium" 
} 
相關問題