-4

私はGrails 2.1.1を使用しており、コードカバレッジプラグインにはcode-coverage1.2.5を使用しています

テスト ケースは test-app コマンドで成功しましたが、コマンド「test-app -coverage --stacktrace」で cobertura レポートを生成していないことに気付きました。

以下は私が得ているエラーです

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])
4

1 に答える 1

0

あなたのドメインが注入されていないクラスレベルで呼び出してはならない呼び出しをすべて見つけてくださいドメイン内の静的メソッドを試してそのメソッドを呼び出すことができます

于 2013-01-04T14:12:12.560 に答える