我試圖創建一個UrlMappingsTest我的Grails項目,並且我得到以下異常:UrlMappingsTests - 無法加載測試類型「集成」中的類?
java.lang.RuntimeException: Could not load class in test type 'integration'
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
我的類是相當簡單的,我試圖效仿的榜樣。這是怎麼回事?
import grails.test.GrailsUrlMappingsTestCase
class UrlMappingTests extends GrailsUrlMappingsTestCase {
// static mappings = UrlMappings
void testForwardingUrls(){
assertForwardUrlMapping("/rest/users/stefan/files", controller: "file", action: "allFiles");
}
}
與靜態行註釋掉,我得到
[groovyc] You attempted to reference a variable in the binding or an instance variable from a static context.
[groovyc] You misspelled a classname or statically imported field. Please check the spelling.
[groovyc] You attempted to use a method 'UrlMappings' but left out brackets in a place not allowed by the grammar.
[groovyc] @ line 7, column 21.
[groovyc] static mappings = UrlMappings
[groovyc]
^
我得到沒有找到我的時候沒有運行的類。我正在使用1.3.7 – 2011-03-02 14:48:26
嗯沒關係我正在測試我的1.3.6,它的工作。你可以發佈完整的堆棧跟蹤嗎? – Melv 2011-03-02 21:36:48
我開始了一個新項目,在1.3.7中失敗了。我懷疑這是迴歸。 – 2011-03-04 17:44:51