2012-12-28 73 views
-4

我使用Grails 2.1.1即使所有測試用例通過,代碼覆蓋率插件,我使用的代碼coverage1.2.5收到錯誤運行測試程序-coverage命令而Grails的

我注意到,我的測試用例通過成功的測試應用程序的命令而不是由命令生成的Cobertura報告「的測試應用-coverage --stacktrace」

下面是我得到

Flushing results done 
    Cobertura: Loaded information on 320 classes. 
    Cobertura: Saved information on 320 classes. 
    | Error Exception occurred trigger event [TestPhasesEnd]: Could not create a new instance of class [com.sigmainfo.cooptimum.connectplus.priorapproval.PriorApprovalController]! (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) 
    org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [com.sigmainfo.cooptimum.connectplus.priorapproval.PriorApprovalController]! 
     at _Events$_replaceClosureNames_closure5.doCall(_Events.groovy:115) 
     at _Events.replaceClosureNames(_Events.groovy:113) 
     at _Events$replaceClosureNames.callCurrent(Unknown Source) 
     at _Events.replaceClosureNamesInReports(_Events.groovy:105) 
     at _Events$_run_closure3.doCall(_Events.groovy:59) 
     at _GrailsEvents_groovy$_run_closure5.doCall(_GrailsEvents_groovy:53) 
     at _GrailsEvents_groovy$_run_closure5.call(_GrailsEvents_groovy) 
     at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) 
     at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:223) 
     at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) 
     at java_util_concurrent_Callable$call.call(Unknown Source) 
     at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) 
     at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) 
     at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) 
     at TestApp$_run_closure1.doCall(TestApp.groovy:82) 
     at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy) 
     at java_util_concurrent_Callable$call.call(Unknown Source) 
     at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90) 
     at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185) 
     at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy) 
     at java_util_concurrent_Callable$call.call(Unknown Source) 
     at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) 
     at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) 
     at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) 
     at java_util_concurrent_Callable$call.call(Unknown Source) 
     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:591) 
     at gant.Gant.executeTargets(Gant.groovy:590) 
    Caused by: groovy.lang.MissingMethodException: No signature of method: com.sigmainfo.cooptimum.connectplus.DealerBaseInfo.findAll() is applicable for argument types:() values: [] 
    Possible solutions: findAll(), findAll(), findAll(groovy.lang.Closure), findAll(java.lang.Object), findAll(java.lang.String), findAll(groovy.lang.Closure) 
     at com.sigmainfo.cooptimum.connectplus.DealerBaseInfo.findAll(DealerBaseInfo.groovy) 
     at com.sigmainfo.cooptimum.connectplus.DealerBaseInfo$findAll.call(Unknown Source) 
     at com.sigmainfo.cooptimum.connectplus.priorapproval.PriorApprovalController.<init>(PriorApprovalController.groovy:32) 
     ... 42 more 
    | Error Exception occurred trigger event [TestPhasesEnd]: Could not create a new instance of class [com.sigmainfo.cooptimum.connectplus.priorapproval.PriorApprovalController]! 
    Flushing results... 
    Flushing results done 
    Cobertura: Loaded information on 320 classes. 
    Cobertura: Saved information on 320 classes. 

下面的錯誤代碼控制器片段

class PriorApprovalController extends FileUploaderController{ 
    Subject currentUser = SecurityUtils.subject 
    def baseRecordList = DealerBaseInfo.findAll("from DealerBaseInfo as dealers",[cache: false]) 
    def dataSource 
    def mailSenderService 
    def exportService 
    def priorApprovalInfo 
    def currentuser 
    def dealerBaseInfo1 

我收到錯誤的行

def baseRecordList = DealerBaseInfo.findAll("from DealerBaseInfo as dealers",[cache: false]) 
+0

你應該考慮給一些更多的信息,不只是線程標題和一些堆棧跟蹤... – herom

+0

請給你的問題添加更多的細節;導致錯誤的代碼片段,您懷疑導致錯誤的是什麼以及您嘗試過什麼 –

+0

您應至少提供您已調用的Grails版本和完整命令行。 –

回答

0

找到所有的u呼籲不應該在類級別被稱作您的域名沒有注入u能域與靜態方法試圖調用該方法

+1

http://www.grammarbook.com/punctuation/periods.asp – Blazemonger

相關問題